From 305b7f9636c7c4d23f3b3e8e45f41b1bcc773b2c Mon Sep 17 00:00:00 2001 From: horse69 Date: Sat, 17 Nov 2012 02:15:55 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/freetel/code@1002 01035d8c-6547-0410-b346-abe4f91aad63 --- mini-asterisk-gui2/voiplines.js | 69 +++++++++++++++++---------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/mini-asterisk-gui2/voiplines.js b/mini-asterisk-gui2/voiplines.js index 914f6750..4c50780b 100644 --- a/mini-asterisk-gui2/voiplines.js +++ b/mini-asterisk-gui2/voiplines.js @@ -61,40 +61,7 @@ function initialisePage() { downloadUrl("/cgi-bin/asterisk.cgi?cli=sip show registry",OnSipshowReturn); - // sip info now loaded - if(siprego_line[0] == ';') { - // commented out mean no rego selected - selection = "none"; - document.getElementById('user').value = ""; - document.getElementById('host').value = ""; - document.getElementById('pass').value = ""; - document.getElementById('info').textContent = sipnone_info; - } - else if (siprego.indexOf(sipnat_user) != -1) { - // rego line has sipnat - selection = "sipnat"; - document.getElementById('user').value = sipnat_user; - document.getElementById('host').value = sipnat_host; - document.getElementById('pass').value = sipnat_secret; - document.getElementById('info').textContent = sipnat_info; - } - else if (siprego.indexOf(sipnormal_user) != -1) { - // rego line has sipnormal - selection = "sipnormal"; - document.getElementById('user').value = sipnormal_user; - document.getElementById('host').value = sipnormal_host; - document.getElementById('pass').value = sipnormal_secret; - document.getElementById('info').textContent = sipnormal_info; - } - else if (siprego.indexOf(sipjazmin_user) != -1) { - // rego line has sipjazmin - selection = "sipjazmin"; - document.getElementById('user').value = sipjazmin_user; - document.getElementById('host').value = sipjazmin_host; - document.getElementById('pass').value = sipjazmin_secret; - document.getElementById('info').textContent = sipjazmin_info; - } } @@ -197,6 +164,42 @@ function loadSipConf(doc,status) { } } } + + // sip info now loaded + + if(siprego_line[0] == ';') { + // commented out mean no rego selected + selection = "none"; + document.getElementById('user').value = ""; + document.getElementById('host').value = ""; + document.getElementById('pass').value = ""; + document.getElementById('info').textContent = sipnone_info; + } + else if (siprego.indexOf(sipnat_user) != -1) { + // rego line has sipnat + selection = "sipnat"; + document.getElementById('user').value = sipnat_user; + document.getElementById('host').value = sipnat_host; + document.getElementById('pass').value = sipnat_secret; + document.getElementById('info').textContent = sipnat_info; + } + else if (siprego.indexOf(sipnormal_user) != -1) { + // rego line has sipnormal + selection = "sipnormal"; + document.getElementById('user').value = sipnormal_user; + document.getElementById('host').value = sipnormal_host; + document.getElementById('pass').value = sipnormal_secret; + document.getElementById('info').textContent = sipnormal_info; + } + else if (siprego.indexOf(sipjazmin_user) != -1) { + // rego line has sipjazmin + selection = "sipjazmin"; + document.getElementById('user').value = sipjazmin_user; + document.getElementById('host').value = sipjazmin_host; + document.getElementById('pass').value = sipjazmin_secret; + document.getElementById('info').textContent = sipjazmin_info; + } + } ); -- 2.25.1