mv to attic
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 1 Jul 2014 22:03:31 +0000 (22:03 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 1 Jul 2014 22:03:31 +0000 (22:03 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1730 01035d8c-6547-0410-b346-abe4f91aad63

156 files changed:
attic/mini-asterisk-gui2/README.txt [new file with mode: 0644]
attic/mini-asterisk-gui2/about.html [new file with mode: 0644]
attic/mini-asterisk-gui2/about.js [new file with mode: 0644]
attic/mini-asterisk-gui2/admin.html [new file with mode: 0644]
attic/mini-asterisk-gui2/admin.js [new file with mode: 0644]
attic/mini-asterisk-gui2/at-620r.png [new file with mode: 0644]
attic/mini-asterisk-gui2/cgi-bin/asterisk.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/catproc.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/commentkey.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/getconf.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/getdhcp.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/getemergencyip.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/getnetwork.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/ifconfig.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/install.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/ipkg.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/network-backdoor.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/network-static.cgi [new file with mode: 0644]
attic/mini-asterisk-gui2/cgi-bin/network.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/reset.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/restart.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setline.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setlinekey.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setpassword.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setring.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setservice.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/setword.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/sipshowpeers.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/uncommentkey.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/upgrade.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/cgi-bin/uptime.cgi [new file with mode: 0755]
attic/mini-asterisk-gui2/configure_AT-530.html [new file with mode: 0644]
attic/mini-asterisk-gui2/configure_AT-620R.html [new file with mode: 0644]
attic/mini-asterisk-gui2/configure_AT.js [new file with mode: 0644]
attic/mini-asterisk-gui2/cross.png [new file with mode: 0644]
attic/mini-asterisk-gui2/devel notes.txt [new file with mode: 0644]
attic/mini-asterisk-gui2/diagnostics.html [new file with mode: 0644]
attic/mini-asterisk-gui2/diagnostics.js [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/asterisk/extensions.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/asterisk/extensions.conf.orig [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/asterisk/iax.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/asterisk/sip.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/asterisk/zapata.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/lighttpd.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/lighttpd/conf-available/.gitignore [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/lighttpd/conf-enabled/10-cgi.conf [new symlink]
attic/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf.x86 [new file with mode: 0644]
attic/mini-asterisk-gui2/etc/zaptel.conf [new file with mode: 0644]
attic/mini-asterisk-gui2/faq.html [new file with mode: 0644]
attic/mini-asterisk-gui2/faq.js [new file with mode: 0644]
attic/mini-asterisk-gui2/install notes.txt [new file with mode: 0644]
attic/mini-asterisk-gui2/install_gui2.sh [new file with mode: 0755]
attic/mini-asterisk-gui2/ipphones.html [new file with mode: 0644]
attic/mini-asterisk-gui2/ipphones.js [new file with mode: 0644]
attic/mini-asterisk-gui2/login.html [new file with mode: 0644]
attic/mini-asterisk-gui2/logout.html [new file with mode: 0644]
attic/mini-asterisk-gui2/logout.js [new file with mode: 0644]
attic/mini-asterisk-gui2/menu.js [new file with mode: 0644]
attic/mini-asterisk-gui2/minicommon.js [new file with mode: 0644]
attic/mini-asterisk-gui2/ministyle.css [new file with mode: 0644]
attic/mini-asterisk-gui2/network.html [new file with mode: 0644]
attic/mini-asterisk-gui2/network.js [new file with mode: 0644]
attic/mini-asterisk-gui2/phones.html [new file with mode: 0644]
attic/mini-asterisk-gui2/phones.js [new file with mode: 0644]
attic/mini-asterisk-gui2/system.html [new file with mode: 0644]
attic/mini-asterisk-gui2/system.js [new file with mode: 0644]
attic/mini-asterisk-gui2/tick.png [new file with mode: 0644]
attic/mini-asterisk-gui2/todo 2012_10.txt [new file with mode: 0644]
attic/mini-asterisk-gui2/todo 2012_11.txt [new file with mode: 0644]
attic/mini-asterisk-gui2/todo notes [new file with mode: 0644]
attic/mini-asterisk-gui2/tooltip.css [new file with mode: 0644]
attic/mini-asterisk-gui2/tooltip.js [new file with mode: 0644]
attic/mini-asterisk-gui2/tooltips.js [new file with mode: 0644]
attic/mini-asterisk-gui2/voiplines.html [new file with mode: 0644]
attic/mini-asterisk-gui2/voiplines.js [new file with mode: 0644]
mini-asterisk-gui2/README.txt [deleted file]
mini-asterisk-gui2/about.html [deleted file]
mini-asterisk-gui2/about.js [deleted file]
mini-asterisk-gui2/admin.html [deleted file]
mini-asterisk-gui2/admin.js [deleted file]
mini-asterisk-gui2/at-620r.png [deleted file]
mini-asterisk-gui2/cgi-bin/asterisk.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/catproc.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/commentkey.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/fpingnodes.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/getconf.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/getdhcp.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/getemergencyip.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/getnetwork.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/ifconfig.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/install.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/ipkg.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/network-backdoor.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/network-static.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/network.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/reset.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/restart.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setline.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setlinekey.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setlinekey2.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setpassword.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setring.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setservice.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/setword.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/sipshowpeers.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/uncommentkey.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/upgrade.cgi [deleted file]
mini-asterisk-gui2/cgi-bin/uptime.cgi [deleted file]
mini-asterisk-gui2/configure_AT-530.html [deleted file]
mini-asterisk-gui2/configure_AT-620R.html [deleted file]
mini-asterisk-gui2/configure_AT.js [deleted file]
mini-asterisk-gui2/cross.png [deleted file]
mini-asterisk-gui2/devel notes.txt [deleted file]
mini-asterisk-gui2/diagnostics.html [deleted file]
mini-asterisk-gui2/diagnostics.js [deleted file]
mini-asterisk-gui2/etc/asterisk/extensions.conf [deleted file]
mini-asterisk-gui2/etc/asterisk/extensions.conf.orig [deleted file]
mini-asterisk-gui2/etc/asterisk/iax.conf [deleted file]
mini-asterisk-gui2/etc/asterisk/sip.conf [deleted file]
mini-asterisk-gui2/etc/asterisk/zapata.conf [deleted file]
mini-asterisk-gui2/etc/lighttpd.conf [deleted file]
mini-asterisk-gui2/etc/lighttpd/conf-available/.gitignore [deleted file]
mini-asterisk-gui2/etc/lighttpd/conf-enabled/10-cgi.conf [deleted symlink]
mini-asterisk-gui2/etc/lighttpd/lighttpd.conf [deleted file]
mini-asterisk-gui2/etc/lighttpd/lighttpd.conf.x86 [deleted file]
mini-asterisk-gui2/etc/zaptel.conf [deleted file]
mini-asterisk-gui2/faq.html [deleted file]
mini-asterisk-gui2/faq.js [deleted file]
mini-asterisk-gui2/install notes.txt [deleted file]
mini-asterisk-gui2/install_gui2.sh [deleted file]
mini-asterisk-gui2/ipphones.html [deleted file]
mini-asterisk-gui2/ipphones.js [deleted file]
mini-asterisk-gui2/login.html [deleted file]
mini-asterisk-gui2/logout.html [deleted file]
mini-asterisk-gui2/logout.js [deleted file]
mini-asterisk-gui2/menu.js [deleted file]
mini-asterisk-gui2/minicommon.js [deleted file]
mini-asterisk-gui2/ministyle.css [deleted file]
mini-asterisk-gui2/network.html [deleted file]
mini-asterisk-gui2/network.js [deleted file]
mini-asterisk-gui2/phones.html [deleted file]
mini-asterisk-gui2/phones.js [deleted file]
mini-asterisk-gui2/system.html [deleted file]
mini-asterisk-gui2/system.js [deleted file]
mini-asterisk-gui2/tick.png [deleted file]
mini-asterisk-gui2/todo 2012_10.txt [deleted file]
mini-asterisk-gui2/todo 2012_11.txt [deleted file]
mini-asterisk-gui2/todo notes [deleted file]
mini-asterisk-gui2/tooltip.css [deleted file]
mini-asterisk-gui2/tooltip.js [deleted file]
mini-asterisk-gui2/tooltips.js [deleted file]
mini-asterisk-gui2/voiplines.html [deleted file]
mini-asterisk-gui2/voiplines.js [deleted file]

diff --git a/attic/mini-asterisk-gui2/README.txt b/attic/mini-asterisk-gui2/README.txt
new file mode 100644 (file)
index 0000000..c0b03b3
--- /dev/null
@@ -0,0 +1,17 @@
+Mini Asterisk GUI Version 2
+===========================
+
+Rewrite of original concept using Javascript.
+
+Check out notes in install notes.txt
+
+TODO
+----
+
+[ ] fping ipkg dependancy
+[ ] blog post
+    + javascript with firebox is a joy to debug
+    + cf server side, CGIs
+    + keep CGIs really small, very productive
+    + BASIC style string processing versus regexp
+    + CGI wring, regexp, sed is painfully slow, so minimise it
diff --git a/attic/mini-asterisk-gui2/about.html b/attic/mini-asterisk-gui2/about.html
new file mode 100644 (file)
index 0000000..0d35efb
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>About</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css" />
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="about.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="about"></div>
+       <table align="right" width=600>
+          <tr><td align="left" valign="top"><h2>About</h2></td></tr>
+          <tr><td><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision 1.0</td></tr>
+          <tr><td>&nbsp;</td></tr>
+          <tr><td>Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>
+          <tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" alt="ip04_case"  border="0" /></a></td><td> </td><td></td></tr>
+       </table>
+
+
+    </td>
+
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/about.js b/attic/mini-asterisk-gui2/about.js
new file mode 100644 (file)
index 0000000..5f6835c
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  about.js
+  Ian Roberts
+  May 7 2012
+
+  About screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+
+}
+
+
+
diff --git a/attic/mini-asterisk-gui2/admin.html b/attic/mini-asterisk-gui2/admin.html
new file mode 100644 (file)
index 0000000..72c517d
--- /dev/null
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>Admin</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css" />
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="tooltips.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="admin.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td valign="top">
+
+    <table align="right" width=600>
+      <tr><td>&nbsp;</td></tr>
+         
+      <tr><td align="left" valign="top"><h2>Admin</h2></td></tr>
+      <tr><td>&nbsp;</td></tr>
+      <tr><td colspan="2"><h3>Change Phone System Password</h3></td></tr>
+      <tr><td>New Password:</td><td><input type="password" name="pass" ></td>
+          <td><input type="button" style="width:100%" value="Set Password" onClick="onClickSetPassword()"></td>
+      </tr>
+      <tr><td>&nbsp;</td></tr>
+      <tr><td></td><td>Default password is uClinux</td></tr>
+
+      <tr><td>&nbsp;</td></tr>
+      <tr><td colspan="2"><h3>Restart Phone System</h3></td>
+          <td><input type="button" style="width:100%" value="Restart" onClick="onClickRestart()"></td>
+      </tr>
+
+      <tr><td>&nbsp;</td></tr>
+       <tr><td colspan="2"><h3>Reset Phone System Defaults</h3></td>
+          <td><input type="button" style="width:100%" value="Reset" onClick="onClickReset()"></td>
+      </tr>
+
+      <tr><td>&nbsp;</td></tr>
+      <tr onMouseOver="popUp(event,'admin_upgrade')" onmouseout="popUp(event,'admin_upgrade')">
+          <td colspan="2"><h3>Upgrade Mini Asterisk</h3></td>
+          <td><input type="button" style="width:100%" value="Upgrade" onClick="onClickUpgrade()"></td>
+      </tr>
+
+      <tr><td>&nbsp;</td></tr>
+      <tr><td colspan="2"><h3>Install New Firmware</h3></td>
+      </tr>      
+      <tr onMouseOver="popUp(event,'admin_firmware')" onmouseout="popUp(event,'admin_firmware')">
+          <td>Firmware URL:</td>
+          <td><input type="text" size="45" name="firmwareurl" ></td>
+          <td><input type="button" style="width:100%" value="Install" onClick="onClickInstall()"></td>
+
+      </tr>
+         
+
+   </table>
+   
+  </td>
+  </tr>
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/admin.js b/attic/mini-asterisk-gui2/admin.js
new file mode 100644 (file)
index 0000000..b64259c
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+  admin.js
+  Ian Roberts
+  May 10 2012
+
+  Admin screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+var firmwareurl = "hi";
+var newpassword = "hello";
+
+
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+    
+    
+
+}
+
+function onClickSetPassword() {
+
+        newpassword= document.pass.value;
+        downloadUrl("/cgi-bin/setpassword.cgi?newpassword="+newpassword,OnSetPasswordReturn);
+
+//      if not x86 (developement environment)
+//         pass=`echo "$QUERY_STRING" | grep -oe "pass=[^&?]*" | sed -n "s/pass=//p"`
+//         passwd_cmdline $pass
+
+}
+
+
+function onClickInstall() {
+
+       firmwareurl=document.firmwareurl.value;
+       downloadUrl("/cgi-bin/install.cgi?file="+firmwareurl,OnInstallReturn);
+
+//      if not x86 (developement environment)
+//    firmwareurl=`echo "$QUERY_STRING" | grep -oe "firmwareurl=[^&?]*" | sed -n "s/firmwareurl=//p"`
+//    # convert URL encoded string, this can just handle : and / so be careful
+//    # with script names
+//    firmwareurl=`echo $firmwareurl | sed -e "s/%3A/:/" -e "s_%2F_/_g"`
+//    wget $firmwareurl
+//    filename=`echo $firmwareurl | sed 's_^.*/__'`
+//    sh $filename
+//    exit
+
+}
+
+function onClickUpgrade() {
+
+       downloadUrl("/cgi-bin/upgrade.cgi?arg=",OnUpgradeReturn);
+
+//      if not x86 (developement environment)
+//    rev_before=`grep -oe "Revision: [0-9]*" /www/about.sh`
+//    echo "<strong>Current $rev_before</strong><br>"
+//    echo "<strong>Removing $ver_before</strong><br>"
+//    ipkg remove mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+//    echo "<strong>Installing...</strong><br>"
+//    ipkg update | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+//    ipkg install mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+
+
+}
+
+
+function onClickReset() {
+
+       downloadUrl("/cgi-bin/reset.cgi?arg=",OnResetReturn);
+
+//      if not x86 (developement environment)
+//     cp /etc/asterisk/extensions.conf.def /etc/asterisk/extensions.conf
+//     cp /etc/asterisk/sip.conf.def /etc/asterisk/sip.conf
+//     asterisk -rx "sip reload" 2>/dev/null 1 > /dev/null
+//     asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
+
+}
+
+
+function onClickRestart() {
+
+       downloadUrl("/cgi-bin/restart.cgi?arg=",OnRestartReturn);
+
+//      if not x86 (developement environment)
+//          reboot
+}
+
diff --git a/attic/mini-asterisk-gui2/at-620r.png b/attic/mini-asterisk-gui2/at-620r.png
new file mode 100644 (file)
index 0000000..a2e5b0b
Binary files /dev/null and b/attic/mini-asterisk-gui2/at-620r.png differ
diff --git a/attic/mini-asterisk-gui2/cgi-bin/asterisk.cgi b/attic/mini-asterisk-gui2/cgi-bin/asterisk.cgi
new file mode 100755 (executable)
index 0000000..eaf292c
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+# asterisk.cgi
+# David Rowe 22 Dec 2010
+#
+# CGI to return the output from an Asterisk command line
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+CLI=`echo "$QUERY_STRING" | sed -n "s/.*cli=//p" | sed -n "s/%20/ /pg"`
+echo "$CLI"
+asterisk -rx "$CLI"
+echo hello
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/catproc.cgi b/attic/mini-asterisk-gui2/cgi-bin/catproc.cgi
new file mode 100755 (executable)
index 0000000..65afe25
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# catproc.cgi
+#  Ian Roberts
+#  May 7 2012
+# CGI to execute cat /proc/<argument>
+# script expects only one argument
+# valid arguments are version, loadavg, cpuinfo, mtd, meminfo, yaffs
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
+#Todo : Test for one argument
+#Todo : Test for valid argument
+cat /proc/$arg
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/commentkey.cgi b/attic/mini-asterisk-gui2/cgi-bin/commentkey.cgi
new file mode 100755 (executable)
index 0000000..afaf43d
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh 
+# commentkey.cgi
+# David Rowe 30 Oct 2012
+#
+# CGI to comment a chunk of text that has a certain key phrase on each line
+#
+# Test on host with:
+#
+#    $ export QUERY_STRING='file=test.txt&key=Jazmin mini'; ./commentkey.cgi
+#
+# try using test file:
+# 
+#   root:/root> cat test.txt 
+#   [user]                       ; Jazmin mini-asterisk do not remove this comment
+#   host=sip.jazmin.net.au       ; Jazmin mini-asterisk do not remove this comment
+#   secret=<Password>            ; Jazmin mini-asterisk do not remove this comment           
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+file=`echo $QUERY_STRING | grep -oe "file=[^&?]*" | sed -n "s/file=//p"`
+key=`echo $QUERY_STRING | grep -oe "key=[^&?]*" | sed -n "s/key=//p" | sed "s/%22/\"/g"`
+echo $QUERY_STRING
+echo $file
+echo $key
+if [ -f $file ]; then
+  # to debug remove -i (write results to file), it will then just print results
+  perl -i -pe "s/(.*$key)/;\$1/" $file
+else
+  echo "$file does not exist"
+fi
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi b/attic/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi
new file mode 100755 (executable)
index 0000000..d0c19fa
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# fpingnodes.cgi
+# David Rowe 5 Dec 2010
+#
+# CGI to fping a bunch of nodes
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"`
+fping $ip -a -b1400 -r1 2>/dev/null
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/getconf.cgi b/attic/mini-asterisk-gui2/cgi-bin/getconf.cgi
new file mode 100755 (executable)
index 0000000..c1115a3
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# getconf.cgi
+# David Rowe 12 Dec 2010
+#
+# CGI to return an Asterisk conf file
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+CONF_PATH=/etc/asterisk
+FILE=`echo "$QUERY_STRING" | sed -n "s/.*file=//p"`
+if [ -f $CONF_PATH/$FILE ] ; then 
+  cat $CONF_PATH/$FILE
+fi
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/getdhcp.cgi b/attic/mini-asterisk-gui2/cgi-bin/getdhcp.cgi
new file mode 100755 (executable)
index 0000000..ff708fc
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# getdhcp.cgi
+# David Rowe 8 March 2011
+#
+# CGI to return DHCP config details
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+if [ -f /etc/rc.d/S10network ]; then
+  dhcp=yes
+  ipaddress=`ifconfig eth0 | sed -n 's/.*inet addr:\(.*\)  Bcast.*/\1/p'`
+  netmask=`ifconfig eth0 | sed -n 's/.*Mask:\(.*\)\s*/\1/p'`
+  gateway=`route -n | awk '/^0.0.0.0/ {print $2}'`
+  dns=`cat /etc/resolv.conf | awk '/^nameserver/ {print $2}'`
+  echo DHCP=\"yes\"
+  echo IPADDRESS=\"$ipaddress\"
+  echo NETMASK=\"$netmask\"
+  echo GATEWAY=\"$gateway\"
+  echo DNS=\"$dns\"
+else
+  echo DHCP=\"no\"
+fi
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/getemergencyip.cgi b/attic/mini-asterisk-gui2/cgi-bin/getemergencyip.cgi
new file mode 100755 (executable)
index 0000000..6d58b67
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# getemergency.cgi
+# David Rowe 8 March 2011
+#
+# CGI to return emergency IP details
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+if [ -f /etc/rc.d/S05network-backdoor ]; then
+  backdoor=`sed -n 's/IPADDRESS="\(.*\)"/\1/p' /etc/init.d/network-backdoor`
+  echo BACKDOOR=\"$backdoor\"
+fi
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/getnetwork.cgi b/attic/mini-asterisk-gui2/cgi-bin/getnetwork.cgi
new file mode 100755 (executable)
index 0000000..ceb0631
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+# getnetwork.cgi
+# Ian Roberts 19 March 2012
+#
+# CGI to return network connection details
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+internet=`fping google.com`;
+#packet_loss=`fping google.com -c 1 -q | sed -n 's/.*received, \(.*\)%.*/\1/p'`
+#if [ $packet_loss = "0" ]; then
+#    internet="yes";
+#fi
+
+echo INTERNET=\"$internet\"
+#echo PACKETLOSS=\"$packet_loss\"
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/ifconfig.cgi b/attic/mini-asterisk-gui2/cgi-bin/ifconfig.cgi
new file mode 100755 (executable)
index 0000000..98685c4
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+# asterisk.cgi
+# David Rowe 3 March 2011 
+#
+# CGI to return the output from an Asterisk command line
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p"`
+ifconfig $arg
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/install.cgi b/attic/mini-asterisk-gui2/cgi-bin/install.cgi
new file mode 100755 (executable)
index 0000000..29b936e
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+# install.cgi
+# Ian Roberts 31 May 2012
+#
+# CGI to install new firmware....
+# runs a shellscript as root
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+
+# check what sort of machine we are running on.  Many operations
+# outlawed for x86
+
+cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
+if [ $? -eq 0 ]; then
+    mach="ip0x"
+else
+    mach="x86"
+fi
+
+
+
+if [ $mach != "ip0x" ] ; then
+       echo "<html>Sorry, only supported on the IP0X</html>"
+       exit
+fi
+
+firmwareurl=`echo "$QUERY_STRING" | grep -oe "firmwareurl=[^&?]*" | sed -n "s/firmwareurl=//p"`
+# convert URL encoded string, this can just handle : and / so be careful
+# with script names
+firmwareurl=`echo $firmwareurl | sed -e "s/%3A/:/" -e "s_%2F_/_g"`
+wget $firmwareurl
+filename=`echo $firmwareurl | sed 's_^.*/__'`
+sh $filename
+exit
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/ipkg.cgi b/attic/mini-asterisk-gui2/cgi-bin/ipkg.cgi
new file mode 100755 (executable)
index 0000000..4a14727
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# ipkg.cgi
+#  Ian Roberts
+#  May 12 2012
+# CGI to execute ipkg <argument>
+# script expects only one argument
+# valid arguments are list_installed, list etc
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
+#Todo : Test for one argument
+#Todo : Test for valid argument
+ipkg $arg
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/network-backdoor.cgi b/attic/mini-asterisk-gui2/cgi-bin/network-backdoor.cgi
new file mode 100755 (executable)
index 0000000..0accbcd
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# network-backdoor.cgi
+# Ian Roberts 15 Sept 2012
+#
+# CGI to return the output from an /etc/init.d/network-backdoor command 
+#
+# valid action are start, stop, enable, disable
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
+echo "$ARG"
+/etc/init.d/network-backdoor "$ARG"
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/network-static.cgi b/attic/mini-asterisk-gui2/cgi-bin/network-static.cgi
new file mode 100644 (file)
index 0000000..b70d62e
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# network-static.cgi
+# Ian Roberts 15 Sept 2012
+#
+# CGI to return the output from an /etc/init.d/network-static command 
+#
+# valid action are start, stop, enable, disable
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
+echo "$ARG"
+/etc/init.d/network-static "$ARG"
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/network.cgi b/attic/mini-asterisk-gui2/cgi-bin/network.cgi
new file mode 100755 (executable)
index 0000000..6babf8a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# network.cgi
+# Ian Roberts 15 Sept 2012
+#
+# CGI to return the output from an /etc/init.d/network command 
+#
+# valid actions are start, stop, enable, disable
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
+echo "$ARG"
+/etc/init.d/network "$ARG"
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/reset.cgi b/attic/mini-asterisk-gui2/cgi-bin/reset.cgi
new file mode 100755 (executable)
index 0000000..984bb49
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh
+# reset.cgi
+# Ian Roberts 31 May 2012
+#
+# CGI to reset ipox
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+
+# check what sort of machine we are running on.  Many operations
+# outlawed for x86
+
+cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
+if [ $? -eq 0 ]; then
+    mach="ip0x"
+else
+    mach="x86"
+fi
+
+
+
+if [ $mach != "ip0x" ] ; then
+       echo "Sorry, only supported on the IP0X"
+cat <<EOF
+</body>
+</html>
+EOF
+       exit
+fi
+
+# reset the dialplan files
+cp /etc/asterisk/extensions.conf.def /etc/asterisk/extensions.conf
+cp /etc/asterisk/sip.conf.def /etc/asterisk/sip.conf
+# reload the dialplans in asterisk
+asterisk -rx "sip reload" 2>/dev/null 1 > /dev/null
+asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
+
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/restart.cgi b/attic/mini-asterisk-gui2/cgi-bin/restart.cgi
new file mode 100755 (executable)
index 0000000..af29a8c
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+# restart.cgi
+# Ian Roberts 31 May 2012
+#
+# CGI to reboot ipox
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+
+# check what sort of machine we are running on.  Many operations
+# outlawed for x86
+
+cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
+if [ $? -eq 0 ]; then
+    mach="ip0x"
+else
+    mach="x86"
+fi
+
+
+
+if [ $mach != "ip0x" ] ; then
+       echo "<html>Sorry, only supported on the IP0X</html>"
+       exit
+fi
+
+# kill cookie to log out.  This ensures hitting refresh wont run
+# the restart process again
+
+cat <<EOF
+Content-type: text/html
+Set-Cookie: loggedin=1; expires=Thursday, 01-Jan-98 12:00:00 GMT
+
+<head>
+<title>Mini Asterisk - Restart</title>
+</head>
+<body>
+<h2>Restarting...come back in 1 minute</h2>
+</body>
+EOF
+reboot
+
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setline.cgi b/attic/mini-asterisk-gui2/cgi-bin/setline.cgi
new file mode 100755 (executable)
index 0000000..eaaf47a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+# setline.cgi
+# David Rowe 9 March 2011
+#
+# CGI to set the text in "file" from "this" to "that"
+#
+# Test on host with:
+#
+#    $ export QUERY_STRING='file=test.txt&this=IPADDRESS=&that="192.168.1.31"'; ./setline.cgi
+#
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+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"`
+echo $QUERY_STRING
+echo $file
+echo $this
+echo $that
+if [ -f $file ]; then
+  sed -i "s/$this.*/$this$that/g" $file
+else
+  echo "$file does not exist"
+fi
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setlinekey.cgi b/attic/mini-asterisk-gui2/cgi-bin/setlinekey.cgi
new file mode 100755 (executable)
index 0000000..11e9c5a
--- /dev/null
@@ -0,0 +1,45 @@
+#!/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
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+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
+#   sed 's/\($this\)[^\s]*\($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
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi b/attic/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi
new file mode 100755 (executable)
index 0000000..2d49f08
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh 
+# setlinekey2.cgi
+# David Rowe 29 Oct 2012
+#
+# CGI to set the text in "file" from "this" to "that" on lines with text "key"
+#
+# Test on host with:
+#
+#    $ export QUERY_STRING='file=test.txt&this=host=&that=192.168.1.31&key=Jazmin mini'; ./setlinekey2.cgi
+#
+# using test file:
+# 
+#   root:/root> cat test.txt 
+#   host=192.168.1.28       ; Jazmin mini-asterisk do not remove this comment
+#   dtmfmod=rfc2833         ; Jazmin mini-asterisk do not remove this comment
+#   host=192.168.1.29       ; SIP mini-asterisk do not remove this comment
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+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
+  # to debug remove -i (write results to file), it will then just print results
+  perl -i -pe "s/($this)[A-Za-z0-9\.\<\>]*(.*$key.*)/$this$that\$2/" $file
+else
+  echo "$file does not exist"
+fi
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setpassword.cgi b/attic/mini-asterisk-gui2/cgi-bin/setpassword.cgi
new file mode 100755 (executable)
index 0000000..b0765e5
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+# setpassword.cgi
+# Ian Roberts 31 May 2012
+#
+# CGI to set password on ipox
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+
+# check what sort of machine we are running on.  Many operations
+# outlawed for x86
+
+cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
+if [ $? -eq 0 ]; then
+    mach="ip0x"
+else
+    mach="x86"
+fi
+
+
+
+if [ $mach != "ip0x" ] ; then
+       echo "<html>Sorry, only supported on the IP0X</html>"
+       exit
+fi
+
+pass=`echo "$QUERY_STRING" | grep -oe "pass=[^&?]*" | sed -n "s/pass=//p"`
+passwd_cmdline $pass
+
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setring.cgi b/attic/mini-asterisk-gui2/cgi-bin/setring.cgi
new file mode 100755 (executable)
index 0000000..b9525de
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# setring.cgi
+# 
+# Ian Roberts 30 August 2012
+#
+# CGI to set extension to ring on an incoming call
+#
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+
+# extract extensions to ring 
+# must replace underscores with forward slash
+
+echo "Input $QUERY_STRING"
+
+a=`echo "$QUERY_STRING" | sed -n "s/=on*//pg" | sed -n 's,_,/,pg'`
+
+# escape & if present
+echo "$a" | grep "&" >> /dev/null
+if [ $? -eq 0 ]; then
+  a=`echo $a | sed -n "s/&/\\\\&/pg"`
+fi
+
+echo "Mods $a"
+sed -i "s_s,1,Dial(.*) ;; mini-asterisk_s,1,Dial($a) ;; mini-asterisk_" /etc/asterisk/extensions.conf
+#sed -i "s_s,1,Dial(.*) ;; mini-asterisk_s,1,Dial($a) ;; mini-asterisk_" /etc/asterisk/extensions.conf
+
+#reload extensions.conf
+
+# do this from js with a call to asterisk.cgi
+#asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setservice.cgi b/attic/mini-asterisk-gui2/cgi-bin/setservice.cgi
new file mode 100755 (executable)
index 0000000..e97d63b
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+# setservice.cgi
+# Ian Roberts 18 Sept 2012
+#
+# CGI to return the output from an service command 
+#
+# valid actions are restartstatic, restartdhcp, restartbackup, enabledhcp, enablestatic
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
+echo "arg is $ARG"
+
+if [ $ARG = "restartstatic" ]; then
+       echo "restart static"
+       /etc/init.d/network-static stop
+       /etc/init.d/network-static start
+fi
+
+if [ $ARG = "restartbackup" ]; then
+       echo "restartbackup"
+       /etc/init.d/network-backup stop
+       /etc/init.d/network-backup start
+fi
+
+if [ $ARG = "restartdhcp" ]; then
+       echo "restartdhcp"
+       /etc/init.d/network stop
+       /etc/init.d/network start
+fi
+
+if [ $ARG = "enabledhcp" ]; then
+       echo "enabledhcp"
+    /etc/init.d/network-static disable
+    /etc/init.d/network-static stop
+    /etc/init.d/network enable
+    /etc/init.d/network start
+fi
+
+if [ $ARG = "enablestatic" ]; then
+       echo "enable static"
+    /etc/init.d/network stop
+    /etc/init.d/network disable
+    /etc/init.d/network-static enable
+fi
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/setword.cgi b/attic/mini-asterisk-gui2/cgi-bin/setword.cgi
new file mode 100755 (executable)
index 0000000..8fa2ad1
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+# setword.cgi
+# Ian Roberts 29 Oct 2012
+#
+# CGI to replace the text in "file" from "this" to "that"
+#
+# Test on host with:
+#
+#    $ export QUERY_STRING='file=test.txt&this=IPADDRESS&that="192.168.1.31"'; ./setword.cgi
+#
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+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"`
+echo $QUERY_STRING
+echo $file
+echo $this
+echo $that
+if [ -f $file ]; then
+  sed -i "s/$this/$that/g" $file
+else
+  echo "$file does not exist"
+fi
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/sipshowpeers.cgi b/attic/mini-asterisk-gui2/cgi-bin/sipshowpeers.cgi
new file mode 100755 (executable)
index 0000000..be4fb91
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+# sipshowpeers.cgi
+#  Ian Roberts
+#  May 11 2012
+# CGI to execute get sip phone info
+# no argument
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+#arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
+
+#Todo : Test for asterisk running 
+
+asterisk "-rx sip show peers" 2>/dev/null
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/uncommentkey.cgi b/attic/mini-asterisk-gui2/cgi-bin/uncommentkey.cgi
new file mode 100755 (executable)
index 0000000..2348dcf
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh 
+# uncommentkey.cgi
+# David Rowe 30 Oct 2012
+#
+# CGI to uncomment a chunk of text that has a certain key phrase on each line
+#
+# Test on host with:
+#
+#    $ export QUERY_STRING='file=test.txt&key=Jazmin mini'; ./uncommentkey.cgi
+#
+# try using test file:
+# 
+#   root:/root> cat test.txt 
+#   ;[user]                       ; Jazmin mini-asterisk do not remove this comment
+#   ;host=sip.jazmin.net.au       ; Jazmin mini-asterisk do not remove this comment
+#   ;secret=<Password>            ; Jazmin mini-asterisk do not remove this comment           
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+file=`echo $QUERY_STRING | grep -oe "file=[^&?]*" | sed -n "s/file=//p"`
+key=`echo $QUERY_STRING | grep -oe "key=[^&?]*" | sed -n "s/key=//p" | sed "s/%22/\"/g"`
+echo $QUERY_STRING
+echo $file
+echo $key
+if [ -f $file ]; then
+  # to debug remove -i (write results to file), it will then just print results
+  perl -i -pe "s/^;(.*$key)/\$1/" $file
+else
+  echo "$file does not exist"
+fi
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/upgrade.cgi b/attic/mini-asterisk-gui2/cgi-bin/upgrade.cgi
new file mode 100755 (executable)
index 0000000..e22f5d2
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+# upgrade.cgi
+# Ian Roberts 31 May 2012
+#
+# CGI to upgrade mini-asterisk-gui
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+
+# check what sort of machine we are running on.  Many operations
+# outlawed for x86
+
+cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
+if [ $? -eq 0 ]; then
+    mach="ip0x"
+else
+    mach="x86"
+fi
+
+
+
+if [ $mach != "ip0x" ] ; then
+       echo "Sorry, only supported on the IP0X"
+cat <<EOF
+</body>
+</html>
+EOF
+       exit
+fi
+
+# remove, update and install mini-asterisk-gui
+
+rev_before=`grep -oe "Revision: [0-9]*" /www/about.sh`
+echo "<strong>Current $rev_before</strong><br>"
+echo "<strong>Removing $ver_before</strong><br>"
+ipkg remove mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+echo "<strong>Installing...</strong><br>"
+ipkg update | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+ipkg install mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
+
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/cgi-bin/uptime.cgi b/attic/mini-asterisk-gui2/cgi-bin/uptime.cgi
new file mode 100755 (executable)
index 0000000..2073e2d
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+# uptime.cgi
+#  Ian Roberts
+#  May 12 2012
+# CGI to execute uptime
+# no arguments
+
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1"></head></head>
+<body>
+EOF
+
+#arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
+uptime
+
+cat <<EOF
+</body>
+</html>
+EOF
diff --git a/attic/mini-asterisk-gui2/configure_AT-530.html b/attic/mini-asterisk-gui2/configure_AT-530.html
new file mode 100644 (file)
index 0000000..73c8ae2
--- /dev/null
@@ -0,0 +1,49 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\r
+<title>ipPhones</title>\r
+\r
+<link rel="stylesheet" type="text/css" href="ministyle.css">\r
+<link rel="stylesheet" href="tooltip.css" type="text/css" />\r
+<script type="text/javascript" src="minicommon.js"></script>\r
+<script type="text/javascript" src="tooltip.js"></script>\r
+<script type="text/javascript" src="menu.js"></script>\r
+<script type="text/javascript" src="configure_AT.js"></script>\r
+<script type="text/javascript">\r
+\r
+</script>\r
+\r
+</head>\r
+\r
+<body onload="initialise()">\r
+\r
+  <table align="center" width=800>\r
+  <tr>\r
+    <td><div id="menu"></div></td>\r
+    <td><div id="ipphones"></div>\r
+      <h2>&nbsp;<br>How to Configure IP Phones</h2>\r
+      <h3>1. Atcom AT-530</h3>\r
+\r
+       <ol>\r
+       <li>Connect the WAN port of the AT-530 to your network, it will boot and obtain an IP via DHCP.  \r
+       <li>Find the <strong>IP</strong> of the phone by pressing the <strong>Sysinfo</strong> button a few times.  \r
+       <li>Open another browser window.  Go to the phones <strong>IP</strong>, for example <strong>http://192.168.1.160</strong>\r
+       <li>Login to the phone using the username/password <strong>admin/admin</strong>.  \r
+       <li>Optional: set a static IP using the WAN menu (I like static IPs for SIP phones).  \r
+       <li>Go to the phone <strong>SIP Config</strong> menu.\r
+       <li>Set <strong>Register Server Address</strong> to your Phone System IP Address.\r
+       <li>Set <strong>Register Username</strong> to the phone number (e.g. 6011).\r
+       <li>Also set <strong>Register Password</strong> to the phone number (e.g. 6011) and\r
+       the <strong>Phone Number</strong> to the phone number (e.g. 6011).\r
+       <li>Check the <strong>Enable Register</strong> box.\r
+       <li>Then click on <strong>Apply</strong>. \r
+       <li>On your browser refresh this page to see if the phone is connected to your phone system.\r
+       </ol>\r
+\r
+    </td>\r
+  </tr>\r
+\r
+  </table>\r
+</body>\r
+</html>\r
diff --git a/attic/mini-asterisk-gui2/configure_AT-620R.html b/attic/mini-asterisk-gui2/configure_AT-620R.html
new file mode 100644 (file)
index 0000000..3c33cb5
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\r
+<title>ipPhones</title>\r
+\r
+<link rel="stylesheet" type="text/css" href="ministyle.css">\r
+<link rel="stylesheet" href="tooltip.css" type="text/css" />\r
+<script type="text/javascript" src="minicommon.js"></script>\r
+<script type="text/javascript" src="tooltip.js"></script>\r
+<script type="text/javascript" src="menu.js"></script>\r
+<script type="text/javascript" src="configure_AT.js"></script>\r
+<script type="text/javascript">\r
+\r
+</script>\r
+\r
+</head>\r
+\r
+<body onload="initialise()">\r
+\r
+  <table align="center" width=800>\r
+  <tr>\r
+    <td><div id="menu"></div></td>\r
+    <td><div id="ipphones"></div>\r
+      <h2>&nbsp;<br>How to Configure IP Phones</h2>\r
+\r
+      <h3>2. Atcom AT-620R</h3>\r
+\r
+       <ol>\r
+       <li>Connect the WAN port of the AT-620R to your network, it will boot and obtain an IP via DHCP.  \r
+       <li>Press the <strong>Menu</strong> button.  Enter <strong>123</strong> for the password, and press the <strong>OK</strong> soft button.  \r
+       <li>Using the <strong>down</strong> direction button (just beneath the menu key) move to the <strong>Product Info</strong> menu.  Then press the down button again and select <strong>Network Status</strong>.  The IP of the phone will be displayed at the top of the screen, for example 192.168.1.160.\r
+       <li>On your PC open another browser window.  Go to the phones <strong>IP</strong>, for example <strong>http://192.168.1.160</strong>\r
+       <li>Login to the phone using the username/password <strong>admin/admin</strong>.  \r
+       <li>Go to the phone <strong>VOIP</strong> menu.\r
+       <li>Set <strong>Server Address</strong> to your Phone System IP Address.\r
+       <li>Set <strong>Account Name</strong> to the phone number (e.g. 6011).\r
+       <li>Also set <strong>Password</strong> to the phone number (e.g. 6011) and <strong>Phone Number</strong> and <strong>Display Name</strong> to the phone number (e.g. 6011).\r
+       <img src="at-620r.png" alt="at-620r"/>\r
+       <li>Check the <strong>Enable Register</strong> box.\r
+       <li>Then click on <strong>Apply</strong>. \r
+       <li>On your browser refresh this page to see if the phone is connected to your phone system.\r
+       </ol>\r
+\r
+\r
+    </td>\r
+  </tr>\r
+\r
+  </table>\r
+</body>\r
+</html>\r
diff --git a/attic/mini-asterisk-gui2/configure_AT.js b/attic/mini-asterisk-gui2/configure_AT.js
new file mode 100644 (file)
index 0000000..4742f1a
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  configure_AT.js
+  Ian Roberts
+  May 7 2012
+
+  Configure At handset screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+
+}
+
+
+
diff --git a/attic/mini-asterisk-gui2/cross.png b/attic/mini-asterisk-gui2/cross.png
new file mode 100644 (file)
index 0000000..05baecd
Binary files /dev/null and b/attic/mini-asterisk-gui2/cross.png differ
diff --git a/attic/mini-asterisk-gui2/devel notes.txt b/attic/mini-asterisk-gui2/devel notes.txt
new file mode 100644 (file)
index 0000000..2ae696a
--- /dev/null
@@ -0,0 +1,340 @@
+IP04 GUI2 Development notes
+Ian Roberts 
+Sept 2012
+
+
+IP04 Environment
+
+       telnet root@192.168.1.30
+       ipkg install dropbear           (for ssh access to ip04)
+       ipkg install fping 
+       ssh root@192.168.1.30
+       url:   192.168.1.30
+
+
+PC Environment 
+
+Packages
+
+       svn             version control
+       openssh         communication with ip04
+       fping           used to determine internet connection
+       chrome          built-in debugger .... ctrl-shift-i
+                       install validator extension
+       firefox         install extensions firebug debugger and html validator
+       lighttpd        minimal webserver
+       asterisk-1.4.11 when testing code around asterisk -r calls
+                       needs to be installed (we need access to the conf files)
+                       but doesn't have to be running unless testing sip stuff
+
+Source code
+
+       svn co https://freetel.svn.sourceforge.net/svnroot/freetel/mini-asterisk-gui2
+
+       svn status
+       svn diff <file>
+       svn add <newfile>
+       svn ci <file>
+       svn propset executable
+
+       tortoise svn on win7 
+       checkout https://freetel.svn.sourceforge.net/svnroot/freetel/mini-asterisk-gui
+
+lighttpd setup
+
+       point at the mini-asterisk-gui2 directory.
+       enable cgi
+       see x86 instructions at http://www.rowetel.com/blog/?page_id=455
+
+Asterisk Install
+
+       Install asterisk-1.4.11 from source code
+       see x86 instructions at http://www.rowetel.com/blog/?page_id=455
+
+       IP04 runs 1.4.4-1 (2007) with zaptel-sport 1.4.3-2 on a 2.6.19-3 kernel (2006).
+
+       You can ipkg install asterisk-1.4.20 (2008)
+
+       Asterisk 1.4.22 (2008) changed from using zaptel-sport to dahdi.
+
+       Asterisk 1.6.2.7 (2010) uses dahdi 2.3.0
+
+       AsteriskNow (2012) runs Asterisk 1.8.11 with Dahdi 2.6.1 on a 2.6.18-308 kernel
+
+
+Asterisk conf files
+
+
+       copy the following files from the gui2 source to /etc on the pc.
+
+       gui2/etc/asterisk/extensions.conf  to   /etc/asterisk/extensions.conf
+       gui2/etc/asterisk/sip.conf         to   /etc/asterisk/sip.conf
+       gui2/etc/asterisk/zapata.conf      to   /etc/asterisk/zapata.conf
+       gui2/etc/asterisk/iax.conf         to   /etc/asterisk/iax.conf
+
+       and
+
+       gui2/etc/zaptel.conf to /etc/zaptel.conf
+
+
+browser
+
+       url :   127.0.0.1/phones.html
+
+
+
+Method
+
+       Svn co code to PC gui2 directory
+       Point local web server at gui2 directory and enable cgi
+       Test on PC with 127.0.0.1/gui2/phones.html
+       Svn ci changes.
+       
+       
+       telnet IP04 pristine build or ssh to modified IP04 (dropbear)
+       Install gui2 from root directory
+          sh install_gui2.sh
+       
+       Test on IP04 with 192.168.1.30/gui2/phones.html
+
+
+
+
+Specific Tasks
+
+fping 
+       check reaction times 
+
+network 
+       test write properties
+
+sys info 
+       format and paging
+
+reception 
+       Incoming calls are switched to a handset defined in /etc/extensions.conf
+
+       exten => s,1,Dial(Zap/4&SIP/6011) ;; mini-asterisk - don't remove this comment
+
+       In this case, the analog handset hanging off Zap/4, and the sip hanset 6011
+
+       I had to use a static html button for reception update. 
+       The dynamic created button failed to fire setring.cgi
+
+       Setring.cgi : escaping the & works on the IP04 but fails on devel pc.... linux mint. 
+       sed on diff platforms?
+
+       http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf
+
+
+Install script
+       Done....install_gui2.sh
+
+Simple Switch button for GUI2 or original.
+       The GUIs can coexist. Should have the option of switching.
+
+dial tones impedance 
+    zaptel init.d
+       ztcfg
+       
+       cat /etc/zaptel.conf
+
+       loadzone = us
+       defaultzone=us
+
+       fxsks=1,2
+       fxoks=3,4
+
+       ---------------------------
+       loadzone = [your country] 
+       Set US or AUS
+       us au fr nl uk fi es jp no at nz it us-old gr tw cl se be sg il br hu lt pl za pt ee mx in de ch dk cz cn ve ph
+       http://www.voip-info.org/wiki/view/Asterisk+config+zaptel.conf
+
+Outgoing calls
+       Selectable FXO.
+       exten => _0.,1,Dial(Zap/g1/${EXTEN:1})
+
+Bad line/Bad HW detection
+       http://blackfin.uclinux.org/gf/project/asterisk/forum/?_forum_action=ForumMessageBrowse&thread_id=36325&action=ForumBrowse&forum_id=121
+        port the Oslec echo sampling code to the Blackfin
+
+       When I was developing the Oslec echo canceller I patched Zaptel to allow sampling of echo signals:
+       http://www.rowetel.com/ucasterisk/oslec.html#sample
+       With these samples I can usally diagnose echo problems, for example an obvious hardware problem, large or variable delays, a bad PSTN line or (rarely these days) Oslec falling over.
+       However I only ever ran the sampling code on x86 platforms, it was never ported to the Blackfin as there have been very few echo problems with the IP0X.
+       I don't have the time for this myself, but if some one would like to port the Oslec echo sampling code to the Blackfin I would be happy to take a look at the samples and help diagnose the echo problems.  The link above explains what is involved (some patches to Zaptel and a user mode program).
+       - David
+
+
+ntp page
+       ipkg install ntp
+       setting times.
+       Configuring ntp?
+
+       root:~> ipkg files ntp
+       Package ntp (4.1.1-1) is installed on root and has the following files:
+       /bin/ntpd
+       /bin/ntpdate
+       /etc/init.d/ntp
+       /usr/doc/ntp.txt
+
+        NOTES:
+
+        1. Set the /etc/TZ file for your timezone
+
+        2. The TZ env variable in your shell will set the current
+           time zone.  This gets set automatically via /etc/profile
+           for console and ssh logins, but for some reason it is not
+           set in telnet logins (maybe because they currently don't
+           have a proper login).
+
+        3. List of magic TZ codes here (thanks Mike Taht):
+               http://wiki.openwrt.org/OpenWrtDocs/Configuration
+               (search on TZ)
+
+        4. It's a really good idea to install the login ipkg (ipkg install
+           login), otherwise TZ doesn't get set correctly at the start of
+           each telnet session.  Without login TZ gets set only on the
+           serial console and ssh logins.
+
+       http://souptonuts.sourceforge.net/readme_working_with_time.html
+
+            Hours From Greenwich Mean Time (GMT) Value            
+                                                                   
+             0 GMT Greenwich Mean Time                             
+             +1   ECT   European Central Time                      
+             +2   EET   European Eastern Time                      
+             +2   ART                                              
+             +3   EAT   Saudi Arabia                               
+             +3.5 MET   Iran                                       
+             +4   NET                                              
+             +5   PLT   West Asia                                  
+             +5.5 IST   India                                      
+             +6   BST   Central Asia                               
+             +7   VST   Bangkok                                    
+             +8   CTT   China                                      
+             +9   JST   Japan                                      
+             +9.5 ACT   Central Australia                          
+             +10  AET   Eastern Australia                          
+             +11  SST   Central Pacific                            
+             +12  NST   New Zealand                                
+             -11  MIT   Samoa                                      
+             -10  HST   Hawaii                                     
+             -9   AST   Alaska                                     
+             -8   PST   Pacific Standard Time                      
+             -7   PNT   Arizona                                    
+             -7   MST   Mountain Standard Time                     
+             -6   CST   Central Standard Time                      
+             -5   EST   Eastern Standard Time                      
+             -5   IET   Indiana East                               
+             -4   PRT   Atlantic Standard Time                     
+             -3.5 CNT   Newfoundland                               
+             -3   AGT   Eastern South America                      
+             -3   BET   Eastern South America                      
+             -1   CAT   Azores                                     
+
+
+
+Simple autoattendant
+
+       http://blackfin.uclinux.org/gf/project/asterisk/forum/?_forum_action=ForumMessageBrowse&thread_id=35285&action=ForumBrowse&forum_id=121
+
+               [default]
+
+               exten => s,1,Ringing
+
+               exten => s,n,Wait(1)
+
+               exten => s,n,Answer
+
+               exten => s,n,Wait(1)
+
+               exten => s,n,Background(thank-you-for-calling)
+
+               exten => s,n,Background(if-u-know-ext-dial)
+
+               exten => s,n,Background(otherwise)
+
+               exten => s,n,Background(to-reach-operator)
+
+               exten => s,n,Background(pls-hold-while-try)
+
+               exten => s,n,WaitExten(6)
+
+               exten => 6000,1,Goto(s,1)
+
+               exten => 6050,1,VoiceMailMain
+
+               exten => 6060,1,MeetMe(${EXTEN},dM,,)
+
+               exten => 6090,1,Queue(${EXTEN})
+
+
+time-based autoattendant.
+       
+       http://astbook.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/Autoattendant_id287976.html
+       (for asterisk 1.8)
+
+       [main_menu]
+
+       exten => s,1,Verbose(1, Caller ${CALLERID(all)} has entered the auto attendant)
+           same => n,Answer()
+
+       ; this sets the inter-digit timer
+           same => n,Set(TIMEOUT(digit)=2)
+
+       ; wait one second to establish audio
+           same => n,Wait(1)
+
+       ; If Mon-Fri 9-5 goto label daygreeting
+           same => n,GotoIfTime(9:00-17:00,mon-fri,*,*?daygreeting:afterhoursgreeting)
+
+           same => n(afterhoursgreeting),Background(after-hours) ; AFTER HOURS GREETING
+           same => n,Goto(menuprompt)
+
+           same => n(daygreeting),Background(daytime)   ; DAY GREETING
+           same => n,Goto(menuprompt)
+
+           same => n(menuprompt),Background(main-menu) ; MAIN MENU PROMPT
+           same => n,WaitExten(4)                      ; more than 4 seconds is probably
+                                                       ; too much
+           same => n,Goto(0,1)                         ; Treat as if caller has pressed '0'
+
+       exten => 1,1,Verbose(1, Caller ${CALLERID(all)} has entered the sales queue)
+           same => n,Goto(Queues,7002,1)     ; Sales Queue - see Chapter 13 for details
+
+       exten => 2,1,Verbose(1, Caller ${CALLERID(all)} has entered the service queue)
+           same => n,Goto(Queues,7001,1)     ; Service Queue - see Chapter 13 for details
+
+       exten => 3,1,Verbose(1, Caller ${CALLERID(all)} has requested address and fax info)
+           same => n,Background()            ; Address and fax info
+           same => n,Goto(s,menuprompt)      ; Take caller back to main menu prompt
+
+       exten => #,1,Verbose(1, Caller ${CALLERID(all)} is entering the directory)
+           same => n,Directory(default)   ; Send the caller to the directory.
+                                          ; Use InternalSets as the dialing context
+
+       exten => 0,1,Verbose(1, Caller ${CALLERID(all)} is calling the operator)
+           same => n,Dial(SIP/operator)      ; Operator extension/queue
+
+       exten => i,1,Verbose(1, Caller ${CALLERID(all)} has entered an invalid selection)
+           same => n,Playback(invalid)
+           same => n,Goto(s,menuprompt)
+
+       exten => t,1,Verbose(1, Caller ${CALLERID(all)} has timed out)
+           same => n,Goto(0,1)
+
+
+       ; You will want to have a pattern match for the various extensions
+       ; that you'll allow external callers to dial
+       ; BUT DON'T JUST INCLUDE THE LocalSets CONTEXT
+       ; OR EXTERNAL CALLERS WILL BE ABLE TO MAKE CALLS OUT OF YOUR SYSTEM
+
+       ; WHATEVER YOU DO HERE, TEST IT CAREFULLY TO ENSURE EXTERNAL CALLERS
+       ; WILL NOT BE ABLE TO DO ANYTHING BUT DIAL INTERNAL EXTENSIONS
+
+       exten => _1XX,1,Verbose(1,Call to an extension starting with '1'
+           same => n,Goto(InternalSets,${EXTEN},1)
+
+
diff --git a/attic/mini-asterisk-gui2/diagnostics.html b/attic/mini-asterisk-gui2/diagnostics.html
new file mode 100644 (file)
index 0000000..f091415
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>Diagnostics</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="diagnostics.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="diagnostics"></div></td>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/diagnostics.js b/attic/mini-asterisk-gui2/diagnostics.js
new file mode 100644 (file)
index 0000000..a2f321f
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+  diagnostics.js
+  Ian Roberts
+  May 10 2012
+
+  diagnostics screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+    // 
+    
+    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
+    var html = '';
+
+    html += '<table align="right" width=600>';
+
+    // print out info
+
+    html += '<tr><td colspan="3" align="left" valign="top"><h2>Diagnostics</h2></td></tr>';
+    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision XXX</td></tr>';
+    html += '<tr><td colspan="2">Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>';
+    // this image will only come up if internet connection is present
+    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td><td> </td><td></td></tr>';
+    html += '<tr><td>&nbsp</td></tr>';
+    html += '</table>';
+
+    document.getElementById("diagnostics").innerHTML += html;
+
+}
+
+
+
diff --git a/attic/mini-asterisk-gui2/etc/asterisk/extensions.conf b/attic/mini-asterisk-gui2/etc/asterisk/extensions.conf
new file mode 100644 (file)
index 0000000..b995781
--- /dev/null
@@ -0,0 +1,59 @@
+; extensions.conf
+; David Rowe 4 Jan 2010
+;
+
+; Designed for Mini Asterisk GUI.  However you can hand modify as much
+; as you like, as GUI scripts read/and write regular extensions.conf
+; without messing with your custom dialplan
+
+
+[general]
+static = yes
+writeprotect = no
+autofallthrough = yes
+clearglobalvars = no
+priorityjumping = no
+
+[default]
+
+; Pre-configured analog extensions, depends on IP0X model and what modules
+; are installed.  Some of these may map to FXO ports
+
+exten => 6001,1,Dial(Zap/1)    ; mini_ext
+exten => 6002,1,Dial(Zap/2)    ; mini_ext
+exten => 6003,1,Dial(Zap/3)    ; mini_ext
+exten => 6004,1,Dial(Zap/4)    ; mini_ext
+exten => 6005,1,Dial(Zap/5)    ; mini_ext
+exten => 6006,1,Dial(Zap/6)    ; mini_ext
+exten => 6007,1,Dial(Zap/7)    ; mini_ext
+exten => 6008,1,Dial(Zap/8)    ; mini_ext
+
+; Pre-configured SIP-phone extensions.  Primary use case is multiple SIP
+; extensions and FXO analog Ports
+
+exten => 6011,1,Dial(SIP/6011)    ; mini_ext
+exten => 6012,1,Dial(SIP/6012)    ; mini_ext
+exten => 6013,1,Dial(SIP/6013)    ; mini_ext
+exten => 6014,1,Dial(SIP/6014)    ; mini_ext
+exten => 6015,1,Dial(SIP/6015)    ; mini_ext
+exten => 6016,1,Dial(SIP/6016)    ; mini_ext
+exten => 6017,1,Dial(SIP/6017)    ; mini_ext
+exten => 6018,1,Dial(SIP/6018)    ; mini_ext
+exten => 6019,1,Dial(SIP/6019)    ; mini_ext
+exten => 6020,1,Dial(SIP/6020)    ; mini_ext
+exten => 6021,1,Dial(SIP/6021)    ; mini_ext
+exten => 6022,1,Dial(SIP/6022)    ; mini_ext
+
+; Pre-configured mini-asterisk outgoing Analog group
+
+exten => _0.,1,Dial(Zap/g2/${EXTEN:1})
+
+; Pre-configured mini-asterisk outgoing VOIP line
+
+exten => _1.,1,Dial(SIP/voip/${EXTEN:1}) 
+
+; Pre-configured incoming calls
+
+exten => s,1,Dial(SIP/6011) ;; mini-asterisk - don't remove this comment
+
+#include "commis.conf"
diff --git a/attic/mini-asterisk-gui2/etc/asterisk/extensions.conf.orig b/attic/mini-asterisk-gui2/etc/asterisk/extensions.conf.orig
new file mode 100644 (file)
index 0000000..1b947c7
--- /dev/null
@@ -0,0 +1,69 @@
+; extensions.conf
+; David Rowe 4 Jan 2010
+;
+
+; Designed for Mini Asterisk GUI.  However you can hand modify as much
+; as you like, as GUI scripts read/and write regular extensions.conf
+; without messing with your custom dialplan
+
+
+[general]
+static = yes
+writeprotect = no
+autofallthrough = yes
+clearglobalvars = no
+priorityjumping = no
+
+[default]
+
+exten => 555,1,Answer
+exten => 555,2,Read(ip||3)
+exten => 555,3,Ping(10.130.1.${ip})
+
+exten => 556,1,Answer
+exten => 556,2,milliwatt
+
+exten => 557,1,Answer
+exten => 557,2,Echo
+
+; Pre-configured analog extensions, depends on IP0X model and what modules
+; are installed.  Some of these may map to FXO ports
+
+; mini_ext tag causes GUI to pick these up and display on GUI
+
+exten => 6001,1,Dial(Zap/1) ; mini_ext
+exten => 6002,1,Dial(Zap/2) ; mini_ext
+exten => 6003,1,Dial(Zap/3) ; mini_ext
+exten => 6004,1,Dial(Zap/4) ; mini_ext
+exten => 6005,1,Dial(Zap/5) ; mini_ext
+exten => 6006,1,Dial(Zap/6) ; mini_ext
+exten => 6007,1,Dial(Zap/7) ; mini_ext
+exten => 6008,1,Dial(Zap/8) ; mini_ext
+
+; Pre-configured SIP-phone extensions.  Primary use case is multiple SIP
+; extensions and FXO analog Ports
+
+exten => 6011,1,Dial(SIP/6011) ; mini_ext
+exten => 6012,1,Dial(SIP/6012) ; mini_ext
+exten => 6013,1,Dial(SIP/6013) ; mini_ext
+exten => 6014,1,Dial(SIP/6014) ; mini_ext
+exten => 6015,1,Dial(SIP/6015) ; mini_ext
+exten => 6016,1,Dial(SIP/6016) ; mini_ext
+exten => 6017,1,Dial(SIP/6017) ; mini_ext
+exten => 6018,1,Dial(SIP/6018) ; mini_ext
+exten => 6019,1,Dial(SIP/6019) ; mini_ext
+exten => 6020,1,Dial(SIP/6020) ; mini_ext
+exten => 6021,1,Dial(SIP/6021) ; mini_ext
+exten => 6022,1,Dial(SIP/6022) ; mini_ext
+
+;; Pre-configured mini-asterisk outgoing Analog group
+
+exten => _0.,1,Dial(Zap/g1/${EXTEN:1})
+
+;; Pre-configured mini-asterisk outgoing VOIP line
+
+exten => _1.,1,Dial(SIP/user/${EXTEN:1}) 
+
+;; Pre-configured incoming calls
+
+exten => s,1,Dial(SIP/6011) ;; mini-asterisk - don't remove this comment
diff --git a/attic/mini-asterisk-gui2/etc/asterisk/iax.conf b/attic/mini-asterisk-gui2/etc/asterisk/iax.conf
new file mode 100644 (file)
index 0000000..4c016ba
--- /dev/null
@@ -0,0 +1,410 @@
+
+; Inter-Asterisk eXchange driver definition
+;
+; This configuration is re-read at reload
+; or with the CLI command
+;      reload chan_iax2.so
+;
+; General settings, like port number to bind to, and
+; an option address (the default is to bind to all
+; local addresses).
+;
+[general]
+;bindport=4569                 ; bindport and bindaddr may be specified
+;                               ; NOTE: bindport must be specified BEFORE
+                               ; bindaddr or may be specified on a specific
+                               ; bindaddr if followed by colon and port
+                               ;  (e.g. bindaddr=192.168.0.1:4569)
+;bindaddr=192.168.0.1          ; more than once to bind to multiple
+;                               ; addresses, but the first will be the 
+;                               ; default
+;
+; Set iaxcompat to yes if you plan to use layered switches or
+; some other scenario which may cause some delay when doing a
+; lookup in the dialplan. It incurs a small performance hit to
+; enable it. This option causes Asterisk to spawn a separate thread
+; when it receives an IAX DPREQ (Dialplan Request) instead of
+; blocking while it waits for a response.
+;
+;iaxcompat=yes
+;
+; Disable UDP checksums (if nochecksums is set, then no checkums will
+; be calculated/checked on systems supporting this feature)
+;
+;nochecksums=no
+;
+;
+; For increased security against brute force password attacks
+; enable "delayreject" which will delay the sending of authentication
+; reject for REGREQ or AUTHREP if there is a password.  
+;
+;delayreject=yes
+;
+; You may specify a global default AMA flag for iaxtel calls.  It must be
+; one of 'default', 'omit', 'billing', or 'documentation'.  These flags
+; are used in the generation of call detail records.
+;
+;amaflags=default
+;
+; ADSI (Analog Display Services Interface) can be enabled if you have
+; (or may have) ADSI compatible CPE equipment
+;
+;adsi=no
+;
+; You may specify a default account for Call Detail Records in addition
+; to specifying on a per-user basis
+;
+;accountcode=lss0101
+;
+; You may specify a global default language for users. 
+; Can be specified also on a per-user basis
+; If omitted, will fallback to english
+;
+;language=en
+;
+; This option specifies a preference for which music on hold class this channel
+; should listen to when put on hold if the music class has not been set on the
+; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
+; channel putting this one on hold did not suggest a music class.
+;
+; If this option is set to "passthrough", then the hold message will always be
+; passed through as signalling instead of generating hold music locally.
+;
+; This option may be specified globally, or on a per-user or per-peer basis.
+;
+;mohinterpret=default
+;
+; This option specifies which music on hold class to suggest to the peer channel
+; when this channel places the peer on hold. It may be specified globally or on
+; a per-user or per-peer basis.
+;
+;mohsuggest=default
+;
+; Specify bandwidth of low, medium, or high to control which codecs are used
+; in general.
+;
+bandwidth=low
+;
+; You can also fine tune codecs here using "allow" and "disallow" clauses
+; with specific codecs.  Use "all" to represent all formats.
+;
+;allow=all                     ; same as bandwidth=high
+;disallow=g723.1               ; Hm...  Proprietary, don't use it...
+disallow=lpc10                 ; Icky sound quality...  Mr. Roboto.
+;allow=gsm                     ; Always allow GSM, it's cool :)
+;
+
+; You can adjust several parameters relating to the jitter buffer.
+; The jitter buffer's function is to compensate for varying
+; network delay.
+;
+; All the jitter buffer settings except dropcount are in milliseconds.
+; The jitter buffer works for INCOMING audio - the outbound audio
+; will be dejittered by the jitter buffer at the other end.
+;
+; jitterbuffer=yes|no: global default as to whether you want
+; the jitter buffer at all.
+;
+; forcejitterbuffer=yes|no: in the ideal world, when we bridge VoIP channels
+; we don't want to do jitterbuffering on the switch, since the endpoints
+; can each handle this.  However, some endpoints may have poor jitterbuffers 
+; themselves, so this option will force * to always jitterbuffer, even in this
+; case.
+;
+; maxjitterbuffer: a maximum size for the jitter buffer.
+; Setting a reasonable maximum here will prevent the call delay
+; from rising to silly values in extreme situations; you'll hear
+; SOMETHING, even though it will be jittery.
+;
+; resyncthreshold: when the jitterbuffer notices a significant change in delay
+; that continues over a few frames, it will resync, assuming that the change in
+; delay was caused by a timestamping mix-up. The threshold for noticing a
+; change in delay is measured as twice the measured jitter plus this resync
+; threshold.
+; Resyncing can be disabled by setting this parameter to -1.
+;
+; maxjitterinterps: the maximum number of interpolation frames the jitterbuffer
+; should return in a row. Since some clients do not send CNG/DTX frames to
+; indicate silence, the jitterbuffer will assume silence has begun after
+; returning this many interpolations. This prevents interpolating throughout
+; a long silence.
+;
+
+jitterbuffer=no
+forcejitterbuffer=no
+;dropcount=2
+;maxjitterbuffer=1000
+;maxjitterinterps=10
+;resyncthreshold=1000
+;maxexcessbuffer=80
+;minexcessbuffer=10
+;jittershrinkrate=1
+
+;trunkfreq=20                  ; How frequently to send trunk msgs (in ms)
+
+; Should we send timestamps for the individual sub-frames within trunk frames?
+; There is a small bandwidth use for these (less than 1kbps/call), but they
+; ensure that frame timestamps get sent end-to-end properly.  If both ends of
+; all your trunks go directly to TDM, _and_ your trunkfreq equals the frame
+; length for your codecs, you can probably suppress these.  The receiver must
+; also support this feature, although they do not also need to have it enabled.
+;
+; trunktimestamps=yes
+;
+; Minimum and maximum amounts of time that IAX peers can request as
+; a registration expiration interval (in seconds).
+; minregexpire = 60
+; maxregexpire = 60
+;
+; IAX helper threads
+; Establishes the number of iax helper threads to handle I/O.
+; iaxthreadcount = 10
+; Establishes the number of extra dynamic threads that may be spawned to handle I/O
+; iaxmaxthreadcount = 100
+;
+; We can register with another IAX server to let him know where we are
+; in case we have a dynamic IP address for example
+;
+; Register with tormenta using username marko and password secretpass
+;
+;register => marko:secretpass@tormenta.linux-support.net
+;
+; Register joe at remote host with no password
+;
+;register => joe@remotehost:5656
+;
+; Register marko at tormenta.linux-support.net using RSA key "torkey"
+;
+;register => marko:[torkey]@tormenta.linux-support.net
+;
+; Sample Registration for iaxtel
+;
+; Visit http://www.iaxtel.com to register with iaxtel.  Replace "user"
+; and "pass" with your username and password for iaxtel.  Incoming 
+; calls arrive at the "s" extension of "default" context.
+;
+;register => user:pass@iaxtel.com
+;
+; Sample Registration for IAX + FWD
+;
+; To register using IAX with FWD, it must be enabled by visiting the URL
+; http://www.fwdnet.net/index.php?section_id=112
+;
+; Note that you need an extension in you default context which matches
+; your free world dialup number.  Please replace "FWDNumber" with your
+; FWD number and "passwd" with your password.
+;
+;register => FWDNumber:passwd@iax.fwdnet.net
+;
+;
+; You can disable authentication debugging to reduce the amount of 
+; debugging traffic.
+;
+;authdebug=no
+;
+; See doc/README.tos for a description of the tos parameters.
+;tos=ef
+;
+; If regcontext is specified, Asterisk will dynamically create and destroy
+; a NoOp priority 1 extension for a given peer who registers or unregisters
+; with us.  The actual extension is the 'regexten' parameter of the registering
+; peer or its name if 'regexten' is not provided.  More than one regexten
+; may be supplied if they are separated by '&'.  Patterns may be used in
+; regexten.
+;
+;regcontext=iaxregistrations
+;
+; If we don't get ACK to our NEW within 2000ms, and autokill is set to yes,
+; then we cancel the whole thing (that's enough time for one retransmission
+; only).  This is used to keep things from stalling for a long time for a host
+; that is not available, but would be ill advised for bad connections.  In
+; addition to 'yes' or 'no' you can also specify a number of milliseconds.
+; See 'qualify' for individual peers to turn on for just a specific peer.
+;
+autokill=yes
+;
+; codecpriority controls the codec negotiation of an inbound IAX call.
+; This option is inherited to all user entities.  It can also be defined 
+; in each user entity separately which will override the setting in general.
+;
+; The valid values are:
+;
+; caller   - Consider the callers preferred order ahead of the host's.
+; host     - Consider the host's preferred order ahead of the caller's.
+; disabled - Disable the consideration of codec preference altogether.
+;            (this is the original behaviour before preferences were added)
+; reqonly  - Same as disabled, only do not consider capabilities if
+;            the requested format is not available the call will only
+;            be accepted if the requested format is available.
+;
+; The default value is 'host'
+;
+;codecpriority=host
+
+;rtcachefriends=yes    ; Cache realtime friends by adding them to the internal list
+                       ; just like friends added from the config file only on a
+                       ; as-needed basis? (yes|no)
+
+;rtupdate=yes          ; Send registry updates to database using realtime? (yes|no)
+                       ; If set to yes, when a IAX2 peer registers successfully,
+                       ; the ip address, the origination port, the registration period,
+                       ; and the username of the peer will be set to database via realtime.
+                       ; If not present, defaults to 'yes'.
+
+;rtautoclear=yes       ; Auto-Expire friends created on the fly on the same schedule
+                       ; as if it had just registered? (yes|no|<seconds>)
+                       ; If set to yes, when the registration expires, the friend will
+                       ; vanish from the configuration until requested again.
+                       ; If set to an integer, friends expire within this number of
+                       ; seconds instead of the registration interval.
+
+;rtignoreregexpire=yes ; When reading a peer from Realtime, if the peer's registration
+                       ; has expired based on its registration interval, used the stored
+                       ; address information regardless. (yes|no)
+
+; Guest sections for unauthenticated connection attempts.  Just specify an
+; empty secret, or provide no secret section.
+;
+[guest]
+type=user
+context=default
+callerid="Guest IAX User"
+
+;
+; Trust Caller*ID Coming from iaxtel.com
+;
+[iaxtel]
+type=user
+context=default
+auth=rsa
+inkeys=iaxtel
+
+;
+; Trust Caller*ID Coming from iax.fwdnet.net
+;
+[iaxfwd]
+type=user
+context=default
+auth=rsa
+inkeys=freeworlddialup
+
+;
+; Trust callerid delivered over DUNDi/e164
+;
+;
+;[dundi]
+;type=user
+;dbsecret=dundi/secret
+;context=dundi-e164-local
+
+;
+; Further user sections may be added, specifying a context and a secret used
+; for connections with that given authentication name.  Limited IP based
+; access control is allowed by use of "allow" and "deny" keywords.  Multiple
+; rules are permitted.  Multiple permitted contexts may be specified, in
+; which case the first will be the default.  You can also override caller*ID
+; so that when you receive a call you set the Caller*ID to be what you want
+; instead of trusting what the remote user provides
+;
+; There are three authentication methods that are supported:  md5, plaintext,
+; and rsa.  The least secure is "plaintext", which sends passwords cleartext
+; across the net.  "md5" uses a challenge/response md5 sum arrangement, but
+; still requires both ends have plain text access to the secret.  "rsa" allows
+; unidirectional secret knowledge through public/private keys.  If "rsa"
+; authentication is used, "inkeys" is a list of acceptable public keys on the 
+; local system that can be used to authenticate the remote peer, separated by
+; the ":" character.  "outkey" is a single, private key to use to authenticate
+; to the other side.  Public keys are named /var/lib/asterisk/keys/<name>.pub
+; while private keys are named /var/lib/asterisk/keys/<name>.key.  Private
+; keys should always be 3DES encrypted.
+;
+;
+; NOTE: All hostnames and IP addresses in this file are for example purposes
+;       only; you should not expect any of them to actually be available for
+;       your use.
+;
+;
+;[markster]
+;type=user
+;context=default
+;context=local
+;auth=md5,plaintext,rsa
+;secret=markpasswd
+;setvar=foo=bar
+;dbsecret=mysecrets/place      ; Secrets can be stored in astdb, too
+;transfer=no           ; Disable IAX native transfer
+;transfer=mediaonly    ; When doing IAX native transfers, transfer 
+                       ; only media stream
+;jitterbuffer=yes      ; Override global setting an enable jitter buffer
+;                      ; for this user
+;maxauthreq=10          ; Set maximum number of outstanding AUTHREQs waiting for replies. Any further authentication attempts will be blocked
+;                       ; if this limit is reached until they expire or a reply is received.
+;callerid="Mark Spencer" <(256) 428-6275>
+;deny=0.0.0.0/0.0.0.0
+;accountcode=markster0101
+;permit=209.16.236.73/255.255.255.0
+;language=en           ; Use english as default language
+;
+; Peers may also be specified, with a secret and
+; a remote hostname.
+;
+[demo]
+type=peer
+username=asterisk
+secret=supersecret
+host=216.207.245.47
+;sendani=no
+;host=asterisk.linux-support.net
+;port=5036
+;mask=255.255.255.255
+;qualify=yes                   ; Make sure this peer is alive
+;qualifysmoothing = yes                ; use an average of the last two PONG
+                               ; results to reduce falsely detected LAGGED hosts
+                               ; Default: Off
+;qualifyfreqok = 60000         ; how frequently to ping the peer when
+                               ; everything seems to be ok, in milliseconds
+;qualifyfreqnotok = 10000      ; how frequently to ping the peer when it's
+                               ; either LAGGED or UNAVAILABLE, in milliseconds
+;jitterbuffer=no               ; Turn off jitter buffer for this peer
+
+;
+; Peers can remotely register as well, so that they can be mobile.  Default
+; IP's can also optionally be given but are not required.  Caller*ID can be
+; suggested to the other side as well if it is for example a phone instead of
+; another PBX.
+;
+
+;[dynamichost]
+;host=dynamic
+;secret=mysecret
+;mailbox=1234          ; Notify about mailbox 1234
+;inkeys=key1:key2
+;peercontext=local     ; Default context to request for calls to peer
+;defaultip=216.207.245.34
+;callerid="Some Host" <(256) 428-6011>
+;
+
+;
+;[biggateway]
+;type=peer
+;host=192.168.0.1
+;context=*
+;secret=myscret
+;trunk=yes                     ; Use IAX2 trunking with this host
+;timezone=America/New_York     ; Set a timezone for the date/time IE
+;
+
+;
+; Friends are a short cut for creating a user and
+; a peer with the same values.
+;
+;[marko]
+;type=friend
+;host=dynamic
+;regexten=1234
+;secret=moofoo   ; Multiple secrets may be specified. For a "user", all
+;secret=foomoo   ; specified entries will be accepted as valid. For a "peer",
+;secret=shazbot  ; only the last specified secret will be used.
+;context=default
+;permit=0.0.0.0/0.0.0.0
+
diff --git a/attic/mini-asterisk-gui2/etc/asterisk/sip.conf b/attic/mini-asterisk-gui2/etc/asterisk/sip.conf
new file mode 100644 (file)
index 0000000..bd4b84f
--- /dev/null
@@ -0,0 +1,844 @@
+;
+; SIP Configuration example for Asterisk
+;
+; Syntax for specifying a SIP device in extensions.conf is
+; SIP/devicename where devicename is defined in a section below.
+;
+; You may also use 
+; SIP/username@domain to call any SIP user on the Internet
+; (Don't forget to enable DNS SRV records if you want to use this)
+; 
+; If you define a SIP proxy as a peer below, you may call
+; SIP/proxyhostname/user or SIP/user@proxyhostname 
+; where the proxyhostname is defined in a section below 
+; 
+; Useful CLI commands to check peers/users:
+;   sip show peers             Show all SIP peers (including friends)
+;   sip show users             Show all SIP users (including friends)
+;   sip show registry          Show status of hosts we register with
+;
+;   sip debug                  Show all SIP messages
+;
+;   reload chan_sip.so         Reload configuration file
+;                              Active SIP peers will not be reconfigured
+;
+
+[general]
+context=default                        ; Default context for incoming calls
+allowguest=no                  ; Allow or reject guest calls (default is yes)
+allowoverlap=no                        ; Disable overlap dialing support. (Default is yes)
+;allowtransfer=no              ; Disable all transfers (unless enabled in peers or users)
+                               ; Default is enabled
+;realm=mydomain.tld            ; Realm for digest authentication
+                               ; defaults to "asterisk". If you set a system name in
+                               ; asterisk.conf, it defaults to that system name
+                               ; Realms MUST be globally unique according to RFC 3261
+                               ; Set this to your host name or domain name
+bindport=5060                  ; UDP Port to bind to (SIP standard port is 5060)
+                               ; bindport is the local UDP port that Asterisk will listen on
+bindaddr=0.0.0.0               ; IP address to bind to (0.0.0.0 binds to all)
+srvlookup=yes                  ; Enable DNS SRV lookups on outbound calls
+                               ; Note: Asterisk only uses the first host 
+                               ; in SRV records
+                               ; Disabling DNS SRV lookups disables the 
+                               ; ability to place SIP calls based on domain 
+                               ; names to some other SIP users on the Internet
+                               
+;domain=mydomain.tld           ; Set default domain for this host
+                               ; If configured, Asterisk will only allow
+                               ; INVITE and REFER to non-local domains
+                               ; Use "sip show domains" to list local domains
+;pedantic=yes                  ; Enable checking of tags in headers, 
+                               ; international character conversions in URIs
+                               ; and multiline formatted headers for strict
+                               ; SIP compatibility (defaults to "no")
+
+; See doc/README.tos for a description of these parameters.
+;tos_sip=cs3                    ; Sets TOS for SIP packets.
+;tos_audio=ef                   ; Sets TOS for RTP audio packets.
+;tos_video=af41                 ; Sets TOS for RTP video packets.
+
+;maxexpiry=3600                        ; Maximum allowed time of incoming registrations
+                               ; and subscriptions (seconds)
+;minexpiry=60                  ; Minimum length of registrations/subscriptions (default 60)
+;defaultexpiry=120             ; Default length of incoming/outgoing registration
+;t1min=100                     ; Minimum roundtrip time for messages to monitored hosts
+                               ; Defaults to 100 ms
+;notifymimetype=text/plain     ; Allow overriding of mime type in MWI NOTIFY
+;checkmwi=10                   ; Default time between mailbox checks for peers
+;buggymwi=no                   ; Cisco SIP firmware doesn't support the MWI RFC
+                               ; fully. Enable this option to not get error messages
+                               ; when sending MWI to phones with this bug.
+;vmexten=voicemail             ; dialplan extension to reach mailbox sets the 
+                               ; Message-Account in the MWI notify message 
+                               ; defaults to "asterisk"
+;disallow=all                  ; First disallow all codecs
+;allow=ulaw                    ; Allow codecs in order of preference
+;allow=ilbc                    ; see doc/rtp-packetization for framing options
+;
+; This option specifies a preference for which music on hold class this channel
+; should listen to when put on hold if the music class has not been set on the
+; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
+; channel putting this one on hold did not suggest a music class.
+;
+; This option may be specified globally, or on a per-user or per-peer basis.
+;
+;mohinterpret=default
+;
+; This option specifies which music on hold class to suggest to the peer channel
+; when this channel places the peer on hold. It may be specified globally or on
+; a per-user or per-peer basis.
+;
+;mohsuggest=default
+;
+;language=en                   ; Default language setting for all users/peers
+                               ; This may also be set for individual users/peers
+;relaxdtmf=yes                 ; Relax dtmf handling
+;trustrpid = no                        ; If Remote-Party-ID should be trusted
+;sendrpid = yes                        ; If Remote-Party-ID should be sent
+;progressinband=never          ; If we should generate in-band ringing always
+                               ; use 'never' to never use in-band signalling, even in cases
+                               ; where some buggy devices might not render it
+                               ; Valid values: yes, no, never Default: never
+;useragent=Asterisk PBX                ; Allows you to change the user agent string
+;promiscredir = no             ; If yes, allows 302 or REDIR to non-local SIP address
+                               ; Note that promiscredir when redirects are made to the
+                                       ; local system will cause loops since Asterisk is incapable
+                                       ; of performing a "hairpin" call.
+;usereqphone = no              ; If yes, ";user=phone" is added to uri that contains
+                               ; a valid phone number
+;dtmfmode = rfc2833            ; Set default dtmfmode for sending DTMF. Default: rfc2833
+                               ; Other options: 
+                               ; info : SIP INFO messages
+                               ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
+                               ; auto : Use rfc2833 if offered, inband otherwise
+
+;compactheaders = yes          ; send compact sip headers.
+;
+;videosupport=yes              ; Turn on support for SIP video. You need to turn this on
+                               ; in the this section to get any video support at all.
+                               ; You can turn it off on a per peer basis if the general
+                               ; video support is enabled, but you can't enable it for
+                               ; one peer only without enabling in the general section.
+;maxcallbitrate=384            ; Maximum bitrate for video calls (default 384 kb/s)
+                               ; Videosupport and maxcallbitrate is settable
+                               ; for peers and users as well
+;callevents=no                 ; generate manager events when sip ua 
+                               ; performs events (e.g. hold)
+;alwaysauthreject = yes                ; When an incoming INVITE or REGISTER is to be rejected,
+                               ; for any reason, always reject with '401 Unauthorized'
+                               ; instead of letting the requester know whether there was
+                               ; a matching user or peer for their request
+
+;g726nonstandard = yes         ; If the peer negotiates G726-32 audio, use AAL2 packing
+                               ; order instead of RFC3551 packing order (this is required
+                               ; for Sipura and Grandstream ATAs, among others). This is
+                               ; contrary to the RFC3551 specification, the peer _should_
+                               ; be negotiating AAL2-G726-32 instead :-(
+
+;matchexterniplocally = yes     ; Only substitute the externip or externhost setting if it matches
+                                ; your localnet setting. Unless you have some sort of strange network
+                                ; setup you will not need to enable this.
+
+;
+; If regcontext is specified, Asterisk will dynamically create and destroy a
+; NoOp priority 1 extension for a given peer who registers or unregisters with
+; us and have a "regexten=" configuration item.  
+; Multiple contexts may be specified by separating them with '&'. The 
+; actual extension is the 'regexten' parameter of the registering peer or its
+; name if 'regexten' is not provided.  If more than one context is provided,
+; the context must be specified within regexten by appending the desired
+; context after '@'.  More than one regexten may be supplied if they are 
+; separated by '&'.  Patterns may be used in regexten.
+;
+;regcontext=sipregistrations
+;
+;--------------------------- RTP timers ----------------------------------------------------
+; These timers are currently used for both audio and video streams. The RTP timeouts
+; are only applied to the audio channel.
+; The settings are settable in the global section as well as per device
+;
+;rtptimeout=60                 ; Terminate call if 60 seconds of no RTP or RTCP activity
+                               ; on the audio channel
+                               ; when we're not on hold. This is to be able to hangup
+                               ; a call in the case of a phone disappearing from the net,
+                               ; like a powerloss or grandma tripping over a cable.
+;rtpholdtimeout=300            ; Terminate call if 300 seconds of no RTP or RTCP activity
+                               ; on the audio channel
+                               ; when we're on hold (must be > rtptimeout)
+;rtpkeepalive=<secs>           ; Send keepalives in the RTP stream to keep NAT open
+                               ; (default is off - zero)
+;--------------------------- SIP DEBUGGING ---------------------------------------------------
+;sipdebug = yes                        ; Turn on SIP debugging by default, from
+                               ; the moment the channel loads this configuration
+;recordhistory=yes             ; Record SIP history by default 
+                               ; (see sip history / sip no history)
+;dumphistory=yes               ; Dump SIP history at end of SIP dialogue
+                               ; SIP history is output to the DEBUG logging channel
+
+
+;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
+; You can subscribe to the status of extensions with a "hint" priority
+; (See extensions.conf.sample for examples)
+; chan_sip support two major formats for notifications: dialog-info and SIMPLE 
+;
+; You will get more detailed reports (busy etc) if you have a call limit set
+; for a device. When the call limit is filled, we will indicate busy. Note that
+; you need at least 2 in order to be able to do attended transfers.
+;
+; For queues, you will need this level of detail in status reporting, regardless
+; if you use SIP subscriptions. Queues and manager use the same internal interface
+; for reading status information.
+;
+; Note: Subscriptions does not work if you have a realtime dialplan and use the
+; realtime switch.
+;
+;allowsubscribe=no             ; Disable support for subscriptions. (Default is yes)
+;subscribecontext = default    ; Set a specific context for SUBSCRIBE requests
+                               ; Useful to limit subscriptions to local extensions
+                               ; Settable per peer/user also
+;notifyringing = yes           ; Notify subscriptions on RINGING state (default: no)
+;notifyhold = yes              ; Notify subscriptions on HOLD state (default: no)
+                               ; Turning on notifyringing and notifyhold will add a lot
+                               ; more database transactions if you are using realtime.
+;limitonpeers = yes            ; Apply call limits on peers only. This will improve 
+                               ; status notification when you are using type=friend
+                               ; Inbound calls, that really apply to the user part
+                               ; of a friend will now be added to and compared with
+                               ; the peer limit instead of applying two call limits,
+                               ; one for the peer and one for the user.
+
+;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
+;
+; This setting is available in the [general] section as well as in device configurations.
+; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
+; both parties have T38 support enabled in their Asterisk configuration 
+; This has to be enabled in the general section for all devices to work. You can then
+; disable it on a per device basis. 
+;
+; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
+;
+; t38pt_udptl = yes            ; Default false
+;
+;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
+; Asterisk can register as a SIP user agent to a SIP proxy (provider)
+; Format for the register statement is:
+;       register => user[:secret[:authuser]]@host[:port][/extension]
+;
+; If no extension is given, the 's' extension is used. The extension needs to
+; be defined in extensions.conf to be able to accept calls from this SIP proxy
+; (provider).
+;
+; host is either a host name defined in DNS or the name of a section defined
+; below.
+;
+; Examples:
+;
+;register => 9876: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
+;
+;
+;register => 2345:password@sip_proxy/1234
+;
+;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider
+;    connect to local extension 1234 in extensions.conf, default context,
+;    unless you configure a [sip_proxy] section below, and configure a
+;    context.
+;    Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
+;    Tip 2: Use separate type=peer and type=user sections for SIP providers
+;           (instead of type=friend) if you have calls in both directions
+  
+;registertimeout=20            ; retry registration calls every 20 seconds (default)
+;registerattempts=10           ; Number of registration attempts before we give up
+                               ; 0 = continue forever, hammering the other server
+                               ; until it accepts the registration
+                               ; Default is 0 tries, continue forever
+
+;----------------------------------------- NAT SUPPORT ------------------------
+; The externip, externhost and localnet settings are used if you use Asterisk
+; behind a NAT device to communicate with services on the outside.
+
+;externip = 200.201.202.203    ; Address that we're going to put in outbound SIP
+                               ; messages if we're behind a NAT
+
+                               ; The externip and localnet is used
+                               ; when registering and communicating with other proxies
+                               ; that we're registered with
+;externhost=foo.dyndns.net     ; Alternatively you can specify an 
+                               ; external host, and Asterisk will 
+                               ; perform DNS queries periodically.  Not
+                               ; recommended for production 
+                               ; environments!  Use externip instead
+;externrefresh=10              ; How often to refresh externhost if 
+                               ; used
+                               ; You may add multiple local networks.  A reasonable 
+                               ; set of defaults are:
+;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
+;localnet=10.0.0.0/255.0.0.0   ; Also RFC1918
+;localnet=172.16.0.0/12                ; Another RFC1918 with CIDR notation
+;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
+
+; The nat= setting is used when Asterisk is on a public IP, communicating with
+; devices hidden behind a NAT device (broadband router).  If you have one-way
+; audio problems, you usually have problems with your NAT configuration or your
+; firewall's support of SIP+RTP ports.  You configure Asterisk choice of RTP
+; ports for incoming audio in rtp.conf
+;
+;nat=no                                ; Global NAT settings  (Affects all peers and users)
+                                ; yes = Always ignore info and assume NAT
+                                ; no = Use NAT mode only according to RFC3581 (;rport)
+                                ; never = Never attempt NAT mode or RFC3581 support
+                               ; route = Assume NAT, don't send rport 
+                               ; (work around more UNIDEN bugs)
+
+;----------------------------------- MEDIA HANDLING --------------------------------
+; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
+; no reason for Asterisk to stay in the media path, the media will be redirected.
+; This does not really work with in the case where Asterisk is outside and have
+; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
+;
+;canreinvite=yes               ; Asterisk by default tries to redirect the
+                               ; RTP media stream (audio) to go directly from
+                               ; the caller to the callee.  Some devices do not
+                               ; support this (especially if one of them is behind a NAT).
+                               ; The default setting is YES. If you have all clients
+                               ; behind a NAT, or for some other reason wants Asterisk to
+                               ; stay in the audio path, you may want to turn this off.
+
+                               ; In Asterisk 1.4 this setting also affect direct RTP
+                               ; at call setup (a new feature in 1.4 - setting up the
+                               ; call directly between the endpoints instead of sending
+                               ; a re-INVITE).
+
+;directrtpsetup=yes            ; Enable the new experimental direct RTP setup. This sets up
+                               ; the call directly with media peer-2-peer without re-invites.
+                               ; Will not work for video and cases where the callee sends 
+                               ; RTP payloads and fmtp headers in the 200 OK that does not match the
+                               ; callers INVITE.
+
+;canreinvite=nonat             ; An additional option is to allow media path redirection
+                               ; (reinvite) but only when the peer where the media is being
+                               ; sent is known to not be behind a NAT (as the RTP core can
+                               ; determine it based on the apparent IP address the media
+                               ; arrives from).
+
+;canreinvite=update            ; Yet a third option... use UPDATE for media path redirection,
+                               ; instead of INVITE. This can be combined with 'nonat', as
+                               ; 'canreinvite=update,nonat'. It implies 'yes'.
+
+;----------------------------------------- REALTIME SUPPORT ------------------------
+; For additional information on ARA, the Asterisk Realtime Architecture,
+; please read realtime.txt and extconfig.txt in the /doc directory of the
+; source code.
+;
+;rtcachefriends=yes            ; Cache realtime friends by adding them to the internal list
+                               ; just like friends added from the config file only on a
+                               ; as-needed basis? (yes|no)
+
+;rtsavesysname=yes             ; Save systemname in realtime database at registration
+                               ; Default= no
+
+;rtupdate=yes                  ; Send registry updates to database using realtime? (yes|no)
+                               ; If set to yes, when a SIP UA registers successfully, the ip address,
+                               ; the origination port, the registration period, and the username of
+                               ; the UA will be set to database via realtime. 
+                               ; If not present, defaults to 'yes'.
+;rtautoclear=yes               ; Auto-Expire friends created on the fly on the same schedule
+                               ; as if it had just registered? (yes|no|<seconds>)
+                               ; If set to yes, when the registration expires, the friend will
+                               ; vanish from the configuration until requested again. If set
+                               ; to an integer, friends expire within this number of seconds
+                               ; instead of the registration interval.
+
+;ignoreregexpire=yes           ; Enabling this setting has two functions:
+                               ;
+                               ; For non-realtime peers, when their registration expires, the
+                               ; information will _not_ be removed from memory or the Asterisk database
+                               ; if you attempt to place a call to the peer, the existing information
+                               ; will be used in spite of it having expired
+                               ;
+                               ; For realtime peers, when the peer is retrieved from realtime storage,
+                               ; the registration information will be used regardless of whether
+                               ; it has expired or not; if it expires while the realtime peer 
+                               ; is still in memory (due to caching or other reasons), the 
+                               ; information will not be removed from realtime storage
+
+;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
+; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
+; domains, each of which can direct the call to a specific context if desired.
+; By default, all domains are accepted and sent to the default context or the
+; context associated with the user/peer placing the call.
+; Domains can be specified using:
+; domain=<domain>[,<context>]
+; Examples:
+; domain=myasterisk.dom
+; domain=customer.com,customer-context
+;
+; In addition, all the 'default' domains associated with a server should be
+; added if incoming request filtering is desired.
+; autodomain=yes
+;
+; To disallow requests for domains not serviced by this server:
+; allowexternaldomains=no
+
+;domain=mydomain.tld,mydomain-incoming
+                               ; Add domain and configure incoming context
+                               ; for external calls to this domain
+;domain=1.2.3.4                        ; Add IP address as local domain
+                               ; You can have several "domain" settings
+;allowexternalinvites=no       ; Disable INVITE and REFER to non-local domains
+                               ; Default is yes
+;autodomain=yes                        ; Turn this on to have Asterisk add local host
+                               ; name and local IP to domain list.
+
+; fromdomain=mydomain.tld      ; When making outbound SIP INVITEs to
+                               ; non-peers, use your primary domain "identity"
+                               ; for From: headers instead of just your IP
+                               ; address. This is to be polite and
+                               ; it may be a mandatory requirement for some
+                               ; destinations which do not have a prior
+                               ; account relationship with your server. 
+
+;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
+                              ; SIP channel. Defaults to "no". An enabled jitterbuffer will
+                              ; be used only if the sending side can create and the receiving
+                              ; side can not accept jitter. The SIP channel can accept jitter,
+                              ; thus a jitterbuffer on the receive SIP side will be used only
+                              ; if it is forced and enabled.
+
+; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a SIP
+                              ; channel. Defaults to "no".
+
+; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
+
+; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
+                              ; resynchronized. Useful to improve the quality of the voice, with
+                              ; big jumps in/broken timestamps, usually sent from exotic devices
+                              ; and programs. Defaults to 1000.
+
+; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
+                              ; channel. Two implementations are currently available - "fixed"
+                              ; (with size always equals to jbmaxsize) and "adaptive" (with
+                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
+;-----------------------------------------------------------------------------------
+
+[authentication]
+; Global credentials for outbound calls, i.e. when a proxy challenges your
+; Asterisk server for authentication. These credentials override
+; any credentials in peer/register definition if realm is matched.
+;
+; This way, Asterisk can authenticate for outbound calls to other
+; realms. We match realm on the proxy challenge and pick an set of 
+; credentials from this list
+; Syntax:
+;      auth = <user>:<secret>@<realm>
+;      auth = <user>#<md5secret>@<realm>
+; Example:
+;auth=mark:topsecret@digium.com
+; 
+; You may also add auth= statements to [peer] definitions 
+; Peer auth= override all other authentication settings if we match on realm
+
+;------------------------------------------------------------------------------
+; Users and peers have different settings available. Friends have all settings,
+; since a friend is both a peer and a user
+;
+; User config options:        Peer configuration:
+; --------------------        -------------------
+; context                     context
+; callingpres                callingpres
+; permit                      permit
+; deny                        deny
+; secret                      secret
+; md5secret                   md5secret
+; dtmfmode                    dtmfmode
+; canreinvite                 canreinvite
+; nat                         nat
+; callgroup                   callgroup
+; pickupgroup                 pickupgroup
+; language                    language
+; allow                       allow
+; disallow                    disallow
+; insecure                    insecure
+; trustrpid                   trustrpid
+; progressinband              progressinband
+; promiscredir                promiscredir
+; useclientcode               useclientcode
+; accountcode                 accountcode
+; setvar                      setvar
+; callerid                   callerid
+; amaflags                   amaflags
+; call-limit                 call-limit
+; allowoverlap               allowoverlap
+; allowsubscribe             allowsubscribe
+; allowtransfer                      allowtransfer
+; subscribecontext           subscribecontext
+; videosupport               videosupport
+; maxcallbitrate             maxcallbitrate
+; rfc2833compensate           mailbox
+;                             username
+;                             template
+;                             fromdomain
+;                             regexten
+;                             fromuser
+;                             host
+;                             port
+;                             qualify
+;                             defaultip
+;                             rtptimeout
+;                             rtpholdtimeout
+;                             sendrpid
+;                             outboundproxy
+;                             rfc2833compensate
+
+;[sip_proxy]
+; For incoming calls only. Example: FWD (Free World Dialup)
+; We match on IP address of the proxy for incoming calls 
+; since we can not match on username (caller id)
+;type=peer
+;context=from-fwd
+;host=fwd.pulver.com
+
+;[sip_proxy-out]
+;type=peer                             ; we only want to call out, not be called
+;secret=guessit
+;username=yourusername                 ; Authentication user for outbound proxies
+;fromuser=yourusername                 ; Many SIP providers require this!
+;fromdomain=provider.sip.domain        
+;host=box.provider.com
+;usereqphone=yes                       ; This provider requires ";user=phone" on URI
+;call-limit=5                          ; permit only 5 simultaneous outgoing calls to this peer
+;outboundproxy=proxy.provider.domain   ; send outbound signaling to this proxy, not directly to the peer
+                                       ; Call-limits will not be enforced on real-time peers,
+                                       ; since they are not stored in-memory
+;port=80                               ; The port number we want to connect to on the remote side
+                                       ; Also used as "defaultport" in combination with "defaultip" settings
+
+;------------------------------------------------------------------------------
+; Definitions of locally connected SIP devices
+;
+; type = user  a device that authenticates to us by "from" field to place calls
+; type = peer  a device we place calls to or that calls us and we match by host
+; type = friend two configurations (peer+user) in one
+;
+; For device names, we recommend using only a-z, numerics (0-9) and underscore
+; 
+; For local phones, type=friend works most of the time
+;
+; If you have one-way audio, you probably have NAT problems. 
+; If Asterisk is on a public IP, and the phone is inside of a NAT device
+; you will need to configure nat option for those phones.
+; Also, turn on qualify=yes to keep the nat session open
+
+;[grandstream1]
+;type=friend                   
+;context=from-sip              ; Where to start in the dialplan when this phone calls
+;callerid=John Doe <1234>      ; Full caller ID, to override the phones config
+                               ; on incoming calls to Asterisk
+;host=192.168.0.23             ; we have a static but private IP address
+                               ; No registration allowed
+;nat=no                                ; there is not NAT between phone and Asterisk
+;canreinvite=yes               ; allow RTP voice traffic to bypass Asterisk
+;dtmfmode=info                 ; either RFC2833 or INFO for the BudgeTone
+;call-limit=1                  ; permit only 1 outgoing call and 1 incoming call at a time
+                               ; from the phone to asterisk
+                               ; 1 for the explicit peer, 1 for the explicit user,
+                               ; remember that a friend equals 1 peer and 1 user in
+                               ; memory
+                               ; This will affect your subscriptions as well.
+                               ; There is no combined call counter for a "friend"
+                               ; so there's currently no way in sip.conf to limit
+                               ; to one inbound or outbound call per phone. Use
+                               ; the group counters in the dial plan for that.
+                               ;
+;mailbox=1234@default          ; mailbox 1234 in voicemail context "default"
+;disallow=all                  ; need to disallow=all before we can use allow=
+;allow=ulaw                    ; Note: In user sections the order of codecs
+                               ; listed with allow= does NOT matter!
+;allow=alaw
+;allow=g723.1                  ; Asterisk only supports g723.1 pass-thru!
+;allow=g729                    ; Pass-thru only unless g729 license obtained
+;callingpres=allowed_passed_screen     ; Set caller ID presentation
+                               ; See README.callingpres for more information
+
+
+;[xlite1]
+; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
+; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
+;type=friend
+;regexten=1234                 ; When they register, create extension 1234
+;callerid="Jane Smith" <5678>
+;host=dynamic                  ; This device needs to register
+;nat=yes                       ; X-Lite is behind a NAT router
+;canreinvite=no                        ; Typically set to NO if behind NAT
+;disallow=all
+;allow=gsm                     ; GSM consumes far less bandwidth than ulaw
+;allow=ulaw
+;allow=alaw
+;mailbox=1234@default,1233@default     ; Subscribe to status of multiple mailboxes
+
+
+;[snom]
+;type=friend                   ; Friends place calls and receive calls
+;context=from-sip              ; Context for incoming calls from this user
+;secret=blah
+;subscribecontext=localextensions      ; Only allow SUBSCRIBE for local extensions
+;language=de                   ; Use German prompts for this user 
+;host=dynamic                  ; This peer register with us
+;dtmfmode=inband               ; Choices are inband, rfc2833, or info
+;defaultip=192.168.0.59                ; IP used until peer registers
+;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
+;subscribemwi=yes              ; Only send notifications if this phone 
+                               ; subscribes for mailbox notification
+;vmexten=voicemail             ; dialplan extension to reach mailbox 
+                               ; sets the Message-Account in the MWI notify message
+                               ; defaults to global vmexten which defaults to "asterisk"
+;disallow=all
+;allow=ulaw                    ; dtmfmode=inband only works with ulaw or alaw!
+
+
+;[polycom]
+;type=friend                   ; Friends place calls and receive calls
+;context=from-sip              ; Context for incoming calls from this user
+;secret=blahpoly
+;host=dynamic                  ; This peer register with us
+;dtmfmode=rfc2833              ; Choices are inband, rfc2833, or info
+;username=polly                        ; Username to use in INVITE until peer registers
+                               ; Normally you do NOT need to set this parameter
+;disallow=all
+;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
+;progressinband=no             ; Polycom phones don't work properly with "never"
+
+
+;[pingtel]
+;type=friend
+;secret=blah
+;host=dynamic
+;insecure=port                 ; Allow matching of peer by IP address without 
+                               ; matching port number
+;insecure=invite               ; Do not require authentication of incoming INVITEs
+;insecure=port,invite          ; (both)
+;qualify=1000                  ; Consider it down if it's 1 second to reply
+                               ; Helps with NAT session
+                               ; qualify=yes uses default value
+;
+; Call group and Pickup group should be in the range from 0 to 63
+;
+;callgroup=1,3-4               ; We are in caller groups 1,3,4
+;pickupgroup=1,3-5             ; We can do call pick-p for call group 1,3,4,5
+;defaultip=192.168.0.60                ; IP address to use if peer has not registered
+;deny=0.0.0.0/0.0.0.0          ; ACL: Control access to this account based on IP address
+;permit=192.168.0.60/255.255.255.0
+
+;[cisco1]
+;type=friend
+;secret=blah
+;qualify=200                   ; Qualify peer is no more than 200ms away
+;nat=yes                       ; This phone may be natted
+                               ; Send SIP and RTP to the IP address that packet is 
+                               ; received from instead of trusting SIP headers 
+;host=dynamic                  ; This device registers with us
+;canreinvite=no                        ; Asterisk by default tries to redirect the
+                               ; RTP media stream (audio) to go directly from
+                               ; the caller to the callee.  Some devices do not
+                               ; support this (especially if one of them is 
+                               ; behind a NAT).
+;defaultip=192.168.0.4         ; IP address to use until registration
+;username=goran                        ; Username to use when calling this device before registration
+                               ; Normally you do NOT need to set this parameter
+;setvar=CUSTID=5678            ; Channel variable to be set for all calls from this device
+
+;[pre14-asterisk]
+;type=friend
+;secret=digium
+;host=dynamic
+;rfc2833compensate=yes         ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
+                               ; You must have this turned on or DTMF reception will work improperly.
+
+[6010]
+type=friend
+context=default
+host=dynamic
+secret=6010
+canreinvite=no
+callerid=6010
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6011]
+type=friend
+context=default
+host=dynamic
+secret=6011
+canreinvite=no
+callerid=6011
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6012]
+type=friend
+context=default
+host=dynamic
+secret=6012
+canreinvite=no
+callerid=6012
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6013]
+type=friend
+context=default
+host=dynamic
+secret=6013
+canreinvite=no
+callerid=6013
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6014]
+type=friend
+context=default
+host=dynamic
+secret=6014
+canreinvite=no
+callerid=6014
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6015]
+type=friend
+context=default
+host=dynamic
+secret=6015
+canreinvite=no
+callerid=6015
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6016]
+type=friend
+context=default
+host=dynamic
+secret=6016
+canreinvite=no
+callerid=6016
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6017]
+type=friend
+context=default
+host=dynamic
+secret=6017
+canreinvite=no
+callerid=6017
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6018]
+type=friend
+context=default
+host=dynamic
+secret=6018
+canreinvite=no
+callerid=6018
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6019]
+type=friend
+context=default
+host=dynamic
+secret=6019
+canreinvite=no
+callerid=6019
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+[6020]
+type=friend
+context=default
+host=dynamic
+secret=6020
+canreinvite=no
+callerid=6020
+disallow=all
+allow=ulaw,alaw
+qualify=yes
+
+; Pre-configured mini-asterisk SIP trunks
+
+;[usersipnat]            ; sipnat-mini-asterisk do not remove this comment
+;                          You reach your ITSP via a NAT router (most common)
+;type=friend             ; sipnat-mini-asterisk do not remove this comment
+;context=default         ; sipnat-mini-asterisk do not remove this comment
+;username=usernat        ; sipnat-mini-asterisk do not remove this comment
+;secret=passwordnat      ; sipnat-mini-asterisk do not remove this comment
+;fromdomain=fromdomainnat ; sipnat-mini-asterisk do not remove this comment
+;fromuser=fromusernat     ; sipnat-mini-asterisk do not remove this comment
+;host=hostnat            ; sipnat-mini-asterisk do not remove this comment
+;canreinvite=no          ; sipnat-mini-asterisk do not remove this comment
+;disallow=all            ; sipnat-mini-asterisk do not remove this comment
+;allow=ulaw,alaw         ; sipnat-mini-asterisk do not remove this comment
+;qualify=yes             ; sipnat-mini-asterisk do not remove this comment
+;nat=yes                 ; sipnat-mini-asterisk do not remove this comment
+
+;[usersipnormal]         ; sipnormal-mini-asterisk do not remove this comment
+;                          No NAT router between your Phone system and your ITSP
+;type=friend             ; sipnormal-mini-asterisk do not remove this comment
+;context=default         ; sipnormal-mini-asterisk do not remove this comment
+;username=usersip        ; sipnormal-mini-asterisk do not remove this comment
+;secret=passwordsip      ; sipnormal-mini-asterisk do not remove this comment
+;fromdomain=fromdomainsip ; sipnormal-mini-asterisk do not remove this comment
+;fromuser=fromusersip     ; sipnormal-mini-asterisk do not remove this comment
+;host=hostsip            ; sipnormal-mini-asterisk do not remove this comment
+;canreinvite=no          ; sipnormal-mini-asterisk do not remove this comment
+;disallow=all            ; sipnormal-mini-asterisk do not remove this comment
+;allow=ulaw,alaw         ; sipnormal-mini-asterisk do not remove this comment
+;qualify=yes             ; sipnormal-mini-asterisk do not remove this comment
+
+;[userjazmin]            ; jazmin-mini-asterisk do not remove this comment
+;                          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=fromdomainjaz ; jazmin-mini-asterisk do not remove this comment
+;fromuser=fromuserjaz     ; 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
+
+;[usertrev]              ; usertrev-mini-asterisk do not remove this comment
+;                           a test sip provider
+;type=friend             ; usertrev-mini-asterisk do not remove this comment
+;context=default         ; usertrev-mini-asterisk do not remove this comment
+;username=trev           ; usertrev-mini-asterisk do not remove this comment
+;secret=supertrev        ; usertrev-mini-asterisk do not remove this comment
+;host=dynamic            ; usertrev-mini-asterisk do not remove this comment
+;canreinvite=no          ; usertrev-mini-asterisk do not remove this comment
+;disallow=all            ; usertrev-mini-asterisk do not remove this comment
+;allow=ulaw,alaw         ; usertrev-mini-asterisk do not remove this comment
+;qualify=yes             ; usertrev-mini-asterisk do not remove this comment
+;nat=yes                 ; usertrev-mini-asterisk do not remove this comment
diff --git a/attic/mini-asterisk-gui2/etc/asterisk/zapata.conf b/attic/mini-asterisk-gui2/etc/asterisk/zapata.conf
new file mode 100644 (file)
index 0000000..d870b8d
--- /dev/null
@@ -0,0 +1,658 @@
+;
+; Zapata telephony interface
+;
+; Configuration file
+;
+; You need to restart Asterisk to re-configure the Zap channel
+; CLI> reload chan_zap.so 
+;              will reload the configuration file,
+;              but not all configuration options are 
+;              re-configured during a reload.
+
+
+
+[trunkgroups]
+;
+; Trunk groups are used for NFAS or GR-303 connections.
+;
+; Group: Defines a trunk group.  
+;        trunkgroup => <trunkgroup>,<dchannel>[,<backup1>...]
+;
+;        trunkgroup  is the numerical trunk group to create
+;        dchannel    is the zap channel which will have the 
+;                    d-channel for the trunk.
+;        backup1     is an optional list of backup d-channels.
+;
+;trunkgroup => 1,24,48
+;trunkgroup => 1,24
+;
+; Spanmap: Associates a span with a trunk group
+;        spanmap => <zapspan>,<trunkgroup>[,<logicalspan>]
+;
+;        zapspan     is the zap span number to associate
+;        trunkgroup  is the trunkgroup (specified above) for the mapping
+;        logicalspan is the logical span number within the trunk group to use.
+;                    if unspecified, no logical span number is used.
+;
+;spanmap => 1,1,1
+;spanmap => 2,1,2
+;spanmap => 3,1,3
+;spanmap => 4,1,4
+
+[channels]
+;
+; Default language
+;
+;language=en
+;
+; Default context
+;
+context=default
+;
+; Switchtype:  Only used for PRI.
+;
+; national:      National ISDN 2 (default)
+; dms100:        Nortel DMS100
+; 4ess:           AT&T 4ESS
+; 5ess:                  Lucent 5ESS
+; euroisdn:       EuroISDN
+; ni1:            Old National ISDN 1
+; qsig:           Q.SIG
+;
+switchtype=national
+;
+; Some switches (AT&T especially) require network specific facility IE
+; supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet'
+;
+;nsf=none
+;
+; PRI Dialplan:  Only RARELY used for PRI.
+;
+; unknown:        Unknown
+; private:        Private ISDN
+; local:          Local ISDN
+; national:      National ISDN
+; international:  International ISDN
+; dynamic:       Dynamically selects the appropriate dialplan
+;
+;pridialplan=national
+;
+; PRI Local Dialplan:  Only RARELY used for PRI (sets the calling number's numbering plan)
+;
+; unknown:        Unknown
+; private:        Private ISDN
+; local:          Local ISDN
+; national:      National ISDN
+; international:  International ISDN
+; dynamic:       Dynamically selects the appropriate dialplan
+;
+;prilocaldialplan=national
+;
+; PRI callerid prefixes based on the given TON/NPI (dialplan)
+; This is especially needed for euroisdn E1-PRIs
+; 
+; sample 1 for Germany 
+;internationalprefix = 00
+;nationalprefix = 0
+;localprefix = 0711
+;privateprefix = 07115678
+;unknownprefix = 
+;
+; sample 2 for Germany 
+;internationalprefix = +
+;nationalprefix = +49
+;localprefix = +49711
+;privateprefix = +497115678
+;unknownprefix = 
+;
+; PRI resetinterval: sets the time in seconds between restart of unused
+; channels, defaults to 3600; minimum 60 seconds.  Some PBXs don't like
+; channel restarts. so set the interval to a very long interval e.g. 100000000
+; or 'never' to disable *entirely*.
+;
+;resetinterval = 3600 
+;
+; Overlap dialing mode (sending overlap digits)
+;
+;overlapdial=yes
+;
+; PRI Out of band indications.
+; Enable this to report Busy and Congestion on a PRI using out-of-band
+; notification. Inband indication, as used by Asterisk doesn't seem to work
+; with all telcos.
+; 
+; outofband:      Signal Busy/Congestion out of band with RELEASE/DISCONNECT
+; inband:         Signal Busy/Congestion using in-band tones
+;
+; priindication = outofband
+;
+; If you need to override the existing channels selection routine and force all
+; PRI channels to be marked as exclusively selected, set this to yes.
+; priexclusive = yes
+;
+; ISDN Timers
+; All of the ISDN timers and counters that are used are configurable.  Specify
+; the timer name, and its value (in ms for timers).
+; K:    Layer 2 max number of outstanding unacknowledged I frames (default 7)
+; N200: Layer 2 max number of retransmissions of a frame (default 3)
+; T200: Layer 2 max time before retransmission of a frame (default 1000 ms)
+; T203: Layer 2 max time without frames being exchanged (default 10000 ms)
+; T305: Wait for DISCONNECT acknowledge (default 30000 ms)
+; T308: Wait for RELEASE acknowledge (default 4000 ms)
+; T309: Maintain active calls on Layer 2 disconnection (default -1, Asterisk clears calls)
+;       EuroISDN: 6000 to 12000 ms, according to (N200 + 1) x T200 + 2s
+;       May vary in other ISDN standards (Q.931 1993 : 90000 ms)
+; T313: Wait for CONNECT acknowledge, CPE side only (default 3000 ms)
+;
+; pritimer => t200,1000
+; pritimer => t313,4000
+;
+; To enable transmission of facility-based ISDN supplementary services (such
+; as caller name from CPE over facility), enable this option.
+; facilityenable = yes
+;
+;
+; Signalling method (default is fxs).  Valid values:
+; em:             E & M
+; em_w:           E & M Wink
+; featd:          Feature Group D (The fake, Adtran style, DTMF)
+; featdmf:        Feature Group D (The real thing, MF (domestic, US))
+; featdmf_ta:     Feature Group D (The real thing, MF (domestic, US)) through
+;                 a Tandem Access point
+; featb:          Feature Group B (MF (domestic, US))
+; fgccama        Feature Group C-CAMA (DP DNIS, MF ANI)
+; fgccamamf      Feature Group C-CAMA MF (MF DNIS, MF ANI)
+; fxs_ls:         FXS (Loop Start)
+; fxs_gs:         FXS (Ground Start)
+; fxs_ks:         FXS (Kewl Start)
+; fxo_ls:         FXO (Loop Start)
+; fxo_gs:         FXO (Ground Start)
+; fxo_ks:         FXO (Kewl Start)
+; pri_cpe:        PRI signalling, CPE side
+; pri_net:        PRI signalling, Network side
+; gr303fxoks_net: GR-303 Signalling, FXO Loopstart, Network side
+; gr303fxsks_cpe: GR-303 Signalling, FXS Loopstart, CPE side
+; sf:            SF (Inband Tone) Signalling
+; sf_w:                  SF Wink
+; sf_featd:       SF Feature Group D (The fake, Adtran style, DTMF)
+; sf_featdmf:     SF Feature Group D (The real thing, MF (domestic, US))
+; sf_featb:       SF Feature Group B (MF (domestic, US))
+; e911:           E911 (MF) style signalling
+;
+; The following are used for Radio interfaces:
+; fxs_rx:         Receive audio/COR on an FXS kewlstart interface (FXO at the
+;                 channel bank)
+; fxs_tx:         Transmit audio/PTT on an FXS loopstart interface (FXO at the
+;                 channel bank)
+; fxo_rx:         Receive audio/COR on an FXO loopstart interface (FXS at the
+;                 channel bank)
+; fxo_tx:         Transmit audio/PTT on an FXO groundstart interface (FXS at
+;                 the channel bank)
+; em_rx:          Receive audio/COR on an E&M interface (1-way)
+; em_tx:          Transmit audio/PTT on an E&M interface (1-way)
+; em_txrx:        Receive audio/COR AND Transmit audio/PTT on an E&M interface
+;                 (2-way)
+; em_rxtx:        Same as em_txrx (for our dyslexic friends)
+; sf_rx:          Receive audio/COR on an SF interface (1-way)
+; sf_tx:          Transmit audio/PTT on an SF interface (1-way)
+; sf_txrx:        Receive audio/COR AND Transmit audio/PTT on an SF interface
+;                 (2-way)
+; sf_rxtx:        Same as sf_txrx (for our dyslexic friends)
+;
+signalling=fxo_ls
+;
+; If you have an outbound signalling format that is different from format
+; specified above (but compatible), you can specify outbound signalling format,
+; (see below). The 'signalling' format specified will be the inbound signalling
+; format. If you only specify 'signalling', then it will be the format for
+; both inbound and outbound.
+; 
+; signalling=featdmf
+; outsignalling=featb
+;
+; For Feature Group D Tandem access, to set the default CIC and OZZ use these
+; parameters:
+;defaultozz=0000
+;defaultcic=303
+;
+; A variety of timing parameters can be specified as well
+; Including:
+;    prewink:     Pre-wink time (default 50ms)
+;    preflash:    Pre-flash time (default 50ms)
+;    wink:        Wink time (default 150ms)
+;    flash:       Flash time (default 750ms)
+;    start:       Start time (default 1500ms)
+;    rxwink:      Receiver wink time (default 300ms)
+;    rxflash:     Receiver flashtime (default 1250ms)
+;    debounce:    Debounce timing (default 600ms)
+;
+rxwink=300             ; Atlas seems to use long (250ms) winks
+;
+; How long generated tones (DTMF and MF) will be played on the channel
+; (in milliseconds)
+;toneduration=100
+;
+; Whether or not to do distinctive ring detection on FXO lines
+;
+;usedistinctiveringdetection=yes
+;distinctiveringaftercid=yes   ; enable dring detection after callerid for those countries like Australia
+                               ; where the ring cadence is changed *after* the callerid spill.
+;
+; Whether or not to use caller ID
+;
+usecallerid=yes
+;
+; Type of caller ID signalling in use
+;     bell     = bell202 as used in US
+;     v23      = v23 as used in the UK
+;     v23_jp   = v23 as used in Japan
+;     dtmf     = DTMF as used in Denmark, Sweden and Netherlands
+;     smdi     = Use SMDI for callerid.  Requires SMDI to be enabled (usesmdi).
+;
+;cidsignalling=bell
+;
+; What signals the start of caller ID
+;     ring     = a ring signals the start
+;     polarity = polarity reversal signals the start
+;
+;cidstart=ring
+;
+; Whether or not to hide outgoing caller ID (Override with *67 or *82)
+;
+hidecallerid=no
+;
+; Whether or not to enable call waiting on internal extensions
+; With this set to 'yes', busy extensions will hear the call-waiting
+; tone, and can use hook-flash to switch between callers. The Dial()
+; app will not return the "BUSY" result for extensions.
+;
+callwaiting=yes
+;
+; Whether or not restrict outgoing caller ID (will be sent as ANI only, not
+; available for the user)
+; Mostly use with FXS ports
+;
+;restrictcid=no
+;
+; Whether or not use the caller ID presentation for the outgoing call that the
+; calling switch is sending.
+; See README.callingpres
+;
+usecallingpres=yes
+;
+; Some countries (UK) have ring tones with different ring tones (ring-ring),
+; which means the callerid needs to be set later on, and not just after
+; the first ring, as per the default. 
+;
+;sendcalleridafter=1
+;
+;
+; Support Caller*ID on Call Waiting
+;
+callwaitingcallerid=yes
+;
+; Support three-way calling
+;
+threewaycalling=yes
+;
+; Support flash-hook call transfer (requires three way calling)
+; Also enables call parking (overrides the 'canpark' parameter)
+;
+transfer=yes
+;
+; Allow call parking
+; ('canpark=no' is overridden by 'transfer=yes')
+;
+canpark=yes
+;
+; Support call forward variable
+;
+cancallforward=yes
+;
+; Whether or not to support Call Return (*69)
+;
+callreturn=yes
+;
+; Stutter dialtone support: If a mailbox is specified without a voicemail 
+; context, then when voicemail is received in a mailbox in the default 
+; voicemail context in voicemail.conf, taking the phone off hook will cause a
+; stutter dialtone instead of a normal one. 
+;
+; If a mailbox is specified *with* a voicemail context, the same will result
+; if voicemail received in mailbox in the specified voicemail context.
+;
+; for default voicemail context, the example below is fine:
+;
+;mailbox=1234
+;
+; for any other voicemail context, the following will produce the stutter tone:
+;
+;mailbox=1234@context 
+;
+; Enable echo cancellation 
+; Use either "yes", "no", or a power of two from 32 to 256 if you wish to
+; actually set the number of taps of cancellation.
+;
+; Note that if any of your Zaptel cards have hardware echo cancellers,
+; then this setting only turns them on and off; numeric settings will
+; be treated as "yes". There are no special settings required for
+; hardware echo cancellers; when present and enabled in their kernel
+; modules, they take precedence over the software echo canceller compiled
+; into Zaptel automatically.
+;
+echocancel=yes
+;
+; Generally, it is not necessary (and in fact undesirable) to echo cancel when
+; the circuit path is entirely TDM.  You may, however, change this behavior
+; by enabling the echo cancel during pure TDM bridging below.
+;
+echocancelwhenbridged=yes
+;
+; In some cases, the echo canceller doesn't train quickly enough and there
+; is echo at the beginning of the call.  Enabling echo training will cause
+; asterisk to briefly mute the channel, send an impulse, and use the impulse
+; response to pre-train the echo canceller so it can start out with a much
+; closer idea of the actual echo.  Value may be "yes", "no", or a number of
+; milliseconds to delay before training (default = 400)
+;
+; WARNING:  In some cases this option can make echo worse!  If you are
+; trying to debug an echo problem, it is worth checking to see if your echo
+; is better with the option set to yes or no.  Use whatever setting gives
+; the best results.
+;
+; Note that these parameters do not apply to hardware echo cancellers.
+;
+;echotraining=yes
+;echotraining=800
+;
+; If you are having trouble with DTMF detection, you can relax the DTMF
+; detection parameters.  Relaxing them may make the DTMF detector more likely
+; to have "talkoff" where DTMF is detected when it shouldn't be.
+;
+;relaxdtmf=yes
+;
+; You may also set the default receive and transmit gains (in dB)
+;
+rxgain=0.0
+txgain=0.0
+;
+; Logical groups can be assigned to allow outgoing rollover.  Groups range
+; from 0 to 63, and multiple groups can be specified.
+;
+group=1
+;
+; Ring groups (a.k.a. call groups) and pickup groups.  If a phone is ringing
+; and it is a member of a group which is one of your pickup groups, then
+; you can answer it by picking up and dialling *8#.  For simple offices, just
+; make these both the same.  Groups range from 0 to 63.
+;
+callgroup=1
+pickupgroup=1
+
+;
+; Specify whether the channel should be answered immediately or if the simple
+; switch should provide dialtone, read digits, etc.
+;
+immediate=no
+;
+; Specify whether flash-hook transfers to 'busy' channels should complete or
+; return to the caller performing the transfer (default is yes).
+;
+;transfertobusy=no
+;
+; CallerID can be set to "asreceived" or a specific number if you want to
+; override it.  Note that "asreceived" only applies to trunk interfaces.
+;
+;callerid=2564286000
+;
+; AMA flags affects the recording of Call Detail Records.  If specified
+; it may be 'default', 'omit', 'billing', or 'documentation'.
+;
+;amaflags=default
+;
+; Channels may be associated with an account code to ease
+; billing
+;
+;accountcode=lss0101
+;
+; ADSI (Analog Display Services Interface) can be enabled on a per-channel
+; basis if you have (or may have) ADSI compatible CPE equipment
+;
+;adsi=yes
+;
+; SMDI (Simplified Message Desk Interface) can be enabled on a per-channel
+; basis if you would like that channel to behave like an SMDI message desk.
+; The SMDI port specified should have already been defined in smdi.conf.  The
+; default port is /dev/ttyS0.
+;
+;usesmdi=yes
+;smdiport=/dev/ttyS0
+;
+; On trunk interfaces (FXS) and E&M interfaces (E&M, Wink, Feature Group D
+; etc, it can be useful to perform busy detection either in an effort to 
+; detect hangup or for detecting busies.  This enables listening for
+; the beep-beep busy pattern.
+;
+;busydetect=yes
+;
+; If busydetect is enabled, it is also possible to specify how many busy tones
+; to wait for before hanging up.  The default is 4, but better results can be
+; achieved if set to 6 or even 8.  Mind that the higher the number, the more
+; time that will be needed to hangup a channel, but lowers the probability
+; that you will get random hangups.
+;
+;busycount=4
+;
+; If busydetect is enabled, it is also possible to specify the cadence of your
+; busy signal.  In many countries, it is 500msec on, 500msec off.  Without
+; busypattern specified, we'll accept any regular sound-silence pattern that
+; repeats <busycount> times as a busy signal.  If you specify busypattern,
+; then we'll further check the length of the sound (tone) and silence, which
+; will further reduce the chance of a false positive.
+;
+;busypattern=500,500
+;
+; NOTE: In the Asterisk Makefile you'll find further options to tweak the busy
+; detector.  If your country has a busy tone with the same length tone and
+; silence (as many countries do), consider defining the
+; -DBUSYDETECT_COMPARE_TONE_AND_SILENCE option.
+;
+; Use a polarity reversal to mark when a outgoing call is answered by the
+; remote party.
+;
+;answeronpolarityswitch=yes
+;
+; In some countries, a polarity reversal is used to signal the disconnect of a
+; phone line.  If the hanguponpolarityswitch option is selected, the call will
+; be considered "hung up" on a polarity reversal.
+;
+;hanguponpolarityswitch=yes
+;
+; On trunk interfaces (FXS) it can be useful to attempt to follow the progress
+; of a call through RINGING, BUSY, and ANSWERING.   If turned on, call
+; progress attempts to determine answer, busy, and ringing on phone lines.
+; This feature is HIGHLY EXPERIMENTAL and can easily detect false answers,
+; so don't count on it being very accurate.
+;
+; Few zones are supported at the time of this writing, but may be selected
+; with "progzone"
+;
+; This feature can also easily detect false hangups. The symptoms of this is
+; being disconnected in the middle of a call for no reason.
+;
+;callprogress=yes
+;progzone=us
+;
+; FXO (FXS signalled) devices must have a timeout to determine if there was a
+; hangup before the line was answered.  This value can be tweaked to shorten
+; how long it takes before Zap considers a non-ringing line to have hungup.
+;
+;ringtimeout=8000
+;
+; For FXO (FXS signalled) devices, whether to use pulse dial instead of DTMF
+;
+;pulsedial=yes
+;
+; For fax detection, uncomment one of the following lines.  The default is *OFF*
+;
+;faxdetect=both
+;faxdetect=incoming
+;faxdetect=outgoing
+;faxdetect=no
+;
+; This option specifies a preference for which music on hold class this channel
+; should listen to when put on hold if the music class has not been set on the
+; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
+; channel putting this one on hold did not suggest a music class.
+;
+; If this option is set to "passthrough", then the hold message will always be
+; passed through as signalling instead of generating hold music locally. This
+; setting is only valid when used on a channel that uses digital signalling.
+;
+; This option may be specified globally, or on a per-user or per-peer basis.
+;
+;mohinterpret=default
+;
+; This option specifies which music on hold class to suggest to the peer channel
+; when this channel places the peer on hold. It may be specified globally or on
+; a per-user or per-peer basis.
+;
+;mohsuggest=default
+;
+; PRI channels can have an idle extension and a minunused number.  So long as
+; at least "minunused" channels are idle, chan_zap will try to call "idledial"
+; on them, and then dump them into the PBX in the "idleext" extension (which
+; is of the form exten@context).  When channels are needed the "idle" calls
+; are disconnected (so long as there are at least "minidle" calls still
+; running, of course) to make more channels available.  The primary use of
+; this is to create a dynamic service, where idle channels are bundled through
+; multilink PPP, thus more efficiently utilizing combined voice/data services
+; than conventional fixed mappings/muxings.
+;
+;idledial=6999
+;idleext=6999@dialout
+;minunused=2
+;minidle=1
+;
+; Configure jitter buffers in zapata (each one is 20ms, default is 4)
+;
+;jitterbuffers=4
+;
+;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
+                              ; ZAP channel. Defaults to "no". An enabled jitterbuffer will
+                              ; be used only if the sending side can create and the receiving
+                              ; side can not accept jitter. The ZAP channel can't accept jitter,
+                              ; thus an enabled jitterbuffer on the receive ZAP side will always
+                              ; be used if the sending side can create jitter.
+
+; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
+
+; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
+                              ; resynchronized. Useful to improve the quality of the voice, with
+                              ; big jumps in/broken timestamps, usually sent from exotic devices
+                              ; and programs. Defaults to 1000.
+
+; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a ZAP
+                              ; channel. Two implementations are currently available - "fixed"
+                              ; (with size always equals to jbmax-size) and "adaptive" (with
+                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
+;-----------------------------------------------------------------------------------
+;
+; You can define your own custom ring cadences here.  You can define up to 8
+; pairs.  If the silence is negative, it indicates where the callerid spill is
+; to be placed.  Also, if you define any custom cadences, the default cadences
+; will be turned off.
+;
+; Syntax is:  cadence=ring,silence[,ring,silence[...]]
+;
+; These are the default cadences:
+;
+;cadence=125,125,2000,-4000
+;cadence=250,250,500,1000,250,250,500,-4000
+;cadence=125,125,125,125,125,-4000
+;cadence=1000,500,2500,-5000
+;
+; Each channel consists of the channel number or range.  It inherits the
+; parameters that were specified above its declaration.
+;
+; For GR-303, CRV's are created like channels except they must start with the
+; trunk group followed by a colon, e.g.: 
+;
+; crv => 1:1
+; crv => 2:1-2,5-8
+;
+;
+;callerid="Green Phone"<(256) 428-6121>
+;channel => 1
+;callerid="Black Phone"<(256) 428-6122>
+;channel => 2
+;callerid="CallerID Phone" <(256) 428-6123>
+;callerid="CallerID Phone" <(630) 372-1564>
+;callerid="CallerID Phone" <(256) 704-4666>
+;channel => 3
+;callerid="Pac Tel Phone" <(256) 428-6124>
+;channel => 4
+;callerid="Uniden Dead" <(256) 428-6125>
+;channel => 5
+;callerid="Cortelco 2500" <(256) 428-6126>
+;channel => 6
+;callerid="Main TA 750" <(256) 428-6127>
+;channel => 44
+;
+; For example, maybe we have some other channels which start out in a
+; different context and use E & M signalling instead.
+;
+;context=remote
+;sigalling=em
+;channel => 15
+;channel => 16
+
+;signalling=em_w
+;
+; All those in group 0 I'll use for outgoing calls
+;
+; Strip most significant digit (9) before sending
+;
+;stripmsd=1
+;callerid=asreceived
+;group=0
+;signalling=fxs_ls
+;channel => 45
+
+;signalling=fxo_ls
+;group=1
+;callerid="Joe Schmoe" <(256) 428-6131>
+;channel => 25
+;callerid="Megan May" <(256) 428-6132>
+;channel => 26
+;callerid="Suzy Queue" <(256) 428-6233>
+;channel => 27
+;callerid="Larry Moe" <(256) 428-6234>
+;channel => 28
+;
+; Sample PRI (CPE) config:  Specify the switchtype, the signalling as either
+; pri_cpe or pri_net for CPE or Network termination, and generally you will
+; want to create a single "group" for all channels of the PRI.
+;
+; switchtype = national
+; signalling = pri_cpe
+; group = 2
+; channel => 1-23
+
+;
+
+;  Used for distinctive ring support for x100p.
+;  You can see the dringX patterns is to set any one of the dringXcontext fields
+;  and they will be printed on the console when an inbound call comes in.
+;
+;dring1=95,0,0 
+;dring1context=internal1 
+;dring2=325,95,0 
+;dring2context=internal2 
+; If no pattern is matched here is where we go.
+;context=default
+;channel => 1 
+
diff --git a/attic/mini-asterisk-gui2/etc/lighttpd.conf b/attic/mini-asterisk-gui2/etc/lighttpd.conf
new file mode 100644 (file)
index 0000000..5c883db
--- /dev/null
@@ -0,0 +1,231 @@
+# lighttpd configuration file
+#
+# use a it as base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.6 2004/08/29 09:44:53 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules              = (
+#                               "mod_rewrite",
+#                               "mod_redirect",
+                               "mod_access",
+#                              "mod_auth",
+#                               "mod_status",
+#                              "mod_fastcgi",
+#                              "mod_simple_vhost",
+#                              "mod_evhost",
+                               "mod_cgi",
+#                              "mod_compress",
+#                               "mod_ssi",
+#                               "mod_usertrack",
+#                              "mod_rrdtool",
+#                              "mod_accesslog"
+)
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root             = "/www/"
+
+## where to send error-messages to
+# server.errorlog            = ""
+
+# files to check for if .../ is requested
+server.indexfiles          = ( "index.php", "index.html",
+                                "index.htm", "default.htm" )
+
+# mimetype mapping
+mimetype.assign            = (
+  ".pdf"          =>      "application/pdf",
+  ".sig"          =>      "application/pgp-signature",
+  ".spl"          =>      "application/futuresplash",
+  ".class"        =>      "application/octet-stream",
+  ".ps"           =>      "application/postscript",
+  ".torrent"      =>      "application/x-bittorrent",
+  ".dvi"          =>      "application/x-dvi",
+  ".gz"           =>      "application/x-gzip",
+  ".pac"          =>      "application/x-ns-proxy-autoconfig",
+  ".swf"          =>      "application/x-shockwave-flash",
+  ".tar.gz"       =>      "application/x-tgz",
+  ".tgz"          =>      "application/x-tgz",
+  ".tar"          =>      "application/x-tar",
+  ".zip"          =>      "application/zip",
+  ".mp3"          =>      "audio/mpeg",
+  ".m3u"          =>      "audio/x-mpegurl",
+  ".wma"          =>      "audio/x-ms-wma",
+  ".wax"          =>      "audio/x-ms-wax",
+  ".ogg"          =>      "audio/x-wav",
+  ".wav"          =>      "audio/x-wav",
+  ".gif"          =>      "image/gif",
+  ".jpg"          =>      "image/jpeg",
+  ".jpeg"         =>      "image/jpeg",
+  ".png"          =>      "image/png",
+  ".xbm"          =>      "image/x-xbitmap",
+  ".xpm"          =>      "image/x-xpixmap",
+  ".xwd"          =>      "image/x-xwindowdump",
+  ".css"          =>      "text/css",
+  ".html"         =>      "text/html",
+  ".htm"          =>      "text/html",
+  ".js"           =>      "text/javascript",
+  ".asc"          =>      "text/plain",
+  ".c"            =>      "text/plain",
+  ".conf"         =>      "text/plain",
+  ".text"         =>      "text/plain",
+  ".txt"          =>      "text/plain",
+  ".dtd"          =>      "text/xml",
+  ".xml"          =>      "text/xml",
+  ".mpeg"         =>      "video/mpeg",
+  ".mpg"          =>      "video/mpeg",
+  ".mov"          =>      "video/quicktime",
+  ".qt"           =>      "video/quicktime",
+  ".avi"          =>      "video/x-msvideo",
+  ".asf"          =>      "video/x-ms-asf",
+  ".asx"          =>      "video/x-ms-asf",
+  ".wmv"          =>      "video/x-ms-wmv"
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+# mimetypes.use-xattr = "enable"
+
+#### accesslog module
+# accesslog.filename          = "/www/logs/access.log"
+
+## deny access the file-extensions
+#
+# ~    is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+#      of the document-root
+url.access-deny             = ( "~", ".inc" )
+
+
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port                = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind                = "grisu.home.kneschke.de"
+
+## error-handler for status 404
+#server.error-handler-404   = "/error-handler.html"
+#server.error-handler-404   = "/error-handler.php"
+
+
+###### virtual hosts
+##
+##   If you want name-based virtual hosting add the next three settings and load
+##   mod_simple_vhost
+##
+## document-root =
+##   virtual-server-root + virtual-server-default-host + virtual-server-docroot or
+##   virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root         = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host        = "grisu.home.kneschke.de"
+#simple-vhost.document-root       = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-"
+
+## virtual directory listings
+#server.dir-listing          = "enable"
+
+## send unhandled HTTP-header headers to error-log
+#debug.dump-unknown-headers  = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot            = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username            = "wwwrun"
+
+## change uid to <uid> (default: don't care)
+#server.groupname           = "wwwrun"
+
+#### compress module
+#compress.cache-dir          = "/tmp/lighttpd/cache/compress/"
+#compress.filetype           = ("text/plain", "text/html")
+
+#### fastcgi module
+## read fastcgi.txt for more info
+#fastcgi.server              = ( ".php" =>
+#                              ( "grisu" =>
+#                                (
+#                                  "host" => "192.168.2.10",
+#                                  "port" => 1026
+#                                )
+#                              )
+#                            )
+
+#### CGI module
+cgi.assign = ( ".sh"  => "/bin/sh",".pl" => "/usr/bin/perl",
+                                ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine                  = "enable"
+#ssl.pemfile                 = "server.pem"
+
+#### status module
+# status.status-url = "/server-status"
+# status.config-url = "/server-config"
+
+#### auth module
+## read authentification.txt for more info
+# auth.backend                = "plain"
+# auth.backend.plain.userfile = "lighttpd.user"
+# auth.backend.plain.groupfile = "lighttpd.group"
+
+# auth.backend.ldap.hostname = "localhost"
+# auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
+# auth.backend.ldap.filter   = "(uid=$)"
+
+# auth.require                = ( "/server-status" =>
+#                                (
+#                                "method"  => "digest",
+#                                "realm"   => "download archiv",
+#                                "require" => "group=www|user=jan|host=192.168.2.10"
+#                              ),
+#                              "/server-info" =>
+#                                (
+#                                "method"  => "digest",
+#                                "realm"   => "download archiv",
+#                                "require" => "group=www|user=jan|host=192.168.2.10"
+#                              )
+#                              )
+
+#### url handling modules (rewrite, redirect, access)
+# url.rewrite                 = ( "^/$"             => "/server-status" )
+# url.redirect                = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
+
+#### expire module
+# expire.url                  = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+# ssi.extension              = ( ".shtml" )
+
+#### rrdtool
+# rrdtool.binary = "/usr/bin/rrdtool"
+# rrdtool.db-name = "/var/www/lighttpd.rrd"
diff --git a/attic/mini-asterisk-gui2/etc/lighttpd/conf-available/.gitignore b/attic/mini-asterisk-gui2/etc/lighttpd/conf-available/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/attic/mini-asterisk-gui2/etc/lighttpd/conf-enabled/10-cgi.conf b/attic/mini-asterisk-gui2/etc/lighttpd/conf-enabled/10-cgi.conf
new file mode 120000 (symlink)
index 0000000..995c40c
--- /dev/null
@@ -0,0 +1 @@
+../conf-available/10-cgi.conf
\ No newline at end of file
diff --git a/attic/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf b/attic/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf
new file mode 100644 (file)
index 0000000..bc650da
--- /dev/null
@@ -0,0 +1,36 @@
+server.modules = (
+       "mod_access",
+       "mod_alias",
+       "mod_compress",
+       "mod_redirect",
+#       "mod_rewrite",
+)
+
+server.document-root        = "/home/ian/mini-asterisk-gui2"
+server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
+server.errorlog             = "/var/log/lighttpd/error.log"
+server.pid-file             = "/var/run/lighttpd.pid"
+server.username             = "www-data"
+server.groupname            = "www-data"
+#server.username             = "wwwrun"
+#server.groupname            = "wwwrun"
+
+index-file.names            = ( "index.php", "index.html",
+                                "index.htm", "default.htm",
+                               " index.lighttpd.html" )
+
+url.access-deny             = ( "~", ".inc" )
+
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+## Use ipv6 if available
+#include_shell "/usr/share/lighttpd/use-ipv6.pl"
+
+dir-listing.encoding        = "utf-8"
+server.dir-listing          = "enable"
+
+compress.cache-dir          = "/var/cache/lighttpd/compress/"
+compress.filetype           = ( "application/x-javascript", "text/css", "text/html", "text/plain" )
+
+include_shell "/usr/share/lighttpd/create-mime.assign.pl"
+include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
diff --git a/attic/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf.x86 b/attic/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf.x86
new file mode 100644 (file)
index 0000000..bc650da
--- /dev/null
@@ -0,0 +1,36 @@
+server.modules = (
+       "mod_access",
+       "mod_alias",
+       "mod_compress",
+       "mod_redirect",
+#       "mod_rewrite",
+)
+
+server.document-root        = "/home/ian/mini-asterisk-gui2"
+server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
+server.errorlog             = "/var/log/lighttpd/error.log"
+server.pid-file             = "/var/run/lighttpd.pid"
+server.username             = "www-data"
+server.groupname            = "www-data"
+#server.username             = "wwwrun"
+#server.groupname            = "wwwrun"
+
+index-file.names            = ( "index.php", "index.html",
+                                "index.htm", "default.htm",
+                               " index.lighttpd.html" )
+
+url.access-deny             = ( "~", ".inc" )
+
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+## Use ipv6 if available
+#include_shell "/usr/share/lighttpd/use-ipv6.pl"
+
+dir-listing.encoding        = "utf-8"
+server.dir-listing          = "enable"
+
+compress.cache-dir          = "/var/cache/lighttpd/compress/"
+compress.filetype           = ( "application/x-javascript", "text/css", "text/html", "text/plain" )
+
+include_shell "/usr/share/lighttpd/create-mime.assign.pl"
+include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
diff --git a/attic/mini-asterisk-gui2/etc/zaptel.conf b/attic/mini-asterisk-gui2/etc/zaptel.conf
new file mode 100644 (file)
index 0000000..5fd585c
--- /dev/null
@@ -0,0 +1,4 @@
+loadzone = us
+defaultzone=us
+
+fxoks=2,3,4
diff --git a/attic/mini-asterisk-gui2/faq.html b/attic/mini-asterisk-gui2/faq.html
new file mode 100644 (file)
index 0000000..8cc7833
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>FAQ</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="faq.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="faq"></div>
+
+    <h2>FAQ</h2>
+    <ol>
+
+       <li><strong>How do I set up my Phone system?</strong> 
+           <ol>
+           <li> Hover your mouse to get instructions (try the menu to the left).</li>
+           <li> Analog Ports are detected automatically.</li>
+           <li> Set up your <a href="network.html">Network</a>.</li>
+           <li> Add your <a href="ipphones.html">IP Phones</a>.</li>
+           <li> Configure your <a href="voiplines.html">Voip Line</a>.</li>
+           <li> The <a href="phones.html">Phone System</a> page gives you a 
+                summary of your phone system and tells you how to make calls 
+                (hover your mouse).</li>
+           </ol>
+       </li>
+
+       <li><strong>Where can I find out more about Mini Asterisk:</strong> The <a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk Home Page</a>.
+
+       <li><strong>Where can I get Support:</strong> You can try the
+           <a href="https://lists.sourceforge.net/lists/listinfo/freetel-discuss">Free Telephony Project</a> Mailing List.
+
+       <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.
+
+       <li><strong>Put a call on hold/transfer:</strong> On an IP Phone try
+           the recall or transfer button.  On an Analog Phone hold down the
+           hook button for 1 second then dial the new number.
+
+       <li><strong>Why another Asterisk GUI</strong> I had some specific
+           needs for a light weight, very easy to use GUI for
+           the <a href="http://www.rowetel.com/ucasterisk/ip04.html">IP0X</a>
+           line of products.  So I scratched the itch.  More
+           information <a href="http://www.rowetel.com/ucasterisk/mini.html#why">here</a>.
+
+    </ol>
+
+    <h2>Resources and Links</h2>
+    <ol>
+       <li>If you want to learn more about Asterisk a good on-line book is <a href="http://astbook.asteriskdocs.org">Asterisk - The Future of Telephony</a>
+    </ol>
+
+    </td>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/faq.js b/attic/mini-asterisk-gui2/faq.js
new file mode 100644 (file)
index 0000000..762695c
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  faq.js
+  Ian Roberts
+  May 10 2012
+
+  FAQ screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+}
+
+
+
diff --git a/attic/mini-asterisk-gui2/install notes.txt b/attic/mini-asterisk-gui2/install notes.txt
new file mode 100644 (file)
index 0000000..b88e680
--- /dev/null
@@ -0,0 +1,32 @@
+IP04 GUI2 Install notes
+Ian Roberts 
+Sept 2012
+
+
+0. Connect ip04 to network. Power up.
+
+1. Telnet 192.168.1.30
+
+2. Create a file
+
+   vi install_gui2.sh
+
+3. Copy script from
+   http://freetel.svn.sourceforge.net/viewvc/freetel/mini-asterisk-gui2/install_gui2.sh?revision=717&content-type=text%2Fplain
+   
+   Paste into vi session (right click will do it)
+   Save file
+   
+4. Make the script executable
+
+   chmod a+x install_gui2.sh
+
+5. Run the script
+
+   sh install_gui2.sh
+
+6. Check gui2 
+
+   192.168.1.30/gui2/phones.html
+
+
diff --git a/attic/mini-asterisk-gui2/install_gui2.sh b/attic/mini-asterisk-gui2/install_gui2.sh
new file mode 100755 (executable)
index 0000000..541e490
--- /dev/null
@@ -0,0 +1,84 @@
+# Script to install GUI2 to IP04
+# Original gui left intact
+# New gui at 192.168.1.30/gui2/phones.html
+# Developement Edition
+# Ian Roberts
+# Sept 2012
+
+# check we are on an IP0x box
+echo "must be root directory on IP0x"
+echo ""
+cd /
+
+# remove old copy if exists
+
+rm gui2.tar.gz
+
+
+# get the source
+
+wget -O gui2.tar.gz http://freetel.svn.sourceforge.net/viewvc/freetel/mini-asterisk-gui2/?view=tar
+
+
+echo ""
+
+# unpack
+
+tar zxvf gui2.tar.gz
+
+
+# check root
+
+#testing
+#mkdir www
+#mkdir www/cgi-bin
+
+
+#create directories if required
+
+mkdir /www/gui2
+mkdir /www/cgi-bin
+
+# copy web files to /www
+
+cp mini-asterisk-gui2/*.html /www/gui2
+cp mini-asterisk-gui2/*.js /www/gui2
+cp mini-asterisk-gui2/*.png /www/gui2
+cp mini-asterisk-gui2/*.css /www/gui2
+
+
+# copy cgi to /www/cgi-bin
+
+cp mini-asterisk-gui2/cgi-bin/*.* /www/cgi-bin
+
+
+# check packages installed
+
+ipkg install fping
+
+
+# check extension.conf 60xx lines have mini_ext tags
+
+cp mini-asterisk-gui2/etc/asterisk/extensions.conf /etc/asterisk/extensions.conf
+
+# check sip.conf has new provider keywords
+
+cp mini-asterisk-gui2/etc/asterisk/sip.conf /etc/asterisk/sip.conf
+
+# check lighttpd installed
+# check cgi support in lighttpd
+
+cp mini-asterisk-gui2/etc/lighttpd.conf /etc/lighttpd.conf
+
+# webserver index should point browser at gui2 login
+
+# restart the http server
+/etc/init.d/lighttpd stop
+/etc/init.d/lighttpd start
+
+
+echo ""
+echo "Point your browser at 192.168.1.30/gui2/phones.html"
+
+
+
diff --git a/attic/mini-asterisk-gui2/ipphones.html b/attic/mini-asterisk-gui2/ipphones.html
new file mode 100644 (file)
index 0000000..49f64ef
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>ipPhones</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="ipphones.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td>
+      <h2>&nbsp;<br>IP Phones</h2>
+               <table>
+         <tr><td>
+            <div id="ipphones_table"></div>
+               </td></tr>
+
+               <tr><td>
+           &nbsp;
+               </td></tr>
+        
+       
+         <tr><td>
+         <a href=configure_AT-530.html>Configure AT-530</a>
+               </td></tr>
+
+         <tr><td>
+         <a href=configure_AT-620R.html>Configure AT-620R</a>
+               </td></tr>
+
+               </table>
+         </td>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/ipphones.js b/attic/mini-asterisk-gui2/ipphones.js
new file mode 100644 (file)
index 0000000..08a9fa7
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+  ipphones.js
+  Ian Roberts
+  May 10 2012
+
+  IP Phones screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    document.getElementById("ipphones_table").innerHTML = "Checking....";
+
+     // kick off cascading CGIs, initialisePage() will be called when complete
+        
+    loadExtensions();
+}
+
+function initialisePage() {
+    // 
+     var tick = '<img src="tick.png" alt="IP phone detected" />';
+     var cross = '<img src="cross.png" alt="No phone detected" />';
+    var html = '';
+    var j = 0;
+       
+    html += '<form name="phones" method="get">';
+
+    html += '<table align="right" width=600 cellspacing=2>';
+
+    // print out IP phones
+    //  j is 6011,6012 etc
+
+    for (j in ip_ext) {
+        if (ip_ext[j] != '') {
+            html += "<tr>";
+               html += "<td>" + j + "</td>" ;
+               html += "<td>" + ip_ext[j] + "</td>";
+            html += "<td>" + tick + "</td>";
+            html += "</tr>";
+           } 
+               else {
+            html += "<tr>";
+               html += "<td>" + j + "</td>" ;
+               html += "<td>" + "available" + "</td>";
+            html += "<td>" + cross + "</td>";
+            html += "</tr>";
+               }
+    }
+
+    html += '</table>';
+       
+    html += '</form>';
+    document.getElementById("ipphones_table").innerHTML = html;
+
+}
+
+function somefunction() {
+    // 
+    
+    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
+    var html = '';
+
+    html += '<table align="right" width=600>';
+
+    // print out info
+
+    html += '<tr><td colspan="3" align="left" valign="top"><h2>IP Phones</h2></td></tr>';
+    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision XXX</td></tr>';
+    html += '<tr><td colspan="2">Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>';
+    // this image will only come up if internet connection is present
+    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td><td> </td><td></td></tr>';
+    html += '<tr><td>&nbsp</td></tr>';
+    html += '</table>';
+
+//    document.getElementById("ipphones").innerHTML += html;
+
+}
+
diff --git a/attic/mini-asterisk-gui2/login.html b/attic/mini-asterisk-gui2/login.html
new file mode 100644 (file)
index 0000000..24b6bb1
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>Mini Asterisk - Login</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css" />
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript">
+//      <input name="update_recept" type="button" style="width:100%" value="update reception" onClick="onClickUpdateReception()" />
+
+</script>
+
+</head>
+
+<body>
+  
+    <table align="center" width=600>
+    <tr><td colspan="2" align="left"><h2>Login</h2></td>
+    <tr>
+      <tr><td>Password:</td><td><input type="password" name="pass" ></td></tr>
+      <tr><td><input name="submit_password" type="button" style="width:50%" value="Login" onClick="onClickLogin()"></td></tr>
+
+    </tr>
+    <tr><td></td><td>Default password is uClinux</td>
+    </table>
+  
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/logout.html b/attic/mini-asterisk-gui2/logout.html
new file mode 100644 (file)
index 0000000..87fe8de
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>Logout</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="logout.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="logout"></div></td>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/logout.js b/attic/mini-asterisk-gui2/logout.js
new file mode 100644 (file)
index 0000000..5ae4521
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+  logout.js
+  Ian Roberts
+  May 10 2012
+
+  Logout screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+    // 
+    
+    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
+    var html = '';
+
+    html += '<table align="right" width=600>';
+
+    // print out info
+
+    html += '<tr><td colspan="3" align="left" valign="top"><h2>Logout</h2></td></tr>';
+    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision XXX</td></tr>';
+    html += '<tr><td colspan="2">Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>';
+    // this image will only come up if internet connection is present
+    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td><td> </td><td></td></tr>';
+    html += '<tr><td>&nbsp</td></tr>';
+    html += '</table>';
+
+    document.getElementById("logout").innerHTML += html;
+
+}
+
+
+
diff --git a/attic/mini-asterisk-gui2/menu.js b/attic/mini-asterisk-gui2/menu.js
new file mode 100644 (file)
index 0000000..c45f322
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+  menu.js
+  David Rowe 
+  Jan 4 2010
+
+  Function(s) to create main menu.  Interesting to compare this to static HTML.
+*/
+
+var menuItems = [
+    '<a href="phones.html">Phone System</a>',
+    '<a href="about.html">About</a>',
+    '<a href="system.html">System Info</a>',
+//    '<a href="diagnostics.html">Diagnostics</a>',
+    '<a href="admin.html">Admin</a>',
+    '<a href="faq.html">FAQ</a>',
+    '<a href="ipphones.html">IP Phones</a>',
+    '<a href="network.html">Network</a>',
+    '<a href="voiplines.html">VOIP Line</a>',
+    '<a href="logout.html">Logout</a>'
+];
+
+var menuTips = [
+    'phones_tip',
+    'about_tip',
+    'system_tip',
+//    'diagnostics_tip',
+    'admin_tip',
+    'faq_tip',
+    'ipphones_tip',
+    'network_tip',
+    'voipline_tip',
+    'logout_tip'
+];
+
+var menuToolTips = [
+    '<div id="phones_tip" class="tip">Lists your phones and phone lines</div>',
+    '<div id="about_tip" class="tip">Software version and links to web site</div>',
+    '<div id="system_tip" class="tip">Cpu, memory, loadavg info , linux version and installed packages</div>',
+//    '<div id="diagnostics_tip" class="tip">Test your phone system components</div>',
+    '<div id="admin_tip" class="tip">Change your password, reset the default settings, upgrade software</div>',
+    '<div id="faq_tip" class="tip">Frequently asked questions and links to further information</div>',
+    '<div id="ipphones_tip" class="tip">Set up your IP phones</div>',
+    '<div id="network_tip" class="tip">Connect the phone system to your network and the Internet</div>',
+    '<div id="voipline_tip" class="tip">Set up your VOIP phone line</div>',
+    '<div id="logout_tip" class="tip">I think you can work this one out....</div>'
+];
+
+function mainMenu() {
+    var html = '';
+
+    for(var i=0; i<menuToolTips.length; i++) {
+       html += menuToolTips[i] + "\n";
+    }
+
+    html += '<td valign="top" >';
+    html += '<table align="right" width=170>';
+    html += '<tr><td><h2>&nbsp;</h2></td></tr>';
+    for(var i=0; i<menuItems.length; i++) {
+       var tooltip  = 'onMouseOver="popUp(event,' + "'" + menuTips[i] + "'" + ')" ';
+           tooltip += 'onMouseOut="popUp(event,' + "'" + menuTips[i] + "'" + ')"';
+
+       html += '<tr ' + tooltip + '><td>' + menuItems[i] + '</td></tr>' + "\n";
+    }
+
+    html += '</table>';
+                               
+    document.getElementById('menu').innerHTML = html;
+}
diff --git a/attic/mini-asterisk-gui2/minicommon.js b/attic/mini-asterisk-gui2/minicommon.js
new file mode 100644 (file)
index 0000000..904eed8
--- /dev/null
@@ -0,0 +1,433 @@
+/*
+  minicommon.js
+  David Rowe 
+  Dec 16 2010
+
+  Common functions used by Mini Asterisk GUI.
+*/
+
+var    logged_in = 0;
+
+// index Zaptel port number (1,2,...), value extension (6001,6002...)
+
+var analog_ext = [];
+
+// zaptel port number (1,2,...), value FXS/FXO
+
+var zap = [];
+
+// all IP extensions, index ext, value true|false to indicate if live
+
+var ip_ext = [];
+
+var network = "no";
+
+// incomming calls are routed to these extensions ie (6003, Zap/3)
+// this should be made dynamically from the reception line in extensions.conf
+
+//testing
+//var reception = [["6003","Zap/3"],["6004","Zap/4"],["6011","SIP/6011"],["6012","SIP/6012"]] ;
+
+
+var recept_num = [];
+var ext_code =[];
+var recept_code =[];
+var recept_count = 0;
+var outgoing_num=0;
+var outgoing_code=[];
+var ext_count = 0;
+
+
+var items = [[1,2],[3,4],[5,6]];
+
+// these are the selections for the new reception numbers
+
+var selected = [];
+
+function loadExtensions() {
+
+    /* 
+       Kick off cascading CGIs and callbacks to load analog and ip
+       extension data.
+
+       From extensions.conf and zaptel.conf, determine which zap ports
+       are live and what type they are (FXS or FXO).
+
+       From extensions.conf determine, asterisk -r sip show peers
+       to determine which sip extenions are live
+
+       That will do for now......
+    */
+    
+    downloadUrl("/cgi-bin/getconf.cgi?file=../zaptel.conf", loadZapata);
+}
+
+// remove leading and trailing whitespace from a string
+
+function trim(stringToTrim) {
+       return stringToTrim.replace(/^\s+|\s+$/g,"");
+}
+
+
+/*
+  Given extenions.conf lines like this:
+
+  exten => 6011,1,Dial(SIP/6011)
+  exten => 6001,1,Dial(Zap/1)          
+  exten =>  EXT,1,Dial(TECH1/TECH2)
+
+  returns EXT, TECH1, TECH2
+*/
+
+function parseDialPlan(line) {
+    var split1 = line.split(",");
+    var split2 = split1[0].split("=>");
+    var ext = trim(split2[1]);
+    var tech = split1[2];
+    var index1 = tech.indexOf('(');
+    var index2 = tech.indexOf('/');
+    var index3 = tech.indexOf(')');
+
+    var tech1 = tech.substr(index1+1, index2-index1-1); 
+    var tech2 = tech.substr(index2+1, index3-index2-1);
+
+    return [ext,tech1,tech2];
+}
+
+
+// called to process /etc/zapata.conf
+// creates an associative array of active Zap ports
+
+function loadZapata(doc,status) {
+    loadHtmlTextFile(
+        doc, 
+        function(line) {
+
+           if (line.indexOf('fxoks') != -1) {
+               var split1 = line.split("=");
+               var ports = split1[1].split(",");
+               for(var i=0; i<ports.length; i++) {
+                   port = trim(ports[i]);
+                   zap[port] = 'FXS';
+               }
+           }
+
+           if (line.indexOf('fxsks') != -1) {
+               var split1 = line.split("=");
+               var ports = split1[1].split(",");
+               for(var i=0; i<ports.length; i++) {
+                   port = trim(ports[i]);
+                   zap[port] = 'FXO';
+               }
+           }
+
+       }
+    );
+                    
+    // now we can load extensions.conf
+
+    downloadUrl("/cgi-bin/getconf.cgi?file=extensions.conf", loadExtensionsConf);
+}
+
+// called to process extensions.conf
+// creates an associative array of analog and ip extensions
+
+function loadExtensionsConf(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           if ((line.indexOf("exten =>") != -1) &&
+               (line.indexOf("mini_ext") != -1)) {
+               var ret = parseDialPlan(line);
+               var ext = ret[0];
+               var tech1 = ret[1];
+               var tech2 = ret[2]; 
+               if (tech1 == "Zap") {
+                   if (zap[tech2] == undefined)
+                       analog_ext[tech2] = "";
+                   else
+                       analog_ext[tech2] = ext; 
+               }
+               if (tech1 == "SIP") {
+                   ip_ext[ext] = "";
+               }
+
+               // save the codes for each extension
+               // need these for constructing the reception string
+               // using underscore instead of forward slash to avoid http managle 
+
+               ext_code[ext_count++] = tech1 +"_"+ tech2;
+               
+           }
+
+           // Save the reception numbers if they exist
+           // Should match one line only
+           //  exten => s,1,Dial(Zap/4&SIP/6011) ;; mini-asterisk - don't remove this comment
+
+           if(line.indexOf("exten => s,1,Dial") != -1) {
+
+               i=0;
+
+               // for each Zap/ read in a single digit and convert to extension
+               while((ret = line.indexOf("Zap/"))!=-1) {
+//                    recept_code[i] = line.substr(ret,5);
+                    recept_num[i] = analog_ext[line.substr(ret+4,1)];
+                    line = line.substr(ret+6,line.length);
+                   i++;
+               }
+
+               // for each SIP/ read in four digits
+               while ((ret = line.indexOf("SIP/")) != -1) {
+//                    recept_code[i] = line.substr(ret,8);
+                    recept_num[i] = line.substr(ret+4,4);
+                    line = line.substr(ret+9,line.length);
+                   i++;
+               }
+
+               recept_count = i;
+
+           }
+       }
+    );
+
+    // we get ip extensions from "sip show peer" at asterisk CLI
+
+    downloadUrl("/cgi-bin/asterisk.cgi?cli=sip show peers", loadIpExtensions);
+}
+
+
+function parseSipShowPeers(line) {
+    var myregexp = /\s+/;
+    var s = line.split(myregexp);
+    var ext = s[0].substr(0,4);
+    var ip = s[1];
+    if (ip_ext[ext] != undefined) {
+       if (line.indexOf("OK") != -1)
+           ip_ext[ext] = ip;
+    }
+}
+
+// called to process asterisk CLI "sip show peers"
+// creates an associative array of IP extensions
+
+function loadIpExtensions(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           parseSipShowPeers(line);
+       }
+       );
+
+    // we get Network connection details
+
+      initialisePage();
+}
+
+function OnResetReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+      initialisePage();
+}
+
+function OnRestartReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+      initialisePage();
+}
+
+function GenericReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+
+}
+
+function OnUpgradeReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+      initialisePage();
+}
+
+function OnInstallReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+      initialisePage();
+}
+
+function OnSetPasswordReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+      initialisePage();
+}
+
+// Load a html encoded text file, strips off the HTML tags
+// and calls textLineProcessing() for every line
+
+function loadHtmlTextFile(doc, textLineProcessing) {
+
+    var lines = doc.split("\n");
+    var state = "looking for body";
+    var next_state;
+
+    for (var j in lines) {
+       next_state = state;
+       if (state == "looking for body") {
+           if (lines[j].indexOf('<body>') != -1)
+               next_state = "body";
+       }
+       if (state == "body") {
+           if (lines[j].indexOf('</body>') != -1)
+               next_state = "finished";
+           else {
+               // main processing of text here
+               textLineProcessing(lines[j]);
+           }
+       }
+       state = next_state;
+    }
+}
+
+
+// called when Fping CGI returns
+
+function processFping(doc, status) {
+
+    // Change icon based on ping results
+
+    var icon;
+
+    if (doc.indexOf("google.com") != -1)
+       icon = '<img src="tick.png" />';
+    else
+       icon = '<img src="cross.png" />';
+
+    document.getElementById('internet').innerHTML = icon;
+}
+
+
+/**
+ * Returns an XMLHttp instance to use for asynchronous
+ * downloading. This method will never throw an exception, but will
+ * return NULL if the browser does not support XmlHttp for any reason.
+ * @return {XMLHttpRequest|Null}
+ */
+
+function createXmlHttpRequest() {
+    try {
+       if (typeof ActiveXObject != 'undefined') {
+           return new ActiveXObject('Microsoft.XMLHTTP');
+       } else if (window["XMLHttpRequest"]) {
+           return new XMLHttpRequest();
+       }
+    } catch (e) {
+       changeStatus(e);
+    }
+    return null;
+}
+
+
+/**
+ * This functions wraps XMLHttpRequest open/send function.
+ * It lets you specify a URL and will call the callback if
+ * it gets a status code of 200.
+ * @param {String} url The URL to retrieve
+ * @param {Function} callback The function to call once retrieved.
+ */
+function downloadUrl(url, callback) {
+    var status = -1;
+    var request = createXmlHttpRequest();
+    if (!request) {
+       return false;
+    }
+
+    request.onreadystatechange = function() {
+       if (request.readyState == 4) {
+           try {
+               status = request.status;
+           } catch (e) {
+               // Usually indicates request timed out in FF.
+           }
+           if (status == 200) {
+               callback(request.responseText, request.status);
+               request.onreadystatechange = function() {};
+           }
+       }
+    }
+    request.open('GET', url, true);
+    try {
+       request.send(null);
+    } catch (e) {
+       changeStatus(e);
+    }
+
+}
+
+/**
+ * This functions wraps XMLHttpRequest open/send function.
+ * It lets you specify a URL and will call the callback if
+ * it gets a status code of 200.
+ * @param {String} url The URL to retrieve
+ * @param {Function} callback The function to call once retrieved.
+ */
+function downloadUrl2(url, callback) {
+    var status = -1;
+    var request = createXmlHttpRequest();
+    if (!request) {
+       return false;
+    }
+
+/*    request.onreadystatechange = function() {
+       if (request.readyState == 4) {
+           try {
+               status = request.status;
+           } catch (e) {
+               // Usually indicates request timed out in FF.
+           }
+           if (status == 200) {
+               callback(request.responseText, request.status);
+               request.onreadystatechange = function() {};
+           }
+       }
+    }
+ */
+
+   request.open('GET', url, true);
+    try {
+       request.send(null);
+    } catch (e) {
+       changeStatus(e);
+    }
+
+}
+
+function onClickLogin() {
+
+       // load password from file
+       
+       // Test submit against pw
+
+       // If ok then
+       var href = "";
+       href = location.href;
+       
+       logged_in = 1;
+       window.location.assign("phones.html");  
+       // else
+       
+       // fail
+}
+
+
diff --git a/attic/mini-asterisk-gui2/ministyle.css b/attic/mini-asterisk-gui2/ministyle.css
new file mode 100644 (file)
index 0000000..d72344f
--- /dev/null
@@ -0,0 +1,70 @@
+html,body{
+       margin:0;
+       padding:0;
+       width:100%;
+       height:100%;
+       font-family:Arial, Helvetica, sans-serif;
+}
+
+div#header{    
+       vertical-align:middle;
+       border-bottom:1px solid #000;
+}
+div#main-map{
+       width:70%;
+       height:100%;
+       float:left;
+}
+div#side{
+       width:30%;
+       float:left;
+}
+
+div#dataPanel{
+       width:90%;
+       height:50%;
+       overflow:auto;
+       border:2px solid #DDDDDD;
+}
+input{
+       width:90%;
+}
+
+input.navi{
+       font-size:12px;
+       height:30px;
+       margin-bottom:10px;
+}
+div ul{
+       margin-top:30px;
+       margin-bottom:30px;
+}
+div ul li{
+       display: inline;
+       list-style-type: none;
+       padding-right: 40px;
+       font-size:18px;
+       font-weight:bold;
+}
+
+div ul li.title{
+       font-size:22px;
+       color:#888;
+}
+
+div#header p{
+       color:#888;
+       font-size:14px;
+       padding-left:20px;
+}
+span.instruction{
+       font-weight:bold;
+       
+}
+
+.message-box { text-align: center; padding: 5px; color:#545454; width:80%;  margin:5px auto; font-size:12px;}
+.clean { background-color: #efefef; border-top: 2px solid #dedede; border-bottom: 2px solid #dedede; }
+.info  { background-color: #f7fafd; border-top: 2px solid #b5d3ff; border-bottom: 2px solid #b5d3ff; }
+.ok    { background-color: #d7f7c4; border-top: 2px solid #82cb2f; border-bottom: 2px solid #82cb2f; }
+.alert { background-color: #fef5be; border-top: 2px solid #fdd425; border-bottom: 2px solid #fdd425; }
+.error { background-color: #ffcdd1; border-top: 2px solid #e10c0c; border-bottom: 2px solid #e10c0c; }
\ No newline at end of file
diff --git a/attic/mini-asterisk-gui2/network.html b/attic/mini-asterisk-gui2/network.html
new file mode 100644 (file)
index 0000000..fe52c70
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>Mini Asterisk - Phones</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="tooltips.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="network.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <div id="tooltips"></div>
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td valign="top">
+
+      <form name="network">
+      <table align="center" width=600 >
+        <tr><td colspan="2" align="left" valign="top"><h2>Network</h2></td></tr>
+       <tr><td colspan="1" align="middle" valign="top"><input type="radio" id="dhcp" name="dhcp" value="yes" onClick="doDHCP()">DHCP</td></tr>
+       <tr><td colspan="1" align="middle" valign="top"><input type="radio" id="static" name="dhcp" value="no" onClick="doStatic()">Static</td></tr>
+        <tr><td>IP Address:</td><td><input type="text" name="ipaddress" onBlur="isIP(this)"></td></tr>
+        <tr><td>Netmask:</td><td><input type="text" name="netmask" onBlur="isIP(this)"></td></tr>
+        <tr><td>Gateway:</td><td><input type="text" name="gateway" onBlur="isIP(this)"></td></tr>
+        <tr><td>DNS:</td><td><input type="text" name="dns" onBlur="isIP(this)"></td></tr>
+        <tr onMouseOver="popUp(event,'network_backdoor')" onMouseOut="popUp(event,'network_backdoor')">
+          <td>Emergency IP:</td><td><input type="text" name="backdoor" onBlur="isIP(this)"></td>
+        </tr>
+        <tr onMouseOver="popUp(event,'network_internet')" onMouseOut="popUp(event,'network_internet')">
+         <td>DNS Connection:</td>
+         <td><div id="dnsok"></div></td>
+        </tr>        <tr onMouseOver="popUp(event,'network_internet')" onMouseOut="popUp(event,'network_internet')">
+         <td>Internet Connection:</td>
+         <td><div id="internet"></div></td>
+        </tr>
+        <tr><td></td><td><input type="button" style="width:20%" value="Apply" onClick="onClickApply()"></td></tr>
+      </table>
+    </form>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/network.js b/attic/mini-asterisk-gui2/network.js
new file mode 100644 (file)
index 0000000..a48fe1d
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+  network.js
+  David Rowe 
+  March 7 2011
+
+  Network screen for Mini Asterisk GUI.
+*/
+
+var dhcp;
+var ipaddress;
+var netmask;
+var gateway;
+var dns;
+var backdoor;
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+    var html = toolTips[0] + toolTips[1];
+    document.getElementById('tooltips').innerHTML = html;
+
+    // kick off cascading CGIs, initialisePage() will be called when complete
+
+    // determine if DHCP or static
+
+    downloadUrl("/cgi-bin/getdhcp.cgi", processDhcp);
+//    initialisePage();
+}
+
+function doDHCP() {
+    greyout("yes");
+}
+
+function doStatic() {
+    greyout("no");
+}
+
+
+function greyout(dhcp) {
+
+    if (dhcp == "yes") {
+       document.getElementById("static").checked = 0;
+       document.getElementById("dhcp").checked = 1;
+       document.network.ipaddress.disabled = 1;
+       document.network.netmask.disabled = 1;
+       document.network.gateway.disabled = 1;
+       document.network.dns.disabled = 1;
+    }
+    else {
+       document.getElementById("static").checked = 1;
+       document.getElementById("dhcp").checked = 0;
+       document.network.ipaddress.disabled = 0;
+       document.network.netmask.disabled = 0;
+       document.network.gateway.disabled = 0;
+       document.network.dns.disabled = 0;
+    }
+}
+
+// called when DHCP CGI returns
+
+function processDhcp(doc,status) {
+    dhcp = "no";
+
+    loadHtmlTextFile(doc, function(line) {
+           parseNetwork(line);
+       }
+       );
+
+    greyout(dhcp);
+
+    if (dhcp == "no") {
+        downloadUrl("/cgi-bin/getconf.cgi?file=../init.d/network-static", processStatic);
+    } else {
+           //initialise(); endless loop
+       }
+}
+
+
+// called when static IP CGI returns
+
+function processStatic(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           parseNetwork(line);
+       }
+       );
+        
+    downloadUrl("/cgi-bin/getemergencyip.cgi", processEmergencyIp);
+}
+
+// called when Emergency CGI returns
+
+function processEmergencyIp(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           parseNetwork(line);
+       }
+       );
+        
+    // fire off fping CGI
+
+    downloadUrl("/cgi-bin/fpingnodes.cgi?ip=google.com", processFping);
+}
+
+function parseNetwork(line) {
+
+    if (line.indexOf("DHCP=") != -1) {
+      var s = line.split('"');
+      dhcp = s[1];
+    }
+
+    if (line.indexOf("IPADDRESS=") != -1) {
+      var s = line.split('"');
+      ipaddress = s[1];
+      document.network.ipaddress.value = ipaddress;
+    }
+
+    if (line.indexOf("NETMASK=") != -1) {
+      var s = line.split('"');
+      netmask = s[1];
+      document.network.netmask.value = netmask;
+    }
+
+    if (line.indexOf("GATEWAY=") != -1) {
+      var s = line.split('"');
+      gateway = s[1];
+      document.network.gateway.value = gateway;
+    }
+
+    if (line.indexOf("DNS=") != -1) {
+      var s = line.split('"');
+      dns = s[1];
+      document.network.dns.value = dns;
+   }
+
+   if (line.indexOf("BACKDOOR=") != -1) {
+      var s = line.split('"');
+      backdoor = s[1];
+      document.network.backdoor.value = backdoor;
+   }
+}
+
+
+// http://moblog.bradleyit.com/2009/06/javascript-ip-address-validation.html
+
+function isIP(obj) {
+    var ary = obj.value.split(".");
+    var ip = true;
+
+    ip = (ary.length == 4); 
+
+    if (ip) {
+       for (var i=0; i<4; i++) { 
+               ip = (!ary[i].match(/^\d{1,3}$/) || (Number(ary[i]) > 255)) ? false : ip; 
+       } 
+    }
+
+    if (!ip) {    
+       // the value is NOT a valid IP address
+       obj.style.background = "red";
+       obj.select();
+    } 
+    else { obj.style.background = ""; } // the value IS a valid IP address
+
+    return ip;
+}
+
+
+// called when Apply button pressed
+
+function onClickApply() {
+
+    // change network type, DHCP or static
+
+    if (document.getElementById("dhcp").checked == 1) {
+
+               if (dhcp = "no") {
+                       // disable network-static service and endable network service
+                       downloadUrl("/cgi-bin/setservice.cgi?action=enabledhcp",GenericReturn);
+               }
+               else {
+                       // dhcp already running, restart service
+                       downloadUrl("/cgi-bin/setservice.cgi?action=restartdhcp",GenericReturn);
+               }
+    }
+    else {
+
+               // start cgi cascade
+               // disable network service and enable network-static service
+               downloadUrl("/cgi-bin/setservice.cgi?action=enablestatic",dhcpReturn);
+
+
+
+
+       }
+}
+
+function dhcpReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       var new_ipaddress = document.network.ipaddress.value;
+       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=IPADDRESS=&that="' + new_ipaddress + '"';
+               
+       downloadUrl(url,ipaddressReturn);
+}
+
+function ipaddressReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       var new_netmask = document.network.netmask.value;
+       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=NETMASK=&that="' + new_netmask + '"';
+       downloadUrl(url,netmaskReturn);
+}
+
+function netmaskReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       var new_gateway = document.network.gateway.value;
+       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=GATEWAY=&that="' + new_gateway + '"';
+       downloadUrl(url,gatewayReturn);
+}
+
+function gatewayReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       var new_dns = document.network.dns.value;
+       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=DNS=&that="' + new_dns + '"';
+       downloadUrl(url,dnsReturn);
+}
+
+
+//     var new_backdoor = document.network.backdoor.value;
+//     var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
+//     downloadUrl(url,GenericReturn);
+
+
+
+//     downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",GenericReturn);
+//     
+
+
+function dnsReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       // finally restart network-static service with new parameters
+
+       downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",restartstaticReturn);
+}
+
+function restartstaticReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       // finally reload the page (this updates the fping....crudely)
+
+       initialise();
+}
+
diff --git a/attic/mini-asterisk-gui2/phones.html b/attic/mini-asterisk-gui2/phones.html
new file mode 100644 (file)
index 0000000..7f2a131
--- /dev/null
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>Mini Asterisk - Phones</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css" />
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="phones.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <div id="tooltips"></div>
+
+  <table align="center" width="950">
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="phones_table"></div></td>
+    <td>
+
+       <input name="update_recept" type="button" style="width:100%" value="update reception" onClick="onClickUpdateReception()" />
+       <!--input name=update_out type="button" style="width:100%" value="update outgoing" onClick="onClickUpdateOutgoing()"-->
+
+    </td>
+  </tr>
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/phones.js b/attic/mini-asterisk-gui2/phones.js
new file mode 100644 (file)
index 0000000..b305d55
--- /dev/null
@@ -0,0 +1,283 @@
+/*
+  phones.js
+  David Rowe 
+  Dec 12 2010
+
+  Phones screen for Mini Asterisk GUI.
+*/
+
+var update_time = 10;
+
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    // kick off cascading CGIs, initialisePage() will be called when complete
+
+    loadExtensions();
+    //initialisePage();
+}
+
+
+function initialisePage() {
+    // construct list of phone extensions
+    
+    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
+    var html = '';
+    var itemcount = 0;
+       
+    html += '<form name="phones" method="get">';
+
+    html += '<table align="right" width=600 cellspacing=2>';
+
+    // print out internet connection
+
+    html += '<tr><td colspan="3" align="left" valign="top"><h2>Phone System (GUI2)</h2></td></tr>';
+    html += '<tr><td colspan="2">Internet Connection:</td><td> </td><td><div id="internet"></div></td></tr>';
+    html += '<tr><td colspan="2">Phone System IP Address:</td><td> </td><td div id="ipaddress"></div></td></tr>';
+    html += '<tr><td>&nbsp</td></tr>';
+
+    // print out analog phones
+
+    html += '<tr><td colspan="4" align="left" valign="top"><h2>Phones</h2></td></tr>';
+    for(var i=0; i<zap.length; i++) {
+        if (zap[i] == 'FXS') {
+            html += "<tr>";
+               html += "<td>" + analog_ext[i] + "</td>" + "<td>" + "Analog Phone" + "</td>";
+               html += "<td>Port" + i  + "</td>";
+
+            html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
+
+            // the reception checkbox code
+               html += "<td>" + '<input name="selected_in[]" ' ;
+                       html += 'value= "' + ext_code[i-1] + '" ';
+            html += 'type="checkbox" ' ;
+
+            if (recept_num.indexOf(analog_ext[i]) != -1) {
+                       html += '" checked/>';
+                       }
+               else {
+                       html += '" unchecked/>';
+               }
+
+               // save the reception code
+               recept_code[itemcount++]=ext_code[i-1];
+
+            html += "</td>";
+       
+            html += "</tr>";
+           }
+    }
+
+
+
+    // print out IP phones
+    //  j is 6011,6012 etc
+
+    for (j in ip_ext) {
+        if (ip_ext[j] != '') {
+            html += "<tr>";
+               html += "<td>" + j + "</td>" + "<td>" + "IP Phone" + "</td>";
+               html += "<td>" + ip_ext[j] + "</td>";
+
+            html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
+
+            // the reception checkbox code
+               html += "<td>" + '<input name="selected_in[]" ';
+                       html += 'value="SIP_' + j + '" ';
+            html += 'type="checkbox" ' ;
+                       
+            if (recept_num.indexOf(j)!=-1) {
+                       html += '" checked/>';
+                   }
+               else {
+                       html += '" unchecked/>';
+               }
+
+               // save the reception code
+           
+               recept_code[itemcount++]=ext_code[(i-1)];
+               i++;
+
+            html += "</td>";
+
+            html += "</tr>";
+           }
+    }
+
+    html += "<tr>";
+    html += "<td>";
+    html += "<a href=ipphones.html>Add IP Phone</a>";
+    html += "</td>";
+
+    // print out submit button
+       //doesn't work ... Only use static html buttons
+
+/*    html += "<td>";
+    html += "<input type='submit' value='Update Reception' onClick='onUpdateReception()'/>";
+    html += "</td>";
+*/
+    html += "</tr>";
+
+
+
+
+
+    // print out phone lines
+
+    html += '<tr><td colspan="4" align="left" valign="top"><h2>Phone Lines</h2></td></tr>';
+    for(var i=0; i<zap.length; i++) {
+        if (zap[i] == 'FXO') {
+            html += "<tr>";
+           html += "<td>" + "0" + "</td>" + "<td>" + "Analog Phone Line" + "</td>";
+           html += "<td>Port" + i + "</td>";
+            html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
+
+            // the outgoing radiobox code
+/*         html += "<td>" + '<input name="selected_out[]" type="radio" ' ;
+
+            if (outgoing_num == i) {
+                   html += '" checked/>';
+               }
+           else {
+                   html += '" unchecked/>';
+           }
+
+           // save the outgoing code
+           
+           outgoing_code[itemcount++]=ext_code[(i-1)];
+
+            html += "</td>";
+
+*/            html += "</tr>";
+       }
+
+
+    }
+
+    // add a voip line
+
+    html += "<tr>";
+    html += "<td>";
+    html += "<a href=voiplines.html>Add Voip line</a>";
+    html += "</td>";
+    html += "</tr>";
+
+    html += '</table>';
+       
+    html += '</form>';
+    document.getElementById("phones_table").innerHTML += html;
+
+    // fire off fping CGI
+
+    downloadUrl("/cgi-bin/fpingnodes.cgi?ip=google.com", processFping);
+
+    // fire off Ifconfig IP address to get IP Address
+
+    downloadUrl("/cgi-bin/ifconfig.cgi?arg=eth0", processIfconfig);
+//    downloadUrl("/cgi-bin/ifconfig.cgi?arg=eth1", processIfconfig);
+
+       // downloadUrl works fine here.
+//    downloadUrl("/cgi-bin/setring.cgi?Zap_3=on", null);
+
+}
+
+
+// called when ifconfig CGI returns
+
+function processIfconfig(doc, status) {
+
+    var ip="";
+
+    if (doc.indexOf("inet addr:") != -1) {
+       ip = doc.substr(doc.indexOf("inet addr:"), doc.length);
+       ip = ip.substr(10, ip.length);
+       ip = ip.substr(0, ip.indexOf(" "));
+    }
+
+    document.getElementById('ipaddress').innerHTML = ip;
+}
+
+function onClickUpdateReception() {
+
+       // get the arguments from the form  selected_in[]
+       ///document.myform.elements['fav[]'].checked
+       var arg ="";
+
+
+       //      number of check boxes in the form
+       var total = document.phones.elements['selected_in[]'].length;
+
+       var recept_box = document.phones.elements['selected_in[]'];
+
+       j=0;
+       for (i=0;i<total; i++) {
+
+               // construct new arg from selected
+               if(recept_box[i].checked) {
+                       
+                       j++;
+                       if (j>1)
+                               arg = arg+"&";
+
+                       // got to make up new codes
+                       arg = arg + recept_box[i].value + "=on";
+               }
+
+       }
+
+    var arg2 =  "/cgi-bin/setring.cgi?" + arg;
+       downloadUrl(arg2,OnSetringReturn);
+
+
+}
+
+function OnSetringReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       downloadUrl("/cgi-bin/asterisk.cgi?cli=dialplan reload",GenericReturn);
+       //initialisePage();
+}
+
+function onClickUpdateOutgoing() {
+
+       // get the arguments from the form  selected_out[]
+       ///document.myform.elements['fav[]'].checked
+       var arg ="";
+
+
+       //      number of check boxes in the form
+       var total = document.phones.elements['selected_out[]'].length;
+
+       var out_box = document.phones.elements['selected_out[]'];
+
+       //j=0;
+       for (i=0;i<total; i++) {
+
+               // construct new arg from selected
+               if(out_box[i].checked) {
+                       
+                       //j++;
+                       //if (j>1)
+                       //      arg = arg+"&";
+
+                       // got to make up new codes
+                       arg = arg + recept_code[i] + "=on";
+               }
+
+       }
+        var arg2 =  "/cgi-bin/setoutgoing.cgi?" + arg;
+//     downloadUrl(arg2,GenericReturn);
+
+
+}
+
+
+
+
diff --git a/attic/mini-asterisk-gui2/system.html b/attic/mini-asterisk-gui2/system.html
new file mode 100644 (file)
index 0000000..39a5821
--- /dev/null
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>System</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="system.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="system"></div>
+        <table align="right" width=600>
+           <tr><td colspan="3" align="left" valign="top"><h2>System</h2></td></tr>
+           <tr><td colspan="2"></td></tr>
+
+           <tr><td colspan="2">cat /proc/version</td></tr>
+           <tr><td id="version" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">cat /proc/loadavg</td></tr>
+           <tr><td id="loadavg" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">cat /proc/cpuinfo</td></tr>
+           <tr><td id="cpuinfo" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">cat /proc/mtd</td></tr>
+           <tr><td id="mtd" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">cat /proc/meminfo</td></tr>
+           <tr><td id="meminfo" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">cat /proc/yaffs</td></tr>
+           <tr><td id="yaffs" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">uptime</td></tr>
+           <tr><td id="uptime" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           <tr><td colspan="2">ipkg list_installed</td></tr>
+           <tr><td id="installed" style="border: 1px solid ;"></td></tr>
+           <tr><td>&nbsp;</td></tr>
+
+           </table>
+
+
+    </td>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/system.js b/attic/mini-asterisk-gui2/system.js
new file mode 100644 (file)
index 0000000..f8b01bb
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+  system.js
+  Ian Roberts
+  May 7 2012
+
+  System screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+var version = "Linux ....";
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    loadSystemInfo();   // Kick off cgi scripts
+    initialisePage();
+}
+
+
+function initialisePage() {
+
+
+//    document.getElementById("system").innerHTML += html;
+
+}
+
+function loadSystemInfo() {
+
+       downloadUrl("/cgi-bin/catproc.cgi?arg=version", loadVersion);
+
+}
+
+function loadVersion(doc, status) {
+
+       document.getElementById('version').innerHTML = doc.substr(doc.indexOf("Linux"), doc.length);
+
+       downloadUrl("/cgi-bin/catproc.cgi?arg=loadavg", loadLoadavg);
+}
+
+function loadLoadavg(doc, status) {
+
+       document.getElementById('loadavg').innerHTML = doc.substr(0, doc.length);
+
+       downloadUrl("/cgi-bin/catproc.cgi?arg=cpuinfo", loadCPUinfo);
+}
+
+function loadCPUinfo(doc, status) {
+       ip = "";
+
+       ip = doc.substr(0, doc.length);
+        if (doc.indexOf("CPU") != -1) {
+
+               // Blackfin hardware is ADSP-BF533
+               ip = doc.substr(doc.indexOf("CPU"), doc.length);
+//             ip = ip.substr(10, ip.length);
+//             ip = ip.substr(0, ip.indexOf("power manage"));
+       }
+
+       document.getElementById('cpuinfo').innerHTML = ip;
+
+       downloadUrl("/cgi-bin/catproc.cgi?arg=mtd", loadmtd);
+}
+
+function loadmtd(doc, status) {
+
+       document.getElementById('mtd').innerHTML = doc.substr(0, doc.length);
+
+       downloadUrl("/cgi-bin/catproc.cgi?arg=meminfo", loadmeminfo);
+}
+
+function loadmeminfo(doc, status) {
+
+       document.getElementById('meminfo').innerHTML = doc.substr(0, doc.length);
+
+       downloadUrl("/cgi-bin/catproc.cgi?arg=yaffs", loadyaffs);
+}
+
+function loadyaffs(doc, status) {
+
+       document.getElementById('yaffs').innerHTML = doc.substr(0, doc.length);
+
+       downloadUrl("/cgi-bin/uptime.cgi?arg=nothing", loaduptime);
+}
+
+function loaduptime(doc, status) {
+
+       document.getElementById('uptime').innerHTML = doc.substr(0, doc.length);
+
+       downloadUrl("/cgi-bin/ipkg.cgi?arg=list_installed", loadinstalled);
+}
+
+function loadinstalled(doc, status) {
+
+       document.getElementById('installed').innerHTML = doc.substr(0, doc.length);
+
+//     end of script cascade
+}
+
+
diff --git a/attic/mini-asterisk-gui2/tick.png b/attic/mini-asterisk-gui2/tick.png
new file mode 100644 (file)
index 0000000..c155dff
Binary files /dev/null and b/attic/mini-asterisk-gui2/tick.png differ
diff --git a/attic/mini-asterisk-gui2/todo 2012_10.txt b/attic/mini-asterisk-gui2/todo 2012_10.txt
new file mode 100644 (file)
index 0000000..cbca6d2
--- /dev/null
@@ -0,0 +1,116 @@
+IP04 GUI2 To do notes\r
+Ian Roberts \r
+\r
+*************************************************************************\r
+\r
+Oct 1 2012\r
+\r
+network page\r
+  \r
+  Test static to dhcp selection\r
+  \r
+  dhcp   if cant reference objects (radio) directly...use getElementById()\r
+         dhcp get 1.30 if possible?\r
+                \r
+  gateway :fping does not time out when internet down\r
+  \r
+  add in emergency ip code\r
+\r
+phones page\r
+\r
+  debug reception errors with 1fxo, 1fxs in zaptel.conf\r
+  \r
+new config page \r
+\r
+  impedance select US or AU\r
+  ntp select region\r
\r
+new login page\r
+  makes a cookie based on \r
+  \r
+  \r
+*****************************************************************************  \r
+  \r
+Oct 18 2012\r
+  \r
+\r
+Phones page\r
+\r
+       Reception update fail : \r
+               Daisy chain url calls\r
+               Fix asterisk cgi prefix .... cli=dial plan\r
+\r
+       internet fping 8.8.8.8\r
+  \r
+Network page\r
+  \r
+       Bad dns .... Try fping 8.8.8.8 instead?\r
+       ....try fping dns check before internet fping\r
+       .... maybe nslookup \r
+                fping 8.8.8.8 ?\r
+\r
+       two crosses dns and internet?\r
+\r
+       fping dns\r
+       if ok fping google\r
+       else fail report\r
+       \r
+[  Dialplan outbound g1/g2 ?   ]\r
+\r
+IP provider page\r
+\r
+Login page\r
+\r
+\r
+*************************************************************************************\r
+\r
+Oct 29 2012\r
+\r
+IP provider page work\r
+       sip.conf modified with new keywords\r
+       install script changed to update sip.conf\r
+       Are sip provider entries ok to leav uncommented?...they have dummy hosts\r
+       \r
+Notice ip phone (ekiga from pc) registrations stay on ip04 after phone has disappeared\r
+\r
+\r
+Error on Fxo/FXS rearrangement  phones lines read as phone\r
+\r
+Register command needs to be unique\r
+\r
+SetRegister.cgi   ?  with mini-asterisk\r
+\r
+       $ cat test.txt | sed 's/\(register=>\).*\( ; mini-asterisk\)/\1bob:superbob@192.168.1.3\2/'\r
+       register=>bob:superbob@192.168.1.3 ; mini-asterisk yada yada\r
+       ;register => 2345:password@sip_proxy/1234\r
+\r
+Register needs to be able to handle other manual register entries\r
+\r
+Or make a mod to set_line_ext.cgi with third arg (jazmin,sip,sip-nat)\r
+\r
+Uncomment / comment sip provider as a cgi?\r
+\r
+                                                               s/$this.*/$this$that/g\r
+[11:09:09 AM | Edited 11:10:06 AM] David Rowe:  s/(host=).*\w/$1trev/g\r
+[11:10:13 AM] David Rowe: host=mal\r
+[11:10:16 AM] David Rowe: host=trev\r
+\r
+\r
+hex codes as uniques?  hard to remember\r
+\r
+$ cat test.txt | sed 's/\(host=\)[a-z]*\(.*sip mini-asterisk.*\)/\1trev\2/'\r
+host=fred ; jazmin mini-asterisk\r
+host=trev ; sip mini-asterisk\r
+\r
+$ cat test.txt | sed 's/\(dtmfmod=\)[a-z0-9\.]*\(.*Jazmin mini-asterisk.*\)/\1trev\2/'\r
+host=192.168.1.28       ; Jazmin mini-asterisk do not remove this comment\r
+dtmfmod=trev         ; Jazmin mini-asterisk do not remove this comment\r
+\r
+debugging\r
+#!/bin/sh\r
+[12:05:07 PM] David Rowe: #!/bin/sh -x\r
+[12:05:16 PM] David Rowe:   sed -i "s/$this.*/$this$that/g" $file\r
+\r
+export QUERY_STRING='file=test.txt&this=host=&that=192.168.1.31&key=Jazmin mini'; ./setlinekey.cgi\r
+\r
+We are getting problems with sed (busybox version) regular expressions on the ip04. We are losing /1 /2 entities.
\ No newline at end of file
diff --git a/attic/mini-asterisk-gui2/todo 2012_11.txt b/attic/mini-asterisk-gui2/todo 2012_11.txt
new file mode 100644 (file)
index 0000000..31ccf5d
--- /dev/null
@@ -0,0 +1,60 @@
+IP04 GUI2 To do notes\r
+Ian Roberts \r
+\r
+*************************************************************************\r
+\r
+Nov 16 2012\r
+\r
+Dave added new cgis to use perl instead of sed.\r
+       - sed is broken under busybox 1.4.1\r
+       - perl is working fine.\r
+    - comment.cgi\r
+       - uncomment.cgi\r
+       - setlinekey2.cgi\r
+\r
+voip provider page\r
+\r
+  Test sip\r
+     - registering successfully with another asterisk box (use host=dynamic)\r
+        - out bound calls ?\r
+        - inbound calls ?\r
+  \r
+  Test jazmin\r
+       - do we get a successful registration ?\r
+               fails with none dropbox set ... read in current registration\r
+               fails with mulit changes...leave voip keyword intact (Done)\r
+               \r
+       - can we make outbound voip calls ?\r
+       - are inbound voip calls working ?\r
+\r
+(Maybe add in voip line 2 page... later)\r
+  \r
+*****************************************************************************  \r
\r
\r
+ Nov 29 2012\r
\r
+ voip line (sip trunk) page is now working.\r
+       - reads settings from sip.conf \r
+       - there are four options for sip trunk... none, sip, sip with nat, and provider\r
+       - you can change user, password, host, fromuser, and fromdomain\r
+       - these changes get saved back into sip.conf when you press the ok\r
\r
+ testing\r
+    - sip              registers       ok\r
+                               outbound        ok\r
+                               inbound         not tested yet\r
+\r
+    - sipnat   registers       not tested yet\r
+                               outbound        not tested yet\r
+                               inbound         not tested yet\r
+\r
+    - provider registers       ok      voip.oeg.com.au\r
+                               outbound        ok      (adelaide ok, wgong fails)\r
+                               inbound         not tested yet\r
+\r
+       - none          clears rego     ok\r
+\r
+       \r
+*************************************************************************************\r
+\r
diff --git a/attic/mini-asterisk-gui2/todo notes b/attic/mini-asterisk-gui2/todo notes
new file mode 100644 (file)
index 0000000..ea1f4e4
--- /dev/null
@@ -0,0 +1,164 @@
+IP04 GUI2 To do notes
+Ian Roberts 
+
+*************************************************************************
+
+Sept 13 2012
+
+Goal is a gui2 package we can install on an ip0x
+  ipkg install gui2
+see baps build makefile
+http://svn.astfin.org/software/baps/trunk/mini-asterisk-gui.mk
+
+1. install script fix :enable cgi     Done
+----------------------------------
+       use sed on /etc/lighttpd.conf
+        1. Change end bracket to comma 
+        2. Uncomment s_#cgi.assign.*_cgi.assign
+        3. Add in end bracket
+       then /etc/init.d/lighttpd restart
+       
+       kiss. just copy the corrected conf file from the sourceforge archive.
+
+2.  install script fix :add mini_ext comments Done 
+------------------------------------------
+       use sed on /etc/asterisk/extension.conf
+
+   show extensions missing mini_ext comment
+       grep "60**" /etc/asterisk/extensions.conf | grep -v "mini"
+
+       grep "60[0-9][0-9],1,Dial(.*) " /etc/asterisk/extensions.conf
+
+
+3. on firefox : update reception button broken   Done 14/9
+---------------------------------------------
+   Chrome 21 is ok
+   Internet Explorer 9 is ok. 
+   IE 8? - check on vista laptop
+   Safari 5.1.7 is ok
+   Firefox 15 fails ...why?.
+   Installed firebug debugger
+   TypeError
+   phones.js line 209
+   document.phones.elements['selected_in[]'] undefined ... 
+
+   I cant see any phones element in the document model.
+
+                
+       David --> Try moving <form> to encapsulate the <table> in phones.js
+       
+       This worked.
+
+4. network page not working       Not done
+------------------------------
+   Also how fast can it detect the internet after change in gateway
+   Try to break internet with dns or gateway changes.
+   Missing a cgi.....setservice.cgi
+   
+   Calls from network.js are 
+   if (document.network.dhcp.value == "yes") {
+
+       if (dhcp = "no") {
+           // disable network-state service and endable network service
+           downloadUrl("/cgi-bin/setservice.cgi?action=enabledhcp",null);
+       }
+       else {
+           // dhcp already running, restart service
+           downloadUrl("/cgi-bin/setservice.cgi?action=restartdhcp",null);
+       }
+    }
+    else {
+
+       if (dhcp = "yes") {
+           // disable network service and enable network-static service
+           downloadUrl("/cgi-bin/setservice.cgi?action=enablestatic",null);
+       }
+
+       .....
+       
+       if (document.network.backdoor.value != backdoor) {
+           var new_ = document.network.backdoor.value;
+           var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
+           downloadUrl(url,null);
+           downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",null);
+       }
+
+       // finally restart network-static service with new parameters
+
+       downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",null);
+    }
+
+       Are URLs with null return  function suppose to be synchronous?
+       
+       The networking functions have to have synchrous sections, esp when start/stop/enable/disable
+       
+       For example, u cant do a network start before a network stop has finished?
+       
+       Try to synchronise with cascading cgi flow. This works.
+       
+       Need to time-out fping after 2-3seconds, else it will go 30s.
+   
+   
+   
+
+5. Outbound calls....
+-------------------------
+
+   Groups of people assigned to different outbound
+   Work with dialplans
+   At present  
+      0 gets outside analog line
+      1 gets a sip call thru the vsp
+   Instead of hard coded 0,1 maybe use a dropbox selection 
+   then try assigning to groups of users.
+   Need to have a page where we set up groups of users.
+
+6. ntp testing
+--------------------
+   try getting ntpclient rather than ntp?
+   try setting TZ in /etc/init.d/asterisk already done...just need reboot
+   web page for setting timezone (radio button and apply checkbox?)
+
+7. use setline.cgi instead of setring.cgi
+--------------------------------------
+   Have setline take care of special cases like escaping the ampersand.
+
+8. Setring.cgi fix    Done 14/9
+--------------------
+   Remove asterisk -r calls from setring.cgi.....do this from javascript with asterisk.cgi.
+   
+9. Pick up second IP04
+----------------------------
+       gui2 install testing
+       unit testing call generation
+       
+10. Move formatting from html to css
+---------------------------------------
+     html <table align="center" width=800>
+     css
+        
+11.    Add some formatting (carriage returns) to the table element in phones.js         
+-------------------------------------------------------         
+        
+General Interest
+
+html validator at http://validator.w3.org/check
+There are validator extensions for most browsers.
+
+Best practices at http://sixrevisions.com/web-standards/20-html-best-practices-you-should-follow/
+      Close my tags !
+         <img src="images/sample.jpg" alt="sample" />
+
+
+
+ IP04 could be redone more simply with a plug computer. $150 - $250AU 
+ http://www.spinifex.com.au/shop/index.php?main_page=product_info&cPath=65&products_id=208
+ 1.2GHz ARM 512M ddr2 512M flash sd boot 2x usb 2x cat5  5W ..... good ip-pbx? good smoothwall or snorby box?
+ Need some sort of USB to FXO to hook up to analog phone lines.
+ $150 http://sangoma.com/products/telecom_boards/analog/usbfxo/specs.html
+ $20 gets you a skype gateway box with an fxo
+ http://openusbfxo.wordpress.com/
+ The blackfin has no memory management unit. This causes many problems and cludgey fixes.
+
+opus codec, silk codec, Jean-marc, codec2 
diff --git a/attic/mini-asterisk-gui2/tooltip.css b/attic/mini-asterisk-gui2/tooltip.css
new file mode 100644 (file)
index 0000000..beaefc0
--- /dev/null
@@ -0,0 +1,7 @@
+.tip {font:14px/16px
+Arial,Helvetica,sans-serif; border:solid 1px
+#666666; width:270px; padding:1px;
+position:absolute; z-index:100;
+visibility:hidden; color:#333333; top:20px;
+left:90px; background-color:#ffffcc;
+layer-background-color:#ffffcc;}
diff --git a/attic/mini-asterisk-gui2/tooltip.js b/attic/mini-asterisk-gui2/tooltip.js
new file mode 100644 (file)
index 0000000..26142e8
--- /dev/null
@@ -0,0 +1,7 @@
+// Extended Tooltip Javascript
+// copyright 9th August 2002, 3rd July 2005, 24th August 2008
+// by Stephen Chapman, Felgall Pty Ltd
+
+// permission is granted to use this javascript provided that the below code is not altered
+function pw() {return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth}; function mouseX(evt) {return evt.clientX ? evt.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) : evt.pageX;} function mouseY(evt) {return evt.clientY ? evt.clientY + (document.documentElement.scrollTop || document.body.scrollTop) : evt.pageY} function popUp(evt,oi) {if (document.getElementById) {var wp = pw(); dm = document.getElementById(oi); ds = dm.style; st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else {tv = mouseY(evt) + 20; lv = mouseX(evt) - (ew/4); if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2; lv += 'px';tv += 'px';  ds.left = lv; ds.top = tv; ds.visibility = "visible";}}}
+                  
diff --git a/attic/mini-asterisk-gui2/tooltips.js b/attic/mini-asterisk-gui2/tooltips.js
new file mode 100644 (file)
index 0000000..658c1f8
--- /dev/null
@@ -0,0 +1,68 @@
+var toolTips = [
+'<div id="network_internet" class="tip">A tick means your phone system can reach the Internet.  You need the Internet for VOIP calls and software upgrades.  If you have a problem reaching the Internet check your Network settings, in particular Gateway and DNS.</div>',
+
+'<div id="network_backdoor" class="tip">Emergency backdoor IP. Useful if you get locked out of the main network connection, for example due to DHCP problems on your network or a configuration mistake.  Write this number down somewhere!</div>',
+
+'<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.  You can answer a call on another ringing phone by dialling *8 on your phone - see FAQ for details.</div>',
+
+'<div id="phone_update_reception" class="tip">Press this button to lock in any changes you have made to the Reception check-boxes above.</div>',
+
+'<div id="phone_anphone" class="tip">Analog Phone: Normal telephone plugged into a port on your phone system.</div>', 
+
+'<div id="phone_ipphone" class="tip"> IP Phone plugged into your network.</div>',
+
+'<div id="phone_line" class="tip"> Analog Phone Line: Analog telephone line plugged into a port on your phone system.</div>',
+
+'<div id="phone_voipline" class="tip"> VOIP Phone Line: Make and receive phone calls over the Internet.</div>',
+
+'<div id="phone_system" class="tip">Important information about your Phone System.</div>',
+
+'<div id="phone_ipaddress" class="tip">The address of your Phone System on your network.  Use this address to connect IP Phones to your Phone System.</div>',
+
+'<div id="phone_phones" class="tip">List of phones connected to your Phone System.  You can connect Analog or IP Phones to your system. When IP Phones are configured correctly, they appear on this list.  If an IP phone is not configured correctly, it will not appear on this list.  Analog phones require hardware to be installed in your Phone system.</div>',
+
+'<div id="phone_lines" class="tip">List of phone lines available. Phone lines are used to make and receive outside calls. You can use regular Analog phone lines or VOIP.  VOIP phone lines require an account with an Internet Telephone Service Provider.  Analog phone lines require hardware to be installed in your Phone System.</div>',
+
+'<div id="phone_ext" class="tip">Dial this number to call this phone</div>',
+
+'<div id="phone_line_prefix" class="tip">Dial 0 for an Analog outside line.  For example to call 5551234 dial 05551234.  Don\'t pause after the 0, just dial 0 and the outside number together.</div>',
+
+'<div id="phone_port_phone" class="tip">Port (socket) on the rear of your Phone System.  Plug the phone into this Port.</div>',
+
+'<div id="phone_port_line" class="tip">Port (socket) on the rear of your Phone System.  Plug the phone line into this Port.</div>',
+
+'<div id="phone_ipphone_ip" class="tip">IP Address of this phone on your network</div>',
+
+'<div id="phone_voipline_ip" class="tip">IP Address of the VOIP Internet Telephone Service Provider</div>',
+
+'<div id="phone_voipline_prefix" class="tip">Dial 1 for a VOIP outside line.  For example to call 5551234 dial 15551234. Don\'t pause after the 1, just dial 1 and the outside number together.</div>',
+
+'<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 page to update</div>',
+
+'<div id="ipphones_connected" class="tip">The IP phone is connected to your phone system and ready to use</div>',
+
+'<div id="ipphones_notconnected" class="tip">No IP phone is connected.  Either no IP phone is present, or the IP phone has not been set up.</div>',
+
+'<div id="voiplines_voiplines" class="tip"> A VOIP line allows you to make and receive phones calls over the Internet.  Normally a VOIP line is provided by an Internet Telephony Service Provider (ITSP).  They will give you an account, which includes the user and password details that you can fill in below.  Refresh this page on your browser to see if your VOIP line is working.  </div>',
+
+'<div id="voiplines_provider" class="tip">Your Internet Telephony Service Provider. They will give you an account with a user name and password.</div>',
+
+'<div id="voiplines_user" class="tip">Your account name with your Internet Telephony Service Provider</div>',
+
+'<div id="voiplines_pass" class="tip">The password for your Internet Telephony Service Provider account</div>',
+
+'<div id="voiplines_host" class="tip">The Internet address of your Internet Telephony Service Provider.  This will usually be filled in automatically.</div>',
+
+'<div id="voiplines_status" class="tip">A tick means you are connected to your Internet Telephony Service Provider.  Refresh your browser to update.</div>',
+
+'<div id="admin_restart" class="tip">Press this button to restart your phone system.  This is the same as turning the power off and back on. </div>',
+
+'<div id="admin_upgrade" class="tip">Press this button to install the latest version of Mini Asterisk.  An Mini Asterisk upgrade requires an Internet connection.</div>',
+
+'<div id="admin_firmware" class="tip">Enter the URL of a firmware update script.  This option can be used to install new firmware on your Phone System.  Installing new firmware requires an Internet connection.  The full URL Must be entered, e.g. http://rowetel.com/ucasterisk/mini/test.sh</div>' 
+];
+
diff --git a/attic/mini-asterisk-gui2/voiplines.html b/attic/mini-asterisk-gui2/voiplines.html
new file mode 100644 (file)
index 0000000..ec2c622
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+<title>voiplines</title>
+
+<link rel="stylesheet" type="text/css" href="ministyle.css">
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+<script type="text/javascript" src="minicommon.js"></script>
+<script type="text/javascript" src="tooltip.js"></script>
+<script type="text/javascript" src="tooltips.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript" src="voiplines.js"></script>
+<script type="text/javascript">
+
+</script>
+
+</head>
+
+<body onload="initialise()">
+
+  <table align="center" width=800>
+  <tr>
+    <td><div id="menu"></div></td>
+    <td><div id="voiplines"></div></td>
+
+   <td valign="top">
+
+    <table align="right" width=600>
+      <tr><td>&nbsp;</td></tr>
+      <tr><td align="left" valign="top" colspan="2"><h2>VOIP Line</h2></td></tr>
+
+      <tr><td>&nbsp;</td></tr>
+
+      <tr id="tt_provider"><td>Provider</td>
+         <td>
+        <select name="provider" id="provider" onchange="changeProvider()">
+             <option value="none">none</option>
+             <option value="sipnat">SIP-NAT</option>
+             <option value="sipnormal">SIP-Normal</option>
+             <option value="jazmin">Provider</option>
+        </select>
+         </td></tr>
+      <tr><td> </td><td><div id=info></div> </td></tr>
+      <tr id="tt_user"><td>User:</td><td><input type="text" name="user" id="user" value=""/></td></tr>
+      <tr id="tt_pass"><td >Password:</td><td><input type="password" name="pass" id="pass" value=""/></td></tr>
+      <tr id="tt_host"><td >Host:</td><td><input type="text" name="host" id="host" value=""/></td></tr>
+      <tr id="tt_fromuser"><td >From user:</td><td><input type="text" name="fromuser" id="fromuser" value=""/></td></tr>
+      <tr id="tt_fromdomain"><td >From domain:</td><td><input type="text" name="fromdomain" id="fromdomain" value=""/></td></tr>
+      <tr><td>&nbsp;</td></tr>
+         <tr><td>Voip Line Status:</td><td><div id="voiplinestatus"></div></td></tr>
+      <tr><td>&nbsp;</td></tr>
+      <tr><td colspan="2">Sometimes it takes a few seconds to connect your Voip Line.</td></tr>
+      <tr><td>&nbsp;</td></tr>
+      <tr><td><input type="submit" value="OK" onClick="onClickApply()" /></td></tr>
+
+
+    </table>
+
+    </td>
+  </tr>
+
+  </table>
+</body>
+</html>
diff --git a/attic/mini-asterisk-gui2/voiplines.js b/attic/mini-asterisk-gui2/voiplines.js
new file mode 100644 (file)
index 0000000..41aac53
--- /dev/null
@@ -0,0 +1,583 @@
+/*
+  voiplines.js
+  Ian Roberts
+  May 10 2012
+
+  voiplines screen for Mini Asterisk GUI2.
+*/
+
+var update_time = 10;
+
+var user = "";
+var host = "";
+var passwd = "";
+var fromuser= "";
+var fromdomain= "";
+
+var selection = "none";
+var lastselection="";
+
+// Registration line from sip.conf
+var siprego_line="";
+var siprego="";
+
+// All from sip.conf
+var sipnat_user="";
+var sipnat_secret="";
+var sipnat_host="";
+var sipnat_fromuser="";
+var sipnat_fromdomain="";
+
+var sipnormal_user="";
+var sipnormal_secret="";
+var sipnormal_host="";
+var sipnormal_fromuser="";
+var sipnormal_fromdomain="";
+
+var sipjazmin_user="";
+var sipjazmin_secret="";
+var sipjazmin_host="";
+var sipjazmin_fromuser="";
+var sipjazmin_fromdomain="";
+
+// Statics
+var sipnone_info = "No provider selected";
+var sipnat_info = "You reach your ITSP via a NAT router ...the most common setup";
+var sipnormal_info = "No NAT router between your Phone system and your ITSP";
+var sipjazmin_info = "Enter your provider details";
+
+// Called when we load page
+
+function initialise() {
+    mainMenu();
+
+    initialisePage();
+}
+
+
+function initialisePage() {
+    
+
+       // Sip reload   
+       
+       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",InitSipReloadReturn);
+       
+}
+
+function InitSipReloadReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       // Check sip registry
+       // Check if provider is up
+       //     asterisk sip show registry
+       //     cascades thru to load sip.conf info
+
+       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip show registry",OnSipshowReturn);
+
+
+}
+
+
+
+function OnSipshowReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+    var tickicon = '<img src="tick.png" alt="Provider OK" />';
+    var crossicon = '<img src="cross.png" alt="No provider found" />';
+    var html = '';
+
+       // If a provider is registered, 
+       
+    if (doc.indexOf("Registered") != -1) {
+               // provider is registered
+               html += tickicon;
+       } else {
+               // no provider or 
+               // provider is not registered
+               html += crossicon;
+       }
+
+    document.getElementById("voiplinestatus").innerHTML = html;
+       
+       // Load sip.conf
+       
+        downloadUrl("/cgi-bin/getconf.cgi?file=sip.conf", loadSipConf);
+
+}
+
+function loadSipConf(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           if (line.indexOf("mini-asterisk") != -1)  {
+                       if (line.indexOf("register-mini-asterisk") != -1) {
+                       
+                               // save this entire line because we are going to replace it later on
+                               siprego_line = line;
+                               var s = line.split(' ');
+                               siprego = s[2];    //  save registration string
+               
+                               if (line.indexOf(";") != 0) {
+                                    registerflag = 1;
+                               }
+                                else {
+                                    registerflag = 0;
+                               }
+                       }
+                       
+                       var myregexp = /\s|=/;       // whitespace or equals .... for splitting out user,secret,host
+                       
+                       if (line.indexOf("sipnat-mini-asterisk") != -1) {
+                               if (line.indexOf("username") != -1) {
+
+                                       var s = line.split(myregexp);
+                                       sipnat_user = s[1]; //  save user
+                               } 
+                               else if (line.indexOf("secret") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnat_secret = s[1]; //  save secret
+                               } 
+                               else if (line.indexOf("host") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnat_host = s[1]; //  save host
+                               }
+                               else if (line.indexOf("fromuser") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnat_fromuser = s[1]; //  save 
+                               }
+                               else if (line.indexOf("fromdomain") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnat_fromdomain = s[1]; //  save 
+                               }
+                       }
+                       if (line.indexOf("sipnormal-mini-asterisk") != -1) {
+                               if (line.indexOf("username") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnormal_user = s[1]; //  save user
+                               }
+                               else if (line.indexOf("secret") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnormal_secret = s[1]; //  save secret
+                               }
+                               else if (line.indexOf("host") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnormal_host = s[1]; //  save host
+                               }
+                               else if (line.indexOf("fromuser") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnormal_fromuser = s[1]; //  save 
+                               }
+                               else if (line.indexOf("fromdomain") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipnormal_fromdomain = s[1]; //  save
+                               }
+                       }
+                       if (line.indexOf("jazmin-mini-asterisk") != -1) {
+                               if (line.indexOf("username") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipjazmin_user = s[1]; //  save user
+                               } 
+                               else if (line.indexOf("secret") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipjazmin_secret = s[1]; //  save secret
+                               }
+                               else if (line.indexOf("host") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipjazmin_host = s[1]; //  save host
+                               }
+                               else if (line.indexOf("fromuser") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipjazmin_fromuser = s[1]; //  save 
+                               }
+                               else if (line.indexOf("fromdomain") != -1) {
+                                       var s = line.split(myregexp);
+                                       sipjazmin_fromdomain = s[1]; //  save
+                               }
+                       }
+               }
+               
+
+               
+       }
+       );
+       
+       // sip info now loaded
+
+       if(siprego_line[0] == ';') { 
+               // commented out mean no rego selected
+               lastselection = "none";
+               document.getElementById('user').value = "";
+               document.getElementById('host').value = "";
+               document.getElementById('pass').value = "";
+               document.getElementById('fromuser').value = "";
+               document.getElementById('fromdomain').value = "";
+               document.getElementById('info').textContent = sipnone_info;
+               document.getElementById('provider').value="none";
+       } 
+       else if (siprego.indexOf(sipnat_user) != -1) {
+               // rego line has sipnat 
+               lastselection = "sipnat";
+               document.getElementById('user').value = sipnat_user;
+               document.getElementById('host').value = sipnat_host;
+               document.getElementById('pass').value = sipnat_secret;
+               document.getElementById('fromuser').value = sipnat_fromuser;
+               document.getElementById('fromdomain').value = sipnat_fromdomain;
+               document.getElementById('info').textContent = sipnat_info;
+               document.getElementById('provider').value="sipnat";
+       }
+       else if (siprego.indexOf(sipnormal_user) != -1) {
+               // rego line has sipnormal
+               lastselection = "sipnormal";
+               document.getElementById('user').value = sipnormal_user;
+               document.getElementById('host').value = sipnormal_host;
+               document.getElementById('pass').value = sipnormal_secret;
+               document.getElementById('fromuser').value = sipnormal_fromuser;
+               document.getElementById('fromdomain').value = sipnormal_fromdomain;
+               document.getElementById('info').textContent = sipnormal_info;
+               document.getElementById('provider').value="sipnormal";
+       }
+       else if (siprego.indexOf(sipjazmin_user) != -1) {
+               // rego line has jazmin
+               lastselection = "jazmin";
+               document.getElementById('user').value = sipjazmin_user;
+               document.getElementById('host').value = sipjazmin_host;
+               document.getElementById('pass').value = sipjazmin_secret;
+               document.getElementById('fromuser').value = sipjazmin_fromuser;
+               document.getElementById('fromdomain').value = sipjazmin_fromdomain;
+               document.getElementById('info').textContent = sipjazmin_info;
+               document.getElementById('provider').value="jazmin";
+       }                       
+}
+
+
+function onClickApply() {
+
+       // All this stuff is synchronous. Must happen in order specified.
+       // You will need to cascade calls to downloadUrl
+
+       // save globals
+       //lastselection = selection;               This causes a bug under firefox, but not chrome ... why?
+       
+    document.getElementById("voiplinestatus").innerHTML = '<td>Checking... </td>';
+       
+       
+       // take provider, username, password and host. 
+       selection = document.getElementById('provider').value;
+       user = document.getElementById('user').value;
+       host = document.getElementById('host').value;
+       passwd = document.getElementById('pass').value;
+       fromuser = document.getElementById('fromuser').value;
+       fromdomain = document.getElementById('fromdomain').value;
+       
+       // 1. Save sip.conf     
+       
+
+       
+       // 2.0 uncomment sip register
+       if(selection == "none") {
+       
+               if(lastselection == "none") {
+                       // do nothing but restart
+                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
+               }
+               else {
+                       // comment out old rego line
+                       // reload and restart
+                       var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
+                       downloadUrl(url,commentregReturn);                      
+               }
+       
+       } 
+       else {
+               if(lastselection==selection) {
+                       // fillout
+                       // restart
+                               var new_register = user+":"+passwd+"@"+host;
+                               var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=' + siprego + '&that=' 
+                                                       + new_register + '&key=register-mini-asterisk';
+                               downloadUrl(url,uncommenttrunkReturn);  
+
+               
+               }
+               else if (lastselection=="none") {
+                               // straight into uncomment
+                               var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
+                               downloadUrl(url,uncommentregReturn);            
+               
+               
+               }
+               else {
+                               // comment old stuff out then straight on
+                               var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
+                               downloadUrl(url,commentregReturn);                      
+               }
+
+               
+       }
+}      
+       
+function commentregReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+               // comment out old selection    
+
+               var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key='+lastselection+'-mini-asterisk';
+               downloadUrl(url,commentTrunkReturn);    
+}
+
+function commentTrunkReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+               // reset voip label     
+
+               var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=voip&that=user'+lastselection;
+               downloadUrl(url,resetVoipLabelReturn);  
+}
+
+function resetVoipLabelReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+               
+               if (lastselection == selection) {
+                       // asterisk sip reload ..
+                       // ....check this may have to load new parms
+                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
+               }
+               else if (selection == "none") {
+                       // asterisk sip reload  to remove old registration
+                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
+               }
+               else {
+                       // uncomment new selection
+                       // fillout new parms
+                       // restart
+                       var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
+                       downloadUrl(url,uncommentregReturn);            
+               }
+
+
+}
+
+function uncommentregReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       //  2.1 insert register command  
+       //          ;register => 1234:password@mysipprovider.com   becomes     register => trev:password@192.168.1.30 
+       
+       var new_register = user+":"+passwd+"@"+host;
+       var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=' + siprego + '&that=' + new_register + '&key=register-mini-asterisk';
+
+       
+       downloadUrl(url,updateregReturn);
+}
+
+function updateregReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+
+       //  2.15 uncomment sip trunk
+
+       var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key='+selection+'-mini-asterisk';
+               
+       downloadUrl(url,uncommenttrunkReturn);  
+
+}
+
+
+
+
+function uncommenttrunkReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       //  2.2 update sip trunk details  ... user pw host
+
+       //          username=usersipnormal                     username=trev
+       //          secret=passwordsip                   secret=password
+       //          host=hostsip                         host=192.168.1.30
+       
+       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
+                               +'&this=username='
+                               +'&that='+user
+                               +'&key='+selection+'-mini-asterisk';
+
+       downloadUrl(url,usernameReturn);
+       
+}
+
+function usernameReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
+                               +'&this=secret='
+                               +'&that='+passwd
+                               +'&key='+selection+'-mini-asterisk';
+
+       downloadUrl(url,passwordReturn);
+       
+}
+
+function passwordReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
+                               +'&this=host='
+                               +'&that='+host
+                               +'&key='+selection+'-mini-asterisk';
+
+       downloadUrl(url,fromhostReturn);
+}
+
+function fromhostReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
+                               +'&this=fromuser='
+                               +'&that='+fromuser
+                               +'&key='+selection+'-mini-asterisk';
+
+       downloadUrl(url,fromuserReturn);
+}
+
+function fromuserReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
+                               +'&this=fromdomain='
+                               +'&that='+fromdomain
+                               +'&key='+selection+'-mini-asterisk';
+
+       downloadUrl(url,fromdomainReturn);
+}
+       
+function fromdomainReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       //   3.8      if new provider
+       //                replace old [voip] entry back to original [usersipnormal] or [usersipnat] or [userjazmin]
+       
+       //   3.9      if new provider
+       //                              [usersipnat]         becomes     [voip]
+       //                              or [usersipnormal]
+       //                              or [userjazmin]
+       
+
+       
+       var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=user'+selection+'&that=voip';
+
+       downloadUrl(url,extReturn);
+}
+
+function extReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       // 4. asterisk sip reload ....ORDER? beardy has this at position 4
+
+       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
+
+}
+
+function sipReloadReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       // 5. asterisk dialplan reload
+
+       downloadUrl("/cgi-bin/asterisk.cgi?cli=dialplan reload",dialplanReloadReturn);
+
+}
+
+function dialplanReloadReturn(doc,status) {
+    loadHtmlTextFile(doc, function(line) {
+           //parseSipShowPeers(line);
+       }
+       );
+       
+       // initialise page?
+
+       initialise();
+
+}
+
+function changeProvider() {
+
+       // fill the host and username fields based on selection
+
+       var sell = document.getElementById('provider').value;
+       
+
+       if (sell == "none" ) {
+               // clear fields
+               document.getElementById('user').value = "";
+               document.getElementById('host').value = "";
+               document.getElementById('pass').value = "";
+               document.getElementById('fromuser').value = "";
+               document.getElementById('fromdomain').value = "";
+               document.getElementById('info').textContent = sipnone_info;
+               
+       } else if (sell == "sipnat" ) {
+               // fill sipnat
+               document.getElementById('user').value = sipnat_user;
+               document.getElementById('host').value = sipnat_host;
+               document.getElementById('pass').value = sipnat_secret;
+               document.getElementById('fromuser').value = sipnat_fromuser;
+               document.getElementById('fromdomain').value = sipnat_fromdomain;
+               document.getElementById('info').textContent = sipnat_info;
+       } else if (sell == "sipnormal" ) {
+           // fill sipnormal
+               document.getElementById('user').value = sipnormal_user;
+               document.getElementById('host').value = sipnormal_host;
+               document.getElementById('pass').value = sipnormal_secret;               
+               document.getElementById('fromuser').value = sipnormal_fromuser;
+               document.getElementById('fromdomain').value = sipnormal_fromdomain;
+               document.getElementById('info').textContent = sipnormal_info;
+       } else if (sell == "jazmin" ) {
+               // fill jazmin
+               document.getElementById('user').value = sipjazmin_user;
+               document.getElementById('host').value = sipjazmin_host;
+               document.getElementById('pass').value = sipjazmin_secret;               
+               document.getElementById('fromuser').value = sipjazmin_fromuser;
+               document.getElementById('fromdomain').value = sipjazmin_fromdomain;
+               document.getElementById('info').textContent = sipjazmin_info;
+       } else {
+               // something weird happened
+       }
+       
+}
+
+
diff --git a/mini-asterisk-gui2/README.txt b/mini-asterisk-gui2/README.txt
deleted file mode 100644 (file)
index c0b03b3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-Mini Asterisk GUI Version 2
-===========================
-
-Rewrite of original concept using Javascript.
-
-Check out notes in install notes.txt
-
-TODO
-----
-
-[ ] fping ipkg dependancy
-[ ] blog post
-    + javascript with firebox is a joy to debug
-    + cf server side, CGIs
-    + keep CGIs really small, very productive
-    + BASIC style string processing versus regexp
-    + CGI wring, regexp, sed is painfully slow, so minimise it
diff --git a/mini-asterisk-gui2/about.html b/mini-asterisk-gui2/about.html
deleted file mode 100644 (file)
index 0d35efb..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>About</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css" />
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="about.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="about"></div>
-       <table align="right" width=600>
-          <tr><td align="left" valign="top"><h2>About</h2></td></tr>
-          <tr><td><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision 1.0</td></tr>
-          <tr><td>&nbsp;</td></tr>
-          <tr><td>Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>
-          <tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" alt="ip04_case"  border="0" /></a></td><td> </td><td></td></tr>
-       </table>
-
-
-    </td>
-
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/about.js b/mini-asterisk-gui2/about.js
deleted file mode 100644 (file)
index 5f6835c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  about.js
-  Ian Roberts
-  May 7 2012
-
-  About screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-
-}
-
-
-
diff --git a/mini-asterisk-gui2/admin.html b/mini-asterisk-gui2/admin.html
deleted file mode 100644 (file)
index 72c517d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Admin</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css" />
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="tooltips.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="admin.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td valign="top">
-
-    <table align="right" width=600>
-      <tr><td>&nbsp;</td></tr>
-         
-      <tr><td align="left" valign="top"><h2>Admin</h2></td></tr>
-      <tr><td>&nbsp;</td></tr>
-      <tr><td colspan="2"><h3>Change Phone System Password</h3></td></tr>
-      <tr><td>New Password:</td><td><input type="password" name="pass" ></td>
-          <td><input type="button" style="width:100%" value="Set Password" onClick="onClickSetPassword()"></td>
-      </tr>
-      <tr><td>&nbsp;</td></tr>
-      <tr><td></td><td>Default password is uClinux</td></tr>
-
-      <tr><td>&nbsp;</td></tr>
-      <tr><td colspan="2"><h3>Restart Phone System</h3></td>
-          <td><input type="button" style="width:100%" value="Restart" onClick="onClickRestart()"></td>
-      </tr>
-
-      <tr><td>&nbsp;</td></tr>
-       <tr><td colspan="2"><h3>Reset Phone System Defaults</h3></td>
-          <td><input type="button" style="width:100%" value="Reset" onClick="onClickReset()"></td>
-      </tr>
-
-      <tr><td>&nbsp;</td></tr>
-      <tr onMouseOver="popUp(event,'admin_upgrade')" onmouseout="popUp(event,'admin_upgrade')">
-          <td colspan="2"><h3>Upgrade Mini Asterisk</h3></td>
-          <td><input type="button" style="width:100%" value="Upgrade" onClick="onClickUpgrade()"></td>
-      </tr>
-
-      <tr><td>&nbsp;</td></tr>
-      <tr><td colspan="2"><h3>Install New Firmware</h3></td>
-      </tr>      
-      <tr onMouseOver="popUp(event,'admin_firmware')" onmouseout="popUp(event,'admin_firmware')">
-          <td>Firmware URL:</td>
-          <td><input type="text" size="45" name="firmwareurl" ></td>
-          <td><input type="button" style="width:100%" value="Install" onClick="onClickInstall()"></td>
-
-      </tr>
-         
-
-   </table>
-   
-  </td>
-  </tr>
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/admin.js b/mini-asterisk-gui2/admin.js
deleted file mode 100644 (file)
index b64259c..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-  admin.js
-  Ian Roberts
-  May 10 2012
-
-  Admin screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-var firmwareurl = "hi";
-var newpassword = "hello";
-
-
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-    
-    
-
-}
-
-function onClickSetPassword() {
-
-        newpassword= document.pass.value;
-        downloadUrl("/cgi-bin/setpassword.cgi?newpassword="+newpassword,OnSetPasswordReturn);
-
-//      if not x86 (developement environment)
-//         pass=`echo "$QUERY_STRING" | grep -oe "pass=[^&?]*" | sed -n "s/pass=//p"`
-//         passwd_cmdline $pass
-
-}
-
-
-function onClickInstall() {
-
-       firmwareurl=document.firmwareurl.value;
-       downloadUrl("/cgi-bin/install.cgi?file="+firmwareurl,OnInstallReturn);
-
-//      if not x86 (developement environment)
-//    firmwareurl=`echo "$QUERY_STRING" | grep -oe "firmwareurl=[^&?]*" | sed -n "s/firmwareurl=//p"`
-//    # convert URL encoded string, this can just handle : and / so be careful
-//    # with script names
-//    firmwareurl=`echo $firmwareurl | sed -e "s/%3A/:/" -e "s_%2F_/_g"`
-//    wget $firmwareurl
-//    filename=`echo $firmwareurl | sed 's_^.*/__'`
-//    sh $filename
-//    exit
-
-}
-
-function onClickUpgrade() {
-
-       downloadUrl("/cgi-bin/upgrade.cgi?arg=",OnUpgradeReturn);
-
-//      if not x86 (developement environment)
-//    rev_before=`grep -oe "Revision: [0-9]*" /www/about.sh`
-//    echo "<strong>Current $rev_before</strong><br>"
-//    echo "<strong>Removing $ver_before</strong><br>"
-//    ipkg remove mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
-//    echo "<strong>Installing...</strong><br>"
-//    ipkg update | tr '\n' '#' | sed -n 's/\#/<br>/pg'
-//    ipkg install mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
-
-
-}
-
-
-function onClickReset() {
-
-       downloadUrl("/cgi-bin/reset.cgi?arg=",OnResetReturn);
-
-//      if not x86 (developement environment)
-//     cp /etc/asterisk/extensions.conf.def /etc/asterisk/extensions.conf
-//     cp /etc/asterisk/sip.conf.def /etc/asterisk/sip.conf
-//     asterisk -rx "sip reload" 2>/dev/null 1 > /dev/null
-//     asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
-
-}
-
-
-function onClickRestart() {
-
-       downloadUrl("/cgi-bin/restart.cgi?arg=",OnRestartReturn);
-
-//      if not x86 (developement environment)
-//          reboot
-}
-
diff --git a/mini-asterisk-gui2/at-620r.png b/mini-asterisk-gui2/at-620r.png
deleted file mode 100644 (file)
index a2e5b0b..0000000
Binary files a/mini-asterisk-gui2/at-620r.png and /dev/null differ
diff --git a/mini-asterisk-gui2/cgi-bin/asterisk.cgi b/mini-asterisk-gui2/cgi-bin/asterisk.cgi
deleted file mode 100755 (executable)
index eaf292c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# asterisk.cgi
-# David Rowe 22 Dec 2010
-#
-# CGI to return the output from an Asterisk command line
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-CLI=`echo "$QUERY_STRING" | sed -n "s/.*cli=//p" | sed -n "s/%20/ /pg"`
-echo "$CLI"
-asterisk -rx "$CLI"
-echo hello
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/catproc.cgi b/mini-asterisk-gui2/cgi-bin/catproc.cgi
deleted file mode 100755 (executable)
index 65afe25..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-# catproc.cgi
-#  Ian Roberts
-#  May 7 2012
-# CGI to execute cat /proc/<argument>
-# script expects only one argument
-# valid arguments are version, loadavg, cpuinfo, mtd, meminfo, yaffs
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
-#Todo : Test for one argument
-#Todo : Test for valid argument
-cat /proc/$arg
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/commentkey.cgi b/mini-asterisk-gui2/cgi-bin/commentkey.cgi
deleted file mode 100755 (executable)
index afaf43d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh 
-# commentkey.cgi
-# David Rowe 30 Oct 2012
-#
-# CGI to comment a chunk of text that has a certain key phrase on each line
-#
-# Test on host with:
-#
-#    $ export QUERY_STRING='file=test.txt&key=Jazmin mini'; ./commentkey.cgi
-#
-# try using test file:
-# 
-#   root:/root> cat test.txt 
-#   [user]                       ; Jazmin mini-asterisk do not remove this comment
-#   host=sip.jazmin.net.au       ; Jazmin mini-asterisk do not remove this comment
-#   secret=<Password>            ; Jazmin mini-asterisk do not remove this comment           
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-file=`echo $QUERY_STRING | grep -oe "file=[^&?]*" | sed -n "s/file=//p"`
-key=`echo $QUERY_STRING | grep -oe "key=[^&?]*" | sed -n "s/key=//p" | sed "s/%22/\"/g"`
-echo $QUERY_STRING
-echo $file
-echo $key
-if [ -f $file ]; then
-  # to debug remove -i (write results to file), it will then just print results
-  perl -i -pe "s/(.*$key)/;\$1/" $file
-else
-  echo "$file does not exist"
-fi
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi b/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi
deleted file mode 100755 (executable)
index d0c19fa..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# fpingnodes.cgi
-# David Rowe 5 Dec 2010
-#
-# CGI to fping a bunch of nodes
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"`
-fping $ip -a -b1400 -r1 2>/dev/null
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/getconf.cgi b/mini-asterisk-gui2/cgi-bin/getconf.cgi
deleted file mode 100755 (executable)
index c1115a3..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-# getconf.cgi
-# David Rowe 12 Dec 2010
-#
-# CGI to return an Asterisk conf file
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-CONF_PATH=/etc/asterisk
-FILE=`echo "$QUERY_STRING" | sed -n "s/.*file=//p"`
-if [ -f $CONF_PATH/$FILE ] ; then 
-  cat $CONF_PATH/$FILE
-fi
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/getdhcp.cgi b/mini-asterisk-gui2/cgi-bin/getdhcp.cgi
deleted file mode 100755 (executable)
index ff708fc..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-# getdhcp.cgi
-# David Rowe 8 March 2011
-#
-# CGI to return DHCP config details
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-if [ -f /etc/rc.d/S10network ]; then
-  dhcp=yes
-  ipaddress=`ifconfig eth0 | sed -n 's/.*inet addr:\(.*\)  Bcast.*/\1/p'`
-  netmask=`ifconfig eth0 | sed -n 's/.*Mask:\(.*\)\s*/\1/p'`
-  gateway=`route -n | awk '/^0.0.0.0/ {print $2}'`
-  dns=`cat /etc/resolv.conf | awk '/^nameserver/ {print $2}'`
-  echo DHCP=\"yes\"
-  echo IPADDRESS=\"$ipaddress\"
-  echo NETMASK=\"$netmask\"
-  echo GATEWAY=\"$gateway\"
-  echo DNS=\"$dns\"
-else
-  echo DHCP=\"no\"
-fi
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/getemergencyip.cgi b/mini-asterisk-gui2/cgi-bin/getemergencyip.cgi
deleted file mode 100755 (executable)
index 6d58b67..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# getemergency.cgi
-# David Rowe 8 March 2011
-#
-# CGI to return emergency IP details
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-if [ -f /etc/rc.d/S05network-backdoor ]; then
-  backdoor=`sed -n 's/IPADDRESS="\(.*\)"/\1/p' /etc/init.d/network-backdoor`
-  echo BACKDOOR=\"$backdoor\"
-fi
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/getnetwork.cgi b/mini-asterisk-gui2/cgi-bin/getnetwork.cgi
deleted file mode 100755 (executable)
index ceb0631..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-# getnetwork.cgi
-# Ian Roberts 19 March 2012
-#
-# CGI to return network connection details
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-internet=`fping google.com`;
-#packet_loss=`fping google.com -c 1 -q | sed -n 's/.*received, \(.*\)%.*/\1/p'`
-#if [ $packet_loss = "0" ]; then
-#    internet="yes";
-#fi
-
-echo INTERNET=\"$internet\"
-#echo PACKETLOSS=\"$packet_loss\"
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/ifconfig.cgi b/mini-asterisk-gui2/cgi-bin/ifconfig.cgi
deleted file mode 100755 (executable)
index 98685c4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# asterisk.cgi
-# David Rowe 3 March 2011 
-#
-# CGI to return the output from an Asterisk command line
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p"`
-ifconfig $arg
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/install.cgi b/mini-asterisk-gui2/cgi-bin/install.cgi
deleted file mode 100755 (executable)
index 29b936e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-# install.cgi
-# Ian Roberts 31 May 2012
-#
-# CGI to install new firmware....
-# runs a shellscript as root
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-
-# check what sort of machine we are running on.  Many operations
-# outlawed for x86
-
-cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
-if [ $? -eq 0 ]; then
-    mach="ip0x"
-else
-    mach="x86"
-fi
-
-
-
-if [ $mach != "ip0x" ] ; then
-       echo "<html>Sorry, only supported on the IP0X</html>"
-       exit
-fi
-
-firmwareurl=`echo "$QUERY_STRING" | grep -oe "firmwareurl=[^&?]*" | sed -n "s/firmwareurl=//p"`
-# convert URL encoded string, this can just handle : and / so be careful
-# with script names
-firmwareurl=`echo $firmwareurl | sed -e "s/%3A/:/" -e "s_%2F_/_g"`
-wget $firmwareurl
-filename=`echo $firmwareurl | sed 's_^.*/__'`
-sh $filename
-exit
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/ipkg.cgi b/mini-asterisk-gui2/cgi-bin/ipkg.cgi
deleted file mode 100755 (executable)
index 4a14727..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-# ipkg.cgi
-#  Ian Roberts
-#  May 12 2012
-# CGI to execute ipkg <argument>
-# script expects only one argument
-# valid arguments are list_installed, list etc
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
-#Todo : Test for one argument
-#Todo : Test for valid argument
-ipkg $arg
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/network-backdoor.cgi b/mini-asterisk-gui2/cgi-bin/network-backdoor.cgi
deleted file mode 100755 (executable)
index 0accbcd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# network-backdoor.cgi
-# Ian Roberts 15 Sept 2012
-#
-# CGI to return the output from an /etc/init.d/network-backdoor command 
-#
-# valid action are start, stop, enable, disable
-#
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
-echo "$ARG"
-/etc/init.d/network-backdoor "$ARG"
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/network-static.cgi b/mini-asterisk-gui2/cgi-bin/network-static.cgi
deleted file mode 100644 (file)
index b70d62e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# network-static.cgi
-# Ian Roberts 15 Sept 2012
-#
-# CGI to return the output from an /etc/init.d/network-static command 
-#
-# valid action are start, stop, enable, disable
-#
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
-echo "$ARG"
-/etc/init.d/network-static "$ARG"
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/network.cgi b/mini-asterisk-gui2/cgi-bin/network.cgi
deleted file mode 100755 (executable)
index 6babf8a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# network.cgi
-# Ian Roberts 15 Sept 2012
-#
-# CGI to return the output from an /etc/init.d/network command 
-#
-# valid actions are start, stop, enable, disable
-#
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
-echo "$ARG"
-/etc/init.d/network "$ARG"
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/reset.cgi b/mini-asterisk-gui2/cgi-bin/reset.cgi
deleted file mode 100755 (executable)
index 984bb49..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-# reset.cgi
-# Ian Roberts 31 May 2012
-#
-# CGI to reset ipox
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-
-# check what sort of machine we are running on.  Many operations
-# outlawed for x86
-
-cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
-if [ $? -eq 0 ]; then
-    mach="ip0x"
-else
-    mach="x86"
-fi
-
-
-
-if [ $mach != "ip0x" ] ; then
-       echo "Sorry, only supported on the IP0X"
-cat <<EOF
-</body>
-</html>
-EOF
-       exit
-fi
-
-# reset the dialplan files
-cp /etc/asterisk/extensions.conf.def /etc/asterisk/extensions.conf
-cp /etc/asterisk/sip.conf.def /etc/asterisk/sip.conf
-# reload the dialplans in asterisk
-asterisk -rx "sip reload" 2>/dev/null 1 > /dev/null
-asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
-
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/restart.cgi b/mini-asterisk-gui2/cgi-bin/restart.cgi
deleted file mode 100755 (executable)
index af29a8c..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-# restart.cgi
-# Ian Roberts 31 May 2012
-#
-# CGI to reboot ipox
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-
-# check what sort of machine we are running on.  Many operations
-# outlawed for x86
-
-cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
-if [ $? -eq 0 ]; then
-    mach="ip0x"
-else
-    mach="x86"
-fi
-
-
-
-if [ $mach != "ip0x" ] ; then
-       echo "<html>Sorry, only supported on the IP0X</html>"
-       exit
-fi
-
-# kill cookie to log out.  This ensures hitting refresh wont run
-# the restart process again
-
-cat <<EOF
-Content-type: text/html
-Set-Cookie: loggedin=1; expires=Thursday, 01-Jan-98 12:00:00 GMT
-
-<head>
-<title>Mini Asterisk - Restart</title>
-</head>
-<body>
-<h2>Restarting...come back in 1 minute</h2>
-</body>
-EOF
-reboot
-
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setline.cgi b/mini-asterisk-gui2/cgi-bin/setline.cgi
deleted file mode 100755 (executable)
index eaaf47a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-# setline.cgi
-# David Rowe 9 March 2011
-#
-# CGI to set the text in "file" from "this" to "that"
-#
-# Test on host with:
-#
-#    $ export QUERY_STRING='file=test.txt&this=IPADDRESS=&that="192.168.1.31"'; ./setline.cgi
-#
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-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"`
-echo $QUERY_STRING
-echo $file
-echo $this
-echo $that
-if [ -f $file ]; then
-  sed -i "s/$this.*/$this$that/g" $file
-else
-  echo "$file does not exist"
-fi
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setlinekey.cgi b/mini-asterisk-gui2/cgi-bin/setlinekey.cgi
deleted file mode 100755 (executable)
index 11e9c5a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/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
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-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
-#   sed 's/\($this\)[^\s]*\($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
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi b/mini-asterisk-gui2/cgi-bin/setlinekey2.cgi
deleted file mode 100755 (executable)
index 2d49f08..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh 
-# setlinekey2.cgi
-# David Rowe 29 Oct 2012
-#
-# CGI to set the text in "file" from "this" to "that" on lines with text "key"
-#
-# Test on host with:
-#
-#    $ export QUERY_STRING='file=test.txt&this=host=&that=192.168.1.31&key=Jazmin mini'; ./setlinekey2.cgi
-#
-# using test file:
-# 
-#   root:/root> cat test.txt 
-#   host=192.168.1.28       ; Jazmin mini-asterisk do not remove this comment
-#   dtmfmod=rfc2833         ; Jazmin mini-asterisk do not remove this comment
-#   host=192.168.1.29       ; SIP mini-asterisk do not remove this comment
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-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
-  # to debug remove -i (write results to file), it will then just print results
-  perl -i -pe "s/($this)[A-Za-z0-9\.\<\>]*(.*$key.*)/$this$that\$2/" $file
-else
-  echo "$file does not exist"
-fi
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setpassword.cgi b/mini-asterisk-gui2/cgi-bin/setpassword.cgi
deleted file mode 100755 (executable)
index b0765e5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-# setpassword.cgi
-# Ian Roberts 31 May 2012
-#
-# CGI to set password on ipox
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-
-# check what sort of machine we are running on.  Many operations
-# outlawed for x86
-
-cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
-if [ $? -eq 0 ]; then
-    mach="ip0x"
-else
-    mach="x86"
-fi
-
-
-
-if [ $mach != "ip0x" ] ; then
-       echo "<html>Sorry, only supported on the IP0X</html>"
-       exit
-fi
-
-pass=`echo "$QUERY_STRING" | grep -oe "pass=[^&?]*" | sed -n "s/pass=//p"`
-passwd_cmdline $pass
-
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setring.cgi b/mini-asterisk-gui2/cgi-bin/setring.cgi
deleted file mode 100755 (executable)
index b9525de..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-# setring.cgi
-# 
-# Ian Roberts 30 August 2012
-#
-# CGI to set extension to ring on an incoming call
-#
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-
-# extract extensions to ring 
-# must replace underscores with forward slash
-
-echo "Input $QUERY_STRING"
-
-a=`echo "$QUERY_STRING" | sed -n "s/=on*//pg" | sed -n 's,_,/,pg'`
-
-# escape & if present
-echo "$a" | grep "&" >> /dev/null
-if [ $? -eq 0 ]; then
-  a=`echo $a | sed -n "s/&/\\\\&/pg"`
-fi
-
-echo "Mods $a"
-sed -i "s_s,1,Dial(.*) ;; mini-asterisk_s,1,Dial($a) ;; mini-asterisk_" /etc/asterisk/extensions.conf
-#sed -i "s_s,1,Dial(.*) ;; mini-asterisk_s,1,Dial($a) ;; mini-asterisk_" /etc/asterisk/extensions.conf
-
-#reload extensions.conf
-
-# do this from js with a call to asterisk.cgi
-#asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setservice.cgi b/mini-asterisk-gui2/cgi-bin/setservice.cgi
deleted file mode 100755 (executable)
index e97d63b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-# setservice.cgi
-# Ian Roberts 18 Sept 2012
-#
-# CGI to return the output from an service command 
-#
-# valid actions are restartstatic, restartdhcp, restartbackup, enabledhcp, enablestatic
-#
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1">
-</head>
-<body>
-EOF
-
-ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
-echo "arg is $ARG"
-
-if [ $ARG = "restartstatic" ]; then
-       echo "restart static"
-       /etc/init.d/network-static stop
-       /etc/init.d/network-static start
-fi
-
-if [ $ARG = "restartbackup" ]; then
-       echo "restartbackup"
-       /etc/init.d/network-backup stop
-       /etc/init.d/network-backup start
-fi
-
-if [ $ARG = "restartdhcp" ]; then
-       echo "restartdhcp"
-       /etc/init.d/network stop
-       /etc/init.d/network start
-fi
-
-if [ $ARG = "enabledhcp" ]; then
-       echo "enabledhcp"
-    /etc/init.d/network-static disable
-    /etc/init.d/network-static stop
-    /etc/init.d/network enable
-    /etc/init.d/network start
-fi
-
-if [ $ARG = "enablestatic" ]; then
-       echo "enable static"
-    /etc/init.d/network stop
-    /etc/init.d/network disable
-    /etc/init.d/network-static enable
-fi
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/setword.cgi b/mini-asterisk-gui2/cgi-bin/setword.cgi
deleted file mode 100755 (executable)
index 8fa2ad1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-# setword.cgi
-# Ian Roberts 29 Oct 2012
-#
-# CGI to replace the text in "file" from "this" to "that"
-#
-# Test on host with:
-#
-#    $ export QUERY_STRING='file=test.txt&this=IPADDRESS&that="192.168.1.31"'; ./setword.cgi
-#
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-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"`
-echo $QUERY_STRING
-echo $file
-echo $this
-echo $that
-if [ -f $file ]; then
-  sed -i "s/$this/$that/g" $file
-else
-  echo "$file does not exist"
-fi
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/sipshowpeers.cgi b/mini-asterisk-gui2/cgi-bin/sipshowpeers.cgi
deleted file mode 100755 (executable)
index be4fb91..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-# sipshowpeers.cgi
-#  Ian Roberts
-#  May 11 2012
-# CGI to execute get sip phone info
-# no argument
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-#arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
-
-#Todo : Test for asterisk running 
-
-asterisk "-rx sip show peers" 2>/dev/null
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/uncommentkey.cgi b/mini-asterisk-gui2/cgi-bin/uncommentkey.cgi
deleted file mode 100755 (executable)
index 2348dcf..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh 
-# uncommentkey.cgi
-# David Rowe 30 Oct 2012
-#
-# CGI to uncomment a chunk of text that has a certain key phrase on each line
-#
-# Test on host with:
-#
-#    $ export QUERY_STRING='file=test.txt&key=Jazmin mini'; ./uncommentkey.cgi
-#
-# try using test file:
-# 
-#   root:/root> cat test.txt 
-#   ;[user]                       ; Jazmin mini-asterisk do not remove this comment
-#   ;host=sip.jazmin.net.au       ; Jazmin mini-asterisk do not remove this comment
-#   ;secret=<Password>            ; Jazmin mini-asterisk do not remove this comment           
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-file=`echo $QUERY_STRING | grep -oe "file=[^&?]*" | sed -n "s/file=//p"`
-key=`echo $QUERY_STRING | grep -oe "key=[^&?]*" | sed -n "s/key=//p" | sed "s/%22/\"/g"`
-echo $QUERY_STRING
-echo $file
-echo $key
-if [ -f $file ]; then
-  # to debug remove -i (write results to file), it will then just print results
-  perl -i -pe "s/^;(.*$key)/\$1/" $file
-else
-  echo "$file does not exist"
-fi
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/upgrade.cgi b/mini-asterisk-gui2/cgi-bin/upgrade.cgi
deleted file mode 100755 (executable)
index e22f5d2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-# upgrade.cgi
-# Ian Roberts 31 May 2012
-#
-# CGI to upgrade mini-asterisk-gui
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-
-# check what sort of machine we are running on.  Many operations
-# outlawed for x86
-
-cat /proc/cpuinfo | grep "CPU:.*ADSP" > /dev/null
-if [ $? -eq 0 ]; then
-    mach="ip0x"
-else
-    mach="x86"
-fi
-
-
-
-if [ $mach != "ip0x" ] ; then
-       echo "Sorry, only supported on the IP0X"
-cat <<EOF
-</body>
-</html>
-EOF
-       exit
-fi
-
-# remove, update and install mini-asterisk-gui
-
-rev_before=`grep -oe "Revision: [0-9]*" /www/about.sh`
-echo "<strong>Current $rev_before</strong><br>"
-echo "<strong>Removing $ver_before</strong><br>"
-ipkg remove mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
-echo "<strong>Installing...</strong><br>"
-ipkg update | tr '\n' '#' | sed -n 's/\#/<br>/pg'
-ipkg install mini-asterisk-gui | tr '\n' '#' | sed -n 's/\#/<br>/pg'
-
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/cgi-bin/uptime.cgi b/mini-asterisk-gui2/cgi-bin/uptime.cgi
deleted file mode 100755 (executable)
index 2073e2d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-# uptime.cgi
-#  Ian Roberts
-#  May 12 2012
-# CGI to execute uptime
-# no arguments
-
-cat <<EOF
-Content-type: text/html
-
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="-1"></head></head>
-<body>
-EOF
-
-#arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p" | sed "s/,/ /g"`
-uptime
-
-cat <<EOF
-</body>
-</html>
-EOF
diff --git a/mini-asterisk-gui2/configure_AT-530.html b/mini-asterisk-gui2/configure_AT-530.html
deleted file mode 100644 (file)
index 73c8ae2..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html>\r
-<html>\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\r
-<title>ipPhones</title>\r
-\r
-<link rel="stylesheet" type="text/css" href="ministyle.css">\r
-<link rel="stylesheet" href="tooltip.css" type="text/css" />\r
-<script type="text/javascript" src="minicommon.js"></script>\r
-<script type="text/javascript" src="tooltip.js"></script>\r
-<script type="text/javascript" src="menu.js"></script>\r
-<script type="text/javascript" src="configure_AT.js"></script>\r
-<script type="text/javascript">\r
-\r
-</script>\r
-\r
-</head>\r
-\r
-<body onload="initialise()">\r
-\r
-  <table align="center" width=800>\r
-  <tr>\r
-    <td><div id="menu"></div></td>\r
-    <td><div id="ipphones"></div>\r
-      <h2>&nbsp;<br>How to Configure IP Phones</h2>\r
-      <h3>1. Atcom AT-530</h3>\r
-\r
-       <ol>\r
-       <li>Connect the WAN port of the AT-530 to your network, it will boot and obtain an IP via DHCP.  \r
-       <li>Find the <strong>IP</strong> of the phone by pressing the <strong>Sysinfo</strong> button a few times.  \r
-       <li>Open another browser window.  Go to the phones <strong>IP</strong>, for example <strong>http://192.168.1.160</strong>\r
-       <li>Login to the phone using the username/password <strong>admin/admin</strong>.  \r
-       <li>Optional: set a static IP using the WAN menu (I like static IPs for SIP phones).  \r
-       <li>Go to the phone <strong>SIP Config</strong> menu.\r
-       <li>Set <strong>Register Server Address</strong> to your Phone System IP Address.\r
-       <li>Set <strong>Register Username</strong> to the phone number (e.g. 6011).\r
-       <li>Also set <strong>Register Password</strong> to the phone number (e.g. 6011) and\r
-       the <strong>Phone Number</strong> to the phone number (e.g. 6011).\r
-       <li>Check the <strong>Enable Register</strong> box.\r
-       <li>Then click on <strong>Apply</strong>. \r
-       <li>On your browser refresh this page to see if the phone is connected to your phone system.\r
-       </ol>\r
-\r
-    </td>\r
-  </tr>\r
-\r
-  </table>\r
-</body>\r
-</html>\r
diff --git a/mini-asterisk-gui2/configure_AT-620R.html b/mini-asterisk-gui2/configure_AT-620R.html
deleted file mode 100644 (file)
index 3c33cb5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html>\r
-<html>\r
-<head>\r
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\r
-<title>ipPhones</title>\r
-\r
-<link rel="stylesheet" type="text/css" href="ministyle.css">\r
-<link rel="stylesheet" href="tooltip.css" type="text/css" />\r
-<script type="text/javascript" src="minicommon.js"></script>\r
-<script type="text/javascript" src="tooltip.js"></script>\r
-<script type="text/javascript" src="menu.js"></script>\r
-<script type="text/javascript" src="configure_AT.js"></script>\r
-<script type="text/javascript">\r
-\r
-</script>\r
-\r
-</head>\r
-\r
-<body onload="initialise()">\r
-\r
-  <table align="center" width=800>\r
-  <tr>\r
-    <td><div id="menu"></div></td>\r
-    <td><div id="ipphones"></div>\r
-      <h2>&nbsp;<br>How to Configure IP Phones</h2>\r
-\r
-      <h3>2. Atcom AT-620R</h3>\r
-\r
-       <ol>\r
-       <li>Connect the WAN port of the AT-620R to your network, it will boot and obtain an IP via DHCP.  \r
-       <li>Press the <strong>Menu</strong> button.  Enter <strong>123</strong> for the password, and press the <strong>OK</strong> soft button.  \r
-       <li>Using the <strong>down</strong> direction button (just beneath the menu key) move to the <strong>Product Info</strong> menu.  Then press the down button again and select <strong>Network Status</strong>.  The IP of the phone will be displayed at the top of the screen, for example 192.168.1.160.\r
-       <li>On your PC open another browser window.  Go to the phones <strong>IP</strong>, for example <strong>http://192.168.1.160</strong>\r
-       <li>Login to the phone using the username/password <strong>admin/admin</strong>.  \r
-       <li>Go to the phone <strong>VOIP</strong> menu.\r
-       <li>Set <strong>Server Address</strong> to your Phone System IP Address.\r
-       <li>Set <strong>Account Name</strong> to the phone number (e.g. 6011).\r
-       <li>Also set <strong>Password</strong> to the phone number (e.g. 6011) and <strong>Phone Number</strong> and <strong>Display Name</strong> to the phone number (e.g. 6011).\r
-       <img src="at-620r.png" alt="at-620r"/>\r
-       <li>Check the <strong>Enable Register</strong> box.\r
-       <li>Then click on <strong>Apply</strong>. \r
-       <li>On your browser refresh this page to see if the phone is connected to your phone system.\r
-       </ol>\r
-\r
-\r
-    </td>\r
-  </tr>\r
-\r
-  </table>\r
-</body>\r
-</html>\r
diff --git a/mini-asterisk-gui2/configure_AT.js b/mini-asterisk-gui2/configure_AT.js
deleted file mode 100644 (file)
index 4742f1a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  configure_AT.js
-  Ian Roberts
-  May 7 2012
-
-  Configure At handset screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-
-}
-
-
-
diff --git a/mini-asterisk-gui2/cross.png b/mini-asterisk-gui2/cross.png
deleted file mode 100644 (file)
index 05baecd..0000000
Binary files a/mini-asterisk-gui2/cross.png and /dev/null differ
diff --git a/mini-asterisk-gui2/devel notes.txt b/mini-asterisk-gui2/devel notes.txt
deleted file mode 100644 (file)
index 2ae696a..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-IP04 GUI2 Development notes
-Ian Roberts 
-Sept 2012
-
-
-IP04 Environment
-
-       telnet root@192.168.1.30
-       ipkg install dropbear           (for ssh access to ip04)
-       ipkg install fping 
-       ssh root@192.168.1.30
-       url:   192.168.1.30
-
-
-PC Environment 
-
-Packages
-
-       svn             version control
-       openssh         communication with ip04
-       fping           used to determine internet connection
-       chrome          built-in debugger .... ctrl-shift-i
-                       install validator extension
-       firefox         install extensions firebug debugger and html validator
-       lighttpd        minimal webserver
-       asterisk-1.4.11 when testing code around asterisk -r calls
-                       needs to be installed (we need access to the conf files)
-                       but doesn't have to be running unless testing sip stuff
-
-Source code
-
-       svn co https://freetel.svn.sourceforge.net/svnroot/freetel/mini-asterisk-gui2
-
-       svn status
-       svn diff <file>
-       svn add <newfile>
-       svn ci <file>
-       svn propset executable
-
-       tortoise svn on win7 
-       checkout https://freetel.svn.sourceforge.net/svnroot/freetel/mini-asterisk-gui
-
-lighttpd setup
-
-       point at the mini-asterisk-gui2 directory.
-       enable cgi
-       see x86 instructions at http://www.rowetel.com/blog/?page_id=455
-
-Asterisk Install
-
-       Install asterisk-1.4.11 from source code
-       see x86 instructions at http://www.rowetel.com/blog/?page_id=455
-
-       IP04 runs 1.4.4-1 (2007) with zaptel-sport 1.4.3-2 on a 2.6.19-3 kernel (2006).
-
-       You can ipkg install asterisk-1.4.20 (2008)
-
-       Asterisk 1.4.22 (2008) changed from using zaptel-sport to dahdi.
-
-       Asterisk 1.6.2.7 (2010) uses dahdi 2.3.0
-
-       AsteriskNow (2012) runs Asterisk 1.8.11 with Dahdi 2.6.1 on a 2.6.18-308 kernel
-
-
-Asterisk conf files
-
-
-       copy the following files from the gui2 source to /etc on the pc.
-
-       gui2/etc/asterisk/extensions.conf  to   /etc/asterisk/extensions.conf
-       gui2/etc/asterisk/sip.conf         to   /etc/asterisk/sip.conf
-       gui2/etc/asterisk/zapata.conf      to   /etc/asterisk/zapata.conf
-       gui2/etc/asterisk/iax.conf         to   /etc/asterisk/iax.conf
-
-       and
-
-       gui2/etc/zaptel.conf to /etc/zaptel.conf
-
-
-browser
-
-       url :   127.0.0.1/phones.html
-
-
-
-Method
-
-       Svn co code to PC gui2 directory
-       Point local web server at gui2 directory and enable cgi
-       Test on PC with 127.0.0.1/gui2/phones.html
-       Svn ci changes.
-       
-       
-       telnet IP04 pristine build or ssh to modified IP04 (dropbear)
-       Install gui2 from root directory
-          sh install_gui2.sh
-       
-       Test on IP04 with 192.168.1.30/gui2/phones.html
-
-
-
-
-Specific Tasks
-
-fping 
-       check reaction times 
-
-network 
-       test write properties
-
-sys info 
-       format and paging
-
-reception 
-       Incoming calls are switched to a handset defined in /etc/extensions.conf
-
-       exten => s,1,Dial(Zap/4&SIP/6011) ;; mini-asterisk - don't remove this comment
-
-       In this case, the analog handset hanging off Zap/4, and the sip hanset 6011
-
-       I had to use a static html button for reception update. 
-       The dynamic created button failed to fire setring.cgi
-
-       Setring.cgi : escaping the & works on the IP04 but fails on devel pc.... linux mint. 
-       sed on diff platforms?
-
-       http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf
-
-
-Install script
-       Done....install_gui2.sh
-
-Simple Switch button for GUI2 or original.
-       The GUIs can coexist. Should have the option of switching.
-
-dial tones impedance 
-    zaptel init.d
-       ztcfg
-       
-       cat /etc/zaptel.conf
-
-       loadzone = us
-       defaultzone=us
-
-       fxsks=1,2
-       fxoks=3,4
-
-       ---------------------------
-       loadzone = [your country] 
-       Set US or AUS
-       us au fr nl uk fi es jp no at nz it us-old gr tw cl se be sg il br hu lt pl za pt ee mx in de ch dk cz cn ve ph
-       http://www.voip-info.org/wiki/view/Asterisk+config+zaptel.conf
-
-Outgoing calls
-       Selectable FXO.
-       exten => _0.,1,Dial(Zap/g1/${EXTEN:1})
-
-Bad line/Bad HW detection
-       http://blackfin.uclinux.org/gf/project/asterisk/forum/?_forum_action=ForumMessageBrowse&thread_id=36325&action=ForumBrowse&forum_id=121
-        port the Oslec echo sampling code to the Blackfin
-
-       When I was developing the Oslec echo canceller I patched Zaptel to allow sampling of echo signals:
-       http://www.rowetel.com/ucasterisk/oslec.html#sample
-       With these samples I can usally diagnose echo problems, for example an obvious hardware problem, large or variable delays, a bad PSTN line or (rarely these days) Oslec falling over.
-       However I only ever ran the sampling code on x86 platforms, it was never ported to the Blackfin as there have been very few echo problems with the IP0X.
-       I don't have the time for this myself, but if some one would like to port the Oslec echo sampling code to the Blackfin I would be happy to take a look at the samples and help diagnose the echo problems.  The link above explains what is involved (some patches to Zaptel and a user mode program).
-       - David
-
-
-ntp page
-       ipkg install ntp
-       setting times.
-       Configuring ntp?
-
-       root:~> ipkg files ntp
-       Package ntp (4.1.1-1) is installed on root and has the following files:
-       /bin/ntpd
-       /bin/ntpdate
-       /etc/init.d/ntp
-       /usr/doc/ntp.txt
-
-        NOTES:
-
-        1. Set the /etc/TZ file for your timezone
-
-        2. The TZ env variable in your shell will set the current
-           time zone.  This gets set automatically via /etc/profile
-           for console and ssh logins, but for some reason it is not
-           set in telnet logins (maybe because they currently don't
-           have a proper login).
-
-        3. List of magic TZ codes here (thanks Mike Taht):
-               http://wiki.openwrt.org/OpenWrtDocs/Configuration
-               (search on TZ)
-
-        4. It's a really good idea to install the login ipkg (ipkg install
-           login), otherwise TZ doesn't get set correctly at the start of
-           each telnet session.  Without login TZ gets set only on the
-           serial console and ssh logins.
-
-       http://souptonuts.sourceforge.net/readme_working_with_time.html
-
-            Hours From Greenwich Mean Time (GMT) Value            
-                                                                   
-             0 GMT Greenwich Mean Time                             
-             +1   ECT   European Central Time                      
-             +2   EET   European Eastern Time                      
-             +2   ART                                              
-             +3   EAT   Saudi Arabia                               
-             +3.5 MET   Iran                                       
-             +4   NET                                              
-             +5   PLT   West Asia                                  
-             +5.5 IST   India                                      
-             +6   BST   Central Asia                               
-             +7   VST   Bangkok                                    
-             +8   CTT   China                                      
-             +9   JST   Japan                                      
-             +9.5 ACT   Central Australia                          
-             +10  AET   Eastern Australia                          
-             +11  SST   Central Pacific                            
-             +12  NST   New Zealand                                
-             -11  MIT   Samoa                                      
-             -10  HST   Hawaii                                     
-             -9   AST   Alaska                                     
-             -8   PST   Pacific Standard Time                      
-             -7   PNT   Arizona                                    
-             -7   MST   Mountain Standard Time                     
-             -6   CST   Central Standard Time                      
-             -5   EST   Eastern Standard Time                      
-             -5   IET   Indiana East                               
-             -4   PRT   Atlantic Standard Time                     
-             -3.5 CNT   Newfoundland                               
-             -3   AGT   Eastern South America                      
-             -3   BET   Eastern South America                      
-             -1   CAT   Azores                                     
-
-
-
-Simple autoattendant
-
-       http://blackfin.uclinux.org/gf/project/asterisk/forum/?_forum_action=ForumMessageBrowse&thread_id=35285&action=ForumBrowse&forum_id=121
-
-               [default]
-
-               exten => s,1,Ringing
-
-               exten => s,n,Wait(1)
-
-               exten => s,n,Answer
-
-               exten => s,n,Wait(1)
-
-               exten => s,n,Background(thank-you-for-calling)
-
-               exten => s,n,Background(if-u-know-ext-dial)
-
-               exten => s,n,Background(otherwise)
-
-               exten => s,n,Background(to-reach-operator)
-
-               exten => s,n,Background(pls-hold-while-try)
-
-               exten => s,n,WaitExten(6)
-
-               exten => 6000,1,Goto(s,1)
-
-               exten => 6050,1,VoiceMailMain
-
-               exten => 6060,1,MeetMe(${EXTEN},dM,,)
-
-               exten => 6090,1,Queue(${EXTEN})
-
-
-time-based autoattendant.
-       
-       http://astbook.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/Autoattendant_id287976.html
-       (for asterisk 1.8)
-
-       [main_menu]
-
-       exten => s,1,Verbose(1, Caller ${CALLERID(all)} has entered the auto attendant)
-           same => n,Answer()
-
-       ; this sets the inter-digit timer
-           same => n,Set(TIMEOUT(digit)=2)
-
-       ; wait one second to establish audio
-           same => n,Wait(1)
-
-       ; If Mon-Fri 9-5 goto label daygreeting
-           same => n,GotoIfTime(9:00-17:00,mon-fri,*,*?daygreeting:afterhoursgreeting)
-
-           same => n(afterhoursgreeting),Background(after-hours) ; AFTER HOURS GREETING
-           same => n,Goto(menuprompt)
-
-           same => n(daygreeting),Background(daytime)   ; DAY GREETING
-           same => n,Goto(menuprompt)
-
-           same => n(menuprompt),Background(main-menu) ; MAIN MENU PROMPT
-           same => n,WaitExten(4)                      ; more than 4 seconds is probably
-                                                       ; too much
-           same => n,Goto(0,1)                         ; Treat as if caller has pressed '0'
-
-       exten => 1,1,Verbose(1, Caller ${CALLERID(all)} has entered the sales queue)
-           same => n,Goto(Queues,7002,1)     ; Sales Queue - see Chapter 13 for details
-
-       exten => 2,1,Verbose(1, Caller ${CALLERID(all)} has entered the service queue)
-           same => n,Goto(Queues,7001,1)     ; Service Queue - see Chapter 13 for details
-
-       exten => 3,1,Verbose(1, Caller ${CALLERID(all)} has requested address and fax info)
-           same => n,Background()            ; Address and fax info
-           same => n,Goto(s,menuprompt)      ; Take caller back to main menu prompt
-
-       exten => #,1,Verbose(1, Caller ${CALLERID(all)} is entering the directory)
-           same => n,Directory(default)   ; Send the caller to the directory.
-                                          ; Use InternalSets as the dialing context
-
-       exten => 0,1,Verbose(1, Caller ${CALLERID(all)} is calling the operator)
-           same => n,Dial(SIP/operator)      ; Operator extension/queue
-
-       exten => i,1,Verbose(1, Caller ${CALLERID(all)} has entered an invalid selection)
-           same => n,Playback(invalid)
-           same => n,Goto(s,menuprompt)
-
-       exten => t,1,Verbose(1, Caller ${CALLERID(all)} has timed out)
-           same => n,Goto(0,1)
-
-
-       ; You will want to have a pattern match for the various extensions
-       ; that you'll allow external callers to dial
-       ; BUT DON'T JUST INCLUDE THE LocalSets CONTEXT
-       ; OR EXTERNAL CALLERS WILL BE ABLE TO MAKE CALLS OUT OF YOUR SYSTEM
-
-       ; WHATEVER YOU DO HERE, TEST IT CAREFULLY TO ENSURE EXTERNAL CALLERS
-       ; WILL NOT BE ABLE TO DO ANYTHING BUT DIAL INTERNAL EXTENSIONS
-
-       exten => _1XX,1,Verbose(1,Call to an extension starting with '1'
-           same => n,Goto(InternalSets,${EXTEN},1)
-
-
diff --git a/mini-asterisk-gui2/diagnostics.html b/mini-asterisk-gui2/diagnostics.html
deleted file mode 100644 (file)
index f091415..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Diagnostics</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="diagnostics.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="diagnostics"></div></td>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/diagnostics.js b/mini-asterisk-gui2/diagnostics.js
deleted file mode 100644 (file)
index a2f321f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  diagnostics.js
-  Ian Roberts
-  May 10 2012
-
-  diagnostics screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-    // 
-    
-    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
-    var html = '';
-
-    html += '<table align="right" width=600>';
-
-    // print out info
-
-    html += '<tr><td colspan="3" align="left" valign="top"><h2>Diagnostics</h2></td></tr>';
-    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision XXX</td></tr>';
-    html += '<tr><td colspan="2">Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>';
-    // this image will only come up if internet connection is present
-    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td><td> </td><td></td></tr>';
-    html += '<tr><td>&nbsp</td></tr>';
-    html += '</table>';
-
-    document.getElementById("diagnostics").innerHTML += html;
-
-}
-
-
-
diff --git a/mini-asterisk-gui2/etc/asterisk/extensions.conf b/mini-asterisk-gui2/etc/asterisk/extensions.conf
deleted file mode 100644 (file)
index b995781..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-; extensions.conf
-; David Rowe 4 Jan 2010
-;
-
-; Designed for Mini Asterisk GUI.  However you can hand modify as much
-; as you like, as GUI scripts read/and write regular extensions.conf
-; without messing with your custom dialplan
-
-
-[general]
-static = yes
-writeprotect = no
-autofallthrough = yes
-clearglobalvars = no
-priorityjumping = no
-
-[default]
-
-; Pre-configured analog extensions, depends on IP0X model and what modules
-; are installed.  Some of these may map to FXO ports
-
-exten => 6001,1,Dial(Zap/1)    ; mini_ext
-exten => 6002,1,Dial(Zap/2)    ; mini_ext
-exten => 6003,1,Dial(Zap/3)    ; mini_ext
-exten => 6004,1,Dial(Zap/4)    ; mini_ext
-exten => 6005,1,Dial(Zap/5)    ; mini_ext
-exten => 6006,1,Dial(Zap/6)    ; mini_ext
-exten => 6007,1,Dial(Zap/7)    ; mini_ext
-exten => 6008,1,Dial(Zap/8)    ; mini_ext
-
-; Pre-configured SIP-phone extensions.  Primary use case is multiple SIP
-; extensions and FXO analog Ports
-
-exten => 6011,1,Dial(SIP/6011)    ; mini_ext
-exten => 6012,1,Dial(SIP/6012)    ; mini_ext
-exten => 6013,1,Dial(SIP/6013)    ; mini_ext
-exten => 6014,1,Dial(SIP/6014)    ; mini_ext
-exten => 6015,1,Dial(SIP/6015)    ; mini_ext
-exten => 6016,1,Dial(SIP/6016)    ; mini_ext
-exten => 6017,1,Dial(SIP/6017)    ; mini_ext
-exten => 6018,1,Dial(SIP/6018)    ; mini_ext
-exten => 6019,1,Dial(SIP/6019)    ; mini_ext
-exten => 6020,1,Dial(SIP/6020)    ; mini_ext
-exten => 6021,1,Dial(SIP/6021)    ; mini_ext
-exten => 6022,1,Dial(SIP/6022)    ; mini_ext
-
-; Pre-configured mini-asterisk outgoing Analog group
-
-exten => _0.,1,Dial(Zap/g2/${EXTEN:1})
-
-; Pre-configured mini-asterisk outgoing VOIP line
-
-exten => _1.,1,Dial(SIP/voip/${EXTEN:1}) 
-
-; Pre-configured incoming calls
-
-exten => s,1,Dial(SIP/6011) ;; mini-asterisk - don't remove this comment
-
-#include "commis.conf"
diff --git a/mini-asterisk-gui2/etc/asterisk/extensions.conf.orig b/mini-asterisk-gui2/etc/asterisk/extensions.conf.orig
deleted file mode 100644 (file)
index 1b947c7..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-; extensions.conf
-; David Rowe 4 Jan 2010
-;
-
-; Designed for Mini Asterisk GUI.  However you can hand modify as much
-; as you like, as GUI scripts read/and write regular extensions.conf
-; without messing with your custom dialplan
-
-
-[general]
-static = yes
-writeprotect = no
-autofallthrough = yes
-clearglobalvars = no
-priorityjumping = no
-
-[default]
-
-exten => 555,1,Answer
-exten => 555,2,Read(ip||3)
-exten => 555,3,Ping(10.130.1.${ip})
-
-exten => 556,1,Answer
-exten => 556,2,milliwatt
-
-exten => 557,1,Answer
-exten => 557,2,Echo
-
-; Pre-configured analog extensions, depends on IP0X model and what modules
-; are installed.  Some of these may map to FXO ports
-
-; mini_ext tag causes GUI to pick these up and display on GUI
-
-exten => 6001,1,Dial(Zap/1) ; mini_ext
-exten => 6002,1,Dial(Zap/2) ; mini_ext
-exten => 6003,1,Dial(Zap/3) ; mini_ext
-exten => 6004,1,Dial(Zap/4) ; mini_ext
-exten => 6005,1,Dial(Zap/5) ; mini_ext
-exten => 6006,1,Dial(Zap/6) ; mini_ext
-exten => 6007,1,Dial(Zap/7) ; mini_ext
-exten => 6008,1,Dial(Zap/8) ; mini_ext
-
-; Pre-configured SIP-phone extensions.  Primary use case is multiple SIP
-; extensions and FXO analog Ports
-
-exten => 6011,1,Dial(SIP/6011) ; mini_ext
-exten => 6012,1,Dial(SIP/6012) ; mini_ext
-exten => 6013,1,Dial(SIP/6013) ; mini_ext
-exten => 6014,1,Dial(SIP/6014) ; mini_ext
-exten => 6015,1,Dial(SIP/6015) ; mini_ext
-exten => 6016,1,Dial(SIP/6016) ; mini_ext
-exten => 6017,1,Dial(SIP/6017) ; mini_ext
-exten => 6018,1,Dial(SIP/6018) ; mini_ext
-exten => 6019,1,Dial(SIP/6019) ; mini_ext
-exten => 6020,1,Dial(SIP/6020) ; mini_ext
-exten => 6021,1,Dial(SIP/6021) ; mini_ext
-exten => 6022,1,Dial(SIP/6022) ; mini_ext
-
-;; Pre-configured mini-asterisk outgoing Analog group
-
-exten => _0.,1,Dial(Zap/g1/${EXTEN:1})
-
-;; Pre-configured mini-asterisk outgoing VOIP line
-
-exten => _1.,1,Dial(SIP/user/${EXTEN:1}) 
-
-;; Pre-configured incoming calls
-
-exten => s,1,Dial(SIP/6011) ;; mini-asterisk - don't remove this comment
diff --git a/mini-asterisk-gui2/etc/asterisk/iax.conf b/mini-asterisk-gui2/etc/asterisk/iax.conf
deleted file mode 100644 (file)
index 4c016ba..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-
-; Inter-Asterisk eXchange driver definition
-;
-; This configuration is re-read at reload
-; or with the CLI command
-;      reload chan_iax2.so
-;
-; General settings, like port number to bind to, and
-; an option address (the default is to bind to all
-; local addresses).
-;
-[general]
-;bindport=4569                 ; bindport and bindaddr may be specified
-;                               ; NOTE: bindport must be specified BEFORE
-                               ; bindaddr or may be specified on a specific
-                               ; bindaddr if followed by colon and port
-                               ;  (e.g. bindaddr=192.168.0.1:4569)
-;bindaddr=192.168.0.1          ; more than once to bind to multiple
-;                               ; addresses, but the first will be the 
-;                               ; default
-;
-; Set iaxcompat to yes if you plan to use layered switches or
-; some other scenario which may cause some delay when doing a
-; lookup in the dialplan. It incurs a small performance hit to
-; enable it. This option causes Asterisk to spawn a separate thread
-; when it receives an IAX DPREQ (Dialplan Request) instead of
-; blocking while it waits for a response.
-;
-;iaxcompat=yes
-;
-; Disable UDP checksums (if nochecksums is set, then no checkums will
-; be calculated/checked on systems supporting this feature)
-;
-;nochecksums=no
-;
-;
-; For increased security against brute force password attacks
-; enable "delayreject" which will delay the sending of authentication
-; reject for REGREQ or AUTHREP if there is a password.  
-;
-;delayreject=yes
-;
-; You may specify a global default AMA flag for iaxtel calls.  It must be
-; one of 'default', 'omit', 'billing', or 'documentation'.  These flags
-; are used in the generation of call detail records.
-;
-;amaflags=default
-;
-; ADSI (Analog Display Services Interface) can be enabled if you have
-; (or may have) ADSI compatible CPE equipment
-;
-;adsi=no
-;
-; You may specify a default account for Call Detail Records in addition
-; to specifying on a per-user basis
-;
-;accountcode=lss0101
-;
-; You may specify a global default language for users. 
-; Can be specified also on a per-user basis
-; If omitted, will fallback to english
-;
-;language=en
-;
-; This option specifies a preference for which music on hold class this channel
-; should listen to when put on hold if the music class has not been set on the
-; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
-; channel putting this one on hold did not suggest a music class.
-;
-; If this option is set to "passthrough", then the hold message will always be
-; passed through as signalling instead of generating hold music locally.
-;
-; This option may be specified globally, or on a per-user or per-peer basis.
-;
-;mohinterpret=default
-;
-; This option specifies which music on hold class to suggest to the peer channel
-; when this channel places the peer on hold. It may be specified globally or on
-; a per-user or per-peer basis.
-;
-;mohsuggest=default
-;
-; Specify bandwidth of low, medium, or high to control which codecs are used
-; in general.
-;
-bandwidth=low
-;
-; You can also fine tune codecs here using "allow" and "disallow" clauses
-; with specific codecs.  Use "all" to represent all formats.
-;
-;allow=all                     ; same as bandwidth=high
-;disallow=g723.1               ; Hm...  Proprietary, don't use it...
-disallow=lpc10                 ; Icky sound quality...  Mr. Roboto.
-;allow=gsm                     ; Always allow GSM, it's cool :)
-;
-
-; You can adjust several parameters relating to the jitter buffer.
-; The jitter buffer's function is to compensate for varying
-; network delay.
-;
-; All the jitter buffer settings except dropcount are in milliseconds.
-; The jitter buffer works for INCOMING audio - the outbound audio
-; will be dejittered by the jitter buffer at the other end.
-;
-; jitterbuffer=yes|no: global default as to whether you want
-; the jitter buffer at all.
-;
-; forcejitterbuffer=yes|no: in the ideal world, when we bridge VoIP channels
-; we don't want to do jitterbuffering on the switch, since the endpoints
-; can each handle this.  However, some endpoints may have poor jitterbuffers 
-; themselves, so this option will force * to always jitterbuffer, even in this
-; case.
-;
-; maxjitterbuffer: a maximum size for the jitter buffer.
-; Setting a reasonable maximum here will prevent the call delay
-; from rising to silly values in extreme situations; you'll hear
-; SOMETHING, even though it will be jittery.
-;
-; resyncthreshold: when the jitterbuffer notices a significant change in delay
-; that continues over a few frames, it will resync, assuming that the change in
-; delay was caused by a timestamping mix-up. The threshold for noticing a
-; change in delay is measured as twice the measured jitter plus this resync
-; threshold.
-; Resyncing can be disabled by setting this parameter to -1.
-;
-; maxjitterinterps: the maximum number of interpolation frames the jitterbuffer
-; should return in a row. Since some clients do not send CNG/DTX frames to
-; indicate silence, the jitterbuffer will assume silence has begun after
-; returning this many interpolations. This prevents interpolating throughout
-; a long silence.
-;
-
-jitterbuffer=no
-forcejitterbuffer=no
-;dropcount=2
-;maxjitterbuffer=1000
-;maxjitterinterps=10
-;resyncthreshold=1000
-;maxexcessbuffer=80
-;minexcessbuffer=10
-;jittershrinkrate=1
-
-;trunkfreq=20                  ; How frequently to send trunk msgs (in ms)
-
-; Should we send timestamps for the individual sub-frames within trunk frames?
-; There is a small bandwidth use for these (less than 1kbps/call), but they
-; ensure that frame timestamps get sent end-to-end properly.  If both ends of
-; all your trunks go directly to TDM, _and_ your trunkfreq equals the frame
-; length for your codecs, you can probably suppress these.  The receiver must
-; also support this feature, although they do not also need to have it enabled.
-;
-; trunktimestamps=yes
-;
-; Minimum and maximum amounts of time that IAX peers can request as
-; a registration expiration interval (in seconds).
-; minregexpire = 60
-; maxregexpire = 60
-;
-; IAX helper threads
-; Establishes the number of iax helper threads to handle I/O.
-; iaxthreadcount = 10
-; Establishes the number of extra dynamic threads that may be spawned to handle I/O
-; iaxmaxthreadcount = 100
-;
-; We can register with another IAX server to let him know where we are
-; in case we have a dynamic IP address for example
-;
-; Register with tormenta using username marko and password secretpass
-;
-;register => marko:secretpass@tormenta.linux-support.net
-;
-; Register joe at remote host with no password
-;
-;register => joe@remotehost:5656
-;
-; Register marko at tormenta.linux-support.net using RSA key "torkey"
-;
-;register => marko:[torkey]@tormenta.linux-support.net
-;
-; Sample Registration for iaxtel
-;
-; Visit http://www.iaxtel.com to register with iaxtel.  Replace "user"
-; and "pass" with your username and password for iaxtel.  Incoming 
-; calls arrive at the "s" extension of "default" context.
-;
-;register => user:pass@iaxtel.com
-;
-; Sample Registration for IAX + FWD
-;
-; To register using IAX with FWD, it must be enabled by visiting the URL
-; http://www.fwdnet.net/index.php?section_id=112
-;
-; Note that you need an extension in you default context which matches
-; your free world dialup number.  Please replace "FWDNumber" with your
-; FWD number and "passwd" with your password.
-;
-;register => FWDNumber:passwd@iax.fwdnet.net
-;
-;
-; You can disable authentication debugging to reduce the amount of 
-; debugging traffic.
-;
-;authdebug=no
-;
-; See doc/README.tos for a description of the tos parameters.
-;tos=ef
-;
-; If regcontext is specified, Asterisk will dynamically create and destroy
-; a NoOp priority 1 extension for a given peer who registers or unregisters
-; with us.  The actual extension is the 'regexten' parameter of the registering
-; peer or its name if 'regexten' is not provided.  More than one regexten
-; may be supplied if they are separated by '&'.  Patterns may be used in
-; regexten.
-;
-;regcontext=iaxregistrations
-;
-; If we don't get ACK to our NEW within 2000ms, and autokill is set to yes,
-; then we cancel the whole thing (that's enough time for one retransmission
-; only).  This is used to keep things from stalling for a long time for a host
-; that is not available, but would be ill advised for bad connections.  In
-; addition to 'yes' or 'no' you can also specify a number of milliseconds.
-; See 'qualify' for individual peers to turn on for just a specific peer.
-;
-autokill=yes
-;
-; codecpriority controls the codec negotiation of an inbound IAX call.
-; This option is inherited to all user entities.  It can also be defined 
-; in each user entity separately which will override the setting in general.
-;
-; The valid values are:
-;
-; caller   - Consider the callers preferred order ahead of the host's.
-; host     - Consider the host's preferred order ahead of the caller's.
-; disabled - Disable the consideration of codec preference altogether.
-;            (this is the original behaviour before preferences were added)
-; reqonly  - Same as disabled, only do not consider capabilities if
-;            the requested format is not available the call will only
-;            be accepted if the requested format is available.
-;
-; The default value is 'host'
-;
-;codecpriority=host
-
-;rtcachefriends=yes    ; Cache realtime friends by adding them to the internal list
-                       ; just like friends added from the config file only on a
-                       ; as-needed basis? (yes|no)
-
-;rtupdate=yes          ; Send registry updates to database using realtime? (yes|no)
-                       ; If set to yes, when a IAX2 peer registers successfully,
-                       ; the ip address, the origination port, the registration period,
-                       ; and the username of the peer will be set to database via realtime.
-                       ; If not present, defaults to 'yes'.
-
-;rtautoclear=yes       ; Auto-Expire friends created on the fly on the same schedule
-                       ; as if it had just registered? (yes|no|<seconds>)
-                       ; If set to yes, when the registration expires, the friend will
-                       ; vanish from the configuration until requested again.
-                       ; If set to an integer, friends expire within this number of
-                       ; seconds instead of the registration interval.
-
-;rtignoreregexpire=yes ; When reading a peer from Realtime, if the peer's registration
-                       ; has expired based on its registration interval, used the stored
-                       ; address information regardless. (yes|no)
-
-; Guest sections for unauthenticated connection attempts.  Just specify an
-; empty secret, or provide no secret section.
-;
-[guest]
-type=user
-context=default
-callerid="Guest IAX User"
-
-;
-; Trust Caller*ID Coming from iaxtel.com
-;
-[iaxtel]
-type=user
-context=default
-auth=rsa
-inkeys=iaxtel
-
-;
-; Trust Caller*ID Coming from iax.fwdnet.net
-;
-[iaxfwd]
-type=user
-context=default
-auth=rsa
-inkeys=freeworlddialup
-
-;
-; Trust callerid delivered over DUNDi/e164
-;
-;
-;[dundi]
-;type=user
-;dbsecret=dundi/secret
-;context=dundi-e164-local
-
-;
-; Further user sections may be added, specifying a context and a secret used
-; for connections with that given authentication name.  Limited IP based
-; access control is allowed by use of "allow" and "deny" keywords.  Multiple
-; rules are permitted.  Multiple permitted contexts may be specified, in
-; which case the first will be the default.  You can also override caller*ID
-; so that when you receive a call you set the Caller*ID to be what you want
-; instead of trusting what the remote user provides
-;
-; There are three authentication methods that are supported:  md5, plaintext,
-; and rsa.  The least secure is "plaintext", which sends passwords cleartext
-; across the net.  "md5" uses a challenge/response md5 sum arrangement, but
-; still requires both ends have plain text access to the secret.  "rsa" allows
-; unidirectional secret knowledge through public/private keys.  If "rsa"
-; authentication is used, "inkeys" is a list of acceptable public keys on the 
-; local system that can be used to authenticate the remote peer, separated by
-; the ":" character.  "outkey" is a single, private key to use to authenticate
-; to the other side.  Public keys are named /var/lib/asterisk/keys/<name>.pub
-; while private keys are named /var/lib/asterisk/keys/<name>.key.  Private
-; keys should always be 3DES encrypted.
-;
-;
-; NOTE: All hostnames and IP addresses in this file are for example purposes
-;       only; you should not expect any of them to actually be available for
-;       your use.
-;
-;
-;[markster]
-;type=user
-;context=default
-;context=local
-;auth=md5,plaintext,rsa
-;secret=markpasswd
-;setvar=foo=bar
-;dbsecret=mysecrets/place      ; Secrets can be stored in astdb, too
-;transfer=no           ; Disable IAX native transfer
-;transfer=mediaonly    ; When doing IAX native transfers, transfer 
-                       ; only media stream
-;jitterbuffer=yes      ; Override global setting an enable jitter buffer
-;                      ; for this user
-;maxauthreq=10          ; Set maximum number of outstanding AUTHREQs waiting for replies. Any further authentication attempts will be blocked
-;                       ; if this limit is reached until they expire or a reply is received.
-;callerid="Mark Spencer" <(256) 428-6275>
-;deny=0.0.0.0/0.0.0.0
-;accountcode=markster0101
-;permit=209.16.236.73/255.255.255.0
-;language=en           ; Use english as default language
-;
-; Peers may also be specified, with a secret and
-; a remote hostname.
-;
-[demo]
-type=peer
-username=asterisk
-secret=supersecret
-host=216.207.245.47
-;sendani=no
-;host=asterisk.linux-support.net
-;port=5036
-;mask=255.255.255.255
-;qualify=yes                   ; Make sure this peer is alive
-;qualifysmoothing = yes                ; use an average of the last two PONG
-                               ; results to reduce falsely detected LAGGED hosts
-                               ; Default: Off
-;qualifyfreqok = 60000         ; how frequently to ping the peer when
-                               ; everything seems to be ok, in milliseconds
-;qualifyfreqnotok = 10000      ; how frequently to ping the peer when it's
-                               ; either LAGGED or UNAVAILABLE, in milliseconds
-;jitterbuffer=no               ; Turn off jitter buffer for this peer
-
-;
-; Peers can remotely register as well, so that they can be mobile.  Default
-; IP's can also optionally be given but are not required.  Caller*ID can be
-; suggested to the other side as well if it is for example a phone instead of
-; another PBX.
-;
-
-;[dynamichost]
-;host=dynamic
-;secret=mysecret
-;mailbox=1234          ; Notify about mailbox 1234
-;inkeys=key1:key2
-;peercontext=local     ; Default context to request for calls to peer
-;defaultip=216.207.245.34
-;callerid="Some Host" <(256) 428-6011>
-;
-
-;
-;[biggateway]
-;type=peer
-;host=192.168.0.1
-;context=*
-;secret=myscret
-;trunk=yes                     ; Use IAX2 trunking with this host
-;timezone=America/New_York     ; Set a timezone for the date/time IE
-;
-
-;
-; Friends are a short cut for creating a user and
-; a peer with the same values.
-;
-;[marko]
-;type=friend
-;host=dynamic
-;regexten=1234
-;secret=moofoo   ; Multiple secrets may be specified. For a "user", all
-;secret=foomoo   ; specified entries will be accepted as valid. For a "peer",
-;secret=shazbot  ; only the last specified secret will be used.
-;context=default
-;permit=0.0.0.0/0.0.0.0
-
diff --git a/mini-asterisk-gui2/etc/asterisk/sip.conf b/mini-asterisk-gui2/etc/asterisk/sip.conf
deleted file mode 100644 (file)
index bd4b84f..0000000
+++ /dev/null
@@ -1,844 +0,0 @@
-;
-; SIP Configuration example for Asterisk
-;
-; Syntax for specifying a SIP device in extensions.conf is
-; SIP/devicename where devicename is defined in a section below.
-;
-; You may also use 
-; SIP/username@domain to call any SIP user on the Internet
-; (Don't forget to enable DNS SRV records if you want to use this)
-; 
-; If you define a SIP proxy as a peer below, you may call
-; SIP/proxyhostname/user or SIP/user@proxyhostname 
-; where the proxyhostname is defined in a section below 
-; 
-; Useful CLI commands to check peers/users:
-;   sip show peers             Show all SIP peers (including friends)
-;   sip show users             Show all SIP users (including friends)
-;   sip show registry          Show status of hosts we register with
-;
-;   sip debug                  Show all SIP messages
-;
-;   reload chan_sip.so         Reload configuration file
-;                              Active SIP peers will not be reconfigured
-;
-
-[general]
-context=default                        ; Default context for incoming calls
-allowguest=no                  ; Allow or reject guest calls (default is yes)
-allowoverlap=no                        ; Disable overlap dialing support. (Default is yes)
-;allowtransfer=no              ; Disable all transfers (unless enabled in peers or users)
-                               ; Default is enabled
-;realm=mydomain.tld            ; Realm for digest authentication
-                               ; defaults to "asterisk". If you set a system name in
-                               ; asterisk.conf, it defaults to that system name
-                               ; Realms MUST be globally unique according to RFC 3261
-                               ; Set this to your host name or domain name
-bindport=5060                  ; UDP Port to bind to (SIP standard port is 5060)
-                               ; bindport is the local UDP port that Asterisk will listen on
-bindaddr=0.0.0.0               ; IP address to bind to (0.0.0.0 binds to all)
-srvlookup=yes                  ; Enable DNS SRV lookups on outbound calls
-                               ; Note: Asterisk only uses the first host 
-                               ; in SRV records
-                               ; Disabling DNS SRV lookups disables the 
-                               ; ability to place SIP calls based on domain 
-                               ; names to some other SIP users on the Internet
-                               
-;domain=mydomain.tld           ; Set default domain for this host
-                               ; If configured, Asterisk will only allow
-                               ; INVITE and REFER to non-local domains
-                               ; Use "sip show domains" to list local domains
-;pedantic=yes                  ; Enable checking of tags in headers, 
-                               ; international character conversions in URIs
-                               ; and multiline formatted headers for strict
-                               ; SIP compatibility (defaults to "no")
-
-; See doc/README.tos for a description of these parameters.
-;tos_sip=cs3                    ; Sets TOS for SIP packets.
-;tos_audio=ef                   ; Sets TOS for RTP audio packets.
-;tos_video=af41                 ; Sets TOS for RTP video packets.
-
-;maxexpiry=3600                        ; Maximum allowed time of incoming registrations
-                               ; and subscriptions (seconds)
-;minexpiry=60                  ; Minimum length of registrations/subscriptions (default 60)
-;defaultexpiry=120             ; Default length of incoming/outgoing registration
-;t1min=100                     ; Minimum roundtrip time for messages to monitored hosts
-                               ; Defaults to 100 ms
-;notifymimetype=text/plain     ; Allow overriding of mime type in MWI NOTIFY
-;checkmwi=10                   ; Default time between mailbox checks for peers
-;buggymwi=no                   ; Cisco SIP firmware doesn't support the MWI RFC
-                               ; fully. Enable this option to not get error messages
-                               ; when sending MWI to phones with this bug.
-;vmexten=voicemail             ; dialplan extension to reach mailbox sets the 
-                               ; Message-Account in the MWI notify message 
-                               ; defaults to "asterisk"
-;disallow=all                  ; First disallow all codecs
-;allow=ulaw                    ; Allow codecs in order of preference
-;allow=ilbc                    ; see doc/rtp-packetization for framing options
-;
-; This option specifies a preference for which music on hold class this channel
-; should listen to when put on hold if the music class has not been set on the
-; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
-; channel putting this one on hold did not suggest a music class.
-;
-; This option may be specified globally, or on a per-user or per-peer basis.
-;
-;mohinterpret=default
-;
-; This option specifies which music on hold class to suggest to the peer channel
-; when this channel places the peer on hold. It may be specified globally or on
-; a per-user or per-peer basis.
-;
-;mohsuggest=default
-;
-;language=en                   ; Default language setting for all users/peers
-                               ; This may also be set for individual users/peers
-;relaxdtmf=yes                 ; Relax dtmf handling
-;trustrpid = no                        ; If Remote-Party-ID should be trusted
-;sendrpid = yes                        ; If Remote-Party-ID should be sent
-;progressinband=never          ; If we should generate in-band ringing always
-                               ; use 'never' to never use in-band signalling, even in cases
-                               ; where some buggy devices might not render it
-                               ; Valid values: yes, no, never Default: never
-;useragent=Asterisk PBX                ; Allows you to change the user agent string
-;promiscredir = no             ; If yes, allows 302 or REDIR to non-local SIP address
-                               ; Note that promiscredir when redirects are made to the
-                                       ; local system will cause loops since Asterisk is incapable
-                                       ; of performing a "hairpin" call.
-;usereqphone = no              ; If yes, ";user=phone" is added to uri that contains
-                               ; a valid phone number
-;dtmfmode = rfc2833            ; Set default dtmfmode for sending DTMF. Default: rfc2833
-                               ; Other options: 
-                               ; info : SIP INFO messages
-                               ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
-                               ; auto : Use rfc2833 if offered, inband otherwise
-
-;compactheaders = yes          ; send compact sip headers.
-;
-;videosupport=yes              ; Turn on support for SIP video. You need to turn this on
-                               ; in the this section to get any video support at all.
-                               ; You can turn it off on a per peer basis if the general
-                               ; video support is enabled, but you can't enable it for
-                               ; one peer only without enabling in the general section.
-;maxcallbitrate=384            ; Maximum bitrate for video calls (default 384 kb/s)
-                               ; Videosupport and maxcallbitrate is settable
-                               ; for peers and users as well
-;callevents=no                 ; generate manager events when sip ua 
-                               ; performs events (e.g. hold)
-;alwaysauthreject = yes                ; When an incoming INVITE or REGISTER is to be rejected,
-                               ; for any reason, always reject with '401 Unauthorized'
-                               ; instead of letting the requester know whether there was
-                               ; a matching user or peer for their request
-
-;g726nonstandard = yes         ; If the peer negotiates G726-32 audio, use AAL2 packing
-                               ; order instead of RFC3551 packing order (this is required
-                               ; for Sipura and Grandstream ATAs, among others). This is
-                               ; contrary to the RFC3551 specification, the peer _should_
-                               ; be negotiating AAL2-G726-32 instead :-(
-
-;matchexterniplocally = yes     ; Only substitute the externip or externhost setting if it matches
-                                ; your localnet setting. Unless you have some sort of strange network
-                                ; setup you will not need to enable this.
-
-;
-; If regcontext is specified, Asterisk will dynamically create and destroy a
-; NoOp priority 1 extension for a given peer who registers or unregisters with
-; us and have a "regexten=" configuration item.  
-; Multiple contexts may be specified by separating them with '&'. The 
-; actual extension is the 'regexten' parameter of the registering peer or its
-; name if 'regexten' is not provided.  If more than one context is provided,
-; the context must be specified within regexten by appending the desired
-; context after '@'.  More than one regexten may be supplied if they are 
-; separated by '&'.  Patterns may be used in regexten.
-;
-;regcontext=sipregistrations
-;
-;--------------------------- RTP timers ----------------------------------------------------
-; These timers are currently used for both audio and video streams. The RTP timeouts
-; are only applied to the audio channel.
-; The settings are settable in the global section as well as per device
-;
-;rtptimeout=60                 ; Terminate call if 60 seconds of no RTP or RTCP activity
-                               ; on the audio channel
-                               ; when we're not on hold. This is to be able to hangup
-                               ; a call in the case of a phone disappearing from the net,
-                               ; like a powerloss or grandma tripping over a cable.
-;rtpholdtimeout=300            ; Terminate call if 300 seconds of no RTP or RTCP activity
-                               ; on the audio channel
-                               ; when we're on hold (must be > rtptimeout)
-;rtpkeepalive=<secs>           ; Send keepalives in the RTP stream to keep NAT open
-                               ; (default is off - zero)
-;--------------------------- SIP DEBUGGING ---------------------------------------------------
-;sipdebug = yes                        ; Turn on SIP debugging by default, from
-                               ; the moment the channel loads this configuration
-;recordhistory=yes             ; Record SIP history by default 
-                               ; (see sip history / sip no history)
-;dumphistory=yes               ; Dump SIP history at end of SIP dialogue
-                               ; SIP history is output to the DEBUG logging channel
-
-
-;--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
-; You can subscribe to the status of extensions with a "hint" priority
-; (See extensions.conf.sample for examples)
-; chan_sip support two major formats for notifications: dialog-info and SIMPLE 
-;
-; You will get more detailed reports (busy etc) if you have a call limit set
-; for a device. When the call limit is filled, we will indicate busy. Note that
-; you need at least 2 in order to be able to do attended transfers.
-;
-; For queues, you will need this level of detail in status reporting, regardless
-; if you use SIP subscriptions. Queues and manager use the same internal interface
-; for reading status information.
-;
-; Note: Subscriptions does not work if you have a realtime dialplan and use the
-; realtime switch.
-;
-;allowsubscribe=no             ; Disable support for subscriptions. (Default is yes)
-;subscribecontext = default    ; Set a specific context for SUBSCRIBE requests
-                               ; Useful to limit subscriptions to local extensions
-                               ; Settable per peer/user also
-;notifyringing = yes           ; Notify subscriptions on RINGING state (default: no)
-;notifyhold = yes              ; Notify subscriptions on HOLD state (default: no)
-                               ; Turning on notifyringing and notifyhold will add a lot
-                               ; more database transactions if you are using realtime.
-;limitonpeers = yes            ; Apply call limits on peers only. This will improve 
-                               ; status notification when you are using type=friend
-                               ; Inbound calls, that really apply to the user part
-                               ; of a friend will now be added to and compared with
-                               ; the peer limit instead of applying two call limits,
-                               ; one for the peer and one for the user.
-
-;----------------------------------------- T.38 FAX PASSTHROUGH SUPPORT -----------------------
-;
-; This setting is available in the [general] section as well as in device configurations.
-; Setting this to yes, enables T.38 fax (UDPTL) passthrough on SIP to SIP calls, provided
-; both parties have T38 support enabled in their Asterisk configuration 
-; This has to be enabled in the general section for all devices to work. You can then
-; disable it on a per device basis. 
-;
-; T.38 faxing only works in SIP to SIP calls, with no local or agent channel being used.
-;
-; t38pt_udptl = yes            ; Default false
-;
-;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
-; Asterisk can register as a SIP user agent to a SIP proxy (provider)
-; Format for the register statement is:
-;       register => user[:secret[:authuser]]@host[:port][/extension]
-;
-; If no extension is given, the 's' extension is used. The extension needs to
-; be defined in extensions.conf to be able to accept calls from this SIP proxy
-; (provider).
-;
-; host is either a host name defined in DNS or the name of a section defined
-; below.
-;
-; Examples:
-;
-;register => 9876: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
-;
-;
-;register => 2345:password@sip_proxy/1234
-;
-;    Register 2345 at sip provider 'sip_proxy'.  Calls from this provider
-;    connect to local extension 1234 in extensions.conf, default context,
-;    unless you configure a [sip_proxy] section below, and configure a
-;    context.
-;    Tip 1: Avoid assigning hostname to a sip.conf section like [provider.com]
-;    Tip 2: Use separate type=peer and type=user sections for SIP providers
-;           (instead of type=friend) if you have calls in both directions
-  
-;registertimeout=20            ; retry registration calls every 20 seconds (default)
-;registerattempts=10           ; Number of registration attempts before we give up
-                               ; 0 = continue forever, hammering the other server
-                               ; until it accepts the registration
-                               ; Default is 0 tries, continue forever
-
-;----------------------------------------- NAT SUPPORT ------------------------
-; The externip, externhost and localnet settings are used if you use Asterisk
-; behind a NAT device to communicate with services on the outside.
-
-;externip = 200.201.202.203    ; Address that we're going to put in outbound SIP
-                               ; messages if we're behind a NAT
-
-                               ; The externip and localnet is used
-                               ; when registering and communicating with other proxies
-                               ; that we're registered with
-;externhost=foo.dyndns.net     ; Alternatively you can specify an 
-                               ; external host, and Asterisk will 
-                               ; perform DNS queries periodically.  Not
-                               ; recommended for production 
-                               ; environments!  Use externip instead
-;externrefresh=10              ; How often to refresh externhost if 
-                               ; used
-                               ; You may add multiple local networks.  A reasonable 
-                               ; set of defaults are:
-;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
-;localnet=10.0.0.0/255.0.0.0   ; Also RFC1918
-;localnet=172.16.0.0/12                ; Another RFC1918 with CIDR notation
-;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
-
-; The nat= setting is used when Asterisk is on a public IP, communicating with
-; devices hidden behind a NAT device (broadband router).  If you have one-way
-; audio problems, you usually have problems with your NAT configuration or your
-; firewall's support of SIP+RTP ports.  You configure Asterisk choice of RTP
-; ports for incoming audio in rtp.conf
-;
-;nat=no                                ; Global NAT settings  (Affects all peers and users)
-                                ; yes = Always ignore info and assume NAT
-                                ; no = Use NAT mode only according to RFC3581 (;rport)
-                                ; never = Never attempt NAT mode or RFC3581 support
-                               ; route = Assume NAT, don't send rport 
-                               ; (work around more UNIDEN bugs)
-
-;----------------------------------- MEDIA HANDLING --------------------------------
-; By default, Asterisk tries to re-invite the audio to an optimal path. If there's
-; no reason for Asterisk to stay in the media path, the media will be redirected.
-; This does not really work with in the case where Asterisk is outside and have
-; clients on the inside of a NAT. In that case, you want to set canreinvite=nonat
-;
-;canreinvite=yes               ; Asterisk by default tries to redirect the
-                               ; RTP media stream (audio) to go directly from
-                               ; the caller to the callee.  Some devices do not
-                               ; support this (especially if one of them is behind a NAT).
-                               ; The default setting is YES. If you have all clients
-                               ; behind a NAT, or for some other reason wants Asterisk to
-                               ; stay in the audio path, you may want to turn this off.
-
-                               ; In Asterisk 1.4 this setting also affect direct RTP
-                               ; at call setup (a new feature in 1.4 - setting up the
-                               ; call directly between the endpoints instead of sending
-                               ; a re-INVITE).
-
-;directrtpsetup=yes            ; Enable the new experimental direct RTP setup. This sets up
-                               ; the call directly with media peer-2-peer without re-invites.
-                               ; Will not work for video and cases where the callee sends 
-                               ; RTP payloads and fmtp headers in the 200 OK that does not match the
-                               ; callers INVITE.
-
-;canreinvite=nonat             ; An additional option is to allow media path redirection
-                               ; (reinvite) but only when the peer where the media is being
-                               ; sent is known to not be behind a NAT (as the RTP core can
-                               ; determine it based on the apparent IP address the media
-                               ; arrives from).
-
-;canreinvite=update            ; Yet a third option... use UPDATE for media path redirection,
-                               ; instead of INVITE. This can be combined with 'nonat', as
-                               ; 'canreinvite=update,nonat'. It implies 'yes'.
-
-;----------------------------------------- REALTIME SUPPORT ------------------------
-; For additional information on ARA, the Asterisk Realtime Architecture,
-; please read realtime.txt and extconfig.txt in the /doc directory of the
-; source code.
-;
-;rtcachefriends=yes            ; Cache realtime friends by adding them to the internal list
-                               ; just like friends added from the config file only on a
-                               ; as-needed basis? (yes|no)
-
-;rtsavesysname=yes             ; Save systemname in realtime database at registration
-                               ; Default= no
-
-;rtupdate=yes                  ; Send registry updates to database using realtime? (yes|no)
-                               ; If set to yes, when a SIP UA registers successfully, the ip address,
-                               ; the origination port, the registration period, and the username of
-                               ; the UA will be set to database via realtime. 
-                               ; If not present, defaults to 'yes'.
-;rtautoclear=yes               ; Auto-Expire friends created on the fly on the same schedule
-                               ; as if it had just registered? (yes|no|<seconds>)
-                               ; If set to yes, when the registration expires, the friend will
-                               ; vanish from the configuration until requested again. If set
-                               ; to an integer, friends expire within this number of seconds
-                               ; instead of the registration interval.
-
-;ignoreregexpire=yes           ; Enabling this setting has two functions:
-                               ;
-                               ; For non-realtime peers, when their registration expires, the
-                               ; information will _not_ be removed from memory or the Asterisk database
-                               ; if you attempt to place a call to the peer, the existing information
-                               ; will be used in spite of it having expired
-                               ;
-                               ; For realtime peers, when the peer is retrieved from realtime storage,
-                               ; the registration information will be used regardless of whether
-                               ; it has expired or not; if it expires while the realtime peer 
-                               ; is still in memory (due to caching or other reasons), the 
-                               ; information will not be removed from realtime storage
-
-;----------------------------------------- SIP DOMAIN SUPPORT ------------------------
-; Incoming INVITE and REFER messages can be matched against a list of 'allowed'
-; domains, each of which can direct the call to a specific context if desired.
-; By default, all domains are accepted and sent to the default context or the
-; context associated with the user/peer placing the call.
-; Domains can be specified using:
-; domain=<domain>[,<context>]
-; Examples:
-; domain=myasterisk.dom
-; domain=customer.com,customer-context
-;
-; In addition, all the 'default' domains associated with a server should be
-; added if incoming request filtering is desired.
-; autodomain=yes
-;
-; To disallow requests for domains not serviced by this server:
-; allowexternaldomains=no
-
-;domain=mydomain.tld,mydomain-incoming
-                               ; Add domain and configure incoming context
-                               ; for external calls to this domain
-;domain=1.2.3.4                        ; Add IP address as local domain
-                               ; You can have several "domain" settings
-;allowexternalinvites=no       ; Disable INVITE and REFER to non-local domains
-                               ; Default is yes
-;autodomain=yes                        ; Turn this on to have Asterisk add local host
-                               ; name and local IP to domain list.
-
-; fromdomain=mydomain.tld      ; When making outbound SIP INVITEs to
-                               ; non-peers, use your primary domain "identity"
-                               ; for From: headers instead of just your IP
-                               ; address. This is to be polite and
-                               ; it may be a mandatory requirement for some
-                               ; destinations which do not have a prior
-                               ; account relationship with your server. 
-
-;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
-; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
-                              ; SIP channel. Defaults to "no". An enabled jitterbuffer will
-                              ; be used only if the sending side can create and the receiving
-                              ; side can not accept jitter. The SIP channel can accept jitter,
-                              ; thus a jitterbuffer on the receive SIP side will be used only
-                              ; if it is forced and enabled.
-
-; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a SIP
-                              ; channel. Defaults to "no".
-
-; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
-
-; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
-                              ; resynchronized. Useful to improve the quality of the voice, with
-                              ; big jumps in/broken timestamps, usually sent from exotic devices
-                              ; and programs. Defaults to 1000.
-
-; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
-                              ; channel. Two implementations are currently available - "fixed"
-                              ; (with size always equals to jbmaxsize) and "adaptive" (with
-                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
-
-; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
-;-----------------------------------------------------------------------------------
-
-[authentication]
-; Global credentials for outbound calls, i.e. when a proxy challenges your
-; Asterisk server for authentication. These credentials override
-; any credentials in peer/register definition if realm is matched.
-;
-; This way, Asterisk can authenticate for outbound calls to other
-; realms. We match realm on the proxy challenge and pick an set of 
-; credentials from this list
-; Syntax:
-;      auth = <user>:<secret>@<realm>
-;      auth = <user>#<md5secret>@<realm>
-; Example:
-;auth=mark:topsecret@digium.com
-; 
-; You may also add auth= statements to [peer] definitions 
-; Peer auth= override all other authentication settings if we match on realm
-
-;------------------------------------------------------------------------------
-; Users and peers have different settings available. Friends have all settings,
-; since a friend is both a peer and a user
-;
-; User config options:        Peer configuration:
-; --------------------        -------------------
-; context                     context
-; callingpres                callingpres
-; permit                      permit
-; deny                        deny
-; secret                      secret
-; md5secret                   md5secret
-; dtmfmode                    dtmfmode
-; canreinvite                 canreinvite
-; nat                         nat
-; callgroup                   callgroup
-; pickupgroup                 pickupgroup
-; language                    language
-; allow                       allow
-; disallow                    disallow
-; insecure                    insecure
-; trustrpid                   trustrpid
-; progressinband              progressinband
-; promiscredir                promiscredir
-; useclientcode               useclientcode
-; accountcode                 accountcode
-; setvar                      setvar
-; callerid                   callerid
-; amaflags                   amaflags
-; call-limit                 call-limit
-; allowoverlap               allowoverlap
-; allowsubscribe             allowsubscribe
-; allowtransfer                      allowtransfer
-; subscribecontext           subscribecontext
-; videosupport               videosupport
-; maxcallbitrate             maxcallbitrate
-; rfc2833compensate           mailbox
-;                             username
-;                             template
-;                             fromdomain
-;                             regexten
-;                             fromuser
-;                             host
-;                             port
-;                             qualify
-;                             defaultip
-;                             rtptimeout
-;                             rtpholdtimeout
-;                             sendrpid
-;                             outboundproxy
-;                             rfc2833compensate
-
-;[sip_proxy]
-; For incoming calls only. Example: FWD (Free World Dialup)
-; We match on IP address of the proxy for incoming calls 
-; since we can not match on username (caller id)
-;type=peer
-;context=from-fwd
-;host=fwd.pulver.com
-
-;[sip_proxy-out]
-;type=peer                             ; we only want to call out, not be called
-;secret=guessit
-;username=yourusername                 ; Authentication user for outbound proxies
-;fromuser=yourusername                 ; Many SIP providers require this!
-;fromdomain=provider.sip.domain        
-;host=box.provider.com
-;usereqphone=yes                       ; This provider requires ";user=phone" on URI
-;call-limit=5                          ; permit only 5 simultaneous outgoing calls to this peer
-;outboundproxy=proxy.provider.domain   ; send outbound signaling to this proxy, not directly to the peer
-                                       ; Call-limits will not be enforced on real-time peers,
-                                       ; since they are not stored in-memory
-;port=80                               ; The port number we want to connect to on the remote side
-                                       ; Also used as "defaultport" in combination with "defaultip" settings
-
-;------------------------------------------------------------------------------
-; Definitions of locally connected SIP devices
-;
-; type = user  a device that authenticates to us by "from" field to place calls
-; type = peer  a device we place calls to or that calls us and we match by host
-; type = friend two configurations (peer+user) in one
-;
-; For device names, we recommend using only a-z, numerics (0-9) and underscore
-; 
-; For local phones, type=friend works most of the time
-;
-; If you have one-way audio, you probably have NAT problems. 
-; If Asterisk is on a public IP, and the phone is inside of a NAT device
-; you will need to configure nat option for those phones.
-; Also, turn on qualify=yes to keep the nat session open
-
-;[grandstream1]
-;type=friend                   
-;context=from-sip              ; Where to start in the dialplan when this phone calls
-;callerid=John Doe <1234>      ; Full caller ID, to override the phones config
-                               ; on incoming calls to Asterisk
-;host=192.168.0.23             ; we have a static but private IP address
-                               ; No registration allowed
-;nat=no                                ; there is not NAT between phone and Asterisk
-;canreinvite=yes               ; allow RTP voice traffic to bypass Asterisk
-;dtmfmode=info                 ; either RFC2833 or INFO for the BudgeTone
-;call-limit=1                  ; permit only 1 outgoing call and 1 incoming call at a time
-                               ; from the phone to asterisk
-                               ; 1 for the explicit peer, 1 for the explicit user,
-                               ; remember that a friend equals 1 peer and 1 user in
-                               ; memory
-                               ; This will affect your subscriptions as well.
-                               ; There is no combined call counter for a "friend"
-                               ; so there's currently no way in sip.conf to limit
-                               ; to one inbound or outbound call per phone. Use
-                               ; the group counters in the dial plan for that.
-                               ;
-;mailbox=1234@default          ; mailbox 1234 in voicemail context "default"
-;disallow=all                  ; need to disallow=all before we can use allow=
-;allow=ulaw                    ; Note: In user sections the order of codecs
-                               ; listed with allow= does NOT matter!
-;allow=alaw
-;allow=g723.1                  ; Asterisk only supports g723.1 pass-thru!
-;allow=g729                    ; Pass-thru only unless g729 license obtained
-;callingpres=allowed_passed_screen     ; Set caller ID presentation
-                               ; See README.callingpres for more information
-
-
-;[xlite1]
-; Turn off silence suppression in X-Lite ("Transmit Silence"=YES)!
-; Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
-;type=friend
-;regexten=1234                 ; When they register, create extension 1234
-;callerid="Jane Smith" <5678>
-;host=dynamic                  ; This device needs to register
-;nat=yes                       ; X-Lite is behind a NAT router
-;canreinvite=no                        ; Typically set to NO if behind NAT
-;disallow=all
-;allow=gsm                     ; GSM consumes far less bandwidth than ulaw
-;allow=ulaw
-;allow=alaw
-;mailbox=1234@default,1233@default     ; Subscribe to status of multiple mailboxes
-
-
-;[snom]
-;type=friend                   ; Friends place calls and receive calls
-;context=from-sip              ; Context for incoming calls from this user
-;secret=blah
-;subscribecontext=localextensions      ; Only allow SUBSCRIBE for local extensions
-;language=de                   ; Use German prompts for this user 
-;host=dynamic                  ; This peer register with us
-;dtmfmode=inband               ; Choices are inband, rfc2833, or info
-;defaultip=192.168.0.59                ; IP used until peer registers
-;mailbox=1234@context,2345      ; Mailbox(-es) for message waiting indicator
-;subscribemwi=yes              ; Only send notifications if this phone 
-                               ; subscribes for mailbox notification
-;vmexten=voicemail             ; dialplan extension to reach mailbox 
-                               ; sets the Message-Account in the MWI notify message
-                               ; defaults to global vmexten which defaults to "asterisk"
-;disallow=all
-;allow=ulaw                    ; dtmfmode=inband only works with ulaw or alaw!
-
-
-;[polycom]
-;type=friend                   ; Friends place calls and receive calls
-;context=from-sip              ; Context for incoming calls from this user
-;secret=blahpoly
-;host=dynamic                  ; This peer register with us
-;dtmfmode=rfc2833              ; Choices are inband, rfc2833, or info
-;username=polly                        ; Username to use in INVITE until peer registers
-                               ; Normally you do NOT need to set this parameter
-;disallow=all
-;allow=ulaw                     ; dtmfmode=inband only works with ulaw or alaw!
-;progressinband=no             ; Polycom phones don't work properly with "never"
-
-
-;[pingtel]
-;type=friend
-;secret=blah
-;host=dynamic
-;insecure=port                 ; Allow matching of peer by IP address without 
-                               ; matching port number
-;insecure=invite               ; Do not require authentication of incoming INVITEs
-;insecure=port,invite          ; (both)
-;qualify=1000                  ; Consider it down if it's 1 second to reply
-                               ; Helps with NAT session
-                               ; qualify=yes uses default value
-;
-; Call group and Pickup group should be in the range from 0 to 63
-;
-;callgroup=1,3-4               ; We are in caller groups 1,3,4
-;pickupgroup=1,3-5             ; We can do call pick-p for call group 1,3,4,5
-;defaultip=192.168.0.60                ; IP address to use if peer has not registered
-;deny=0.0.0.0/0.0.0.0          ; ACL: Control access to this account based on IP address
-;permit=192.168.0.60/255.255.255.0
-
-;[cisco1]
-;type=friend
-;secret=blah
-;qualify=200                   ; Qualify peer is no more than 200ms away
-;nat=yes                       ; This phone may be natted
-                               ; Send SIP and RTP to the IP address that packet is 
-                               ; received from instead of trusting SIP headers 
-;host=dynamic                  ; This device registers with us
-;canreinvite=no                        ; Asterisk by default tries to redirect the
-                               ; RTP media stream (audio) to go directly from
-                               ; the caller to the callee.  Some devices do not
-                               ; support this (especially if one of them is 
-                               ; behind a NAT).
-;defaultip=192.168.0.4         ; IP address to use until registration
-;username=goran                        ; Username to use when calling this device before registration
-                               ; Normally you do NOT need to set this parameter
-;setvar=CUSTID=5678            ; Channel variable to be set for all calls from this device
-
-;[pre14-asterisk]
-;type=friend
-;secret=digium
-;host=dynamic
-;rfc2833compensate=yes         ; Compensate for pre-1.4 DTMF transmission from another Asterisk machine.
-                               ; You must have this turned on or DTMF reception will work improperly.
-
-[6010]
-type=friend
-context=default
-host=dynamic
-secret=6010
-canreinvite=no
-callerid=6010
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6011]
-type=friend
-context=default
-host=dynamic
-secret=6011
-canreinvite=no
-callerid=6011
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6012]
-type=friend
-context=default
-host=dynamic
-secret=6012
-canreinvite=no
-callerid=6012
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6013]
-type=friend
-context=default
-host=dynamic
-secret=6013
-canreinvite=no
-callerid=6013
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6014]
-type=friend
-context=default
-host=dynamic
-secret=6014
-canreinvite=no
-callerid=6014
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6015]
-type=friend
-context=default
-host=dynamic
-secret=6015
-canreinvite=no
-callerid=6015
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6016]
-type=friend
-context=default
-host=dynamic
-secret=6016
-canreinvite=no
-callerid=6016
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6017]
-type=friend
-context=default
-host=dynamic
-secret=6017
-canreinvite=no
-callerid=6017
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6018]
-type=friend
-context=default
-host=dynamic
-secret=6018
-canreinvite=no
-callerid=6018
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6019]
-type=friend
-context=default
-host=dynamic
-secret=6019
-canreinvite=no
-callerid=6019
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-[6020]
-type=friend
-context=default
-host=dynamic
-secret=6020
-canreinvite=no
-callerid=6020
-disallow=all
-allow=ulaw,alaw
-qualify=yes
-
-; Pre-configured mini-asterisk SIP trunks
-
-;[usersipnat]            ; sipnat-mini-asterisk do not remove this comment
-;                          You reach your ITSP via a NAT router (most common)
-;type=friend             ; sipnat-mini-asterisk do not remove this comment
-;context=default         ; sipnat-mini-asterisk do not remove this comment
-;username=usernat        ; sipnat-mini-asterisk do not remove this comment
-;secret=passwordnat      ; sipnat-mini-asterisk do not remove this comment
-;fromdomain=fromdomainnat ; sipnat-mini-asterisk do not remove this comment
-;fromuser=fromusernat     ; sipnat-mini-asterisk do not remove this comment
-;host=hostnat            ; sipnat-mini-asterisk do not remove this comment
-;canreinvite=no          ; sipnat-mini-asterisk do not remove this comment
-;disallow=all            ; sipnat-mini-asterisk do not remove this comment
-;allow=ulaw,alaw         ; sipnat-mini-asterisk do not remove this comment
-;qualify=yes             ; sipnat-mini-asterisk do not remove this comment
-;nat=yes                 ; sipnat-mini-asterisk do not remove this comment
-
-;[usersipnormal]         ; sipnormal-mini-asterisk do not remove this comment
-;                          No NAT router between your Phone system and your ITSP
-;type=friend             ; sipnormal-mini-asterisk do not remove this comment
-;context=default         ; sipnormal-mini-asterisk do not remove this comment
-;username=usersip        ; sipnormal-mini-asterisk do not remove this comment
-;secret=passwordsip      ; sipnormal-mini-asterisk do not remove this comment
-;fromdomain=fromdomainsip ; sipnormal-mini-asterisk do not remove this comment
-;fromuser=fromusersip     ; sipnormal-mini-asterisk do not remove this comment
-;host=hostsip            ; sipnormal-mini-asterisk do not remove this comment
-;canreinvite=no          ; sipnormal-mini-asterisk do not remove this comment
-;disallow=all            ; sipnormal-mini-asterisk do not remove this comment
-;allow=ulaw,alaw         ; sipnormal-mini-asterisk do not remove this comment
-;qualify=yes             ; sipnormal-mini-asterisk do not remove this comment
-
-;[userjazmin]            ; jazmin-mini-asterisk do not remove this comment
-;                          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=fromdomainjaz ; jazmin-mini-asterisk do not remove this comment
-;fromuser=fromuserjaz     ; 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
-
-;[usertrev]              ; usertrev-mini-asterisk do not remove this comment
-;                           a test sip provider
-;type=friend             ; usertrev-mini-asterisk do not remove this comment
-;context=default         ; usertrev-mini-asterisk do not remove this comment
-;username=trev           ; usertrev-mini-asterisk do not remove this comment
-;secret=supertrev        ; usertrev-mini-asterisk do not remove this comment
-;host=dynamic            ; usertrev-mini-asterisk do not remove this comment
-;canreinvite=no          ; usertrev-mini-asterisk do not remove this comment
-;disallow=all            ; usertrev-mini-asterisk do not remove this comment
-;allow=ulaw,alaw         ; usertrev-mini-asterisk do not remove this comment
-;qualify=yes             ; usertrev-mini-asterisk do not remove this comment
-;nat=yes                 ; usertrev-mini-asterisk do not remove this comment
diff --git a/mini-asterisk-gui2/etc/asterisk/zapata.conf b/mini-asterisk-gui2/etc/asterisk/zapata.conf
deleted file mode 100644 (file)
index d870b8d..0000000
+++ /dev/null
@@ -1,658 +0,0 @@
-;
-; Zapata telephony interface
-;
-; Configuration file
-;
-; You need to restart Asterisk to re-configure the Zap channel
-; CLI> reload chan_zap.so 
-;              will reload the configuration file,
-;              but not all configuration options are 
-;              re-configured during a reload.
-
-
-
-[trunkgroups]
-;
-; Trunk groups are used for NFAS or GR-303 connections.
-;
-; Group: Defines a trunk group.  
-;        trunkgroup => <trunkgroup>,<dchannel>[,<backup1>...]
-;
-;        trunkgroup  is the numerical trunk group to create
-;        dchannel    is the zap channel which will have the 
-;                    d-channel for the trunk.
-;        backup1     is an optional list of backup d-channels.
-;
-;trunkgroup => 1,24,48
-;trunkgroup => 1,24
-;
-; Spanmap: Associates a span with a trunk group
-;        spanmap => <zapspan>,<trunkgroup>[,<logicalspan>]
-;
-;        zapspan     is the zap span number to associate
-;        trunkgroup  is the trunkgroup (specified above) for the mapping
-;        logicalspan is the logical span number within the trunk group to use.
-;                    if unspecified, no logical span number is used.
-;
-;spanmap => 1,1,1
-;spanmap => 2,1,2
-;spanmap => 3,1,3
-;spanmap => 4,1,4
-
-[channels]
-;
-; Default language
-;
-;language=en
-;
-; Default context
-;
-context=default
-;
-; Switchtype:  Only used for PRI.
-;
-; national:      National ISDN 2 (default)
-; dms100:        Nortel DMS100
-; 4ess:           AT&T 4ESS
-; 5ess:                  Lucent 5ESS
-; euroisdn:       EuroISDN
-; ni1:            Old National ISDN 1
-; qsig:           Q.SIG
-;
-switchtype=national
-;
-; Some switches (AT&T especially) require network specific facility IE
-; supported values are currently 'none', 'sdn', 'megacom', 'tollfreemegacom', 'accunet'
-;
-;nsf=none
-;
-; PRI Dialplan:  Only RARELY used for PRI.
-;
-; unknown:        Unknown
-; private:        Private ISDN
-; local:          Local ISDN
-; national:      National ISDN
-; international:  International ISDN
-; dynamic:       Dynamically selects the appropriate dialplan
-;
-;pridialplan=national
-;
-; PRI Local Dialplan:  Only RARELY used for PRI (sets the calling number's numbering plan)
-;
-; unknown:        Unknown
-; private:        Private ISDN
-; local:          Local ISDN
-; national:      National ISDN
-; international:  International ISDN
-; dynamic:       Dynamically selects the appropriate dialplan
-;
-;prilocaldialplan=national
-;
-; PRI callerid prefixes based on the given TON/NPI (dialplan)
-; This is especially needed for euroisdn E1-PRIs
-; 
-; sample 1 for Germany 
-;internationalprefix = 00
-;nationalprefix = 0
-;localprefix = 0711
-;privateprefix = 07115678
-;unknownprefix = 
-;
-; sample 2 for Germany 
-;internationalprefix = +
-;nationalprefix = +49
-;localprefix = +49711
-;privateprefix = +497115678
-;unknownprefix = 
-;
-; PRI resetinterval: sets the time in seconds between restart of unused
-; channels, defaults to 3600; minimum 60 seconds.  Some PBXs don't like
-; channel restarts. so set the interval to a very long interval e.g. 100000000
-; or 'never' to disable *entirely*.
-;
-;resetinterval = 3600 
-;
-; Overlap dialing mode (sending overlap digits)
-;
-;overlapdial=yes
-;
-; PRI Out of band indications.
-; Enable this to report Busy and Congestion on a PRI using out-of-band
-; notification. Inband indication, as used by Asterisk doesn't seem to work
-; with all telcos.
-; 
-; outofband:      Signal Busy/Congestion out of band with RELEASE/DISCONNECT
-; inband:         Signal Busy/Congestion using in-band tones
-;
-; priindication = outofband
-;
-; If you need to override the existing channels selection routine and force all
-; PRI channels to be marked as exclusively selected, set this to yes.
-; priexclusive = yes
-;
-; ISDN Timers
-; All of the ISDN timers and counters that are used are configurable.  Specify
-; the timer name, and its value (in ms for timers).
-; K:    Layer 2 max number of outstanding unacknowledged I frames (default 7)
-; N200: Layer 2 max number of retransmissions of a frame (default 3)
-; T200: Layer 2 max time before retransmission of a frame (default 1000 ms)
-; T203: Layer 2 max time without frames being exchanged (default 10000 ms)
-; T305: Wait for DISCONNECT acknowledge (default 30000 ms)
-; T308: Wait for RELEASE acknowledge (default 4000 ms)
-; T309: Maintain active calls on Layer 2 disconnection (default -1, Asterisk clears calls)
-;       EuroISDN: 6000 to 12000 ms, according to (N200 + 1) x T200 + 2s
-;       May vary in other ISDN standards (Q.931 1993 : 90000 ms)
-; T313: Wait for CONNECT acknowledge, CPE side only (default 3000 ms)
-;
-; pritimer => t200,1000
-; pritimer => t313,4000
-;
-; To enable transmission of facility-based ISDN supplementary services (such
-; as caller name from CPE over facility), enable this option.
-; facilityenable = yes
-;
-;
-; Signalling method (default is fxs).  Valid values:
-; em:             E & M
-; em_w:           E & M Wink
-; featd:          Feature Group D (The fake, Adtran style, DTMF)
-; featdmf:        Feature Group D (The real thing, MF (domestic, US))
-; featdmf_ta:     Feature Group D (The real thing, MF (domestic, US)) through
-;                 a Tandem Access point
-; featb:          Feature Group B (MF (domestic, US))
-; fgccama        Feature Group C-CAMA (DP DNIS, MF ANI)
-; fgccamamf      Feature Group C-CAMA MF (MF DNIS, MF ANI)
-; fxs_ls:         FXS (Loop Start)
-; fxs_gs:         FXS (Ground Start)
-; fxs_ks:         FXS (Kewl Start)
-; fxo_ls:         FXO (Loop Start)
-; fxo_gs:         FXO (Ground Start)
-; fxo_ks:         FXO (Kewl Start)
-; pri_cpe:        PRI signalling, CPE side
-; pri_net:        PRI signalling, Network side
-; gr303fxoks_net: GR-303 Signalling, FXO Loopstart, Network side
-; gr303fxsks_cpe: GR-303 Signalling, FXS Loopstart, CPE side
-; sf:            SF (Inband Tone) Signalling
-; sf_w:                  SF Wink
-; sf_featd:       SF Feature Group D (The fake, Adtran style, DTMF)
-; sf_featdmf:     SF Feature Group D (The real thing, MF (domestic, US))
-; sf_featb:       SF Feature Group B (MF (domestic, US))
-; e911:           E911 (MF) style signalling
-;
-; The following are used for Radio interfaces:
-; fxs_rx:         Receive audio/COR on an FXS kewlstart interface (FXO at the
-;                 channel bank)
-; fxs_tx:         Transmit audio/PTT on an FXS loopstart interface (FXO at the
-;                 channel bank)
-; fxo_rx:         Receive audio/COR on an FXO loopstart interface (FXS at the
-;                 channel bank)
-; fxo_tx:         Transmit audio/PTT on an FXO groundstart interface (FXS at
-;                 the channel bank)
-; em_rx:          Receive audio/COR on an E&M interface (1-way)
-; em_tx:          Transmit audio/PTT on an E&M interface (1-way)
-; em_txrx:        Receive audio/COR AND Transmit audio/PTT on an E&M interface
-;                 (2-way)
-; em_rxtx:        Same as em_txrx (for our dyslexic friends)
-; sf_rx:          Receive audio/COR on an SF interface (1-way)
-; sf_tx:          Transmit audio/PTT on an SF interface (1-way)
-; sf_txrx:        Receive audio/COR AND Transmit audio/PTT on an SF interface
-;                 (2-way)
-; sf_rxtx:        Same as sf_txrx (for our dyslexic friends)
-;
-signalling=fxo_ls
-;
-; If you have an outbound signalling format that is different from format
-; specified above (but compatible), you can specify outbound signalling format,
-; (see below). The 'signalling' format specified will be the inbound signalling
-; format. If you only specify 'signalling', then it will be the format for
-; both inbound and outbound.
-; 
-; signalling=featdmf
-; outsignalling=featb
-;
-; For Feature Group D Tandem access, to set the default CIC and OZZ use these
-; parameters:
-;defaultozz=0000
-;defaultcic=303
-;
-; A variety of timing parameters can be specified as well
-; Including:
-;    prewink:     Pre-wink time (default 50ms)
-;    preflash:    Pre-flash time (default 50ms)
-;    wink:        Wink time (default 150ms)
-;    flash:       Flash time (default 750ms)
-;    start:       Start time (default 1500ms)
-;    rxwink:      Receiver wink time (default 300ms)
-;    rxflash:     Receiver flashtime (default 1250ms)
-;    debounce:    Debounce timing (default 600ms)
-;
-rxwink=300             ; Atlas seems to use long (250ms) winks
-;
-; How long generated tones (DTMF and MF) will be played on the channel
-; (in milliseconds)
-;toneduration=100
-;
-; Whether or not to do distinctive ring detection on FXO lines
-;
-;usedistinctiveringdetection=yes
-;distinctiveringaftercid=yes   ; enable dring detection after callerid for those countries like Australia
-                               ; where the ring cadence is changed *after* the callerid spill.
-;
-; Whether or not to use caller ID
-;
-usecallerid=yes
-;
-; Type of caller ID signalling in use
-;     bell     = bell202 as used in US
-;     v23      = v23 as used in the UK
-;     v23_jp   = v23 as used in Japan
-;     dtmf     = DTMF as used in Denmark, Sweden and Netherlands
-;     smdi     = Use SMDI for callerid.  Requires SMDI to be enabled (usesmdi).
-;
-;cidsignalling=bell
-;
-; What signals the start of caller ID
-;     ring     = a ring signals the start
-;     polarity = polarity reversal signals the start
-;
-;cidstart=ring
-;
-; Whether or not to hide outgoing caller ID (Override with *67 or *82)
-;
-hidecallerid=no
-;
-; Whether or not to enable call waiting on internal extensions
-; With this set to 'yes', busy extensions will hear the call-waiting
-; tone, and can use hook-flash to switch between callers. The Dial()
-; app will not return the "BUSY" result for extensions.
-;
-callwaiting=yes
-;
-; Whether or not restrict outgoing caller ID (will be sent as ANI only, not
-; available for the user)
-; Mostly use with FXS ports
-;
-;restrictcid=no
-;
-; Whether or not use the caller ID presentation for the outgoing call that the
-; calling switch is sending.
-; See README.callingpres
-;
-usecallingpres=yes
-;
-; Some countries (UK) have ring tones with different ring tones (ring-ring),
-; which means the callerid needs to be set later on, and not just after
-; the first ring, as per the default. 
-;
-;sendcalleridafter=1
-;
-;
-; Support Caller*ID on Call Waiting
-;
-callwaitingcallerid=yes
-;
-; Support three-way calling
-;
-threewaycalling=yes
-;
-; Support flash-hook call transfer (requires three way calling)
-; Also enables call parking (overrides the 'canpark' parameter)
-;
-transfer=yes
-;
-; Allow call parking
-; ('canpark=no' is overridden by 'transfer=yes')
-;
-canpark=yes
-;
-; Support call forward variable
-;
-cancallforward=yes
-;
-; Whether or not to support Call Return (*69)
-;
-callreturn=yes
-;
-; Stutter dialtone support: If a mailbox is specified without a voicemail 
-; context, then when voicemail is received in a mailbox in the default 
-; voicemail context in voicemail.conf, taking the phone off hook will cause a
-; stutter dialtone instead of a normal one. 
-;
-; If a mailbox is specified *with* a voicemail context, the same will result
-; if voicemail received in mailbox in the specified voicemail context.
-;
-; for default voicemail context, the example below is fine:
-;
-;mailbox=1234
-;
-; for any other voicemail context, the following will produce the stutter tone:
-;
-;mailbox=1234@context 
-;
-; Enable echo cancellation 
-; Use either "yes", "no", or a power of two from 32 to 256 if you wish to
-; actually set the number of taps of cancellation.
-;
-; Note that if any of your Zaptel cards have hardware echo cancellers,
-; then this setting only turns them on and off; numeric settings will
-; be treated as "yes". There are no special settings required for
-; hardware echo cancellers; when present and enabled in their kernel
-; modules, they take precedence over the software echo canceller compiled
-; into Zaptel automatically.
-;
-echocancel=yes
-;
-; Generally, it is not necessary (and in fact undesirable) to echo cancel when
-; the circuit path is entirely TDM.  You may, however, change this behavior
-; by enabling the echo cancel during pure TDM bridging below.
-;
-echocancelwhenbridged=yes
-;
-; In some cases, the echo canceller doesn't train quickly enough and there
-; is echo at the beginning of the call.  Enabling echo training will cause
-; asterisk to briefly mute the channel, send an impulse, and use the impulse
-; response to pre-train the echo canceller so it can start out with a much
-; closer idea of the actual echo.  Value may be "yes", "no", or a number of
-; milliseconds to delay before training (default = 400)
-;
-; WARNING:  In some cases this option can make echo worse!  If you are
-; trying to debug an echo problem, it is worth checking to see if your echo
-; is better with the option set to yes or no.  Use whatever setting gives
-; the best results.
-;
-; Note that these parameters do not apply to hardware echo cancellers.
-;
-;echotraining=yes
-;echotraining=800
-;
-; If you are having trouble with DTMF detection, you can relax the DTMF
-; detection parameters.  Relaxing them may make the DTMF detector more likely
-; to have "talkoff" where DTMF is detected when it shouldn't be.
-;
-;relaxdtmf=yes
-;
-; You may also set the default receive and transmit gains (in dB)
-;
-rxgain=0.0
-txgain=0.0
-;
-; Logical groups can be assigned to allow outgoing rollover.  Groups range
-; from 0 to 63, and multiple groups can be specified.
-;
-group=1
-;
-; Ring groups (a.k.a. call groups) and pickup groups.  If a phone is ringing
-; and it is a member of a group which is one of your pickup groups, then
-; you can answer it by picking up and dialling *8#.  For simple offices, just
-; make these both the same.  Groups range from 0 to 63.
-;
-callgroup=1
-pickupgroup=1
-
-;
-; Specify whether the channel should be answered immediately or if the simple
-; switch should provide dialtone, read digits, etc.
-;
-immediate=no
-;
-; Specify whether flash-hook transfers to 'busy' channels should complete or
-; return to the caller performing the transfer (default is yes).
-;
-;transfertobusy=no
-;
-; CallerID can be set to "asreceived" or a specific number if you want to
-; override it.  Note that "asreceived" only applies to trunk interfaces.
-;
-;callerid=2564286000
-;
-; AMA flags affects the recording of Call Detail Records.  If specified
-; it may be 'default', 'omit', 'billing', or 'documentation'.
-;
-;amaflags=default
-;
-; Channels may be associated with an account code to ease
-; billing
-;
-;accountcode=lss0101
-;
-; ADSI (Analog Display Services Interface) can be enabled on a per-channel
-; basis if you have (or may have) ADSI compatible CPE equipment
-;
-;adsi=yes
-;
-; SMDI (Simplified Message Desk Interface) can be enabled on a per-channel
-; basis if you would like that channel to behave like an SMDI message desk.
-; The SMDI port specified should have already been defined in smdi.conf.  The
-; default port is /dev/ttyS0.
-;
-;usesmdi=yes
-;smdiport=/dev/ttyS0
-;
-; On trunk interfaces (FXS) and E&M interfaces (E&M, Wink, Feature Group D
-; etc, it can be useful to perform busy detection either in an effort to 
-; detect hangup or for detecting busies.  This enables listening for
-; the beep-beep busy pattern.
-;
-;busydetect=yes
-;
-; If busydetect is enabled, it is also possible to specify how many busy tones
-; to wait for before hanging up.  The default is 4, but better results can be
-; achieved if set to 6 or even 8.  Mind that the higher the number, the more
-; time that will be needed to hangup a channel, but lowers the probability
-; that you will get random hangups.
-;
-;busycount=4
-;
-; If busydetect is enabled, it is also possible to specify the cadence of your
-; busy signal.  In many countries, it is 500msec on, 500msec off.  Without
-; busypattern specified, we'll accept any regular sound-silence pattern that
-; repeats <busycount> times as a busy signal.  If you specify busypattern,
-; then we'll further check the length of the sound (tone) and silence, which
-; will further reduce the chance of a false positive.
-;
-;busypattern=500,500
-;
-; NOTE: In the Asterisk Makefile you'll find further options to tweak the busy
-; detector.  If your country has a busy tone with the same length tone and
-; silence (as many countries do), consider defining the
-; -DBUSYDETECT_COMPARE_TONE_AND_SILENCE option.
-;
-; Use a polarity reversal to mark when a outgoing call is answered by the
-; remote party.
-;
-;answeronpolarityswitch=yes
-;
-; In some countries, a polarity reversal is used to signal the disconnect of a
-; phone line.  If the hanguponpolarityswitch option is selected, the call will
-; be considered "hung up" on a polarity reversal.
-;
-;hanguponpolarityswitch=yes
-;
-; On trunk interfaces (FXS) it can be useful to attempt to follow the progress
-; of a call through RINGING, BUSY, and ANSWERING.   If turned on, call
-; progress attempts to determine answer, busy, and ringing on phone lines.
-; This feature is HIGHLY EXPERIMENTAL and can easily detect false answers,
-; so don't count on it being very accurate.
-;
-; Few zones are supported at the time of this writing, but may be selected
-; with "progzone"
-;
-; This feature can also easily detect false hangups. The symptoms of this is
-; being disconnected in the middle of a call for no reason.
-;
-;callprogress=yes
-;progzone=us
-;
-; FXO (FXS signalled) devices must have a timeout to determine if there was a
-; hangup before the line was answered.  This value can be tweaked to shorten
-; how long it takes before Zap considers a non-ringing line to have hungup.
-;
-;ringtimeout=8000
-;
-; For FXO (FXS signalled) devices, whether to use pulse dial instead of DTMF
-;
-;pulsedial=yes
-;
-; For fax detection, uncomment one of the following lines.  The default is *OFF*
-;
-;faxdetect=both
-;faxdetect=incoming
-;faxdetect=outgoing
-;faxdetect=no
-;
-; This option specifies a preference for which music on hold class this channel
-; should listen to when put on hold if the music class has not been set on the
-; channel with Set(CHANNEL(musicclass)=whatever) in the dialplan, and the peer
-; channel putting this one on hold did not suggest a music class.
-;
-; If this option is set to "passthrough", then the hold message will always be
-; passed through as signalling instead of generating hold music locally. This
-; setting is only valid when used on a channel that uses digital signalling.
-;
-; This option may be specified globally, or on a per-user or per-peer basis.
-;
-;mohinterpret=default
-;
-; This option specifies which music on hold class to suggest to the peer channel
-; when this channel places the peer on hold. It may be specified globally or on
-; a per-user or per-peer basis.
-;
-;mohsuggest=default
-;
-; PRI channels can have an idle extension and a minunused number.  So long as
-; at least "minunused" channels are idle, chan_zap will try to call "idledial"
-; on them, and then dump them into the PBX in the "idleext" extension (which
-; is of the form exten@context).  When channels are needed the "idle" calls
-; are disconnected (so long as there are at least "minidle" calls still
-; running, of course) to make more channels available.  The primary use of
-; this is to create a dynamic service, where idle channels are bundled through
-; multilink PPP, thus more efficiently utilizing combined voice/data services
-; than conventional fixed mappings/muxings.
-;
-;idledial=6999
-;idleext=6999@dialout
-;minunused=2
-;minidle=1
-;
-; Configure jitter buffers in zapata (each one is 20ms, default is 4)
-;
-;jitterbuffers=4
-;
-;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
-; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of a
-                              ; ZAP channel. Defaults to "no". An enabled jitterbuffer will
-                              ; be used only if the sending side can create and the receiving
-                              ; side can not accept jitter. The ZAP channel can't accept jitter,
-                              ; thus an enabled jitterbuffer on the receive ZAP side will always
-                              ; be used if the sending side can create jitter.
-
-; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
-
-; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
-                              ; resynchronized. Useful to improve the quality of the voice, with
-                              ; big jumps in/broken timestamps, usually sent from exotic devices
-                              ; and programs. Defaults to 1000.
-
-; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a ZAP
-                              ; channel. Two implementations are currently available - "fixed"
-                              ; (with size always equals to jbmax-size) and "adaptive" (with
-                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
-
-; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
-;-----------------------------------------------------------------------------------
-;
-; You can define your own custom ring cadences here.  You can define up to 8
-; pairs.  If the silence is negative, it indicates where the callerid spill is
-; to be placed.  Also, if you define any custom cadences, the default cadences
-; will be turned off.
-;
-; Syntax is:  cadence=ring,silence[,ring,silence[...]]
-;
-; These are the default cadences:
-;
-;cadence=125,125,2000,-4000
-;cadence=250,250,500,1000,250,250,500,-4000
-;cadence=125,125,125,125,125,-4000
-;cadence=1000,500,2500,-5000
-;
-; Each channel consists of the channel number or range.  It inherits the
-; parameters that were specified above its declaration.
-;
-; For GR-303, CRV's are created like channels except they must start with the
-; trunk group followed by a colon, e.g.: 
-;
-; crv => 1:1
-; crv => 2:1-2,5-8
-;
-;
-;callerid="Green Phone"<(256) 428-6121>
-;channel => 1
-;callerid="Black Phone"<(256) 428-6122>
-;channel => 2
-;callerid="CallerID Phone" <(256) 428-6123>
-;callerid="CallerID Phone" <(630) 372-1564>
-;callerid="CallerID Phone" <(256) 704-4666>
-;channel => 3
-;callerid="Pac Tel Phone" <(256) 428-6124>
-;channel => 4
-;callerid="Uniden Dead" <(256) 428-6125>
-;channel => 5
-;callerid="Cortelco 2500" <(256) 428-6126>
-;channel => 6
-;callerid="Main TA 750" <(256) 428-6127>
-;channel => 44
-;
-; For example, maybe we have some other channels which start out in a
-; different context and use E & M signalling instead.
-;
-;context=remote
-;sigalling=em
-;channel => 15
-;channel => 16
-
-;signalling=em_w
-;
-; All those in group 0 I'll use for outgoing calls
-;
-; Strip most significant digit (9) before sending
-;
-;stripmsd=1
-;callerid=asreceived
-;group=0
-;signalling=fxs_ls
-;channel => 45
-
-;signalling=fxo_ls
-;group=1
-;callerid="Joe Schmoe" <(256) 428-6131>
-;channel => 25
-;callerid="Megan May" <(256) 428-6132>
-;channel => 26
-;callerid="Suzy Queue" <(256) 428-6233>
-;channel => 27
-;callerid="Larry Moe" <(256) 428-6234>
-;channel => 28
-;
-; Sample PRI (CPE) config:  Specify the switchtype, the signalling as either
-; pri_cpe or pri_net for CPE or Network termination, and generally you will
-; want to create a single "group" for all channels of the PRI.
-;
-; switchtype = national
-; signalling = pri_cpe
-; group = 2
-; channel => 1-23
-
-;
-
-;  Used for distinctive ring support for x100p.
-;  You can see the dringX patterns is to set any one of the dringXcontext fields
-;  and they will be printed on the console when an inbound call comes in.
-;
-;dring1=95,0,0 
-;dring1context=internal1 
-;dring2=325,95,0 
-;dring2context=internal2 
-; If no pattern is matched here is where we go.
-;context=default
-;channel => 1 
-
diff --git a/mini-asterisk-gui2/etc/lighttpd.conf b/mini-asterisk-gui2/etc/lighttpd.conf
deleted file mode 100644 (file)
index 5c883db..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-# lighttpd configuration file
-#
-# use a it as base for lighttpd 1.0.0 and above
-#
-# $Id: lighttpd.conf,v 1.6 2004/08/29 09:44:53 weigon Exp $
-
-############ Options you really have to take care of ####################
-
-## modules to load
-# at least mod_access and mod_accesslog should be loaded
-# all other module should only be loaded if really neccesary
-# - saves some time
-# - saves memory
-server.modules              = (
-#                               "mod_rewrite",
-#                               "mod_redirect",
-                               "mod_access",
-#                              "mod_auth",
-#                               "mod_status",
-#                              "mod_fastcgi",
-#                              "mod_simple_vhost",
-#                              "mod_evhost",
-                               "mod_cgi",
-#                              "mod_compress",
-#                               "mod_ssi",
-#                               "mod_usertrack",
-#                              "mod_rrdtool",
-#                              "mod_accesslog"
-)
-
-## a static document-root, for virtual-hosting take look at the
-## server.virtual-* options
-server.document-root             = "/www/"
-
-## where to send error-messages to
-# server.errorlog            = ""
-
-# files to check for if .../ is requested
-server.indexfiles          = ( "index.php", "index.html",
-                                "index.htm", "default.htm" )
-
-# mimetype mapping
-mimetype.assign            = (
-  ".pdf"          =>      "application/pdf",
-  ".sig"          =>      "application/pgp-signature",
-  ".spl"          =>      "application/futuresplash",
-  ".class"        =>      "application/octet-stream",
-  ".ps"           =>      "application/postscript",
-  ".torrent"      =>      "application/x-bittorrent",
-  ".dvi"          =>      "application/x-dvi",
-  ".gz"           =>      "application/x-gzip",
-  ".pac"          =>      "application/x-ns-proxy-autoconfig",
-  ".swf"          =>      "application/x-shockwave-flash",
-  ".tar.gz"       =>      "application/x-tgz",
-  ".tgz"          =>      "application/x-tgz",
-  ".tar"          =>      "application/x-tar",
-  ".zip"          =>      "application/zip",
-  ".mp3"          =>      "audio/mpeg",
-  ".m3u"          =>      "audio/x-mpegurl",
-  ".wma"          =>      "audio/x-ms-wma",
-  ".wax"          =>      "audio/x-ms-wax",
-  ".ogg"          =>      "audio/x-wav",
-  ".wav"          =>      "audio/x-wav",
-  ".gif"          =>      "image/gif",
-  ".jpg"          =>      "image/jpeg",
-  ".jpeg"         =>      "image/jpeg",
-  ".png"          =>      "image/png",
-  ".xbm"          =>      "image/x-xbitmap",
-  ".xpm"          =>      "image/x-xpixmap",
-  ".xwd"          =>      "image/x-xwindowdump",
-  ".css"          =>      "text/css",
-  ".html"         =>      "text/html",
-  ".htm"          =>      "text/html",
-  ".js"           =>      "text/javascript",
-  ".asc"          =>      "text/plain",
-  ".c"            =>      "text/plain",
-  ".conf"         =>      "text/plain",
-  ".text"         =>      "text/plain",
-  ".txt"          =>      "text/plain",
-  ".dtd"          =>      "text/xml",
-  ".xml"          =>      "text/xml",
-  ".mpeg"         =>      "video/mpeg",
-  ".mpg"          =>      "video/mpeg",
-  ".mov"          =>      "video/quicktime",
-  ".qt"           =>      "video/quicktime",
-  ".avi"          =>      "video/x-msvideo",
-  ".asf"          =>      "video/x-ms-asf",
-  ".asx"          =>      "video/x-ms-asf",
-  ".wmv"          =>      "video/x-ms-wmv"
- )
-
-# Use the "Content-Type" extended attribute to obtain mime type if possible
-# mimetypes.use-xattr = "enable"
-
-#### accesslog module
-# accesslog.filename          = "/www/logs/access.log"
-
-## deny access the file-extensions
-#
-# ~    is for backupfiles from vi, emacs, joe, ...
-# .inc is often used for code includes which should in general not be part
-#      of the document-root
-url.access-deny             = ( "~", ".inc" )
-
-
-
-######### Options that are good to be but not neccesary to be changed #######
-
-## bind to port (default: 80)
-#server.port                = 81
-
-## bind to localhost (default: all interfaces)
-#server.bind                = "grisu.home.kneschke.de"
-
-## error-handler for status 404
-#server.error-handler-404   = "/error-handler.html"
-#server.error-handler-404   = "/error-handler.php"
-
-
-###### virtual hosts
-##
-##   If you want name-based virtual hosting add the next three settings and load
-##   mod_simple_vhost
-##
-## document-root =
-##   virtual-server-root + virtual-server-default-host + virtual-server-docroot or
-##   virtual-server-root + http-host + virtual-server-docroot
-##
-#simple-vhost.server-root         = "/home/weigon/wwwroot/servers/"
-#simple-vhost.default-host        = "grisu.home.kneschke.de"
-#simple-vhost.document-root       = "/pages/"
-
-
-##
-## Format: <errorfile-prefix><status>.html
-## -> ..../status-404.html for 'File not found'
-#server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-"
-
-## virtual directory listings
-#server.dir-listing          = "enable"
-
-## send unhandled HTTP-header headers to error-log
-#debug.dump-unknown-headers  = "enable"
-
-### only root can use these options
-#
-# chroot() to directory (default: no chroot() )
-#server.chroot            = "/"
-
-## change uid to <uid> (default: don't care)
-#server.username            = "wwwrun"
-
-## change uid to <uid> (default: don't care)
-#server.groupname           = "wwwrun"
-
-#### compress module
-#compress.cache-dir          = "/tmp/lighttpd/cache/compress/"
-#compress.filetype           = ("text/plain", "text/html")
-
-#### fastcgi module
-## read fastcgi.txt for more info
-#fastcgi.server              = ( ".php" =>
-#                              ( "grisu" =>
-#                                (
-#                                  "host" => "192.168.2.10",
-#                                  "port" => 1026
-#                                )
-#                              )
-#                            )
-
-#### CGI module
-cgi.assign = ( ".sh"  => "/bin/sh",".pl" => "/usr/bin/perl",
-                                ".cgi" => "/usr/bin/perl" )
-#
-
-#### SSL engine
-#ssl.engine                  = "enable"
-#ssl.pemfile                 = "server.pem"
-
-#### status module
-# status.status-url = "/server-status"
-# status.config-url = "/server-config"
-
-#### auth module
-## read authentification.txt for more info
-# auth.backend                = "plain"
-# auth.backend.plain.userfile = "lighttpd.user"
-# auth.backend.plain.groupfile = "lighttpd.group"
-
-# auth.backend.ldap.hostname = "localhost"
-# auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
-# auth.backend.ldap.filter   = "(uid=$)"
-
-# auth.require                = ( "/server-status" =>
-#                                (
-#                                "method"  => "digest",
-#                                "realm"   => "download archiv",
-#                                "require" => "group=www|user=jan|host=192.168.2.10"
-#                              ),
-#                              "/server-info" =>
-#                                (
-#                                "method"  => "digest",
-#                                "realm"   => "download archiv",
-#                                "require" => "group=www|user=jan|host=192.168.2.10"
-#                              )
-#                              )
-
-#### url handling modules (rewrite, redirect, access)
-# url.rewrite                 = ( "^/$"             => "/server-status" )
-# url.redirect                = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
-
-#
-# define a pattern for the host url finding
-# %% => % sign
-# %0 => domain name + tld
-# %1 => tld
-# %2 => domain name without tld
-# %3 => subdomain 1 name
-# %4 => subdomain 2 name
-#
-# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
-
-#### expire module
-# expire.url                  = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
-
-#### ssi
-# ssi.extension              = ( ".shtml" )
-
-#### rrdtool
-# rrdtool.binary = "/usr/bin/rrdtool"
-# rrdtool.db-name = "/var/www/lighttpd.rrd"
diff --git a/mini-asterisk-gui2/etc/lighttpd/conf-available/.gitignore b/mini-asterisk-gui2/etc/lighttpd/conf-available/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mini-asterisk-gui2/etc/lighttpd/conf-enabled/10-cgi.conf b/mini-asterisk-gui2/etc/lighttpd/conf-enabled/10-cgi.conf
deleted file mode 120000 (symlink)
index 995c40c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../conf-available/10-cgi.conf
\ No newline at end of file
diff --git a/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf b/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf
deleted file mode 100644 (file)
index bc650da..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-server.modules = (
-       "mod_access",
-       "mod_alias",
-       "mod_compress",
-       "mod_redirect",
-#       "mod_rewrite",
-)
-
-server.document-root        = "/home/ian/mini-asterisk-gui2"
-server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
-server.errorlog             = "/var/log/lighttpd/error.log"
-server.pid-file             = "/var/run/lighttpd.pid"
-server.username             = "www-data"
-server.groupname            = "www-data"
-#server.username             = "wwwrun"
-#server.groupname            = "wwwrun"
-
-index-file.names            = ( "index.php", "index.html",
-                                "index.htm", "default.htm",
-                               " index.lighttpd.html" )
-
-url.access-deny             = ( "~", ".inc" )
-
-static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
-
-## Use ipv6 if available
-#include_shell "/usr/share/lighttpd/use-ipv6.pl"
-
-dir-listing.encoding        = "utf-8"
-server.dir-listing          = "enable"
-
-compress.cache-dir          = "/var/cache/lighttpd/compress/"
-compress.filetype           = ( "application/x-javascript", "text/css", "text/html", "text/plain" )
-
-include_shell "/usr/share/lighttpd/create-mime.assign.pl"
-include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
diff --git a/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf.x86 b/mini-asterisk-gui2/etc/lighttpd/lighttpd.conf.x86
deleted file mode 100644 (file)
index bc650da..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-server.modules = (
-       "mod_access",
-       "mod_alias",
-       "mod_compress",
-       "mod_redirect",
-#       "mod_rewrite",
-)
-
-server.document-root        = "/home/ian/mini-asterisk-gui2"
-server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
-server.errorlog             = "/var/log/lighttpd/error.log"
-server.pid-file             = "/var/run/lighttpd.pid"
-server.username             = "www-data"
-server.groupname            = "www-data"
-#server.username             = "wwwrun"
-#server.groupname            = "wwwrun"
-
-index-file.names            = ( "index.php", "index.html",
-                                "index.htm", "default.htm",
-                               " index.lighttpd.html" )
-
-url.access-deny             = ( "~", ".inc" )
-
-static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
-
-## Use ipv6 if available
-#include_shell "/usr/share/lighttpd/use-ipv6.pl"
-
-dir-listing.encoding        = "utf-8"
-server.dir-listing          = "enable"
-
-compress.cache-dir          = "/var/cache/lighttpd/compress/"
-compress.filetype           = ( "application/x-javascript", "text/css", "text/html", "text/plain" )
-
-include_shell "/usr/share/lighttpd/create-mime.assign.pl"
-include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
diff --git a/mini-asterisk-gui2/etc/zaptel.conf b/mini-asterisk-gui2/etc/zaptel.conf
deleted file mode 100644 (file)
index 5fd585c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-loadzone = us
-defaultzone=us
-
-fxoks=2,3,4
diff --git a/mini-asterisk-gui2/faq.html b/mini-asterisk-gui2/faq.html
deleted file mode 100644 (file)
index 8cc7833..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>FAQ</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="faq.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="faq"></div>
-
-    <h2>FAQ</h2>
-    <ol>
-
-       <li><strong>How do I set up my Phone system?</strong> 
-           <ol>
-           <li> Hover your mouse to get instructions (try the menu to the left).</li>
-           <li> Analog Ports are detected automatically.</li>
-           <li> Set up your <a href="network.html">Network</a>.</li>
-           <li> Add your <a href="ipphones.html">IP Phones</a>.</li>
-           <li> Configure your <a href="voiplines.html">Voip Line</a>.</li>
-           <li> The <a href="phones.html">Phone System</a> page gives you a 
-                summary of your phone system and tells you how to make calls 
-                (hover your mouse).</li>
-           </ol>
-       </li>
-
-       <li><strong>Where can I find out more about Mini Asterisk:</strong> The <a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk Home Page</a>.
-
-       <li><strong>Where can I get Support:</strong> You can try the
-           <a href="https://lists.sourceforge.net/lists/listinfo/freetel-discuss">Free Telephony Project</a> Mailing List.
-
-       <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.
-
-       <li><strong>Put a call on hold/transfer:</strong> On an IP Phone try
-           the recall or transfer button.  On an Analog Phone hold down the
-           hook button for 1 second then dial the new number.
-
-       <li><strong>Why another Asterisk GUI</strong> I had some specific
-           needs for a light weight, very easy to use GUI for
-           the <a href="http://www.rowetel.com/ucasterisk/ip04.html">IP0X</a>
-           line of products.  So I scratched the itch.  More
-           information <a href="http://www.rowetel.com/ucasterisk/mini.html#why">here</a>.
-
-    </ol>
-
-    <h2>Resources and Links</h2>
-    <ol>
-       <li>If you want to learn more about Asterisk a good on-line book is <a href="http://astbook.asteriskdocs.org">Asterisk - The Future of Telephony</a>
-    </ol>
-
-    </td>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/faq.js b/mini-asterisk-gui2/faq.js
deleted file mode 100644 (file)
index 762695c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-  faq.js
-  Ian Roberts
-  May 10 2012
-
-  FAQ screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-}
-
-
-
diff --git a/mini-asterisk-gui2/install notes.txt b/mini-asterisk-gui2/install notes.txt
deleted file mode 100644 (file)
index b88e680..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-IP04 GUI2 Install notes
-Ian Roberts 
-Sept 2012
-
-
-0. Connect ip04 to network. Power up.
-
-1. Telnet 192.168.1.30
-
-2. Create a file
-
-   vi install_gui2.sh
-
-3. Copy script from
-   http://freetel.svn.sourceforge.net/viewvc/freetel/mini-asterisk-gui2/install_gui2.sh?revision=717&content-type=text%2Fplain
-   
-   Paste into vi session (right click will do it)
-   Save file
-   
-4. Make the script executable
-
-   chmod a+x install_gui2.sh
-
-5. Run the script
-
-   sh install_gui2.sh
-
-6. Check gui2 
-
-   192.168.1.30/gui2/phones.html
-
-
diff --git a/mini-asterisk-gui2/install_gui2.sh b/mini-asterisk-gui2/install_gui2.sh
deleted file mode 100755 (executable)
index 541e490..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# Script to install GUI2 to IP04
-# Original gui left intact
-# New gui at 192.168.1.30/gui2/phones.html
-# Developement Edition
-# Ian Roberts
-# Sept 2012
-
-# check we are on an IP0x box
-echo "must be root directory on IP0x"
-echo ""
-cd /
-
-# remove old copy if exists
-
-rm gui2.tar.gz
-
-
-# get the source
-
-wget -O gui2.tar.gz http://freetel.svn.sourceforge.net/viewvc/freetel/mini-asterisk-gui2/?view=tar
-
-
-echo ""
-
-# unpack
-
-tar zxvf gui2.tar.gz
-
-
-# check root
-
-#testing
-#mkdir www
-#mkdir www/cgi-bin
-
-
-#create directories if required
-
-mkdir /www/gui2
-mkdir /www/cgi-bin
-
-# copy web files to /www
-
-cp mini-asterisk-gui2/*.html /www/gui2
-cp mini-asterisk-gui2/*.js /www/gui2
-cp mini-asterisk-gui2/*.png /www/gui2
-cp mini-asterisk-gui2/*.css /www/gui2
-
-
-# copy cgi to /www/cgi-bin
-
-cp mini-asterisk-gui2/cgi-bin/*.* /www/cgi-bin
-
-
-# check packages installed
-
-ipkg install fping
-
-
-# check extension.conf 60xx lines have mini_ext tags
-
-cp mini-asterisk-gui2/etc/asterisk/extensions.conf /etc/asterisk/extensions.conf
-
-# check sip.conf has new provider keywords
-
-cp mini-asterisk-gui2/etc/asterisk/sip.conf /etc/asterisk/sip.conf
-
-# check lighttpd installed
-# check cgi support in lighttpd
-
-cp mini-asterisk-gui2/etc/lighttpd.conf /etc/lighttpd.conf
-
-# webserver index should point browser at gui2 login
-
-# restart the http server
-/etc/init.d/lighttpd stop
-/etc/init.d/lighttpd start
-
-
-echo ""
-echo "Point your browser at 192.168.1.30/gui2/phones.html"
-
-
-
diff --git a/mini-asterisk-gui2/ipphones.html b/mini-asterisk-gui2/ipphones.html
deleted file mode 100644 (file)
index 49f64ef..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>ipPhones</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="ipphones.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td>
-      <h2>&nbsp;<br>IP Phones</h2>
-               <table>
-         <tr><td>
-            <div id="ipphones_table"></div>
-               </td></tr>
-
-               <tr><td>
-           &nbsp;
-               </td></tr>
-        
-       
-         <tr><td>
-         <a href=configure_AT-530.html>Configure AT-530</a>
-               </td></tr>
-
-         <tr><td>
-         <a href=configure_AT-620R.html>Configure AT-620R</a>
-               </td></tr>
-
-               </table>
-         </td>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/ipphones.js b/mini-asterisk-gui2/ipphones.js
deleted file mode 100644 (file)
index 08a9fa7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-  ipphones.js
-  Ian Roberts
-  May 10 2012
-
-  IP Phones screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    document.getElementById("ipphones_table").innerHTML = "Checking....";
-
-     // kick off cascading CGIs, initialisePage() will be called when complete
-        
-    loadExtensions();
-}
-
-function initialisePage() {
-    // 
-     var tick = '<img src="tick.png" alt="IP phone detected" />';
-     var cross = '<img src="cross.png" alt="No phone detected" />';
-    var html = '';
-    var j = 0;
-       
-    html += '<form name="phones" method="get">';
-
-    html += '<table align="right" width=600 cellspacing=2>';
-
-    // print out IP phones
-    //  j is 6011,6012 etc
-
-    for (j in ip_ext) {
-        if (ip_ext[j] != '') {
-            html += "<tr>";
-               html += "<td>" + j + "</td>" ;
-               html += "<td>" + ip_ext[j] + "</td>";
-            html += "<td>" + tick + "</td>";
-            html += "</tr>";
-           } 
-               else {
-            html += "<tr>";
-               html += "<td>" + j + "</td>" ;
-               html += "<td>" + "available" + "</td>";
-            html += "<td>" + cross + "</td>";
-            html += "</tr>";
-               }
-    }
-
-    html += '</table>';
-       
-    html += '</form>';
-    document.getElementById("ipphones_table").innerHTML = html;
-
-}
-
-function somefunction() {
-    // 
-    
-    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
-    var html = '';
-
-    html += '<table align="right" width=600>';
-
-    // print out info
-
-    html += '<tr><td colspan="3" align="left" valign="top"><h2>IP Phones</h2></td></tr>';
-    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision XXX</td></tr>';
-    html += '<tr><td colspan="2">Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>';
-    // this image will only come up if internet connection is present
-    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td><td> </td><td></td></tr>';
-    html += '<tr><td>&nbsp</td></tr>';
-    html += '</table>';
-
-//    document.getElementById("ipphones").innerHTML += html;
-
-}
-
diff --git a/mini-asterisk-gui2/login.html b/mini-asterisk-gui2/login.html
deleted file mode 100644 (file)
index 24b6bb1..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Mini Asterisk - Login</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css" />
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript">
-//      <input name="update_recept" type="button" style="width:100%" value="update reception" onClick="onClickUpdateReception()" />
-
-</script>
-
-</head>
-
-<body>
-  
-    <table align="center" width=600>
-    <tr><td colspan="2" align="left"><h2>Login</h2></td>
-    <tr>
-      <tr><td>Password:</td><td><input type="password" name="pass" ></td></tr>
-      <tr><td><input name="submit_password" type="button" style="width:50%" value="Login" onClick="onClickLogin()"></td></tr>
-
-    </tr>
-    <tr><td></td><td>Default password is uClinux</td>
-    </table>
-  
-</body>
-</html>
diff --git a/mini-asterisk-gui2/logout.html b/mini-asterisk-gui2/logout.html
deleted file mode 100644 (file)
index 87fe8de..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Logout</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="logout.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="logout"></div></td>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/logout.js b/mini-asterisk-gui2/logout.js
deleted file mode 100644 (file)
index 5ae4521..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-  logout.js
-  Ian Roberts
-  May 10 2012
-
-  Logout screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-    // 
-    
-    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
-    var html = '';
-
-    html += '<table align="right" width=600>';
-
-    // print out info
-
-    html += '<tr><td colspan="3" align="left" valign="top"><h2>Logout</h2></td></tr>';
-    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/mini.html">Mini Asterisk GUI2</a></td><td> </td><td>Revision XXX</td></tr>';
-    html += '<tr><td colspan="2">Brought to you by the</td><td> </td><td> <a href="http://rowetel.com/ucasterisk/index.html">Free Telephony Project</a></td></tr>';
-    // this image will only come up if internet connection is present
-    html += '<tr><td colspan="2"><a href="http://rowetel.com/ucasterisk/ip04.html"><img src="http://rowetel.com/images/ip04/ip04_case.jpg" border="0" /></a></td><td> </td><td></td></tr>';
-    html += '<tr><td>&nbsp</td></tr>';
-    html += '</table>';
-
-    document.getElementById("logout").innerHTML += html;
-
-}
-
-
-
diff --git a/mini-asterisk-gui2/menu.js b/mini-asterisk-gui2/menu.js
deleted file mode 100644 (file)
index c45f322..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-  menu.js
-  David Rowe 
-  Jan 4 2010
-
-  Function(s) to create main menu.  Interesting to compare this to static HTML.
-*/
-
-var menuItems = [
-    '<a href="phones.html">Phone System</a>',
-    '<a href="about.html">About</a>',
-    '<a href="system.html">System Info</a>',
-//    '<a href="diagnostics.html">Diagnostics</a>',
-    '<a href="admin.html">Admin</a>',
-    '<a href="faq.html">FAQ</a>',
-    '<a href="ipphones.html">IP Phones</a>',
-    '<a href="network.html">Network</a>',
-    '<a href="voiplines.html">VOIP Line</a>',
-    '<a href="logout.html">Logout</a>'
-];
-
-var menuTips = [
-    'phones_tip',
-    'about_tip',
-    'system_tip',
-//    'diagnostics_tip',
-    'admin_tip',
-    'faq_tip',
-    'ipphones_tip',
-    'network_tip',
-    'voipline_tip',
-    'logout_tip'
-];
-
-var menuToolTips = [
-    '<div id="phones_tip" class="tip">Lists your phones and phone lines</div>',
-    '<div id="about_tip" class="tip">Software version and links to web site</div>',
-    '<div id="system_tip" class="tip">Cpu, memory, loadavg info , linux version and installed packages</div>',
-//    '<div id="diagnostics_tip" class="tip">Test your phone system components</div>',
-    '<div id="admin_tip" class="tip">Change your password, reset the default settings, upgrade software</div>',
-    '<div id="faq_tip" class="tip">Frequently asked questions and links to further information</div>',
-    '<div id="ipphones_tip" class="tip">Set up your IP phones</div>',
-    '<div id="network_tip" class="tip">Connect the phone system to your network and the Internet</div>',
-    '<div id="voipline_tip" class="tip">Set up your VOIP phone line</div>',
-    '<div id="logout_tip" class="tip">I think you can work this one out....</div>'
-];
-
-function mainMenu() {
-    var html = '';
-
-    for(var i=0; i<menuToolTips.length; i++) {
-       html += menuToolTips[i] + "\n";
-    }
-
-    html += '<td valign="top" >';
-    html += '<table align="right" width=170>';
-    html += '<tr><td><h2>&nbsp;</h2></td></tr>';
-    for(var i=0; i<menuItems.length; i++) {
-       var tooltip  = 'onMouseOver="popUp(event,' + "'" + menuTips[i] + "'" + ')" ';
-           tooltip += 'onMouseOut="popUp(event,' + "'" + menuTips[i] + "'" + ')"';
-
-       html += '<tr ' + tooltip + '><td>' + menuItems[i] + '</td></tr>' + "\n";
-    }
-
-    html += '</table>';
-                               
-    document.getElementById('menu').innerHTML = html;
-}
diff --git a/mini-asterisk-gui2/minicommon.js b/mini-asterisk-gui2/minicommon.js
deleted file mode 100644 (file)
index 904eed8..0000000
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
-  minicommon.js
-  David Rowe 
-  Dec 16 2010
-
-  Common functions used by Mini Asterisk GUI.
-*/
-
-var    logged_in = 0;
-
-// index Zaptel port number (1,2,...), value extension (6001,6002...)
-
-var analog_ext = [];
-
-// zaptel port number (1,2,...), value FXS/FXO
-
-var zap = [];
-
-// all IP extensions, index ext, value true|false to indicate if live
-
-var ip_ext = [];
-
-var network = "no";
-
-// incomming calls are routed to these extensions ie (6003, Zap/3)
-// this should be made dynamically from the reception line in extensions.conf
-
-//testing
-//var reception = [["6003","Zap/3"],["6004","Zap/4"],["6011","SIP/6011"],["6012","SIP/6012"]] ;
-
-
-var recept_num = [];
-var ext_code =[];
-var recept_code =[];
-var recept_count = 0;
-var outgoing_num=0;
-var outgoing_code=[];
-var ext_count = 0;
-
-
-var items = [[1,2],[3,4],[5,6]];
-
-// these are the selections for the new reception numbers
-
-var selected = [];
-
-function loadExtensions() {
-
-    /* 
-       Kick off cascading CGIs and callbacks to load analog and ip
-       extension data.
-
-       From extensions.conf and zaptel.conf, determine which zap ports
-       are live and what type they are (FXS or FXO).
-
-       From extensions.conf determine, asterisk -r sip show peers
-       to determine which sip extenions are live
-
-       That will do for now......
-    */
-    
-    downloadUrl("/cgi-bin/getconf.cgi?file=../zaptel.conf", loadZapata);
-}
-
-// remove leading and trailing whitespace from a string
-
-function trim(stringToTrim) {
-       return stringToTrim.replace(/^\s+|\s+$/g,"");
-}
-
-
-/*
-  Given extenions.conf lines like this:
-
-  exten => 6011,1,Dial(SIP/6011)
-  exten => 6001,1,Dial(Zap/1)          
-  exten =>  EXT,1,Dial(TECH1/TECH2)
-
-  returns EXT, TECH1, TECH2
-*/
-
-function parseDialPlan(line) {
-    var split1 = line.split(",");
-    var split2 = split1[0].split("=>");
-    var ext = trim(split2[1]);
-    var tech = split1[2];
-    var index1 = tech.indexOf('(');
-    var index2 = tech.indexOf('/');
-    var index3 = tech.indexOf(')');
-
-    var tech1 = tech.substr(index1+1, index2-index1-1); 
-    var tech2 = tech.substr(index2+1, index3-index2-1);
-
-    return [ext,tech1,tech2];
-}
-
-
-// called to process /etc/zapata.conf
-// creates an associative array of active Zap ports
-
-function loadZapata(doc,status) {
-    loadHtmlTextFile(
-        doc, 
-        function(line) {
-
-           if (line.indexOf('fxoks') != -1) {
-               var split1 = line.split("=");
-               var ports = split1[1].split(",");
-               for(var i=0; i<ports.length; i++) {
-                   port = trim(ports[i]);
-                   zap[port] = 'FXS';
-               }
-           }
-
-           if (line.indexOf('fxsks') != -1) {
-               var split1 = line.split("=");
-               var ports = split1[1].split(",");
-               for(var i=0; i<ports.length; i++) {
-                   port = trim(ports[i]);
-                   zap[port] = 'FXO';
-               }
-           }
-
-       }
-    );
-                    
-    // now we can load extensions.conf
-
-    downloadUrl("/cgi-bin/getconf.cgi?file=extensions.conf", loadExtensionsConf);
-}
-
-// called to process extensions.conf
-// creates an associative array of analog and ip extensions
-
-function loadExtensionsConf(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           if ((line.indexOf("exten =>") != -1) &&
-               (line.indexOf("mini_ext") != -1)) {
-               var ret = parseDialPlan(line);
-               var ext = ret[0];
-               var tech1 = ret[1];
-               var tech2 = ret[2]; 
-               if (tech1 == "Zap") {
-                   if (zap[tech2] == undefined)
-                       analog_ext[tech2] = "";
-                   else
-                       analog_ext[tech2] = ext; 
-               }
-               if (tech1 == "SIP") {
-                   ip_ext[ext] = "";
-               }
-
-               // save the codes for each extension
-               // need these for constructing the reception string
-               // using underscore instead of forward slash to avoid http managle 
-
-               ext_code[ext_count++] = tech1 +"_"+ tech2;
-               
-           }
-
-           // Save the reception numbers if they exist
-           // Should match one line only
-           //  exten => s,1,Dial(Zap/4&SIP/6011) ;; mini-asterisk - don't remove this comment
-
-           if(line.indexOf("exten => s,1,Dial") != -1) {
-
-               i=0;
-
-               // for each Zap/ read in a single digit and convert to extension
-               while((ret = line.indexOf("Zap/"))!=-1) {
-//                    recept_code[i] = line.substr(ret,5);
-                    recept_num[i] = analog_ext[line.substr(ret+4,1)];
-                    line = line.substr(ret+6,line.length);
-                   i++;
-               }
-
-               // for each SIP/ read in four digits
-               while ((ret = line.indexOf("SIP/")) != -1) {
-//                    recept_code[i] = line.substr(ret,8);
-                    recept_num[i] = line.substr(ret+4,4);
-                    line = line.substr(ret+9,line.length);
-                   i++;
-               }
-
-               recept_count = i;
-
-           }
-       }
-    );
-
-    // we get ip extensions from "sip show peer" at asterisk CLI
-
-    downloadUrl("/cgi-bin/asterisk.cgi?cli=sip show peers", loadIpExtensions);
-}
-
-
-function parseSipShowPeers(line) {
-    var myregexp = /\s+/;
-    var s = line.split(myregexp);
-    var ext = s[0].substr(0,4);
-    var ip = s[1];
-    if (ip_ext[ext] != undefined) {
-       if (line.indexOf("OK") != -1)
-           ip_ext[ext] = ip;
-    }
-}
-
-// called to process asterisk CLI "sip show peers"
-// creates an associative array of IP extensions
-
-function loadIpExtensions(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           parseSipShowPeers(line);
-       }
-       );
-
-    // we get Network connection details
-
-      initialisePage();
-}
-
-function OnResetReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-      initialisePage();
-}
-
-function OnRestartReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-      initialisePage();
-}
-
-function GenericReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-
-}
-
-function OnUpgradeReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-      initialisePage();
-}
-
-function OnInstallReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-      initialisePage();
-}
-
-function OnSetPasswordReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-      initialisePage();
-}
-
-// Load a html encoded text file, strips off the HTML tags
-// and calls textLineProcessing() for every line
-
-function loadHtmlTextFile(doc, textLineProcessing) {
-
-    var lines = doc.split("\n");
-    var state = "looking for body";
-    var next_state;
-
-    for (var j in lines) {
-       next_state = state;
-       if (state == "looking for body") {
-           if (lines[j].indexOf('<body>') != -1)
-               next_state = "body";
-       }
-       if (state == "body") {
-           if (lines[j].indexOf('</body>') != -1)
-               next_state = "finished";
-           else {
-               // main processing of text here
-               textLineProcessing(lines[j]);
-           }
-       }
-       state = next_state;
-    }
-}
-
-
-// called when Fping CGI returns
-
-function processFping(doc, status) {
-
-    // Change icon based on ping results
-
-    var icon;
-
-    if (doc.indexOf("google.com") != -1)
-       icon = '<img src="tick.png" />';
-    else
-       icon = '<img src="cross.png" />';
-
-    document.getElementById('internet').innerHTML = icon;
-}
-
-
-/**
- * Returns an XMLHttp instance to use for asynchronous
- * downloading. This method will never throw an exception, but will
- * return NULL if the browser does not support XmlHttp for any reason.
- * @return {XMLHttpRequest|Null}
- */
-
-function createXmlHttpRequest() {
-    try {
-       if (typeof ActiveXObject != 'undefined') {
-           return new ActiveXObject('Microsoft.XMLHTTP');
-       } else if (window["XMLHttpRequest"]) {
-           return new XMLHttpRequest();
-       }
-    } catch (e) {
-       changeStatus(e);
-    }
-    return null;
-}
-
-
-/**
- * This functions wraps XMLHttpRequest open/send function.
- * It lets you specify a URL and will call the callback if
- * it gets a status code of 200.
- * @param {String} url The URL to retrieve
- * @param {Function} callback The function to call once retrieved.
- */
-function downloadUrl(url, callback) {
-    var status = -1;
-    var request = createXmlHttpRequest();
-    if (!request) {
-       return false;
-    }
-
-    request.onreadystatechange = function() {
-       if (request.readyState == 4) {
-           try {
-               status = request.status;
-           } catch (e) {
-               // Usually indicates request timed out in FF.
-           }
-           if (status == 200) {
-               callback(request.responseText, request.status);
-               request.onreadystatechange = function() {};
-           }
-       }
-    }
-    request.open('GET', url, true);
-    try {
-       request.send(null);
-    } catch (e) {
-       changeStatus(e);
-    }
-
-}
-
-/**
- * This functions wraps XMLHttpRequest open/send function.
- * It lets you specify a URL and will call the callback if
- * it gets a status code of 200.
- * @param {String} url The URL to retrieve
- * @param {Function} callback The function to call once retrieved.
- */
-function downloadUrl2(url, callback) {
-    var status = -1;
-    var request = createXmlHttpRequest();
-    if (!request) {
-       return false;
-    }
-
-/*    request.onreadystatechange = function() {
-       if (request.readyState == 4) {
-           try {
-               status = request.status;
-           } catch (e) {
-               // Usually indicates request timed out in FF.
-           }
-           if (status == 200) {
-               callback(request.responseText, request.status);
-               request.onreadystatechange = function() {};
-           }
-       }
-    }
- */
-
-   request.open('GET', url, true);
-    try {
-       request.send(null);
-    } catch (e) {
-       changeStatus(e);
-    }
-
-}
-
-function onClickLogin() {
-
-       // load password from file
-       
-       // Test submit against pw
-
-       // If ok then
-       var href = "";
-       href = location.href;
-       
-       logged_in = 1;
-       window.location.assign("phones.html");  
-       // else
-       
-       // fail
-}
-
-
diff --git a/mini-asterisk-gui2/ministyle.css b/mini-asterisk-gui2/ministyle.css
deleted file mode 100644 (file)
index d72344f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-html,body{
-       margin:0;
-       padding:0;
-       width:100%;
-       height:100%;
-       font-family:Arial, Helvetica, sans-serif;
-}
-
-div#header{    
-       vertical-align:middle;
-       border-bottom:1px solid #000;
-}
-div#main-map{
-       width:70%;
-       height:100%;
-       float:left;
-}
-div#side{
-       width:30%;
-       float:left;
-}
-
-div#dataPanel{
-       width:90%;
-       height:50%;
-       overflow:auto;
-       border:2px solid #DDDDDD;
-}
-input{
-       width:90%;
-}
-
-input.navi{
-       font-size:12px;
-       height:30px;
-       margin-bottom:10px;
-}
-div ul{
-       margin-top:30px;
-       margin-bottom:30px;
-}
-div ul li{
-       display: inline;
-       list-style-type: none;
-       padding-right: 40px;
-       font-size:18px;
-       font-weight:bold;
-}
-
-div ul li.title{
-       font-size:22px;
-       color:#888;
-}
-
-div#header p{
-       color:#888;
-       font-size:14px;
-       padding-left:20px;
-}
-span.instruction{
-       font-weight:bold;
-       
-}
-
-.message-box { text-align: center; padding: 5px; color:#545454; width:80%;  margin:5px auto; font-size:12px;}
-.clean { background-color: #efefef; border-top: 2px solid #dedede; border-bottom: 2px solid #dedede; }
-.info  { background-color: #f7fafd; border-top: 2px solid #b5d3ff; border-bottom: 2px solid #b5d3ff; }
-.ok    { background-color: #d7f7c4; border-top: 2px solid #82cb2f; border-bottom: 2px solid #82cb2f; }
-.alert { background-color: #fef5be; border-top: 2px solid #fdd425; border-bottom: 2px solid #fdd425; }
-.error { background-color: #ffcdd1; border-top: 2px solid #e10c0c; border-bottom: 2px solid #e10c0c; }
\ No newline at end of file
diff --git a/mini-asterisk-gui2/network.html b/mini-asterisk-gui2/network.html
deleted file mode 100644 (file)
index fe52c70..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Mini Asterisk - Phones</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="tooltips.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="network.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <div id="tooltips"></div>
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td valign="top">
-
-      <form name="network">
-      <table align="center" width=600 >
-        <tr><td colspan="2" align="left" valign="top"><h2>Network</h2></td></tr>
-       <tr><td colspan="1" align="middle" valign="top"><input type="radio" id="dhcp" name="dhcp" value="yes" onClick="doDHCP()">DHCP</td></tr>
-       <tr><td colspan="1" align="middle" valign="top"><input type="radio" id="static" name="dhcp" value="no" onClick="doStatic()">Static</td></tr>
-        <tr><td>IP Address:</td><td><input type="text" name="ipaddress" onBlur="isIP(this)"></td></tr>
-        <tr><td>Netmask:</td><td><input type="text" name="netmask" onBlur="isIP(this)"></td></tr>
-        <tr><td>Gateway:</td><td><input type="text" name="gateway" onBlur="isIP(this)"></td></tr>
-        <tr><td>DNS:</td><td><input type="text" name="dns" onBlur="isIP(this)"></td></tr>
-        <tr onMouseOver="popUp(event,'network_backdoor')" onMouseOut="popUp(event,'network_backdoor')">
-          <td>Emergency IP:</td><td><input type="text" name="backdoor" onBlur="isIP(this)"></td>
-        </tr>
-        <tr onMouseOver="popUp(event,'network_internet')" onMouseOut="popUp(event,'network_internet')">
-         <td>DNS Connection:</td>
-         <td><div id="dnsok"></div></td>
-        </tr>        <tr onMouseOver="popUp(event,'network_internet')" onMouseOut="popUp(event,'network_internet')">
-         <td>Internet Connection:</td>
-         <td><div id="internet"></div></td>
-        </tr>
-        <tr><td></td><td><input type="button" style="width:20%" value="Apply" onClick="onClickApply()"></td></tr>
-      </table>
-    </form>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/network.js b/mini-asterisk-gui2/network.js
deleted file mode 100644 (file)
index a48fe1d..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-  network.js
-  David Rowe 
-  March 7 2011
-
-  Network screen for Mini Asterisk GUI.
-*/
-
-var dhcp;
-var ipaddress;
-var netmask;
-var gateway;
-var dns;
-var backdoor;
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-    var html = toolTips[0] + toolTips[1];
-    document.getElementById('tooltips').innerHTML = html;
-
-    // kick off cascading CGIs, initialisePage() will be called when complete
-
-    // determine if DHCP or static
-
-    downloadUrl("/cgi-bin/getdhcp.cgi", processDhcp);
-//    initialisePage();
-}
-
-function doDHCP() {
-    greyout("yes");
-}
-
-function doStatic() {
-    greyout("no");
-}
-
-
-function greyout(dhcp) {
-
-    if (dhcp == "yes") {
-       document.getElementById("static").checked = 0;
-       document.getElementById("dhcp").checked = 1;
-       document.network.ipaddress.disabled = 1;
-       document.network.netmask.disabled = 1;
-       document.network.gateway.disabled = 1;
-       document.network.dns.disabled = 1;
-    }
-    else {
-       document.getElementById("static").checked = 1;
-       document.getElementById("dhcp").checked = 0;
-       document.network.ipaddress.disabled = 0;
-       document.network.netmask.disabled = 0;
-       document.network.gateway.disabled = 0;
-       document.network.dns.disabled = 0;
-    }
-}
-
-// called when DHCP CGI returns
-
-function processDhcp(doc,status) {
-    dhcp = "no";
-
-    loadHtmlTextFile(doc, function(line) {
-           parseNetwork(line);
-       }
-       );
-
-    greyout(dhcp);
-
-    if (dhcp == "no") {
-        downloadUrl("/cgi-bin/getconf.cgi?file=../init.d/network-static", processStatic);
-    } else {
-           //initialise(); endless loop
-       }
-}
-
-
-// called when static IP CGI returns
-
-function processStatic(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           parseNetwork(line);
-       }
-       );
-        
-    downloadUrl("/cgi-bin/getemergencyip.cgi", processEmergencyIp);
-}
-
-// called when Emergency CGI returns
-
-function processEmergencyIp(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           parseNetwork(line);
-       }
-       );
-        
-    // fire off fping CGI
-
-    downloadUrl("/cgi-bin/fpingnodes.cgi?ip=google.com", processFping);
-}
-
-function parseNetwork(line) {
-
-    if (line.indexOf("DHCP=") != -1) {
-      var s = line.split('"');
-      dhcp = s[1];
-    }
-
-    if (line.indexOf("IPADDRESS=") != -1) {
-      var s = line.split('"');
-      ipaddress = s[1];
-      document.network.ipaddress.value = ipaddress;
-    }
-
-    if (line.indexOf("NETMASK=") != -1) {
-      var s = line.split('"');
-      netmask = s[1];
-      document.network.netmask.value = netmask;
-    }
-
-    if (line.indexOf("GATEWAY=") != -1) {
-      var s = line.split('"');
-      gateway = s[1];
-      document.network.gateway.value = gateway;
-    }
-
-    if (line.indexOf("DNS=") != -1) {
-      var s = line.split('"');
-      dns = s[1];
-      document.network.dns.value = dns;
-   }
-
-   if (line.indexOf("BACKDOOR=") != -1) {
-      var s = line.split('"');
-      backdoor = s[1];
-      document.network.backdoor.value = backdoor;
-   }
-}
-
-
-// http://moblog.bradleyit.com/2009/06/javascript-ip-address-validation.html
-
-function isIP(obj) {
-    var ary = obj.value.split(".");
-    var ip = true;
-
-    ip = (ary.length == 4); 
-
-    if (ip) {
-       for (var i=0; i<4; i++) { 
-               ip = (!ary[i].match(/^\d{1,3}$/) || (Number(ary[i]) > 255)) ? false : ip; 
-       } 
-    }
-
-    if (!ip) {    
-       // the value is NOT a valid IP address
-       obj.style.background = "red";
-       obj.select();
-    } 
-    else { obj.style.background = ""; } // the value IS a valid IP address
-
-    return ip;
-}
-
-
-// called when Apply button pressed
-
-function onClickApply() {
-
-    // change network type, DHCP or static
-
-    if (document.getElementById("dhcp").checked == 1) {
-
-               if (dhcp = "no") {
-                       // disable network-static service and endable network service
-                       downloadUrl("/cgi-bin/setservice.cgi?action=enabledhcp",GenericReturn);
-               }
-               else {
-                       // dhcp already running, restart service
-                       downloadUrl("/cgi-bin/setservice.cgi?action=restartdhcp",GenericReturn);
-               }
-    }
-    else {
-
-               // start cgi cascade
-               // disable network service and enable network-static service
-               downloadUrl("/cgi-bin/setservice.cgi?action=enablestatic",dhcpReturn);
-
-
-
-
-       }
-}
-
-function dhcpReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       var new_ipaddress = document.network.ipaddress.value;
-       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=IPADDRESS=&that="' + new_ipaddress + '"';
-               
-       downloadUrl(url,ipaddressReturn);
-}
-
-function ipaddressReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       var new_netmask = document.network.netmask.value;
-       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=NETMASK=&that="' + new_netmask + '"';
-       downloadUrl(url,netmaskReturn);
-}
-
-function netmaskReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       var new_gateway = document.network.gateway.value;
-       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=GATEWAY=&that="' + new_gateway + '"';
-       downloadUrl(url,gatewayReturn);
-}
-
-function gatewayReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       var new_dns = document.network.dns.value;
-       var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=DNS=&that="' + new_dns + '"';
-       downloadUrl(url,dnsReturn);
-}
-
-
-//     var new_backdoor = document.network.backdoor.value;
-//     var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
-//     downloadUrl(url,GenericReturn);
-
-
-
-//     downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",GenericReturn);
-//     
-
-
-function dnsReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       // finally restart network-static service with new parameters
-
-       downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",restartstaticReturn);
-}
-
-function restartstaticReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       // finally reload the page (this updates the fping....crudely)
-
-       initialise();
-}
-
diff --git a/mini-asterisk-gui2/phones.html b/mini-asterisk-gui2/phones.html
deleted file mode 100644 (file)
index 7f2a131..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Mini Asterisk - Phones</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css" />
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="phones.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <div id="tooltips"></div>
-
-  <table align="center" width="950">
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="phones_table"></div></td>
-    <td>
-
-       <input name="update_recept" type="button" style="width:100%" value="update reception" onClick="onClickUpdateReception()" />
-       <!--input name=update_out type="button" style="width:100%" value="update outgoing" onClick="onClickUpdateOutgoing()"-->
-
-    </td>
-  </tr>
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/phones.js b/mini-asterisk-gui2/phones.js
deleted file mode 100644 (file)
index b305d55..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
-  phones.js
-  David Rowe 
-  Dec 12 2010
-
-  Phones screen for Mini Asterisk GUI.
-*/
-
-var update_time = 10;
-
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    // kick off cascading CGIs, initialisePage() will be called when complete
-
-    loadExtensions();
-    //initialisePage();
-}
-
-
-function initialisePage() {
-    // construct list of phone extensions
-    
-    var icon = '<img src="tick.png" alt="Analog Phone OK" />';
-    var html = '';
-    var itemcount = 0;
-       
-    html += '<form name="phones" method="get">';
-
-    html += '<table align="right" width=600 cellspacing=2>';
-
-    // print out internet connection
-
-    html += '<tr><td colspan="3" align="left" valign="top"><h2>Phone System (GUI2)</h2></td></tr>';
-    html += '<tr><td colspan="2">Internet Connection:</td><td> </td><td><div id="internet"></div></td></tr>';
-    html += '<tr><td colspan="2">Phone System IP Address:</td><td> </td><td div id="ipaddress"></div></td></tr>';
-    html += '<tr><td>&nbsp</td></tr>';
-
-    // print out analog phones
-
-    html += '<tr><td colspan="4" align="left" valign="top"><h2>Phones</h2></td></tr>';
-    for(var i=0; i<zap.length; i++) {
-        if (zap[i] == 'FXS') {
-            html += "<tr>";
-               html += "<td>" + analog_ext[i] + "</td>" + "<td>" + "Analog Phone" + "</td>";
-               html += "<td>Port" + i  + "</td>";
-
-            html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
-
-            // the reception checkbox code
-               html += "<td>" + '<input name="selected_in[]" ' ;
-                       html += 'value= "' + ext_code[i-1] + '" ';
-            html += 'type="checkbox" ' ;
-
-            if (recept_num.indexOf(analog_ext[i]) != -1) {
-                       html += '" checked/>';
-                       }
-               else {
-                       html += '" unchecked/>';
-               }
-
-               // save the reception code
-               recept_code[itemcount++]=ext_code[i-1];
-
-            html += "</td>";
-       
-            html += "</tr>";
-           }
-    }
-
-
-
-    // print out IP phones
-    //  j is 6011,6012 etc
-
-    for (j in ip_ext) {
-        if (ip_ext[j] != '') {
-            html += "<tr>";
-               html += "<td>" + j + "</td>" + "<td>" + "IP Phone" + "</td>";
-               html += "<td>" + ip_ext[j] + "</td>";
-
-            html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
-
-            // the reception checkbox code
-               html += "<td>" + '<input name="selected_in[]" ';
-                       html += 'value="SIP_' + j + '" ';
-            html += 'type="checkbox" ' ;
-                       
-            if (recept_num.indexOf(j)!=-1) {
-                       html += '" checked/>';
-                   }
-               else {
-                       html += '" unchecked/>';
-               }
-
-               // save the reception code
-           
-               recept_code[itemcount++]=ext_code[(i-1)];
-               i++;
-
-            html += "</td>";
-
-            html += "</tr>";
-           }
-    }
-
-    html += "<tr>";
-    html += "<td>";
-    html += "<a href=ipphones.html>Add IP Phone</a>";
-    html += "</td>";
-
-    // print out submit button
-       //doesn't work ... Only use static html buttons
-
-/*    html += "<td>";
-    html += "<input type='submit' value='Update Reception' onClick='onUpdateReception()'/>";
-    html += "</td>";
-*/
-    html += "</tr>";
-
-
-
-
-
-    // print out phone lines
-
-    html += '<tr><td colspan="4" align="left" valign="top"><h2>Phone Lines</h2></td></tr>';
-    for(var i=0; i<zap.length; i++) {
-        if (zap[i] == 'FXO') {
-            html += "<tr>";
-           html += "<td>" + "0" + "</td>" + "<td>" + "Analog Phone Line" + "</td>";
-           html += "<td>Port" + i + "</td>";
-            html += "<td>" + '<img src="tick.png" alt="tick" />' + "</td>";
-
-            // the outgoing radiobox code
-/*         html += "<td>" + '<input name="selected_out[]" type="radio" ' ;
-
-            if (outgoing_num == i) {
-                   html += '" checked/>';
-               }
-           else {
-                   html += '" unchecked/>';
-           }
-
-           // save the outgoing code
-           
-           outgoing_code[itemcount++]=ext_code[(i-1)];
-
-            html += "</td>";
-
-*/            html += "</tr>";
-       }
-
-
-    }
-
-    // add a voip line
-
-    html += "<tr>";
-    html += "<td>";
-    html += "<a href=voiplines.html>Add Voip line</a>";
-    html += "</td>";
-    html += "</tr>";
-
-    html += '</table>';
-       
-    html += '</form>';
-    document.getElementById("phones_table").innerHTML += html;
-
-    // fire off fping CGI
-
-    downloadUrl("/cgi-bin/fpingnodes.cgi?ip=google.com", processFping);
-
-    // fire off Ifconfig IP address to get IP Address
-
-    downloadUrl("/cgi-bin/ifconfig.cgi?arg=eth0", processIfconfig);
-//    downloadUrl("/cgi-bin/ifconfig.cgi?arg=eth1", processIfconfig);
-
-       // downloadUrl works fine here.
-//    downloadUrl("/cgi-bin/setring.cgi?Zap_3=on", null);
-
-}
-
-
-// called when ifconfig CGI returns
-
-function processIfconfig(doc, status) {
-
-    var ip="";
-
-    if (doc.indexOf("inet addr:") != -1) {
-       ip = doc.substr(doc.indexOf("inet addr:"), doc.length);
-       ip = ip.substr(10, ip.length);
-       ip = ip.substr(0, ip.indexOf(" "));
-    }
-
-    document.getElementById('ipaddress').innerHTML = ip;
-}
-
-function onClickUpdateReception() {
-
-       // get the arguments from the form  selected_in[]
-       ///document.myform.elements['fav[]'].checked
-       var arg ="";
-
-
-       //      number of check boxes in the form
-       var total = document.phones.elements['selected_in[]'].length;
-
-       var recept_box = document.phones.elements['selected_in[]'];
-
-       j=0;
-       for (i=0;i<total; i++) {
-
-               // construct new arg from selected
-               if(recept_box[i].checked) {
-                       
-                       j++;
-                       if (j>1)
-                               arg = arg+"&";
-
-                       // got to make up new codes
-                       arg = arg + recept_box[i].value + "=on";
-               }
-
-       }
-
-    var arg2 =  "/cgi-bin/setring.cgi?" + arg;
-       downloadUrl(arg2,OnSetringReturn);
-
-
-}
-
-function OnSetringReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       downloadUrl("/cgi-bin/asterisk.cgi?cli=dialplan reload",GenericReturn);
-       //initialisePage();
-}
-
-function onClickUpdateOutgoing() {
-
-       // get the arguments from the form  selected_out[]
-       ///document.myform.elements['fav[]'].checked
-       var arg ="";
-
-
-       //      number of check boxes in the form
-       var total = document.phones.elements['selected_out[]'].length;
-
-       var out_box = document.phones.elements['selected_out[]'];
-
-       //j=0;
-       for (i=0;i<total; i++) {
-
-               // construct new arg from selected
-               if(out_box[i].checked) {
-                       
-                       //j++;
-                       //if (j>1)
-                       //      arg = arg+"&";
-
-                       // got to make up new codes
-                       arg = arg + recept_code[i] + "=on";
-               }
-
-       }
-        var arg2 =  "/cgi-bin/setoutgoing.cgi?" + arg;
-//     downloadUrl(arg2,GenericReturn);
-
-
-}
-
-
-
-
diff --git a/mini-asterisk-gui2/system.html b/mini-asterisk-gui2/system.html
deleted file mode 100644 (file)
index 39a5821..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>System</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="system.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="system"></div>
-        <table align="right" width=600>
-           <tr><td colspan="3" align="left" valign="top"><h2>System</h2></td></tr>
-           <tr><td colspan="2"></td></tr>
-
-           <tr><td colspan="2">cat /proc/version</td></tr>
-           <tr><td id="version" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">cat /proc/loadavg</td></tr>
-           <tr><td id="loadavg" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">cat /proc/cpuinfo</td></tr>
-           <tr><td id="cpuinfo" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">cat /proc/mtd</td></tr>
-           <tr><td id="mtd" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">cat /proc/meminfo</td></tr>
-           <tr><td id="meminfo" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">cat /proc/yaffs</td></tr>
-           <tr><td id="yaffs" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">uptime</td></tr>
-           <tr><td id="uptime" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           <tr><td colspan="2">ipkg list_installed</td></tr>
-           <tr><td id="installed" style="border: 1px solid ;"></td></tr>
-           <tr><td>&nbsp;</td></tr>
-
-           </table>
-
-
-    </td>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/system.js b/mini-asterisk-gui2/system.js
deleted file mode 100644 (file)
index f8b01bb..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-  system.js
-  Ian Roberts
-  May 7 2012
-
-  System screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-var version = "Linux ....";
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    loadSystemInfo();   // Kick off cgi scripts
-    initialisePage();
-}
-
-
-function initialisePage() {
-
-
-//    document.getElementById("system").innerHTML += html;
-
-}
-
-function loadSystemInfo() {
-
-       downloadUrl("/cgi-bin/catproc.cgi?arg=version", loadVersion);
-
-}
-
-function loadVersion(doc, status) {
-
-       document.getElementById('version').innerHTML = doc.substr(doc.indexOf("Linux"), doc.length);
-
-       downloadUrl("/cgi-bin/catproc.cgi?arg=loadavg", loadLoadavg);
-}
-
-function loadLoadavg(doc, status) {
-
-       document.getElementById('loadavg').innerHTML = doc.substr(0, doc.length);
-
-       downloadUrl("/cgi-bin/catproc.cgi?arg=cpuinfo", loadCPUinfo);
-}
-
-function loadCPUinfo(doc, status) {
-       ip = "";
-
-       ip = doc.substr(0, doc.length);
-        if (doc.indexOf("CPU") != -1) {
-
-               // Blackfin hardware is ADSP-BF533
-               ip = doc.substr(doc.indexOf("CPU"), doc.length);
-//             ip = ip.substr(10, ip.length);
-//             ip = ip.substr(0, ip.indexOf("power manage"));
-       }
-
-       document.getElementById('cpuinfo').innerHTML = ip;
-
-       downloadUrl("/cgi-bin/catproc.cgi?arg=mtd", loadmtd);
-}
-
-function loadmtd(doc, status) {
-
-       document.getElementById('mtd').innerHTML = doc.substr(0, doc.length);
-
-       downloadUrl("/cgi-bin/catproc.cgi?arg=meminfo", loadmeminfo);
-}
-
-function loadmeminfo(doc, status) {
-
-       document.getElementById('meminfo').innerHTML = doc.substr(0, doc.length);
-
-       downloadUrl("/cgi-bin/catproc.cgi?arg=yaffs", loadyaffs);
-}
-
-function loadyaffs(doc, status) {
-
-       document.getElementById('yaffs').innerHTML = doc.substr(0, doc.length);
-
-       downloadUrl("/cgi-bin/uptime.cgi?arg=nothing", loaduptime);
-}
-
-function loaduptime(doc, status) {
-
-       document.getElementById('uptime').innerHTML = doc.substr(0, doc.length);
-
-       downloadUrl("/cgi-bin/ipkg.cgi?arg=list_installed", loadinstalled);
-}
-
-function loadinstalled(doc, status) {
-
-       document.getElementById('installed').innerHTML = doc.substr(0, doc.length);
-
-//     end of script cascade
-}
-
-
diff --git a/mini-asterisk-gui2/tick.png b/mini-asterisk-gui2/tick.png
deleted file mode 100644 (file)
index c155dff..0000000
Binary files a/mini-asterisk-gui2/tick.png and /dev/null differ
diff --git a/mini-asterisk-gui2/todo 2012_10.txt b/mini-asterisk-gui2/todo 2012_10.txt
deleted file mode 100644 (file)
index cbca6d2..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-IP04 GUI2 To do notes\r
-Ian Roberts \r
-\r
-*************************************************************************\r
-\r
-Oct 1 2012\r
-\r
-network page\r
-  \r
-  Test static to dhcp selection\r
-  \r
-  dhcp   if cant reference objects (radio) directly...use getElementById()\r
-         dhcp get 1.30 if possible?\r
-                \r
-  gateway :fping does not time out when internet down\r
-  \r
-  add in emergency ip code\r
-\r
-phones page\r
-\r
-  debug reception errors with 1fxo, 1fxs in zaptel.conf\r
-  \r
-new config page \r
-\r
-  impedance select US or AU\r
-  ntp select region\r
\r
-new login page\r
-  makes a cookie based on \r
-  \r
-  \r
-*****************************************************************************  \r
-  \r
-Oct 18 2012\r
-  \r
-\r
-Phones page\r
-\r
-       Reception update fail : \r
-               Daisy chain url calls\r
-               Fix asterisk cgi prefix .... cli=dial plan\r
-\r
-       internet fping 8.8.8.8\r
-  \r
-Network page\r
-  \r
-       Bad dns .... Try fping 8.8.8.8 instead?\r
-       ....try fping dns check before internet fping\r
-       .... maybe nslookup \r
-                fping 8.8.8.8 ?\r
-\r
-       two crosses dns and internet?\r
-\r
-       fping dns\r
-       if ok fping google\r
-       else fail report\r
-       \r
-[  Dialplan outbound g1/g2 ?   ]\r
-\r
-IP provider page\r
-\r
-Login page\r
-\r
-\r
-*************************************************************************************\r
-\r
-Oct 29 2012\r
-\r
-IP provider page work\r
-       sip.conf modified with new keywords\r
-       install script changed to update sip.conf\r
-       Are sip provider entries ok to leav uncommented?...they have dummy hosts\r
-       \r
-Notice ip phone (ekiga from pc) registrations stay on ip04 after phone has disappeared\r
-\r
-\r
-Error on Fxo/FXS rearrangement  phones lines read as phone\r
-\r
-Register command needs to be unique\r
-\r
-SetRegister.cgi   ?  with mini-asterisk\r
-\r
-       $ cat test.txt | sed 's/\(register=>\).*\( ; mini-asterisk\)/\1bob:superbob@192.168.1.3\2/'\r
-       register=>bob:superbob@192.168.1.3 ; mini-asterisk yada yada\r
-       ;register => 2345:password@sip_proxy/1234\r
-\r
-Register needs to be able to handle other manual register entries\r
-\r
-Or make a mod to set_line_ext.cgi with third arg (jazmin,sip,sip-nat)\r
-\r
-Uncomment / comment sip provider as a cgi?\r
-\r
-                                                               s/$this.*/$this$that/g\r
-[11:09:09 AM | Edited 11:10:06 AM] David Rowe:  s/(host=).*\w/$1trev/g\r
-[11:10:13 AM] David Rowe: host=mal\r
-[11:10:16 AM] David Rowe: host=trev\r
-\r
-\r
-hex codes as uniques?  hard to remember\r
-\r
-$ cat test.txt | sed 's/\(host=\)[a-z]*\(.*sip mini-asterisk.*\)/\1trev\2/'\r
-host=fred ; jazmin mini-asterisk\r
-host=trev ; sip mini-asterisk\r
-\r
-$ cat test.txt | sed 's/\(dtmfmod=\)[a-z0-9\.]*\(.*Jazmin mini-asterisk.*\)/\1trev\2/'\r
-host=192.168.1.28       ; Jazmin mini-asterisk do not remove this comment\r
-dtmfmod=trev         ; Jazmin mini-asterisk do not remove this comment\r
-\r
-debugging\r
-#!/bin/sh\r
-[12:05:07 PM] David Rowe: #!/bin/sh -x\r
-[12:05:16 PM] David Rowe:   sed -i "s/$this.*/$this$that/g" $file\r
-\r
-export QUERY_STRING='file=test.txt&this=host=&that=192.168.1.31&key=Jazmin mini'; ./setlinekey.cgi\r
-\r
-We are getting problems with sed (busybox version) regular expressions on the ip04. We are losing /1 /2 entities.
\ No newline at end of file
diff --git a/mini-asterisk-gui2/todo 2012_11.txt b/mini-asterisk-gui2/todo 2012_11.txt
deleted file mode 100644 (file)
index 31ccf5d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-IP04 GUI2 To do notes\r
-Ian Roberts \r
-\r
-*************************************************************************\r
-\r
-Nov 16 2012\r
-\r
-Dave added new cgis to use perl instead of sed.\r
-       - sed is broken under busybox 1.4.1\r
-       - perl is working fine.\r
-    - comment.cgi\r
-       - uncomment.cgi\r
-       - setlinekey2.cgi\r
-\r
-voip provider page\r
-\r
-  Test sip\r
-     - registering successfully with another asterisk box (use host=dynamic)\r
-        - out bound calls ?\r
-        - inbound calls ?\r
-  \r
-  Test jazmin\r
-       - do we get a successful registration ?\r
-               fails with none dropbox set ... read in current registration\r
-               fails with mulit changes...leave voip keyword intact (Done)\r
-               \r
-       - can we make outbound voip calls ?\r
-       - are inbound voip calls working ?\r
-\r
-(Maybe add in voip line 2 page... later)\r
-  \r
-*****************************************************************************  \r
\r
\r
- Nov 29 2012\r
\r
- voip line (sip trunk) page is now working.\r
-       - reads settings from sip.conf \r
-       - there are four options for sip trunk... none, sip, sip with nat, and provider\r
-       - you can change user, password, host, fromuser, and fromdomain\r
-       - these changes get saved back into sip.conf when you press the ok\r
\r
- testing\r
-    - sip              registers       ok\r
-                               outbound        ok\r
-                               inbound         not tested yet\r
-\r
-    - sipnat   registers       not tested yet\r
-                               outbound        not tested yet\r
-                               inbound         not tested yet\r
-\r
-    - provider registers       ok      voip.oeg.com.au\r
-                               outbound        ok      (adelaide ok, wgong fails)\r
-                               inbound         not tested yet\r
-\r
-       - none          clears rego     ok\r
-\r
-       \r
-*************************************************************************************\r
-\r
diff --git a/mini-asterisk-gui2/todo notes b/mini-asterisk-gui2/todo notes
deleted file mode 100644 (file)
index ea1f4e4..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-IP04 GUI2 To do notes
-Ian Roberts 
-
-*************************************************************************
-
-Sept 13 2012
-
-Goal is a gui2 package we can install on an ip0x
-  ipkg install gui2
-see baps build makefile
-http://svn.astfin.org/software/baps/trunk/mini-asterisk-gui.mk
-
-1. install script fix :enable cgi     Done
-----------------------------------
-       use sed on /etc/lighttpd.conf
-        1. Change end bracket to comma 
-        2. Uncomment s_#cgi.assign.*_cgi.assign
-        3. Add in end bracket
-       then /etc/init.d/lighttpd restart
-       
-       kiss. just copy the corrected conf file from the sourceforge archive.
-
-2.  install script fix :add mini_ext comments Done 
-------------------------------------------
-       use sed on /etc/asterisk/extension.conf
-
-   show extensions missing mini_ext comment
-       grep "60**" /etc/asterisk/extensions.conf | grep -v "mini"
-
-       grep "60[0-9][0-9],1,Dial(.*) " /etc/asterisk/extensions.conf
-
-
-3. on firefox : update reception button broken   Done 14/9
----------------------------------------------
-   Chrome 21 is ok
-   Internet Explorer 9 is ok. 
-   IE 8? - check on vista laptop
-   Safari 5.1.7 is ok
-   Firefox 15 fails ...why?.
-   Installed firebug debugger
-   TypeError
-   phones.js line 209
-   document.phones.elements['selected_in[]'] undefined ... 
-
-   I cant see any phones element in the document model.
-
-                
-       David --> Try moving <form> to encapsulate the <table> in phones.js
-       
-       This worked.
-
-4. network page not working       Not done
-------------------------------
-   Also how fast can it detect the internet after change in gateway
-   Try to break internet with dns or gateway changes.
-   Missing a cgi.....setservice.cgi
-   
-   Calls from network.js are 
-   if (document.network.dhcp.value == "yes") {
-
-       if (dhcp = "no") {
-           // disable network-state service and endable network service
-           downloadUrl("/cgi-bin/setservice.cgi?action=enabledhcp",null);
-       }
-       else {
-           // dhcp already running, restart service
-           downloadUrl("/cgi-bin/setservice.cgi?action=restartdhcp",null);
-       }
-    }
-    else {
-
-       if (dhcp = "yes") {
-           // disable network service and enable network-static service
-           downloadUrl("/cgi-bin/setservice.cgi?action=enablestatic",null);
-       }
-
-       .....
-       
-       if (document.network.backdoor.value != backdoor) {
-           var new_ = document.network.backdoor.value;
-           var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
-           downloadUrl(url,null);
-           downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",null);
-       }
-
-       // finally restart network-static service with new parameters
-
-       downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",null);
-    }
-
-       Are URLs with null return  function suppose to be synchronous?
-       
-       The networking functions have to have synchrous sections, esp when start/stop/enable/disable
-       
-       For example, u cant do a network start before a network stop has finished?
-       
-       Try to synchronise with cascading cgi flow. This works.
-       
-       Need to time-out fping after 2-3seconds, else it will go 30s.
-   
-   
-   
-
-5. Outbound calls....
--------------------------
-
-   Groups of people assigned to different outbound
-   Work with dialplans
-   At present  
-      0 gets outside analog line
-      1 gets a sip call thru the vsp
-   Instead of hard coded 0,1 maybe use a dropbox selection 
-   then try assigning to groups of users.
-   Need to have a page where we set up groups of users.
-
-6. ntp testing
---------------------
-   try getting ntpclient rather than ntp?
-   try setting TZ in /etc/init.d/asterisk already done...just need reboot
-   web page for setting timezone (radio button and apply checkbox?)
-
-7. use setline.cgi instead of setring.cgi
---------------------------------------
-   Have setline take care of special cases like escaping the ampersand.
-
-8. Setring.cgi fix    Done 14/9
---------------------
-   Remove asterisk -r calls from setring.cgi.....do this from javascript with asterisk.cgi.
-   
-9. Pick up second IP04
-----------------------------
-       gui2 install testing
-       unit testing call generation
-       
-10. Move formatting from html to css
----------------------------------------
-     html <table align="center" width=800>
-     css
-        
-11.    Add some formatting (carriage returns) to the table element in phones.js         
--------------------------------------------------------         
-        
-General Interest
-
-html validator at http://validator.w3.org/check
-There are validator extensions for most browsers.
-
-Best practices at http://sixrevisions.com/web-standards/20-html-best-practices-you-should-follow/
-      Close my tags !
-         <img src="images/sample.jpg" alt="sample" />
-
-
-
- IP04 could be redone more simply with a plug computer. $150 - $250AU 
- http://www.spinifex.com.au/shop/index.php?main_page=product_info&cPath=65&products_id=208
- 1.2GHz ARM 512M ddr2 512M flash sd boot 2x usb 2x cat5  5W ..... good ip-pbx? good smoothwall or snorby box?
- Need some sort of USB to FXO to hook up to analog phone lines.
- $150 http://sangoma.com/products/telecom_boards/analog/usbfxo/specs.html
- $20 gets you a skype gateway box with an fxo
- http://openusbfxo.wordpress.com/
- The blackfin has no memory management unit. This causes many problems and cludgey fixes.
-
-opus codec, silk codec, Jean-marc, codec2 
diff --git a/mini-asterisk-gui2/tooltip.css b/mini-asterisk-gui2/tooltip.css
deleted file mode 100644 (file)
index beaefc0..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-.tip {font:14px/16px
-Arial,Helvetica,sans-serif; border:solid 1px
-#666666; width:270px; padding:1px;
-position:absolute; z-index:100;
-visibility:hidden; color:#333333; top:20px;
-left:90px; background-color:#ffffcc;
-layer-background-color:#ffffcc;}
diff --git a/mini-asterisk-gui2/tooltip.js b/mini-asterisk-gui2/tooltip.js
deleted file mode 100644 (file)
index 26142e8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// Extended Tooltip Javascript
-// copyright 9th August 2002, 3rd July 2005, 24th August 2008
-// by Stephen Chapman, Felgall Pty Ltd
-
-// permission is granted to use this javascript provided that the below code is not altered
-function pw() {return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth}; function mouseX(evt) {return evt.clientX ? evt.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) : evt.pageX;} function mouseY(evt) {return evt.clientY ? evt.clientY + (document.documentElement.scrollTop || document.body.scrollTop) : evt.pageY} function popUp(evt,oi) {if (document.getElementById) {var wp = pw(); dm = document.getElementById(oi); ds = dm.style; st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else {tv = mouseY(evt) + 20; lv = mouseX(evt) - (ew/4); if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2; lv += 'px';tv += 'px';  ds.left = lv; ds.top = tv; ds.visibility = "visible";}}}
-                  
diff --git a/mini-asterisk-gui2/tooltips.js b/mini-asterisk-gui2/tooltips.js
deleted file mode 100644 (file)
index 658c1f8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-var toolTips = [
-'<div id="network_internet" class="tip">A tick means your phone system can reach the Internet.  You need the Internet for VOIP calls and software upgrades.  If you have a problem reaching the Internet check your Network settings, in particular Gateway and DNS.</div>',
-
-'<div id="network_backdoor" class="tip">Emergency backdoor IP. Useful if you get locked out of the main network connection, for example due to DHCP problems on your network or a configuration mistake.  Write this number down somewhere!</div>',
-
-'<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.  You can answer a call on another ringing phone by dialling *8 on your phone - see FAQ for details.</div>',
-
-'<div id="phone_update_reception" class="tip">Press this button to lock in any changes you have made to the Reception check-boxes above.</div>',
-
-'<div id="phone_anphone" class="tip">Analog Phone: Normal telephone plugged into a port on your phone system.</div>', 
-
-'<div id="phone_ipphone" class="tip"> IP Phone plugged into your network.</div>',
-
-'<div id="phone_line" class="tip"> Analog Phone Line: Analog telephone line plugged into a port on your phone system.</div>',
-
-'<div id="phone_voipline" class="tip"> VOIP Phone Line: Make and receive phone calls over the Internet.</div>',
-
-'<div id="phone_system" class="tip">Important information about your Phone System.</div>',
-
-'<div id="phone_ipaddress" class="tip">The address of your Phone System on your network.  Use this address to connect IP Phones to your Phone System.</div>',
-
-'<div id="phone_phones" class="tip">List of phones connected to your Phone System.  You can connect Analog or IP Phones to your system. When IP Phones are configured correctly, they appear on this list.  If an IP phone is not configured correctly, it will not appear on this list.  Analog phones require hardware to be installed in your Phone system.</div>',
-
-'<div id="phone_lines" class="tip">List of phone lines available. Phone lines are used to make and receive outside calls. You can use regular Analog phone lines or VOIP.  VOIP phone lines require an account with an Internet Telephone Service Provider.  Analog phone lines require hardware to be installed in your Phone System.</div>',
-
-'<div id="phone_ext" class="tip">Dial this number to call this phone</div>',
-
-'<div id="phone_line_prefix" class="tip">Dial 0 for an Analog outside line.  For example to call 5551234 dial 05551234.  Don\'t pause after the 0, just dial 0 and the outside number together.</div>',
-
-'<div id="phone_port_phone" class="tip">Port (socket) on the rear of your Phone System.  Plug the phone into this Port.</div>',
-
-'<div id="phone_port_line" class="tip">Port (socket) on the rear of your Phone System.  Plug the phone line into this Port.</div>',
-
-'<div id="phone_ipphone_ip" class="tip">IP Address of this phone on your network</div>',
-
-'<div id="phone_voipline_ip" class="tip">IP Address of the VOIP Internet Telephone Service Provider</div>',
-
-'<div id="phone_voipline_prefix" class="tip">Dial 1 for a VOIP outside line.  For example to call 5551234 dial 15551234. Don\'t pause after the 1, just dial 1 and the outside number together.</div>',
-
-'<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 page to update</div>',
-
-'<div id="ipphones_connected" class="tip">The IP phone is connected to your phone system and ready to use</div>',
-
-'<div id="ipphones_notconnected" class="tip">No IP phone is connected.  Either no IP phone is present, or the IP phone has not been set up.</div>',
-
-'<div id="voiplines_voiplines" class="tip"> A VOIP line allows you to make and receive phones calls over the Internet.  Normally a VOIP line is provided by an Internet Telephony Service Provider (ITSP).  They will give you an account, which includes the user and password details that you can fill in below.  Refresh this page on your browser to see if your VOIP line is working.  </div>',
-
-'<div id="voiplines_provider" class="tip">Your Internet Telephony Service Provider. They will give you an account with a user name and password.</div>',
-
-'<div id="voiplines_user" class="tip">Your account name with your Internet Telephony Service Provider</div>',
-
-'<div id="voiplines_pass" class="tip">The password for your Internet Telephony Service Provider account</div>',
-
-'<div id="voiplines_host" class="tip">The Internet address of your Internet Telephony Service Provider.  This will usually be filled in automatically.</div>',
-
-'<div id="voiplines_status" class="tip">A tick means you are connected to your Internet Telephony Service Provider.  Refresh your browser to update.</div>',
-
-'<div id="admin_restart" class="tip">Press this button to restart your phone system.  This is the same as turning the power off and back on. </div>',
-
-'<div id="admin_upgrade" class="tip">Press this button to install the latest version of Mini Asterisk.  An Mini Asterisk upgrade requires an Internet connection.</div>',
-
-'<div id="admin_firmware" class="tip">Enter the URL of a firmware update script.  This option can be used to install new firmware on your Phone System.  Installing new firmware requires an Internet connection.  The full URL Must be entered, e.g. http://rowetel.com/ucasterisk/mini/test.sh</div>' 
-];
-
diff --git a/mini-asterisk-gui2/voiplines.html b/mini-asterisk-gui2/voiplines.html
deleted file mode 100644 (file)
index ec2c622..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>voiplines</title>
-
-<link rel="stylesheet" type="text/css" href="ministyle.css">
-<link rel="stylesheet" href="tooltip.css" type="text/css" />
-<script type="text/javascript" src="minicommon.js"></script>
-<script type="text/javascript" src="tooltip.js"></script>
-<script type="text/javascript" src="tooltips.js"></script>
-<script type="text/javascript" src="menu.js"></script>
-<script type="text/javascript" src="voiplines.js"></script>
-<script type="text/javascript">
-
-</script>
-
-</head>
-
-<body onload="initialise()">
-
-  <table align="center" width=800>
-  <tr>
-    <td><div id="menu"></div></td>
-    <td><div id="voiplines"></div></td>
-
-   <td valign="top">
-
-    <table align="right" width=600>
-      <tr><td>&nbsp;</td></tr>
-      <tr><td align="left" valign="top" colspan="2"><h2>VOIP Line</h2></td></tr>
-
-      <tr><td>&nbsp;</td></tr>
-
-      <tr id="tt_provider"><td>Provider</td>
-         <td>
-        <select name="provider" id="provider" onchange="changeProvider()">
-             <option value="none">none</option>
-             <option value="sipnat">SIP-NAT</option>
-             <option value="sipnormal">SIP-Normal</option>
-             <option value="jazmin">Provider</option>
-        </select>
-         </td></tr>
-      <tr><td> </td><td><div id=info></div> </td></tr>
-      <tr id="tt_user"><td>User:</td><td><input type="text" name="user" id="user" value=""/></td></tr>
-      <tr id="tt_pass"><td >Password:</td><td><input type="password" name="pass" id="pass" value=""/></td></tr>
-      <tr id="tt_host"><td >Host:</td><td><input type="text" name="host" id="host" value=""/></td></tr>
-      <tr id="tt_fromuser"><td >From user:</td><td><input type="text" name="fromuser" id="fromuser" value=""/></td></tr>
-      <tr id="tt_fromdomain"><td >From domain:</td><td><input type="text" name="fromdomain" id="fromdomain" value=""/></td></tr>
-      <tr><td>&nbsp;</td></tr>
-         <tr><td>Voip Line Status:</td><td><div id="voiplinestatus"></div></td></tr>
-      <tr><td>&nbsp;</td></tr>
-      <tr><td colspan="2">Sometimes it takes a few seconds to connect your Voip Line.</td></tr>
-      <tr><td>&nbsp;</td></tr>
-      <tr><td><input type="submit" value="OK" onClick="onClickApply()" /></td></tr>
-
-
-    </table>
-
-    </td>
-  </tr>
-
-  </table>
-</body>
-</html>
diff --git a/mini-asterisk-gui2/voiplines.js b/mini-asterisk-gui2/voiplines.js
deleted file mode 100644 (file)
index 41aac53..0000000
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
-  voiplines.js
-  Ian Roberts
-  May 10 2012
-
-  voiplines screen for Mini Asterisk GUI2.
-*/
-
-var update_time = 10;
-
-var user = "";
-var host = "";
-var passwd = "";
-var fromuser= "";
-var fromdomain= "";
-
-var selection = "none";
-var lastselection="";
-
-// Registration line from sip.conf
-var siprego_line="";
-var siprego="";
-
-// All from sip.conf
-var sipnat_user="";
-var sipnat_secret="";
-var sipnat_host="";
-var sipnat_fromuser="";
-var sipnat_fromdomain="";
-
-var sipnormal_user="";
-var sipnormal_secret="";
-var sipnormal_host="";
-var sipnormal_fromuser="";
-var sipnormal_fromdomain="";
-
-var sipjazmin_user="";
-var sipjazmin_secret="";
-var sipjazmin_host="";
-var sipjazmin_fromuser="";
-var sipjazmin_fromdomain="";
-
-// Statics
-var sipnone_info = "No provider selected";
-var sipnat_info = "You reach your ITSP via a NAT router ...the most common setup";
-var sipnormal_info = "No NAT router between your Phone system and your ITSP";
-var sipjazmin_info = "Enter your provider details";
-
-// Called when we load page
-
-function initialise() {
-    mainMenu();
-
-    initialisePage();
-}
-
-
-function initialisePage() {
-    
-
-       // Sip reload   
-       
-       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",InitSipReloadReturn);
-       
-}
-
-function InitSipReloadReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       // Check sip registry
-       // Check if provider is up
-       //     asterisk sip show registry
-       //     cascades thru to load sip.conf info
-
-       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip show registry",OnSipshowReturn);
-
-
-}
-
-
-
-function OnSipshowReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-    var tickicon = '<img src="tick.png" alt="Provider OK" />';
-    var crossicon = '<img src="cross.png" alt="No provider found" />';
-    var html = '';
-
-       // If a provider is registered, 
-       
-    if (doc.indexOf("Registered") != -1) {
-               // provider is registered
-               html += tickicon;
-       } else {
-               // no provider or 
-               // provider is not registered
-               html += crossicon;
-       }
-
-    document.getElementById("voiplinestatus").innerHTML = html;
-       
-       // Load sip.conf
-       
-        downloadUrl("/cgi-bin/getconf.cgi?file=sip.conf", loadSipConf);
-
-}
-
-function loadSipConf(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           if (line.indexOf("mini-asterisk") != -1)  {
-                       if (line.indexOf("register-mini-asterisk") != -1) {
-                       
-                               // save this entire line because we are going to replace it later on
-                               siprego_line = line;
-                               var s = line.split(' ');
-                               siprego = s[2];    //  save registration string
-               
-                               if (line.indexOf(";") != 0) {
-                                    registerflag = 1;
-                               }
-                                else {
-                                    registerflag = 0;
-                               }
-                       }
-                       
-                       var myregexp = /\s|=/;       // whitespace or equals .... for splitting out user,secret,host
-                       
-                       if (line.indexOf("sipnat-mini-asterisk") != -1) {
-                               if (line.indexOf("username") != -1) {
-
-                                       var s = line.split(myregexp);
-                                       sipnat_user = s[1]; //  save user
-                               } 
-                               else if (line.indexOf("secret") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnat_secret = s[1]; //  save secret
-                               } 
-                               else if (line.indexOf("host") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnat_host = s[1]; //  save host
-                               }
-                               else if (line.indexOf("fromuser") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnat_fromuser = s[1]; //  save 
-                               }
-                               else if (line.indexOf("fromdomain") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnat_fromdomain = s[1]; //  save 
-                               }
-                       }
-                       if (line.indexOf("sipnormal-mini-asterisk") != -1) {
-                               if (line.indexOf("username") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnormal_user = s[1]; //  save user
-                               }
-                               else if (line.indexOf("secret") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnormal_secret = s[1]; //  save secret
-                               }
-                               else if (line.indexOf("host") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnormal_host = s[1]; //  save host
-                               }
-                               else if (line.indexOf("fromuser") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnormal_fromuser = s[1]; //  save 
-                               }
-                               else if (line.indexOf("fromdomain") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipnormal_fromdomain = s[1]; //  save
-                               }
-                       }
-                       if (line.indexOf("jazmin-mini-asterisk") != -1) {
-                               if (line.indexOf("username") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipjazmin_user = s[1]; //  save user
-                               } 
-                               else if (line.indexOf("secret") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipjazmin_secret = s[1]; //  save secret
-                               }
-                               else if (line.indexOf("host") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipjazmin_host = s[1]; //  save host
-                               }
-                               else if (line.indexOf("fromuser") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipjazmin_fromuser = s[1]; //  save 
-                               }
-                               else if (line.indexOf("fromdomain") != -1) {
-                                       var s = line.split(myregexp);
-                                       sipjazmin_fromdomain = s[1]; //  save
-                               }
-                       }
-               }
-               
-
-               
-       }
-       );
-       
-       // sip info now loaded
-
-       if(siprego_line[0] == ';') { 
-               // commented out mean no rego selected
-               lastselection = "none";
-               document.getElementById('user').value = "";
-               document.getElementById('host').value = "";
-               document.getElementById('pass').value = "";
-               document.getElementById('fromuser').value = "";
-               document.getElementById('fromdomain').value = "";
-               document.getElementById('info').textContent = sipnone_info;
-               document.getElementById('provider').value="none";
-       } 
-       else if (siprego.indexOf(sipnat_user) != -1) {
-               // rego line has sipnat 
-               lastselection = "sipnat";
-               document.getElementById('user').value = sipnat_user;
-               document.getElementById('host').value = sipnat_host;
-               document.getElementById('pass').value = sipnat_secret;
-               document.getElementById('fromuser').value = sipnat_fromuser;
-               document.getElementById('fromdomain').value = sipnat_fromdomain;
-               document.getElementById('info').textContent = sipnat_info;
-               document.getElementById('provider').value="sipnat";
-       }
-       else if (siprego.indexOf(sipnormal_user) != -1) {
-               // rego line has sipnormal
-               lastselection = "sipnormal";
-               document.getElementById('user').value = sipnormal_user;
-               document.getElementById('host').value = sipnormal_host;
-               document.getElementById('pass').value = sipnormal_secret;
-               document.getElementById('fromuser').value = sipnormal_fromuser;
-               document.getElementById('fromdomain').value = sipnormal_fromdomain;
-               document.getElementById('info').textContent = sipnormal_info;
-               document.getElementById('provider').value="sipnormal";
-       }
-       else if (siprego.indexOf(sipjazmin_user) != -1) {
-               // rego line has jazmin
-               lastselection = "jazmin";
-               document.getElementById('user').value = sipjazmin_user;
-               document.getElementById('host').value = sipjazmin_host;
-               document.getElementById('pass').value = sipjazmin_secret;
-               document.getElementById('fromuser').value = sipjazmin_fromuser;
-               document.getElementById('fromdomain').value = sipjazmin_fromdomain;
-               document.getElementById('info').textContent = sipjazmin_info;
-               document.getElementById('provider').value="jazmin";
-       }                       
-}
-
-
-function onClickApply() {
-
-       // All this stuff is synchronous. Must happen in order specified.
-       // You will need to cascade calls to downloadUrl
-
-       // save globals
-       //lastselection = selection;               This causes a bug under firefox, but not chrome ... why?
-       
-    document.getElementById("voiplinestatus").innerHTML = '<td>Checking... </td>';
-       
-       
-       // take provider, username, password and host. 
-       selection = document.getElementById('provider').value;
-       user = document.getElementById('user').value;
-       host = document.getElementById('host').value;
-       passwd = document.getElementById('pass').value;
-       fromuser = document.getElementById('fromuser').value;
-       fromdomain = document.getElementById('fromdomain').value;
-       
-       // 1. Save sip.conf     
-       
-
-       
-       // 2.0 uncomment sip register
-       if(selection == "none") {
-       
-               if(lastselection == "none") {
-                       // do nothing but restart
-                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
-               }
-               else {
-                       // comment out old rego line
-                       // reload and restart
-                       var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
-                       downloadUrl(url,commentregReturn);                      
-               }
-       
-       } 
-       else {
-               if(lastselection==selection) {
-                       // fillout
-                       // restart
-                               var new_register = user+":"+passwd+"@"+host;
-                               var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=' + siprego + '&that=' 
-                                                       + new_register + '&key=register-mini-asterisk';
-                               downloadUrl(url,uncommenttrunkReturn);  
-
-               
-               }
-               else if (lastselection=="none") {
-                               // straight into uncomment
-                               var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
-                               downloadUrl(url,uncommentregReturn);            
-               
-               
-               }
-               else {
-                               // comment old stuff out then straight on
-                               var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
-                               downloadUrl(url,commentregReturn);                      
-               }
-
-               
-       }
-}      
-       
-function commentregReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-               // comment out old selection    
-
-               var url = '/cgi-bin/commentkey.cgi?file=/etc/asterisk/sip.conf&key='+lastselection+'-mini-asterisk';
-               downloadUrl(url,commentTrunkReturn);    
-}
-
-function commentTrunkReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-               // reset voip label     
-
-               var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=voip&that=user'+lastselection;
-               downloadUrl(url,resetVoipLabelReturn);  
-}
-
-function resetVoipLabelReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-               
-               if (lastselection == selection) {
-                       // asterisk sip reload ..
-                       // ....check this may have to load new parms
-                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
-               }
-               else if (selection == "none") {
-                       // asterisk sip reload  to remove old registration
-                       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
-               }
-               else {
-                       // uncomment new selection
-                       // fillout new parms
-                       // restart
-                       var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key=register-mini-asterisk';
-                       downloadUrl(url,uncommentregReturn);            
-               }
-
-
-}
-
-function uncommentregReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       //  2.1 insert register command  
-       //          ;register => 1234:password@mysipprovider.com   becomes     register => trev:password@192.168.1.30 
-       
-       var new_register = user+":"+passwd+"@"+host;
-       var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=' + siprego + '&that=' + new_register + '&key=register-mini-asterisk';
-
-       
-       downloadUrl(url,updateregReturn);
-}
-
-function updateregReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-
-       //  2.15 uncomment sip trunk
-
-       var url = '/cgi-bin/uncommentkey.cgi?file=/etc/asterisk/sip.conf&key='+selection+'-mini-asterisk';
-               
-       downloadUrl(url,uncommenttrunkReturn);  
-
-}
-
-
-
-
-function uncommenttrunkReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       //  2.2 update sip trunk details  ... user pw host
-
-       //          username=usersipnormal                     username=trev
-       //          secret=passwordsip                   secret=password
-       //          host=hostsip                         host=192.168.1.30
-       
-       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
-                               +'&this=username='
-                               +'&that='+user
-                               +'&key='+selection+'-mini-asterisk';
-
-       downloadUrl(url,usernameReturn);
-       
-}
-
-function usernameReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
-                               +'&this=secret='
-                               +'&that='+passwd
-                               +'&key='+selection+'-mini-asterisk';
-
-       downloadUrl(url,passwordReturn);
-       
-}
-
-function passwordReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
-                               +'&this=host='
-                               +'&that='+host
-                               +'&key='+selection+'-mini-asterisk';
-
-       downloadUrl(url,fromhostReturn);
-}
-
-function fromhostReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
-                               +'&this=fromuser='
-                               +'&that='+fromuser
-                               +'&key='+selection+'-mini-asterisk';
-
-       downloadUrl(url,fromuserReturn);
-}
-
-function fromuserReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       var url = '/cgi-bin/setlinekey2.cgi?file=/etc/asterisk/sip.conf'
-                               +'&this=fromdomain='
-                               +'&that='+fromdomain
-                               +'&key='+selection+'-mini-asterisk';
-
-       downloadUrl(url,fromdomainReturn);
-}
-       
-function fromdomainReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       //   3.8      if new provider
-       //                replace old [voip] entry back to original [usersipnormal] or [usersipnat] or [userjazmin]
-       
-       //   3.9      if new provider
-       //                              [usersipnat]         becomes     [voip]
-       //                              or [usersipnormal]
-       //                              or [userjazmin]
-       
-
-       
-       var url = '/cgi-bin/setword.cgi?file=/etc/asterisk/sip.conf&this=user'+selection+'&that=voip';
-
-       downloadUrl(url,extReturn);
-}
-
-function extReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       // 4. asterisk sip reload ....ORDER? beardy has this at position 4
-
-       downloadUrl("/cgi-bin/asterisk.cgi?cli=sip reload",sipReloadReturn);
-
-}
-
-function sipReloadReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       // 5. asterisk dialplan reload
-
-       downloadUrl("/cgi-bin/asterisk.cgi?cli=dialplan reload",dialplanReloadReturn);
-
-}
-
-function dialplanReloadReturn(doc,status) {
-    loadHtmlTextFile(doc, function(line) {
-           //parseSipShowPeers(line);
-       }
-       );
-       
-       // initialise page?
-
-       initialise();
-
-}
-
-function changeProvider() {
-
-       // fill the host and username fields based on selection
-
-       var sell = document.getElementById('provider').value;
-       
-
-       if (sell == "none" ) {
-               // clear fields
-               document.getElementById('user').value = "";
-               document.getElementById('host').value = "";
-               document.getElementById('pass').value = "";
-               document.getElementById('fromuser').value = "";
-               document.getElementById('fromdomain').value = "";
-               document.getElementById('info').textContent = sipnone_info;
-               
-       } else if (sell == "sipnat" ) {
-               // fill sipnat
-               document.getElementById('user').value = sipnat_user;
-               document.getElementById('host').value = sipnat_host;
-               document.getElementById('pass').value = sipnat_secret;
-               document.getElementById('fromuser').value = sipnat_fromuser;
-               document.getElementById('fromdomain').value = sipnat_fromdomain;
-               document.getElementById('info').textContent = sipnat_info;
-       } else if (sell == "sipnormal" ) {
-           // fill sipnormal
-               document.getElementById('user').value = sipnormal_user;
-               document.getElementById('host').value = sipnormal_host;
-               document.getElementById('pass').value = sipnormal_secret;               
-               document.getElementById('fromuser').value = sipnormal_fromuser;
-               document.getElementById('fromdomain').value = sipnormal_fromdomain;
-               document.getElementById('info').textContent = sipnormal_info;
-       } else if (sell == "jazmin" ) {
-               // fill jazmin
-               document.getElementById('user').value = sipjazmin_user;
-               document.getElementById('host').value = sipjazmin_host;
-               document.getElementById('pass').value = sipjazmin_secret;               
-               document.getElementById('fromuser').value = sipjazmin_fromuser;
-               document.getElementById('fromdomain').value = sipjazmin_fromdomain;
-               document.getElementById('info').textContent = sipjazmin_info;
-       } else {
-               // something weird happened
-       }
-       
-}
-
-