git-svn-id: https://svn.code.sf.net/p/freetel/code@649 01035d8c-6547-0410-b346-abe4f9...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 30 Aug 2012 06:46:16 +0000 (06:46 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 30 Aug 2012 06:46:16 +0000 (06:46 +0000)
mini-asterisk-gui2/minicommon.js

index ccaa53f083eff3c16df30bafa41948c78b8228e8..ff83c87ce14e7c8ebe7be5ab8a10c8675fe1a85a 100644 (file)
@@ -20,6 +20,8 @@ var ip_ext = [];
 
 var network = "no";
 
+// incomming calls are routed to these extensions
+
 var reception  = ["6002"];
 
 function loadExtensions() {
@@ -128,6 +130,26 @@ function loadExtensionsConf(doc,status) {
                    ip_ext[ext] = "";
                }
            }
+
+           // Save the reception numbers if they exist
+           // Should match one line only
+           //  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)
+                    reception [i++] = analog_ext[line.substr(ret+4,1)];
+
+               // 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);
+
+
+           }
        }
     );