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

index 404441df64063eaaab041f06518003d0d6386edc..c94428acd4f9094f4982f28dacec6eac971d8221 100644 (file)
@@ -15,6 +15,9 @@ var lastpasswd="";
 var lastreg="";
 var providerfound = 0;
 
+var sipnat_user="";
+var sipnat_secret="";
+var sipnat_host="";
 
 // Called when we load page
 
@@ -83,16 +86,22 @@ 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(";") == 0) 
+                                    registerflag = 1;
+                                        //save rego user:pswd:host
+                                else
+                                    registerflag = 0;
                        }
                        if (line.indexOf("sipnat-mini-asterisk") != -1) {
-                               // if uncommented
-                               //     registerflag = 1;
-                               // else
-                               //     registerflag = 0;
+                               if (line.indexOf("username") != -1) {
+                                       sipnat_user = ""; //  save user
+                               }
+                               if (line.indexOf("secret") != -1) {
+                                       sipnat_secret = ""; //  save secret
+                               }
+                               if (line.indexOf("host") != -1) {
+                                       sipnat_host = ""; //  save host
+                               }
                        }
                        if (line.indexOf("sipnormal-mini-asterisk") != -1) {
                                // if uncommented