git-svn-id: https://svn.code.sf.net/p/freetel/code@876 01035d8c-6547-0410-b346-abe4f9...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 29 Oct 2012 01:12:21 +0000 (01:12 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 29 Oct 2012 01:12:21 +0000 (01:12 +0000)
mini-asterisk-gui2/cgi-bin/setlinekey.cgi [new file with mode: 0644]
mini-asterisk-gui2/etc/asterisk/sip.conf
mini-asterisk-gui2/phones.js
mini-asterisk-gui2/todo 2012_10.txt

diff --git a/mini-asterisk-gui2/cgi-bin/setlinekey.cgi b/mini-asterisk-gui2/cgi-bin/setlinekey.cgi
new file mode 100644 (file)
index 0000000..3542887
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+# setlinekey.cgi
+# David Rowe 29 Oct 2012
+#
+# CGI to set the text in "file" from "this" to "that" on a commented line key
+#
+# Test on host with:
+#
+#    $ export QUERY_STRING='file=test.txt&this=IPADDRESS=&that="192.168.1.31"'; ./setline.cgi
+#
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+file=`echo $QUERY_STRING | grep -oe "file=[^&?]*" | sed -n "s/file=//p"`
+this=`echo $QUERY_STRING | grep -oe "this=[^&?]*" | sed -n "s/this=//p" | sed "s/%22/\"/g"`
+that=`echo $QUERY_STRING | grep -oe "that=[^&?]*" | sed -n "s/that=//p" | sed "s/%22/\"/g"`
+key=`echo $QUERY_STRING | grep -oe "key=[^&?]*" | sed -n "s/key=//p" | sed "s/%22/\"/g"`
+echo $QUERY_STRING
+echo $file
+echo $this
+echo $that
+echo $key
+if [ -f $file ]; then
+#  sed -i "s/$this.*/$this$that/g" $file
+   sed 's/\($this\)[a-z0-9\.]*\(.*$key.*\)/\1$that\2/' $file
+#  's/\(host=\)[^\s]*\(; Jazmin mini-asterisk.*\)/\1trev\2/'
+#  's/\(host=\)[a-z0-9\.]*\(.*Jazmin mini-asterisk.*\)/\1trev\2/'
+else
+  echo "$file does not exist"
+fi
+cat <<EOF
+</body>
+</html>
+EOF
index 4ee5f1a4dd239b28ed5e168b7fe1c45db609329d..dda07f02e73e8ac1e472645adda51981675f49a8 100644 (file)
@@ -234,7 +234,9 @@ srvlookup=yes                       ; Enable DNS SRV lookups on outbound calls
 ;
 ; Examples:
 ;
-;register=>1234:password@mysipprovider.com     
+;register => 1234:password@mysipprovider.com   ; register-mini-asterisk do not remove this comment
+;
+;register => 1234:password@mysipprovider.com   
 ;
 ;     This will pass incoming calls to the 's' extension
 ;
@@ -782,44 +784,44 @@ qualify=yes
 
 ; Pre-configured mini-asterisk SIP trunks
 
-[usernat] ; "SIP-NAT" mini-asterisk do not remove this comment
+[usernat]               ; sip-nat-mini-asterisk do not remove this comment
 ; You reach your ITSP via a NAT router (most common)
-type=friend             ; "SIP-NAT" mini-asterisk do not remove this comment
-context=default         ; "SIP-NAT" mini-asterisk do not remove this comment
-username=usernat        ; "SIP-NAT" mini-asterisk do not remove this comment
-secret=passwordnat      ; "SIP-NAT" mini-asterisk do not remove this comment
-host=hostnat            ; "SIP-NAT" mini-asterisk do not remove this comment
-canreinvite=no          ; "SIP-NAT" mini-asterisk do not remove this comment
-disallow=all            ; "SIP-NAT" mini-asterisk do not remove this comment
-allow=ulaw,alaw         ; "SIP-NAT" mini-asterisk do not remove this comment
-qualify=yes             ; "SIP-NAT" mini-asterisk do not remove this comment
-nat=yes                 ; "SIP-NAT" mini-asterisk do not remove this comment
-
-[usersip] ; "SIP" mini-asterisk do not remove this comment
+type=friend             ; sip-nat-mini-asterisk do not remove this comment
+context=default         ; sip-nat-mini-asterisk do not remove this comment
+username=usernat        ; sip-nat-mini-asterisk do not remove this comment
+secret=passwordnat      ; sip-nat-mini-asterisk do not remove this comment
+host=hostnat            ; sip-nat-mini-asterisk do not remove this comment
+canreinvite=no          ; sip-nat-mini-asterisk do not remove this comment
+disallow=all            ; sip-nat-mini-asterisk do not remove this comment
+allow=ulaw,alaw         ; sip-nat-mini-asterisk do not remove this comment
+qualify=yes             ; sip-nat-mini-asterisk do not remove this comment
+nat=yes                 ; sip-nat-mini-asterisk do not remove this comment
+
+[usersip]          ; sip-mini-asterisk do not remove this comment
 ; No NAT router between your Phone system and your ITSP
