From 3528047123250128eec93a095cf25c320fd0aabd Mon Sep 17 00:00:00 2001 From: horse69 Date: Mon, 29 Oct 2012 01:12:21 +0000 Subject: [PATCH] git-svn-id: https://svn.code.sf.net/p/freetel/code@876 01035d8c-6547-0410-b346-abe4f91aad63 --- mini-asterisk-gui2/cgi-bin/setlinekey.cgi | 44 +++++++++++++ mini-asterisk-gui2/etc/asterisk/sip.conf | 80 ++++++++++++----------- mini-asterisk-gui2/phones.js | 2 +- mini-asterisk-gui2/todo 2012_10.txt | 20 +++++- 4 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 mini-asterisk-gui2/cgi-bin/setlinekey.cgi diff --git a/mini-asterisk-gui2/cgi-bin/setlinekey.cgi b/mini-asterisk-gui2/cgi-bin/setlinekey.cgi new file mode 100644 index 00000000..35428876 --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/setlinekey.cgi @@ -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 + +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 diff --git a/mini-asterisk-gui2/etc/asterisk/sip.conf b/mini-asterisk-gui2/etc/asterisk/sip.conf index 4ee5f1a4..dda07f02 100644 --- a/mini-asterisk-gui2/etc/asterisk/sip.conf +++ b/mini-asterisk-gui2/etc/asterisk/sip.conf @@ -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 ; Jazmin 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 diff --git a/mini-asterisk-gui2/phones.js b/mini-asterisk-gui2/phones.js index 0152f2fe..b305d55b 100644 --- a/mini-asterisk-gui2/phones.js +++ b/mini-asterisk-gui2/phones.js @@ -132,7 +132,7 @@ function initialisePage() { for(var i=0; i" + "" + "Analog Phone" + ""; + html += "" + "0" + "" + "" + "Analog Phone Line" + ""; html += "Port" + i + ""; html += "" + 'tick' + ""; diff --git a/mini-asterisk-gui2/todo 2012_10.txt b/mini-asterisk-gui2/todo 2012_10.txt index 19efefac..89fbcde6 100644 --- a/mini-asterisk-gui2/todo 2012_10.txt +++ b/mini-asterisk-gui2/todo 2012_10.txt @@ -71,4 +71,22 @@ IP provider page work install script changed to update sip.conf Are sip provider entries ok to leav uncommented?...they have dummy hosts -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 + + +Error on Fxo/FXS rearrangement phones lines read as phone + +Register command needs to be unique + +SetRegister.cgi ? with mini-asterisk + +Register needs to be able to handle other manual register entries + +Or make a mod to set_line_ext.cgi with third arg (jazmin,sip,sip-nat) + +Uncomment / comment sip provider as a cgi? + + s/$this.*/$this$that/g +[11:09:09 AM | Edited 11:10:06 AM] David Rowe: s/(host=).*\w/$1trev/g +[11:10:13 AM] David Rowe: host=mal +[11:10:16 AM] David Rowe: host=trev \ No newline at end of file -- 2.25.1