added firmware upgrade options
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 16 Jan 2010 07:04:38 +0000 (07:04 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 16 Jan 2010 07:04:38 +0000 (07:04 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@123 01035d8c-6547-0410-b346-abe4f91aad63

easy-asterisk-gui/README.txt
easy-asterisk-gui/cgi-bin/admin.sh
easy-asterisk-gui/cgi-bin/menu.html
easy-asterisk-gui/cgi-bin/tooltips.html
easy-asterisk-gui/etc/asterisk/extensions.conf

index 04278754d6db4e3869df96001a18fbfd09f2a45e..7daace52a020f369d1647acd92076f105a7cf837 100644 (file)
@@ -9,18 +9,18 @@ tip documentation and a learning curve of a few minutes.  Analog ports
 and IP Phones are automatically detected, and no knowledge of Asterisk
 configuration is required.
 
-Easy Asterisk is "unfeatured" - most of the Asterisk features are
+Easy Asterisk is "unfeatured" - many of the Asterisk features are
 hidden by the GUI.  Instead it tries to make very basic, very common
 Asterisk installations fast and simple, for example:
 
 * An Asterisk server running on your home gateway/firewall/server.
   You want to connect a few IP Phones and make cheap phones calls
-  using VOIP.  An CD based Asterisk distro is a possibility but you
+  using VOIP.  An Asterisk distro on a CD is a possibility but you
   don't want to dedicate a full PC just for Asterisk.  You don't
   really want to learn obscure dial plan syntax and yet another conf
   file format.
 
-* An small office that already has an old analog phone system.  You
+* A small office that already has an old analog phone system.  You
   want to keep your current analog lines for incoming calls, but
   install 8 IP Phones and use VOIP for outgoing calls.  You know
   enough to set up a DSL router but don't want to rely on some phone
@@ -46,7 +46,7 @@ once you get started and your experience builds these features are of
 course available using regular Asterisk configuration techniques.
 
 Easy Asterisk has been written to be compatible with regular Asterisk
-conf-file style configuration.  Just leave the conf file lines with
+conf file configuration.  Just leave the conf file lines with
 "easy-asterisk" comments alone.  The Asterisk conf files
 extensions.conf and sip.conf are directly modified by Easy Asterisk,
 but changes are limited to the "easy-asterisk" lines.  
@@ -62,23 +62,36 @@ analog hardware.  On the IP0X this happens automatically.
 Installation
 ------------
 
-Note this process will overwrite your Asterisk extensions.conf and
+Note: this process will overwrite your Asterisk extensions.conf and
 sip.conf files - back them up if you have an existing Asterisk
-installation that you want to keep.
+installation that you want to keep.  
 
-IP0X:
+However once easy-asterisk is installed it should honor any manual
+changes made to extensions.conf and sip.conf.
+
+IP0X Installation
+~~~~~~~~~~~~~~~~~
+
+   Prior to Easy Asterisk installation we assume you have some version
+   or Asterisk and Zaptel installed.
 
    -------------------------------------------------------------------
    root~> ipkg install easy-asterisk
    root~> reboot
    -------------------------------------------------------------------
 
-x86: 
+x86 Installation
+~~~~~~~~~~~~~~~~
 
 1. You need a web server, Asterisk and some sort of Perl installed
    (very basic Perl installation is fine).  Configure your web server
-   to run CGIs (.sh and .pl) from /your/web/server/root (lighttpd
-   config instructions below).
+   to run CGIs (.sh and .pl) from /www (lighttpd config instructions
+   below).
+
+   The process below places the web files in /www, you may like to
+   place the files somewhere else like /www/asterisk.  One of the
+   files is named index.html so beware of conflicts of you have other
+   files on your web server.
 
 2. Login as root to install the Easy Asterisk files:
 
@@ -86,12 +99,16 @@ x86:
    # cd ~ 
    # svn co https://freetel.svn.sourceforge.net/svnroot/freetel/easy-asterisk-gui
    # cp easy-asterisk-gui/etc/asterisk/* /etc/asterisk 
-   # cp easy-asterisk-gui/cgi-bin/* /your/web/server/root 
+   # cp easy-asterisk-gui/cgi-bin/* /www
+   # cd /etc/asterisk
+   # cp extensions.conf extensions.conf.def
+   # cp sip.conf sip.conf.def
    # mv etc/asterisk/users.conf etc/asterisk/users.conf.bak
    -------------------------------------------------------------------
 
    The final step above may not be required on your machine if you
-   don't have a users.conf.
+   don't have a users.conf.  The .def copies are required by the
+   "reset defaults" feature on the admin screen.
 
 3. Switch off the internal Asterisk web server by editing
    /etc/asterisk.httpd.conf.  Make sure the enabled line reads like
index 5fca9b4220e0447ef15ff40925ebbac3e2193bc1..50bc6244df3c010b917c5cc801863d76d8b34575 100644 (file)
@@ -15,7 +15,7 @@ if [ $? -eq 1 ]; then
     exit
 fi
 
-# set password CGI
+# set password CGI -----------------------------------------------
 
 echo "$QUERY_STRING" | grep -oe "pass=" > /dev/null
 if [ $? -eq 0 ]; then
@@ -23,7 +23,7 @@ if [ $? -eq 0 ]; then
     passwd_cmdline $pass
 fi
 
-# restart CGI
+# restart CGI ----------------------------------------------------
 
 echo "$QUERY_STRING" | grep -oe "restart=1" > /dev/null
 if [ $? -eq 0 ]; then
@@ -45,6 +45,16 @@ EOF
 reboot
 fi
 
+# set defaults CGI ----------------------------------------------------
+
+echo "$QUERY_STRING" | grep -oe "defaults=1" > /dev/null
+if [ $? -eq 0 ]; then
+    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
+fi
+
 # Construct the web page -------------------------------
 
 cat <<EOF
@@ -73,32 +83,52 @@ cat <<EOF
       <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</h2></td></tr>
-      <tr><td>New Password:</td><td><input type="password" name="pass" ></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="submit" value="Set Password"></td>
+      </tr>
       <tr><td>&nbsp</td></tr>
       <tr><td></td><td>Default password is uClinux</td>
-      <tr><td><input type="submit" value="Set Password"></td></tr>
       </form>
 
       <tr><td>&nbsp</td></tr>
-      <tr><td  colspan="2"><h3>Restart Phone System</h2></td></tr>
-      <form action="admin.sh" method="get">
-      <tr><td><input type="hidden" name="restart" value="1"></td></tr>
-      <tr><td onMouseOver="popUp(event,'admin_restart')" onmouseout="popUp(event,'admin_restart')">
-          <input type="submit" value="Restart"></td></tr>
-      </form>
+      <tr><td colspan="2"><h3>Restart Phone System</h3></td>
+          <td onMouseOver="popUp(event,'admin_restart')" onmouseout="popUp(event,'admin_restart')">
+              <form action="admin.sh" method="get">
+              <input type="hidden" name="restart" value="1">
+              <input type="submit" value="Restart">
+          </form>
+          </td>
+      </tr>
 
       <tr><td>&nbsp</td></tr>
-      <tr><td colspan="2"><h3>Reset Phone System Defaults</h2></td></tr>
-      <form action="admin.sh?defaults=1" method="get">
-      <tr><td><input type="submit" value="Reset"></td></tr>
-      </form>
+      <tr><td colspan="2"><h3>Reset Phone System Defaults</h3></td>
+          <td>
+              <form action="admin.sh" method="get">
+              <input type="hidden" name="defaults" value="1">
+              <input type="submit" value="Reset">
+             </form>
+         </td>
+      </tr>
 
       <tr><td>&nbsp</td></tr>
-      <tr><td colspan="2"><h3>Upgrade Software</h2></td></tr>
-      <form action="admin.sh?upgrade=1" method="get">
-      <tr><td>Software URL:</td><td><input type="text" name="upgrade" ></td></tr>
-      <tr><td><input type="submit" value="Upgrade"></td></tr>
+      <tr onMouseOver="popUp(event,'admin_upgrade')" onmouseout="popUp(event,'admin_upgrade')">
+          <td colspan="2"><h3>Upgrade Easy Asterisk</h3></td>
+          <td>
+              <form action="admin.sh" method="get">
+              <input type="hidden" name="upgrade" value="1">
+              <input type="submit" value="Upgrade">
+          </td>
+      </tr>
+
+      <tr><td>&nbsp</td></tr>
+      <tr><td colspan="2"><h3>Install New Firmware</h3>
+      <form action="admin.sh" method="get">
+      <tr onMouseOver="popUp(event,'admin_firmware')" onmouseout="popUp(event,'admin_firmware')">
+          <td>Firmware URL:</td>
+          <td><input type="text" name="firmwareurl" ></td>
+          <td><input type="submit" value="Install"></td>
+      </tr>
       </form>
 
     </table>
index 81e4aa82c6f7ede1e199827ecc1cd689c6809c89..14e5c51e81d4840b94e1661d40f4211e517e6335 100644 (file)
@@ -1,4 +1,4 @@
-    <div id="admin_tip" class="tip">Change your password, Time & time zone, Reset the defaults, Install new software</div>
+    <div id="admin_tip" class="tip">Change your password, reset the default settings, upgrade software</div>
     <div id="network_tip" class="tip">Connect the phone system to your network and the Internet</div>
     <div id="phones_tip" class="tip">Lists your phones and phone lines</div>
     <div id="ipphones_tip" class="tip">Set up your IP phones</div>
index dab4bffbc5b464ce60e8904b03815bcfe9bb18cb..4fd0229f03f15f86313975624b68801ddc6e9a46 100644 (file)
                         system.  This is the same as turning the power
                         off and back on. </div>
 
+<div id="admin_upgrade" class="tip">
+                        Press this button to the latest version of
+                       Easy Asterisk.  An Easy 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.</div>
+
index 69c35a811a7f4c46ddc3655cf62d8ab9ea02efb0..db6967205b36789babc7e107c37b9f1fb3e81c63 100644 (file)
@@ -52,11 +52,11 @@ exten => 6028,1,Dial(SIP/6028)
 exten => 6029,1,Dial(SIP/6029)
 exten => 6030,1,Dial(SIP/6030)
 
-;; Pre-configured outgoing Analog group
+;; Pre-configured easy-asterisk outgoing Analog group
 
 exten => _0.,1,Dial(Zap/g1/${EXTEN:1})
 
-;; Pre-configured outgoing VOIP line
+;; Pre-configured easy-asterisk outgoing VOIP line
 
 exten => _1.,1,Dial(SIP/voip/${EXTEN:1})