# 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
<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>
# 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];
<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> </h2></td></tr>
<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>
# 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')\"";
}
}
+print '<tr><td> </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>";
<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.
<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
--- /dev/null
+#!/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> </td></tr>
+ <form action="voipline.sh" method="get">
+ <tr><td align="left" valign="top"><h2>VOIP Line</h2></td></tr>
+
+ <tr><td> </td></tr>
+EOF
+./voipline.pl
+
+cat <<EOF
+ <tr><td> </td></tr>
+ <tr><td><input type="submit" value="OK"></td></tr>
+
+ </form>
+
+ </table>
+ </form>
+
+ </td>
+
+ </tr>
+
+</table>
+</body>
+</html>
+EOF
+
--- /dev/null
+#!/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>";