git-svn-id: https://svn.code.sf.net/p/freetel/code@651 01035d8c-6547-0410-b346-abe4f9...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 30 Aug 2012 08:29:07 +0000 (08:29 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 30 Aug 2012 08:29:07 +0000 (08:29 +0000)
mini-asterisk-gui2/cgi-bin/setring.cgi
mini-asterisk-gui2/minicommon.js
mini-asterisk-gui2/phones.js

index 6d09a4119d8dbaeb8ea3a2ab3cacf6f04a8af0ef..98f1be83b728f9ea18516fc0c555e4a37fac5188 100755 (executable)
@@ -17,7 +17,8 @@ Content-type: text/html
 EOF
 
 
-# extract extensions to ring and reload extensions.conf
+# extract extensions to ring
+#echo "Input $QUERY_STRING\n"
 
 a=`echo "$QUERY_STRING" | sed -n "s/=on*//pg" | sed -n 's,_,/,pg'`
 
@@ -28,6 +29,9 @@ if [ $? -eq 0 ]; then
 fi
 
 sed -i "s_s,1,Dial(.*) ;; mini-asterisk_s,1,Dial($a) ;; mini-asterisk_" /etc/asterisk/extensions.conf
+
+#reload extensions.conf
+
 #asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
 
  
index ff83c87ce14e7c8ebe7be5ab8a10c8675fe1a85a..0dd5e6418a597968c261b283e22e461c3b3245d2 100644 (file)
@@ -22,7 +22,7 @@ var network = "no";
 
 // incomming calls are routed to these extensions
 
-var reception  = ["6002"];
+var reception  = [];
 
 function loadExtensions() {
 
@@ -136,18 +136,19 @@ function loadExtensionsConf(doc,status) {
            //  exten => s,1,Dial(Zap/4&SIP/6011) ;; mini-asterisk - don't remove this comment
 
            if(line.indexOf("exten => s,1,Dial") != -1) {
-               // for each Zap/ read in a single digit and convert to extension 
-               ret = line.indexOf("Zap/");
                i=0;
-               if (ret != -1)
+
+               // for each Zap/ read in a single digit and convert to extension 
+               while((ret = line.indexOf("Zap/"))!=-1) {               
                     reception [i++] = analog_ext[line.substr(ret+4,1)];
+                    line = line.substr(ret+6,line.length);
+               }
 
                // for each SIP/ read in four digits
-               ret = line.indexOf("SIP/");
-//                for( x in ret )
-               if (ret != -1)
-                       reception [i++] = line.substr(ret+4,4);
-
+               while ((ret = line.indexOf("SIP/")) != -1) {
+                   reception [i++] = line.substr(ret+4,4);
+                    line = line.substr(ret+9,line.length);
+               }
 
            }
        }
index 089e8698741157ec93c4b09f17810a43c86b449d..fcb6b3a4b0d3cbae96c2ca2440731cb65227ce76 100644 (file)
@@ -51,9 +51,10 @@ function initialisePage() {
            //html += "<td>(Reception)</td>";
 
             // the reception checkbox code
-           html += "<td>" + '<input type="checkbox" name="ZAP/' + i ;
+           html += "<td>" + '<input type="checkbox" name="ZAP_' + i ;     
+               // Underscore used instead of forward slash to pass thru html request
 
-            if (reception.indexOf(analog_ext[i])> -1) {
+            if (reception.indexOf(analog_ext[i]) != -1) {
                    html += '" checked/>';
                }
            else {
@@ -78,10 +79,11 @@ function initialisePage() {
            html += "<td>" + ip_ext[j] + "</td>";
 
             // the reception checkbox code
-           html += "<td>" + '<input type="checkbox" name="SIP/' + ip_ext[j] ;
+           html += "<td>" + '<input type="checkbox" name="SIP_' + ip_ext[j] ;
+               // Underscore used instead of forward slash to pass thru html request
  
 
-            if (!reception.indexOf(ip_ext[j])) {
+            if (reception.indexOf(ip_ext[j])!=-1) {
                    html += '" checked/>';
                }
            else {