started phone GUI
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 4 Jan 2010 11:39:03 +0000 (11:39 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 4 Jan 2010 11:39:03 +0000 (11:39 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@94 01035d8c-6547-0410-b346-abe4f91aad63

easy-asterisk-gui/Makefile
easy-asterisk-gui/banner.html
easy-asterisk-gui/check_network.sh [deleted file]
easy-asterisk-gui/dashboard.sh
easy-asterisk-gui/extensions.conf [new file with mode: 0644]
easy-asterisk-gui/menu.html
easy-asterisk-gui/network.sh
easy-asterisk-gui/phone.js [new file with mode: 0644]
easy-asterisk-gui/phone.sh [new file with mode: 0644]
easy-asterisk-gui/tooltips.html [new file with mode: 0644]

index e34e6d0ab85624de28ea6a8382bae980a6499aa4..9c0e4bfd2728f927ac70559507a1f63a11b29566 100644 (file)
@@ -9,4 +9,5 @@ TESTIP=192.168.1.150
 #      rcp index.html root@$(TESTIP):/var/lib/asterisk/static-http/
 
 test:
-       rcp check_network.sh tick.png cross.png banner.html menu.html check_loggedin.sh logout.sh login.sh dashboard.sh dashboard.js network.sh network.js set_network.sh tooltip.js tooltip.css root@$(TESTIP):/www/cgi-bin
+       rcp tooltips.html phone.sh phone.js tick.png cross.png banner.html menu.html check_loggedin.sh logout.sh login.sh dashboard.sh dashboard.js network.sh network.js set_network.sh tooltip.js tooltip.css root@$(TESTIP):/www/cgi-bin
+       rcp extensions.conf root@$(TESTIP):/etc/asterisk
index c582d25b62ec9b6f39e20fa97292a14ed3a44b5b..02889097da7471b95c02fed717936e81b2e0eb21 100644 (file)
@@ -1 +1 @@
-    <tr><td colspan="2"><h1></h1></td></tr>
+    <tr><td colspan="2"><h2>&nbsp;</h2></td></tr>
diff --git a/easy-asterisk-gui/check_network.sh b/easy-asterisk-gui/check_network.sh
deleted file mode 100644 (file)
index e69de29..0000000
index db8d3b696673318b00687d8b157145b03d93dd5a..0b56f36eb9ff0b4f3615023f91902032831e5867 100644 (file)
@@ -31,26 +31,24 @@ cat << EOF
 <html>
 <title>Easy Asterisk - Dashboard</title>
 <body onload="localInit()">
-<div id="t1" class="tip">Tells you if I can reach the Internet.  If not "Good" check your network settings, in particular Gateway and DNS.</div>
-
-<table align="center" width=800>
 EOF
+
+cat tooltips.html
+echo "<table align="center" width=800 border=0>"
 cat banner.html
 echo "    <tr>"
 cat menu.html    
 cat <<EOF
 
-    <td>
+    <td valign="top">
 
     <form action="/cgi-bin/set_network.sh" onsubmit="return validate_form(this)" method="get">
-    <table align="right" width=600>
-    <tr>
-      <tr><td colspan="2" align="left" valign="top" ><h2>Dashboard</h2></td>
-      <tr onMouseOver="popUp(event,'t1')" onmouseout="popUp(event,'t1')">
+    <table align="right" width=600 border=0>
+      <tr><td colspan="2" align="left" valign="top" ><h2>Dashboard</h2></td></tr>
+      <tr onMouseOver="popUp(event,'network_internet')" onmouseout="popUp(event,'network_internet')">
          <td>Internet Connection:</td>
          <td><div id="internet" >
          <span style="margin-left: 4px;font-weight:bold">&nbsp;</span></div></td>
-
       </tr>
     </table>
     </form>
@@ -60,10 +58,6 @@ cat <<EOF
     </tr>
 
 </table>
-EOF
-
-echo $HTTP_COOKIE
-cat<<EOF
 </body>
 </html>
 EOF
diff --git a/easy-asterisk-gui/extensions.conf b/easy-asterisk-gui/extensions.conf
new file mode 100644 (file)
index 0000000..d1012ab
--- /dev/null
@@ -0,0 +1,54 @@
+; extensions.conf
+; David Rowe 4 Jan 2010
+;
+
+; Designed for Easy 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,n,Dial(Zap/1)
+exten => 6002,n,Dial(Zap/2)
+exten => 6003,n,Dial(Zap/3)
+exten => 6004,n,Dial(Zap/4)
+exten => 6005,n,Dial(Zap/5)
+exten => 6006,n,Dial(Zap/6)
+exten => 6007,n,Dial(Zap/7)
+exten => 6008,n,Dial(Zap/8)
+
+; Pre-configured SIP-phone extensions.  Primary use case is multiple SIP
+; extensions and FXO analog Ports
+
+exten => 6011,n,Dial(SIP/6011)
+exten => 6012,n,Dial(SIP/6012)
+exten => 6013,n,Dial(SIP/6013)
+exten => 6014,n,Dial(SIP/6014)
+exten => 6015,n,Dial(SIP/6015)
+exten => 6016,n,Dial(SIP/6016)
+exten => 6017,n,Dial(SIP/6017)
+exten => 6018,n,Dial(SIP/6018)
+exten => 6019,n,Dial(SIP/6019)
+exten => 6020,n,Dial(SIP/6020)
+exten => 6021,n,Dial(SIP/6021)
+exten => 6022,n,Dial(SIP/6022)
+exten => 6023,n,Dial(SIP/6023)
+exten => 6024,n,Dial(SIP/6024)
+exten => 6025,n,Dial(SIP/6025)
+exten => 6026,n,Dial(SIP/6026)
+exten => 6027,n,Dial(SIP/6027)
+exten => 6028,n,Dial(SIP/6028)
+exten => 6029,n,Dial(SIP/6029)
+exten => 6020,n,Dial(SIP/6020)
+
index 4f3a5e47c7caed7d3e4c1f7a984cacf3150ddd09..c4e6cc99609e4186ed7fb3ba394e7dfbee5f81ea 100644 (file)
@@ -1,4 +1,4 @@
-    <div id="admin_tip" class="tip">Change your password</div>
+    <div id="admin_tip" class="tip">Change your password, Reset the defaults, Install new software</div>
     <div id="dashboard_tip" class="tip">Monitor the status of your phone system</div>
     <div id="network_tip" class="tip">Connect the phone system to your network and the Internet</div>
     <div id="phone_tip" class="tip">Set up your phones and phone calls</div>
index d4c0ee86f5dba5b545d09ce665ed751f5670c8a6..d8172a19341295fd669f10e759add2e1d7d14767 100644 (file)
@@ -63,26 +63,20 @@ cat << EOF
 <html>
 <title>Easy Asterisk - Network</title>
 <body onload="localInit()">
-<div id="t1" class="tip">A tick means I can reach the Internet.  You need the Internet for VOIP calls.  
-                         If you have a problem reaching the Internet check your Network settings, in 
-                         particular Gateway and DNS.</div>
-<div id="t2" 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>
-
-<table align="center" width=800>
 EOF
+
+cat tooltips.html
+echo "<table align="center" width=800 border=0>"
 cat banner.html
 echo "    <tr>"
 cat menu.html    
 cat <<EOF
 
-    <td>
+    <td valign="top">
 
     <form action="/cgi-bin/set_network.sh" onsubmit="return validate_form(this)" method="get">
-    <table align="center" width=600>
-    <tr>
-      <tr><td colspan="2" align="left" valign="top"><h2>Network</h2></td>
+    <table align="center" width=600 border=0>
+      <tr><td colspan="2" align="left" valign="top"><h2>Network</h2></td></tr>
       <tr>
         <td><input type="radio" id="static" name="dhcp" value="no" onClick="doStatic()">Static</td>
         <td><input type="radio" id="dhcp"   name="dhcp" value="yes" onClick="doDHCP()">DHCP</td>
@@ -91,17 +85,16 @@ cat <<EOF
       <tr><td>Netmask:</td><td><input type="text" name="netmask" id="netmask" onBlur="isIP(this)"></td></tr>
       <tr><td>Gateway:</td><td><input type="text" name="gateway" id="gateway" onBlur="isIP(this)"></td></tr>
       <tr><td>DNS:</td><td><input type="text" name="dns" id="dns" onBlur="isIP(this)"></td></tr>
-      <tr onMouseOver="popUp(event,'t2')" onmouseout="popUp(event,'t2')">
+      <tr onMouseOver="popUp(event,'network_backdoor')" onmouseout="popUp(event,'network_backdoor')">
           <td>Emergency IP:</td><td><input type="text" name="backdoor" id="backdoor" onBlur="isIP(this)"></td>
       </tr>
-      <tr onMouseOver="popUp(event,'t1')" onmouseout="popUp(event,'t1')">
+      <tr onMouseOver="popUp(event,'network_internet')" onmouseout="popUp(event,'network_internet')">
          <td>Internet Connection:</td>
          <td><div id="internet" >
          <span style="margin-left: 4px;font-weight:bold">&nbsp;</span></div></td>
 
       </tr>
       <tr><td><input id="networkapply" type="submit" value="Apply"></td></tr>
-    </tr>
     </table>
     </form>
 
diff --git a/easy-asterisk-gui/phone.js b/easy-asterisk-gui/phone.js
new file mode 100644 (file)
index 0000000..9c50cea
--- /dev/null
@@ -0,0 +1,3 @@
+function localInit() {
+}
+
diff --git a/easy-asterisk-gui/phone.sh b/easy-asterisk-gui/phone.sh
new file mode 100644 (file)
index 0000000..1d3a5de
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/sh -x
+# phone.sh
+# David Rowe 4 Jan 2010
+# CGI for Easy Asterisk phones GUI
+
+# Construct the web page -------------------------------
+
+sh check_loggedin.sh
+
+cat <<EOF
+<script src="prototype.js"></script>
+<link href="astman.css" media="all" rel="Stylesheet" type="text/css" />
+<script type="text/javascript" src="tooltip.js"></script>
+<link rel="stylesheet" href="tooltip.css" type="text/css" />
+EOF
+
+echo "<script>"
+echo 'var init_internet="'$internet'";'
+cat phone.js
+echo "</script>"
+
+cat << EOF
+<html>
+<title>Easy Asterisk - Phones</title>
+<body onload="localInit()">
+<div id="t1" class="tip">Tells you if I can reach the Internet.  If 
+                         not "Good" check your network settings, in 
+                         particular Gateway and DNS.</div>
+
+<table align="center" width=800>
+EOF
+cat banner.html
+echo "    <tr>"
+cat menu.html    
+cat <<EOF
+
+    <td>
+
+    <form action="/cgi-bin/set_phone.sh" onsubmit="return validate_form(this)" method="get">
+    <table align="right" width=600>
+    <tr>
+      <tr><td colspan="2" align="left" valign="top" ><h2>Phones</h2></td>
+      <tr onMouseOver="popUp(event,'t1')" onmouseout="popUp(event,'t1')">
+         <td>Internet Connection:</td>
+         <td><div id="internet" >
+         <span style="margin-left: 4px;font-weight:bold">&nbsp;</span></div></td>
+      </tr>
+    </table>
+    </form>
+
+    </td>
+
+    </tr>
+
+</table>
+</body>
+</html>
+EOF
+
diff --git a/easy-asterisk-gui/tooltips.html b/easy-asterisk-gui/tooltips.html
new file mode 100644 (file)
index 0000000..f89cf56
--- /dev/null
@@ -0,0 +1,10 @@
+<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>