working on voip lines screen
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 11 Jan 2010 23:43:19 +0000 (23:43 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 11 Jan 2010 23:43:19 +0000 (23:43 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@106 01035d8c-6547-0410-b346-abe4f91aad63

easy-asterisk-gui/Makefile
easy-asterisk-gui/faq.html
easy-asterisk-gui/ipphones.pl
easy-asterisk-gui/menu.html
easy-asterisk-gui/phones.pl
easy-asterisk-gui/tooltips.html
easy-asterisk-gui/voipline.sh [new file with mode: 0644]
easy-asterisk-gui/voiplines.pl [new file with mode: 0755]

index e245509dc4ef5dccf58d2b2248c98e62e6c3426f..ed9f60d02edf2c434ad760a6e40927d84d95569f 100644 (file)
@@ -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
index c15bf5d55e8b939b89ed4b9d0fedc54da8e9b103..dd6258e5493daa0b6abf23a7f8ac233fcb59ef86 100644 (file)
@@ -1,5 +1,13 @@
 <ol>
-<li>Transfer a Call
+
+<li><strong>Transfer a Call</strong>
+
+<li><strong>Answer a call on another ringing phone</strong>:  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.
+
 </ol>
 
 <h2>Resources and Links</h2>
index 4a712c04b2621754bf956246c790564c1b38aa2b..4c9509584b1f7383feccb9c95a1e873bf62c219c 100755 (executable)
@@ -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];
index a16e6e87d399b3c8e2edfafbd654a1f62ffd0553..080b1a25ea61d8de98a309eb12ec06aa104490ee 100644 (file)
@@ -5,6 +5,7 @@
     <div id="about_tip" class="tip">Boring information like software version numbers</div>
     <div id="faq_tip" class="tip">Frequently asked questions and links to further information</div>
     <div id="logout_tip" class="tip">I think you can work this one out....</div>
+    <div id="voipline_tip" class="tip">Set up your VOIP phone line</div>
     <td valign="top" >
        <table align="right" width=200>
        <tr><td><h2>&nbsp;</h2></td></tr>
@@ -29,5 +30,8 @@
        <tr onMouseOver="popUp(event,'network_tip')" onmouseout="popUp(event,'network_tip')">
          <td><a href="network.sh">Network</a></td>
        </tr>
+       <tr onMouseOver="popUp(event,'voipline_tip')" onmouseout="popUp(event,'voipline_tip')">
+         <td><a href="voiplines.sh">VOIP Line</a></td>
+       </tr>
        </table>
     </td>
index 77cc07dafcee6be3dac1f1e8950a64dc9f0273cd..b96d334c24b33a34379e219e46ab25eb64cc32e8 100755 (executable)
@@ -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 '<tr><td>&nbsp;</td></tr>';
+print "<tr><td colspan=2 onMouseOver=\"popUp(event,'phone_addvoipline')\" onmouseout=\"popUp(event,'phone_addvoipline')\">";
+print "<a href=\"voiplines.sh\">Set Up VOIP Line</a></td></tr>";
index b8df319dd1539fcf151559f4a1d1ac15a8563380..6abf14a22802eee7dfa58ad517f364d30eadef77 100644 (file)
 <div id="phone_reception" class="tip">
                          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.</div>
+                         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.</div>
 
 <div id="phone_anphone" class="tip">
                          Analog Phone: Normal telephone plugged into a port on your phone system.
@@ -80,6 +83,9 @@
 <div id="phone_addipphone" class="tip">
                         Instructions and help on adding a new IP phone</div>
 
+<div id="phone_addvoipline" class="tip">
+                        Instructions and help on VOIP Line set up</div>
+
 <div id="ipphones_ipphones" class="tip">
                         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 (file)
index 0000000..2b2df31
--- /dev/null
@@ -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 "<html>"
+    echo "<head>"
+    echo '<meta http-equiv="REFRESH" content="0;url=http:login.sh">'
+    echo "</head>"
+    echo "</html>"
+    exit
+fi
+
+# Construct the web page -------------------------------
+
+cat <<EOF
+<script src="prototype.js"></script>
+<link href="astman.css" media="all" rel="Stylesheet" type="text/css" />
+<script type="text/javascript" src="tooltip.js"></script>
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+EOF
+
+cat << EOF
+<html>
+<title>Easy Asterisk - VOIP Line</title>
+EOF
+
+cat tooltips.html
+echo '<table align="center" width=800>'
+cat banner.html
+echo "    <tr>"
+cat menu.html    
+cat <<EOF
+
+    <td valign="top">
+
+    <table align="right" width=600>
+      <tr><td>&nbsp</td></tr>
+      <form action="voipline.sh" method="get">
+      <tr><td align="left" valign="top"><h2>VOIP Line</h2></td></tr>
+
+      <tr><td>&nbsp</td></tr>
+EOF
+./voipline.pl
+
+cat <<EOF
+      <tr><td>&nbsp</td></tr>
+      <tr><td><input type="submit" value="OK"></td></tr>
+
+      </form>
+
+    </table>
+    </form>
+
+    </td>
+
+    </tr>
+
+</table>
+</body>
+</html>
+EOF
+
diff --git a/easy-asterisk-gui/voiplines.pl b/easy-asterisk-gui/voiplines.pl
new file mode 100755 (executable)
index 0000000..bed9234
--- /dev/null
@@ -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 (<SIP>) { 
+    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 "<tr><td>User:</td><td><input type=\"text\" name=\"user\" value=\"$user\"></td></tr>\n";
+print "<tr><td>Password:</td><td><input type=\"password\" name=\"pass\" value=\"$pass"></td></tr>";
+print "<tr><td>Host:</td><td><input type=\"text\" name=\"host\" value=\"$host"></td></tr>";