git-svn-id: https://svn.code.sf.net/p/freetel/code@979 01035d8c-6547-0410-b346-abe4f9...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 16 Nov 2012 04:18:45 +0000 (04:18 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 16 Nov 2012 04:18:45 +0000 (04:18 +0000)
mini-asterisk-gui2/voiplines.js

index e354c842b446de7219aa33aab7fcd34eee6b7b49..1ad447551765ac937343b777c3a134b9842216b4 100644 (file)
@@ -72,9 +72,45 @@ function OnSipshowReturn(doc,status) {
        }
 
     document.getElementById("voiplinestatus").innerHTML = html;
+       
+       // Load sip.conf
+       
+        downloadUrl("/cgi-bin/getconf.cgi?file=sip.conf", loadSipConf);
+
+}
 
+function loadSipConf(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           if (line.indexOf("mini-asterisk") != -1)  {
+                       if (line.indexOf("register-mini-asterisk") != -1) {
+                               // if uncommented
+                               //     registerflag = 1;
+                               // else
+                               //     registerflag = 0;
+                       }
+                       if (line.indexOf("sipnat-mini-asterisk") != -1) {
+                               // if uncommented
+                               //     registerflag = 1;
+                               // else
+                               //     registerflag = 0;
+                       }
+                       if (line.indexOf("sipnormal-mini-asterisk") != -1) {
+                               // if uncommented
+                               //     registerflag = 1;
+                               // else
+                               //     registerflag = 0;
+                       }
+                       if (line.indexOf("jazmin-mini-asterisk") != -1) {
+                               // if uncommented
+                               //     registerflag = 1;
+                               // else
+                               //     registerflag = 0;
+                       }
+               }
+       }
 }
 
+
 function onClickApply() {
 
        // All this stuff is synchronous. Must happen in order specified.
@@ -92,9 +128,6 @@ function onClickApply() {
        
        // 1. Save sip.conf     
        
-       // 1.5 Maybe reset the sip.conf file
-       
-       // 2. Update sip.conf
        
        // 2.0 uncomment sip register
        var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';