moved to /usr/bin/perl for x86 compatability, edited README/easy.html web page
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 18 Jan 2010 01:11:28 +0000 (01:11 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 18 Jan 2010 01:11:28 +0000 (01:11 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@128 01035d8c-6547-0410-b346-abe4f91aad63

easy-asterisk-gui/Makefile
easy-asterisk-gui/README.txt
easy-asterisk-gui/cgi-bin/ipphones.pl
easy-asterisk-gui/cgi-bin/login.sh
easy-asterisk-gui/cgi-bin/phones.pl
easy-asterisk-gui/cgi-bin/set_voiplines.pl
easy-asterisk-gui/cgi-bin/voiplines.pl
easy-asterisk-gui/update_revision.sh

index 8d1753d0bbd941360fbf937ab75d39d454bdac6b..400f535e0b9bcb6c042fcc3957ff89a7f5ea46b9 100644 (file)
@@ -3,10 +3,32 @@
 # 
 # Makefile for Easy Asterisk GUI
 #
-# usage: make TESTIP=test.machine.ip|hostname test
-#        make TESTIP=192.168.1.150 test
-#        make TESTIP=boris test
+# 1/ Download files to development box for testing:
+#
+#    usage: make HOST=test.machine.ip|hostname test
+#           make HOST=192.168.1.150 test
+#           make HOST=boris test
+#
+# 2/ Create static copy of web pages from HOST for static demo
+#
+#    usage: make HOST=test.machine.ip static
 
 test:
-       rcp cgi-bin/*.html cgi-bin/*.sh cgi-bin/*.pl cgi-bin/*.js cgi-bin/*.css  cgi-bin/*.png root@$(TESTIP):/www
-       rcp etc/asterisk/*.conf root@$(TESTIP):/etc/asterisk
+       rcp cgi-bin/*.html cgi-bin/*.sh cgi-bin/*.pl cgi-bin/*.js cgi-bin/*.css \
+       cgi-bin/*.png root@$(HOST):/www
+       rcp etc/asterisk/*.conf root@$(HOST):/etc/asterisk
+
+.PHONY : static
+static: 
+       # generate static pages
+
+       rm -Rf static; mkdir static; cd static; \
+       wget -rEk --header="Cookie: loggedin=1" http://$(HOST)/phones.sh
+
+       # modify links to non-existent scripts on static demo
+
+       sed -i "s,http://$(HOST)/set_network.sh,network.sh.html," static/$(HOST)/network.sh.html
+       sed -i "s,http://$(HOST)/set_ring.sh,phones.sh.html," static/$(HOST)/phones.sh.html
+       sed -i "s,http://$(HOST)/set_voiplines.sh,voiplines.sh.html," static/$(HOST)/voiplines.sh.html
+
+
index 72422a2c39a9234e8812a46f4ee061d5df8d698a..33ab826a287024e473f3403c72c03758f763c09a 100644 (file)
@@ -1,6 +1,11 @@
 Easy Asterisk
 =============
 
+Click on the image for an on-line demo:
+
+image::/images/ip04/easy.png["easy Asterisk Demo", link="easy/phones.sh.html"]
+
+[[intro]]
 Introduction
 ------------
 
@@ -9,7 +14,7 @@ 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" - many of the Asterisk features are not
+Easy Asterisk is "unfeatured" - many of the Asterisk options are not
 available.  Instead it tries to make very basic, very common Asterisk
 installations fast and simple, for example:
 
@@ -24,12 +29,65 @@ installations fast and simple, for example:
   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 "the Phone
-  Guy" or "The Coumputer Guy" at $100/hr to maintain your phone
+  Guy" or "The Computer Guy" at $100/hr to maintain your phone
   system.
 
 * You are a "Phone Guy" who doesn't understand Linux and Asterisk but
   you want to install IP-PBXes.
 
+[[why]]
+Why Another Asterisk GUI?
+-------------------------
+
+I needed an Asterisk GUI that was very easy to use for the
+link:ip04.html[IP0X devices] I sell.  Something my wife and kids could
+use.
+
+I was also interested in exploring the ease-of-use meme, as we have
+been discussing it a lot on the http://villagetelco.org[Village Telco]
+project.  Just how easy can we make Asterisk to use? So I scratched
+the itch.
+
+Easy Asterisk has the following features that make it reasonably
+unique.  They may be good or bad features depending on your point of
+view!
+
+* Easy Asterisk is "un-featured" - it hides many of the advanced
+  Asterisk features in the interest of simple and fast configuration.
+
+* Light weight so it can run on embedded boxes like the IP0X family.
+  No SQL database or PHP or LAMP.  Only a basic web server and
+  microperl are required, no CPAN.
+
+* Works directly on extensions.conf and sip.conf, but honors any edits
+  you make to these files.  So all the powerful Asterisk features are
+  available in the background.
+
+* Doesn't use AJAX or the built-in Asterisk web server or users.conf
+  magic.  Plain old HTML, a little Java-script and CGIs written in
+  shell script and Perl.
+
+* Doesn't use the Asterisk programming "model".  For example you don't
+  have to understand what a dial-plan is, much less understand how to
+  code one.  Plain English terms are used instead, for example "Phones
+  and Phone lines".  Terms like Asterisk, Linux, SIP, Zap/1 don't even
+  get a mention.
+
+* Extensive tool tip documentation.  No manual.
+
+* Doesn't require a dedicated PC, not installed from an ISO CD.  So
+  you can use it as a GUI for Asterisk on a little SOHO Linux box that
+  is also your firewall, server etc.
+
+* Easy Asterisk tells you when something is wrong, like if your Phone
+  System can't see the Internet.
+
+* Extensive pre-configuration of extensions.conf and sip.conf,
+  pre-selected phone numbers, SIP trunks are selected from a pull-down
+  menu (except they are called VOIP lines).  Analog ports are auto
+  detected, at least on the IP0X.
+
+[[status]]
 Status
 ------
 
@@ -37,29 +95,17 @@ Alpha.
 
 * Works on IP0X
 * Not tested on x86. Several IP0X features are n/a for x86 and should be
-  disbaled when the x86 (or non-IP0X) platform is detected.
+  disabled when the x86 (or non-IP0X) platform is detected.
 * Needs feedback from real users to see how useful the concept is and what
-  features need to be added.
+  (un)features need to be added.
 
-Implementation
---------------
+[[notes]]
+Implementation Notes
+--------------------
 
 Easy Asterisk is written for the
 http://rowetel.com/ucasterisk/ip04.html[IP0X embedded Asterisk]
 hardware but will also run on x86 and probably many other platforms.
-Easy Asterisk does not require a dedicated PC, you do not need to
-reformat a hard disk and install an ISO CD image.
-
-It is implemented as a set of CGI scripts (shell, perl, client side
-java-script) and pre-configured extensions.conf and sip.conf files.
-Only a basic web server and microperl support are required, making it
-suitable for small embedded platforms.  No Perl libraries or CPAN are
-required.
-
-Easy Asterisk is "unfeatured" - it hides many of the advanced Asterisk
-features in the interest of simple and fast configuration.  However
-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 configuration.  Just leave the conf file lines with
@@ -67,14 +113,11 @@ conf file configuration.  Just leave the conf file lines with
 extensions.conf and sip.conf are directly modified by Easy Asterisk,
 but changes are limited to the "easy-asterisk" lines.  
 
-No database is used.  Neither is the users.conf/AJAX style interface
-based on the Asterisk built-in web server which should be disabled
-when using Easy Asterisk.
-
 For Auto-detection of Zap ports Easy Asterisk looks at
 /etc/zapata.conf, so you may need this set up correctly for your
 analog hardware.  On the IP0X this happens automatically.
 
+[[install]]
 Installation
 ------------
 
@@ -89,59 +132,78 @@ 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.
+Installation instructions for IP0X boxes running link:baps.html[BAPS],
+with some version of Asterisk and Zaptel installed.
 
-   -------------------------------------------------------------------
-   root~> ipkg install easy-asterisk
-   -------------------------------------------------------------------
+-------------------------------------------------------------------
+root~> ipkg install easy-asterisk
+-------------------------------------------------------------------
 
 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 /www (lighttpd config instructions
-   below).  Easy Asterisk expects all files (shell, perl, html etc) to
-   be in the same directory.
-
-   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:
-
-   Remember to backup your existing extensions.conf & sip.conf in
-   /etc/asterisk
-
-   -------------------------------------------------------------------
-   # cd ~ 
-   # svn co https://freetel.svn.sourceforge.net/svnroot/freetel/easy-asterisk-gui
-   # ./update_revision.sh
-   # cp easy-asterisk-gui/etc/asterisk/* /etc/asterisk 
-   # 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.  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
-   this:
+. 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 /www (lighttpd config instructions below).
+Easy Asterisk expects all files (shell, perl, html etc) to be in the
+same directory.  
+
+. 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 make sure you don't overwrite an existing
+index.html.
+
+. Login as root to install the Easy Asterisk files:
++
+Remember to backup your existing extensions.conf & sip.conf in
+/etc/asterisk
++
+-------------------------------------------------------------------
+# cd ~ 
+# svn co https://freetel.svn.sourceforge.net/svnroot/freetel/easy-asterisk-gui
+# ./update_revision.sh
+# cp easy-asterisk-gui/etc/asterisk/* /etc/asterisk 
+# 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.  The .def copies are required by the "reset
+defaults" feature on the admin screen.
+
+. Switch off the internal Asterisk web server by editing
+/etc/asterisk.httpd.conf.  Make sure the enabled line reads like this:
 
    enabled=no
++
+Then stop and restart Asterisk.
+
+. I use lighttpd as the web server, the /etc/lighttpd.conf lines
+required are:
++
+-------------------------------------------------------------------
+cgi.assign = ( ".sh" => "/bin/sh",".pl" => "/usr/sbin/microperl" )
+-------------------------------------------------------------------
+
+[[support]]
+Support
+-------
+
+Comments, features request, bugs please let me know using Free
+Telephony Project http://www.rowetel.com/ucasterisk/#support[Support].
+
+[[source]]
+The Source Code
+---------------
+
+Browse:
+
+http://freetel.svn.sourceforge.net/viewvc/freetel/codec2/[http://freetel.svn.sourceforge.net/viewvc/freetel/codec2/]
 
-   Then stop and restart Asterisk.
+Check Out:
 
-4. I use lighttpd as the web server, the /etc/lighttpd.conf lines
-   required are:
+  $ svn co https://freetel.svn.sourceforge.net/svnroot/freetel/codec2 codec2
 
-   -------------------------------------------------------------------
-   cgi.assign = ( ".sh" => "/bin/sh",".pl" => "/usr/sbin/microperl" )
-   -------------------------------------------------------------------
index 4c9509584b1f7383feccb9c95a1e873bf62c219c..87f279f30f908d35e942275f5436f0e8c9a884cb 100644 (file)
@@ -1,4 +1,4 @@
-#!/sbin/microperl
+#!usr/bin/perl
 # ipphones.pl
 # David Rowe 6 Jan 2010
 #
index fe46266fc8ad09d7ce2bdd226cd438cbea61fc08..03108d68a8b50036c93fe43b6d10e6a4a4836d64 100644 (file)
@@ -44,6 +44,12 @@ else
        echo "<body>"
        echo "Please wait a few seconds....."
        echo "</body>"
+
+       # load easy asterisk conf files in case this is our first login
+
+       asterisk -rx "sip reload" 2>/dev/null 1 > /dev/null
+       asterisk -rx "dialplan reload" 2>/dev/null 1 > /dev/null
+
     else
        # login failed
        cat <<EOF
index a9638d46fc222b236c9193754a16e4caadd5f9ab..b86171ff213626696c6b53a3cdb1c59fd953c242 100644 (file)
@@ -1,4 +1,4 @@
-#!/sbin/microperl
+#!/usr/bin/perl
 # phones.pl
 # David Rowe 5 Jan 2010
 #
index 89c435d4149df1f4b6dd667c7cc68a653f984383..49c89b04eb2842a8aaa025a99663a552c96f0b99 100644 (file)
@@ -1,4 +1,4 @@
-#!/sbin/microperl
+#!/usr/bin/perl
 # set_voiplines.pl
 # David Rowe 12 Jan 2010
 #
index 64b5a2cca55f5c7254efa4479aa2e87126097b21..990d0ea7933368a371d0597e02806160de2e5860 100644 (file)
@@ -1,4 +1,4 @@
-#!/sbin/microperl
+#!/usr/bin/perl
 # voiplines.pl
 # David Rowe 12 Jan 2010
 #
index 19dbf7484ab67ed00702f55413bb9207a5879c5d..cd8e5055cdd1ec3f12ec1aeb4237132c11d6aad3 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/sh
 # update_revision.sh
 #
 # Sets correct Revision number in the about screen.  Good idea to