From 73f434f720d10028642616bcd417cff3547e6482 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Mon, 11 Jan 2010 23:43:19 +0000 Subject: [PATCH] working on voip lines screen git-svn-id: https://svn.code.sf.net/p/freetel/code@106 01035d8c-6547-0410-b346-abe4f91aad63 --- easy-asterisk-gui/Makefile | 2 +- easy-asterisk-gui/faq.html | 10 ++++- easy-asterisk-gui/ipphones.pl | 2 +- easy-asterisk-gui/menu.html | 4 ++ easy-asterisk-gui/phones.pl | 5 ++- easy-asterisk-gui/tooltips.html | 8 +++- easy-asterisk-gui/voipline.sh | 67 +++++++++++++++++++++++++++++++++ easy-asterisk-gui/voiplines.pl | 43 +++++++++++++++++++++ 8 files changed, 136 insertions(+), 5 deletions(-) create mode 100644 easy-asterisk-gui/voipline.sh create mode 100755 easy-asterisk-gui/voiplines.pl diff --git a/easy-asterisk-gui/Makefile b/easy-asterisk-gui/Makefile index e245509d..ed9f60d0 100644 --- a/easy-asterisk-gui/Makefile +++ b/easy-asterisk-gui/Makefile @@ -8,5 +8,5 @@ # make TESTIP=boris test test: - rcp 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 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/faq.html b/easy-asterisk-gui/faq.html index c15bf5d5..dd6258e5 100644 --- a/easy-asterisk-gui/faq.html +++ b/easy-asterisk-gui/faq.html @@ -1,5 +1,13 @@
    -
  1. Transfer a Call + +
  2. Transfer a Call + +
  3. Answer a call on another ringing phone: If you hear another phone ringing and +want to answer the call on your phone, just pick up your phone and +dial *8. Note an IP phone can pick up a call on a ringing IP phone +but not an Analog phone. An Analog pohone can pick up another +ringing Analog phone but not an IP phone. +

Resources and Links

diff --git a/easy-asterisk-gui/ipphones.pl b/easy-asterisk-gui/ipphones.pl index 4a712c04..4c950958 100755 --- a/easy-asterisk-gui/ipphones.pl +++ b/easy-asterisk-gui/ipphones.pl @@ -2,7 +2,7 @@ # ipphones.pl # David Rowe 6 Jan 2010 # -# Test processing for the ipphones screen +# Text processing for the ipphones screen $ipaddress = $ARGV[0]; $more = $ARGV[1]; diff --git a/easy-asterisk-gui/menu.html b/easy-asterisk-gui/menu.html index a16e6e87..080b1a25 100644 --- a/easy-asterisk-gui/menu.html +++ b/easy-asterisk-gui/menu.html @@ -5,6 +5,7 @@
Boring information like software version numbers
Frequently asked questions and links to further information
I think you can work this one out....
+
Set up your VOIP phone line
@@ -29,5 +30,8 @@ + + +

 

Network
VOIP Line
diff --git a/easy-asterisk-gui/phones.pl b/easy-asterisk-gui/phones.pl index 77cc07da..b96d334c 100755 --- a/easy-asterisk-gui/phones.pl +++ b/easy-asterisk-gui/phones.pl @@ -2,7 +2,7 @@ # phones.pl # David Rowe 5 Jan 2010 # -# Test processing for the phones screen. +# Text processing for the phones screen. $tool_tip = "onMouseOver=\"popUp(event,'network_internet')\" onmouseout=\"popUp(event,'network_internet')\""; @@ -193,3 +193,6 @@ foreach $s (sort keys %voip) { } } +print ' '; +print ""; +print "Set Up VOIP Line"; diff --git a/easy-asterisk-gui/tooltips.html b/easy-asterisk-gui/tooltips.html index b8df319d..6abf14a2 100644 --- a/easy-asterisk-gui/tooltips.html +++ b/easy-asterisk-gui/tooltips.html @@ -12,7 +12,10 @@
If ticked this phone will ring when some one calls the phone system from an outside Analog - or VOIP Line. More than one phone can be ticked.
+ or VOIP Line. More than one phone can be + ticked. You can answer a call on another + ringing phone by dialling *8 on your phone - + see FAQ for details.
Analog Phone: Normal telephone plugged into a port on your phone system. @@ -80,6 +83,9 @@
Instructions and help on adding a new IP phone
+
+ Instructions and help on VOIP Line set up
+
List of possible IP phones. For a new phone choose any Available number. Refresh this diff --git a/easy-asterisk-gui/voipline.sh b/easy-asterisk-gui/voipline.sh new file mode 100644 index 00000000..2b2df315 --- /dev/null +++ b/easy-asterisk-gui/voipline.sh @@ -0,0 +1,67 @@ +#!/bin/sh +# voipline.sh +# David Rowe 12 Jan 2010 +# VOIP Line screen for Easy Asterisk GUI + +# check we are logged in + +echo $HTTP_COOKIE | grep "loggedin" > /dev/null +if [ $? -eq 1 ]; then + echo "" + echo "" + echo '' + echo "" + echo "" + exit +fi + +# Construct the web page ------------------------------- + +cat < + + + +EOF + +cat << EOF + +Easy Asterisk - VOIP Line +EOF + +cat tooltips.html +echo '' +cat banner.html +echo " " +cat menu.html +cat < + +
+ + + + + +EOF +./voipline.pl + +cat < + + + + +
 

VOIP Line

 
 
+ + + + + + + + + +EOF + diff --git a/easy-asterisk-gui/voiplines.pl b/easy-asterisk-gui/voiplines.pl new file mode 100755 index 00000000..bed92342 --- /dev/null +++ b/easy-asterisk-gui/voiplines.pl @@ -0,0 +1,43 @@ +#!/sbin/microperl +# voiplines.pl +# David Rowe 12 Jan 2010 +# +# Text processing for the ipphones screen + +# slurp up voip trunk details -------------------------------- + +open SIP, "/etc/asterisk/sip.conf"; +$state = "looking for [voip]"; + +while () { + if ($state eq "looking for [voip]") { + + if (/^\[voip\]/) { + $state="inside [voip]"; + } + + } + + if (($state eq "inside [voip]") { + if (/^\[/) { + $state = "finished"; + } + + if (/user=(.*)/) { + $user = $1; + } + if (/secret=(.*)/) { + $pass = $1; + } + if (/host=(.*)/) { + $host = $1; + } + } +} +close SIP; + +# generate form --------------------------------------------- + +print "User:\n"; +print "Password:"; +print "Host:"; -- 2.25.1