From: horse69 Date: Sun, 2 Sep 2012 05:07:23 +0000 (+0000) Subject: git-svn-id: https://svn.code.sf.net/p/freetel/code@654 01035d8c-6547-0410-b346-abe4f9... X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=80ceb7508413414e34d724f83652c6dc171e989e;p=freetel-svn-tracking.git git-svn-id: https://svn.code.sf.net/p/freetel/code@654 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/mini-asterisk-gui2/cgi-bin/setring.cgi b/mini-asterisk-gui2/cgi-bin/setring.cgi index 98f1be83..adacc8f2 100755 --- a/mini-asterisk-gui2/cgi-bin/setring.cgi +++ b/mini-asterisk-gui2/cgi-bin/setring.cgi @@ -1,6 +1,7 @@ #!/bin/sh # setring.cgi -# David Rowe 9 March 2011 +# +# Ian Roberts 30 August 2012 # # CGI to set extension to ring on an incoming call # @@ -17,7 +18,9 @@ Content-type: text/html EOF -# extract extensions to ring +# extract extensions to ring +# must replace underscores with forward slash + #echo "Input $QUERY_STRING\n" a=`echo "$QUERY_STRING" | sed -n "s/=on*//pg" | sed -n 's,_,/,pg'` diff --git a/mini-asterisk-gui2/minicommon.js b/mini-asterisk-gui2/minicommon.js index 0dd5e641..e3fb4366 100644 --- a/mini-asterisk-gui2/minicommon.js +++ b/mini-asterisk-gui2/minicommon.js @@ -20,9 +20,18 @@ var ip_ext = []; var network = "no"; -// incomming calls are routed to these extensions +// incomming calls are routed to these extensions ie (6003, ZAP/3) +var number=''; +var code=''; -var reception = []; + +var reception[] = {number, code}; + + + +// these are the selections for the new reception numbers + +var selected = []; function loadExtensions() { @@ -138,16 +147,20 @@ function loadExtensionsConf(doc,status) { if(line.indexOf("exten => s,1,Dial") != -1) { i=0; - // 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)]; + // for each Zap/ read in a single digit and convert to extension + while((ret = line.indexOf("Zap/"))!=-1) { + reception[i].code = line.substr(ret,5); + reception[i].number = analog_ext[line.substr(ret+4,1)]; line = line.substr(ret+6,line.length); + i++; } // for each SIP/ read in four digits while ((ret = line.indexOf("SIP/")) != -1) { - reception [i++] = line.substr(ret+4,4); + reception[i].code = line.substr(ret,8); + reception[i].number = line.substr(ret+4,4); line = line.substr(ret+9,line.length); + i++; } } diff --git a/mini-asterisk-gui2/phones.js b/mini-asterisk-gui2/phones.js index f5b0b8df..6a8b094f 100644 --- a/mini-asterisk-gui2/phones.js +++ b/mini-asterisk-gui2/phones.js @@ -51,7 +51,7 @@ function initialisePage() { //html += "(Reception)"; // the reception checkbox code - html += "" + '" + '"; // the reception checkbox code - html += "" + '" + '