From 0f5a12b1eb1c0572a06533749e3314da70e5f0c5 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sat, 16 Jan 2010 07:04:38 +0000 Subject: [PATCH] added firmware upgrade options git-svn-id: https://svn.code.sf.net/p/freetel/code@123 01035d8c-6547-0410-b346-abe4f91aad63 --- easy-asterisk-gui/README.txt | 41 +++++++---- easy-asterisk-gui/cgi-bin/admin.sh | 68 +++++++++++++------ easy-asterisk-gui/cgi-bin/menu.html | 2 +- easy-asterisk-gui/cgi-bin/tooltips.html | 12 ++++ .../etc/asterisk/extensions.conf | 4 +- 5 files changed, 93 insertions(+), 34 deletions(-) diff --git a/easy-asterisk-gui/README.txt b/easy-asterisk-gui/README.txt index 04278754..7daace52 100644 --- a/easy-asterisk-gui/README.txt +++ b/easy-asterisk-gui/README.txt @@ -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 diff --git a/easy-asterisk-gui/cgi-bin/admin.sh b/easy-asterisk-gui/cgi-bin/admin.sh index 5fca9b42..50bc6244 100644 --- a/easy-asterisk-gui/cgi-bin/admin.sh +++ b/easy-asterisk-gui/cgi-bin/admin.sh @@ -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 <

Admin

  -

Change Phone System Password

- New Password: +

Change Phone System Password

+ New Password: + +   Default password is uClinux -   -

Restart Phone System

-
- - - -
+

Restart Phone System

+ +
+ + +
+ +   -

Reset Phone System Defaults

-
- -
+

Reset Phone System Defaults

+ +
+ + +
+ +   -

Upgrade Software

-
- Software URL: - + +

Upgrade Easy Asterisk

+ + + + + + + +   +

Install New Firmware

+ + + Firmware URL: + + +
diff --git a/easy-asterisk-gui/cgi-bin/menu.html b/easy-asterisk-gui/cgi-bin/menu.html index 81e4aa82..14e5c51e 100644 --- a/easy-asterisk-gui/cgi-bin/menu.html +++ b/easy-asterisk-gui/cgi-bin/menu.html @@ -1,4 +1,4 @@ -
Change your password, Time & time zone, Reset the defaults, Install new software
+
Change your password, reset the default settings, upgrade software
Connect the phone system to your network and the Internet
Lists your phones and phone lines
Set up your IP phones
diff --git a/easy-asterisk-gui/cgi-bin/tooltips.html b/easy-asterisk-gui/cgi-bin/tooltips.html index dab4bffb..4fd0229f 100644 --- a/easy-asterisk-gui/cgi-bin/tooltips.html +++ b/easy-asterisk-gui/cgi-bin/tooltips.html @@ -135,3 +135,15 @@ system. This is the same as turning the power off and back on. +
+ Press this button to the latest version of + Easy Asterisk. An Easy Asterisk upgrade + requires an Internet connection.
+ +
+ 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.
+ diff --git a/easy-asterisk-gui/etc/asterisk/extensions.conf b/easy-asterisk-gui/etc/asterisk/extensions.conf index 69c35a81..db696720 100644 --- a/easy-asterisk-gui/etc/asterisk/extensions.conf +++ b/easy-asterisk-gui/etc/asterisk/extensions.conf @@ -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}) -- 2.25.1