git-svn-id: https://svn.code.sf.net/p/freetel/code@1002 01035d8c-6547-0410-b346-abe4f...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 17 Nov 2012 02:15:55 +0000 (02:15 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 17 Nov 2012 02:15:55 +0000 (02:15 +0000)
mini-asterisk-gui2/voiplines.js

index 914f67505742858f583b50c399187eee7bcbbfea..4c50780b3a94dc5ec5ce884109b15312aa4b6c01 100644 (file)
@@ -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;
+               }               
+               
        }
        );