From: drowe67 Date: Tue, 12 Jan 2010 00:25:24 +0000 (+0000) Subject: basic voip line screen working X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=89acead0db7f2c01a7bef578a297835482a79960;p=freetel-svn-tracking.git basic voip line screen working git-svn-id: https://svn.code.sf.net/p/freetel/code@108 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/easy-asterisk-gui/Makefile b/easy-asterisk-gui/Makefile index 386bfe52..e5bff4e8 100644 --- a/easy-asterisk-gui/Makefile +++ b/easy-asterisk-gui/Makefile @@ -8,5 +8,5 @@ # make TESTIP=boris test test: - rcp set_voiplines.pl voiplines.sh voiplines.pl set_ring.sh prototype.js admin.sh index.html faq.sh faq.html about.sh at-530.html ipphones.pl ipphones.sh ipphones.js voipline.jpg anphone.png phoneline.jpg ipphone.png phones.pl tooltips.html phones.sh phones.js tick.png cross.png banner.html menu.html check_loggedin.sh logout.sh login.sh network.sh network.js set_network.sh tooltip.js tooltip.css root@$(TESTIP):/www + rcp set_voiplines.pl set_voiplines.sh voiplines.sh voiplines.pl set_ring.sh prototype.js admin.sh index.html faq.sh faq.html about.sh at-530.html ipphones.pl ipphones.sh ipphones.js voipline.jpg anphone.png phoneline.jpg ipphone.png phones.pl tooltips.html phones.sh phones.js tick.png cross.png banner.html menu.html check_loggedin.sh logout.sh login.sh network.sh network.js set_network.sh tooltip.js tooltip.css root@$(TESTIP):/www rcp sip.conf extensions.conf root@$(TESTIP):/etc/asterisk diff --git a/easy-asterisk-gui/set_voipline.sh b/easy-asterisk-gui/set_voipline.sh deleted file mode 100644 index 21b78446..00000000 --- a/easy-asterisk-gui/set_voipline.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# set_voipline.sh -# # David Rowe 12 Jan 2010 -# -# CGI to set voip line parameters in sip.conf. - -cat < - -set_network.sh - - -Please wait a few seconds..... - - - -EOF - -user=`echo "$QUERY_STRING" | grep -oe "user=[^&?]*" | sed -n "s/user=//p"` -pass=`echo "$QUERY_STRING" | grep -oe "pass=[^&?]*" | sed -n "s/pass=//p"` -host=`echo "$QUERY_STRING" | grep -oe "host=[^&?]*" | sed -n "s/host=//p"` - -./set_voipline.pl $user $pass $host > /etc/asterisk/sip.conf - -cat < - -set_voiplines.sh - - -Please wait a few seconds..... - - - -EOF \ No newline at end of file diff --git a/easy-asterisk-gui/set_voiplines.pl b/easy-asterisk-gui/set_voiplines.pl index 44e9f150..880b3ba0 100755 --- a/easy-asterisk-gui/set_voiplines.pl +++ b/easy-asterisk-gui/set_voiplines.pl @@ -54,8 +54,3 @@ while () { } close SIP; -# generate form fields ------------------------------------------- - -print "User:\n"; -print "Password:"; -print "Host:"; diff --git a/easy-asterisk-gui/set_voiplines.sh b/easy-asterisk-gui/set_voiplines.sh new file mode 100644 index 00000000..4820b789 --- /dev/null +++ b/easy-asterisk-gui/set_voiplines.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# set_voipline.sh +# # David Rowe 12 Jan 2010 +# +# CGI to set voip line parameters in sip.conf. + +# check we are logged in + +echo $HTTP_COOKIE | grep "loggedin" > /dev/null +if [ $? -eq 1 ]; then + echo "" + echo "" + echo '' + echo "" + echo "" + exit +fi + +user=`echo "$QUERY_STRING" | grep -oe "user=[^&?]*" | sed -n "s/user=//p"` +pass=`echo "$QUERY_STRING" | grep -oe "pass=[^&?]*" | sed -n "s/pass=//p"` +host=`echo "$QUERY_STRING" | grep -oe "host=[^&?]*" | sed -n "s/host=//p"` + +./set_voiplines.pl $user $pass $host > /etc/asterisk/sip.conf.new +mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.bak +mv /etc/asterisk/sip.conf.new /etc/asterisk/sip.conf +asterisk -rx "sip reload" 2>/dev/null 1 > /dev/null + +cat < + +set_voiplines.sh + + +Please wait a few seconds..... + + + +EOF +