-type=friend        ; "SIP" mini-asterisk do not remove this comment
-context=default    ; "SIP" mini-asterisk do not remove this comment
-username=usersip   ; "SIP" mini-asterisk do not remove this comment
-secret=passwordsip ; "SIP" mini-asterisk do not remove this comment
-host=hostsip       ; "SIP" mini-asterisk do not remove this comment
-canreinvite=no     ; "SIP" mini-asterisk do not remove this comment
-disallow=all       ; "SIP" mini-asterisk do not remove this comment
-allow=ulaw,alaw    ; "SIP" mini-asterisk do not remove this comment
-qualify=yes        ; "SIP" mini-asterisk do not remove this comment
-
-[userjaz] ; "Jazmin" mini-asterisk do not remove this comment
+type=friend        ; sip-mini-asterisk do not remove this comment
+context=default    ; sip-mini-asterisk do not remove this comment
+username=usersip   ; sip-mini-asterisk do not remove this comment
+secret=passwordsip ; sip-mini-asterisk do not remove this comment
+host=hostsip       ; sip-mini-asterisk do not remove this comment
+canreinvite=no     ; sip-mini-asterisk do not remove this comment
+disallow=all       ; sip-mini-asterisk do not remove this comment
+allow=ulaw,alaw    ; sip-mini-asterisk do not remove this comment
+qualify=yes        ; sip-mini-asterisk do not remove this comment
+
+[userjaz]                     ; jazmin-mini-asterisk do not remove this comment
 ; <a href="http://www.jazmin.com.au/">Jazmin</a> are a South Australian ITSP
-host=hostjaz                  ; "Jazmin" mini-asterisk do not remove this comment
-secret=passwordjaz            ; "Jazmin" mini-asterisk do not remove this comment
-username=userjaz              ; "Jazmin" mini-asterisk do not remove this comment
-fromdomain=hostjaz            ; "Jazmin" mini-asterisk do not remove this comment
-fromuser=userjaz              ; "Jazmin" mini-asterisk do not remove this comment
-insecure=port,invite          ; "Jazmin" mini-asterisk do not remove this comment
-type=friend                   ; "Jazmin" mini-asterisk do not remove this comment
-disallow=all                  ; "Jazmin" mini-asterisk do not remove this comment
-allow=ulaw                    ; "Jazmin" mini-asterisk do not remove this comment
-allow=alaw                    ; "Jazmin" mini-asterisk do not remove this comment
-dtmfmod=rfc2833               ; "Jazmin" mini-asterisk do not remove this comment
-qualify=yes                   ; "Jazmin" mini-asterisk do not remove this comment
-canreinvite=no                ; "Jazmin" mini-asterisk do not remove this comment
-nat=yes                       ; "Jazmin" mini-asterisk do not remove this comment
\ No newline at end of file
+host=hostjaz                  ; jazmin-mini-asterisk do not remove this comment
+secret=passwordjaz            ; jazmin-mini-asterisk do not remove this comment
+username=userjaz              ; jazmin-mini-asterisk do not remove this comment
+fromdomain=hostjaz            ; jazmin-mini-asterisk do not remove this comment
+fromuser=userjaz              ; jazmin-mini-asterisk do not remove this comment
+insecure=port,invite          ; jazmin-mini-asterisk do not remove this comment
+type=friend                   ; jazmin-mini-asterisk do not remove this comment
+disallow=all                  ; jazmin-mini-asterisk do not remove this comment
+allow=ulaw                    ; jazmin-mini-asterisk do not remove this comment
+allow=alaw                    ; jazmin-mini-asterisk do not remove this comment
+dtmfmod=rfc2833               ; jazmin-mini-asterisk do not remove this comment
+qualify=yes                   ; jazmin-mini-asterisk do not remove this comment
+canreinvite=no                ; jazmin-mini-asterisk do not remove this comment
+nat=yes                       ; jazmin-mini-asterisk do not remove this comment
\ No newline at end of file
index 0152f2fe6f0288d8cbffdd3173a50557c0e9082a..b305d55b74b7aa9ab6ef49d5d457f9ad219690f9 100644 (file)
@@ -132,7 +132,7 @@ function initialisePage() {
     for(var i=0; i<zap.length; i++) {
         if (zap[i] == 'FXO') {
             html += "<tr>";
-           html += "<td>" + "0" + "</td>" + "<td>" + "Analog Phone" + "</td>";
+           html += "<td>" + "0" + "</td>" + "<td>" + "Analog Phone Line" + "</td>";
            html += "<td>Port" + i + "</td>";
             html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
 
index 19efefacc8d1fd88146ba9901b632b7d78d9fbf7..89fbcde6c7df76046ee66dbb22df405c389c04d7 100644 (file)
@@ -71,4 +71,22 @@ IP provider page work
        install script changed to update sip.conf\r
        Are sip provider entries ok to leav uncommented?...they have dummy hosts\r
        \r
-Notice ip phone (ekiga from pc) registrations stay on ip04 after phone has disappeared
\ No newline at end of file
+Notice ip phone (ekiga from pc) registrations stay on ip04 after phone has disappeared\r
+\r
+\r
+Error on Fxo/FXS rearrangement  phones lines read as phone\r
+\r
+Register command needs to be unique\r
+\r
+SetRegister.cgi   ?  with mini-asterisk\r
+\r
+Register needs to be able to handle other manual register entries\r
+\r
+Or make a mod to set_line_ext.cgi with third arg (jazmin,sip,sip-nat)\r
+\r
+Uncomment / comment sip provider as a cgi?\r
+\r
+                                                               s/$this.*/$this$that/g\r
+[11:09:09 AM | Edited 11:10:06 AM] David Rowe:  s/(host=).*\w/$1trev/g\r
+[11:10:13 AM] David Rowe: host=mal\r
+[11:10:16 AM] David Rowe: host=trev
\ No newline at end of file