1) Made pbx-asterisk executable.
authorIordan Iordanov <iiordanov@gmail.com>
Mon, 31 Oct 2011 01:00:22 +0000 (01:00 +0000)
committerIordan Iordanov <iiordanov@gmail.com>
Mon, 31 Oct 2011 01:00:22 +0000 (01:00 +0000)
2) Removed a few unused templates.
3) Removed old firewall rule-creation routine from pbx-asterisk.
4) Updated text on main page.

applications/luci-pbx/luasrc/model/cbi/pbx.lua
applications/luci-pbx/root/etc/init.d/pbx-asterisk [changed mode: 0644->0755]
applications/luci-pbx/root/etc/pbx-asterisk/extensions_outgoing_context_header.conf.TEMPLATE [deleted file]
applications/luci-pbx/root/etc/pbx-asterisk/firewall.home-pbx.TEMPLATE [deleted file]

index f73930eee301c511be34629641ccae65c5333eb3..910c749e26693f71a8623b1e755298d19266a5e5 100644 (file)
@@ -75,16 +75,16 @@ end
 
 m = Map (modulename, translate("PBX Main Page"),
         translate("This configuration page allows you to configure a phone system (PBX) service which\
 
 m = Map (modulename, translate("PBX Main Page"),
         translate("This configuration page allows you to configure a phone system (PBX) service which\
-                  permits making phone calls with, and sharing multiple Google and SIP (like Sipgate,\
-                   SipSorcery, and Betamax) accounts among many SIP devices. Note that Google\
-                  accounts, SIP accounts, and local user accounts are configured in the\
-                  \"Google Accounts\", \"SIP Accounts\", and \"User Accounts\" sub-sections.\
-      You must configure at least one local SIP account\
-      on this PBX, to make and receive calls with your Google/SIP accounts.\
-      Configuring multiple users will allow you to make free calls between users, and share the configured\
-      Google and SIP accounts. If you have more than one Google and SIP accounts set up,\
-      you should probably configure how calls to and from them are routed in the \"Call Routing\" page.\
-      If you're interested in using your own PBX from anywhere in the world,\
+      permits making phone calls through multiple Google and SIP (like Sipgate,\
+      SipSorcery, and Betamax) accounts and sharing them among many SIP devices. \
+      Note that Google accounts, SIP accounts, and local user accounts are configured in the \
+      \"Google Accounts\", \"SIP Accounts\", and \"User Accounts\" sub-sections. \
+      You must add at least one User Account to this PBX, and then configure a SIP device or softphone \
+      to use the account, in order to make and receive calls with your Google/SIP accounts. \
+      Configuring multiple users will allow you to make free calls between all users, and share the configured \
+      Google and SIP accounts. If you have more than one Google and SIP accounts set up, \
+      you should probably configure how calls to and from them are routed in the \"Call Routing\" page. \
+      If you're interested in using your own PBX from anywhere in the world, \
       then visit the \"Remote Usage\" section in the \"Advanced Settings\" page."))
 
 ----------------------------------------------------------------------------------------------------
       then visit the \"Remote Usage\" section in the \"Advanced Settings\" page."))
 
 ----------------------------------------------------------------------------------------------------
@@ -105,7 +105,7 @@ function sts.cfgvalue(self, section)
       usrs = luci.sys.exec("asterisk -rx 'sip show users'")
       chan = luci.sys.exec("asterisk -rx 'core show channels'")
       return format_two_indices(reg, 1, 5) .. format_two_indices(jab, 2, 4) .. "\n" 
       usrs = luci.sys.exec("asterisk -rx 'sip show users'")
       chan = luci.sys.exec("asterisk -rx 'core show channels'")
       return format_two_indices(reg, 1, 5) .. format_two_indices(jab, 2, 4) .. "\n" 
-             .. format_one_index(usrs,1) .. "\n" .. chan
+             .. format_one_index(usrs, 1) .. "\n" .. chan
    elseif server == "freeswitch" then
       return "Freeswitch is not supported yet.\n"
    else
    elseif server == "freeswitch" then
       return "Freeswitch is not supported yet.\n"
    else
old mode 100644 (file)
new mode 100755 (executable)
index d96eb4f..d97854d
@@ -33,8 +33,6 @@ ASTGROUP=nogroup
 ASTDIRSRECURSIVE="/var/run/asterisk /var/log/asterisk /var/spool/asterisk"
 ASTDIRS="/usr/lib/asterisk"
 
 ASTDIRSRECURSIVE="/var/run/asterisk /var/log/asterisk /var/spool/asterisk"
 ASTDIRS="/usr/lib/asterisk"
 
-FIREWALL_PATH="/etc/asterisk/firewall.$MODULENAME"
-
 TEMPLATEDIR=/etc/${MODULENAME}-asterisk
 ASTERISKDIR=/etc/asterisk
 WORKDIR=/tmp/$MODULENAME.$$
 TEMPLATEDIR=/etc/${MODULENAME}-asterisk
 ASTERISKDIR=/etc/asterisk
 WORKDIR=/tmp/$MODULENAME.$$
@@ -73,7 +71,6 @@ TMPL_EXTOUTGTALK=$TEMPLATEDIR/extensions_outgoing_gtalk.conf.TEMPLATE
 TMPL_EXTOUTLOCAL=$TEMPLATEDIR/extensions_outgoing_dial_local_user.conf.TEMPLATE
 TMPL_EXTOUTSIP=$TEMPLATEDIR/extensions_outgoing_sip.conf.TEMPLATE
 
 TMPL_EXTOUTLOCAL=$TEMPLATEDIR/extensions_outgoing_dial_local_user.conf.TEMPLATE
 TMPL_EXTOUTSIP=$TEMPLATEDIR/extensions_outgoing_sip.conf.TEMPLATE
 
-TMPL_FIREWALL=$TEMPLATEDIR/firewall.$MODULENAME.TEMPLATE
 TMPL_JABBER=$TEMPLATEDIR/jabber.conf.TEMPLATE
 TMPL_JABBERUSER=$TEMPLATEDIR/jabber_users.conf.TEMPLATE
 TMPL_SIP=$TEMPLATEDIR/sip.conf.TEMPLATE
 TMPL_JABBER=$TEMPLATEDIR/jabber.conf.TEMPLATE
 TMPL_JABBERUSER=$TEMPLATEDIR/jabber_users.conf.TEMPLATE
 TMPL_SIP=$TEMPLATEDIR/sip.conf.TEMPLATE
@@ -557,47 +554,6 @@ pbx_fix_ownership()
        chown $ASTUSER:$ASTGROUP -R $ASTDIRSRECURSIVE
 }
 
        chown $ASTUSER:$ASTGROUP -R $ASTDIRSRECURSIVE
 }
 
-# Creates firewall configuration. However, since this functionality is now
-# taken over by pbx-advanced.lua, this function is unused.
-create_firewall_config()
-{
-       local bindport
-       local rtpstart
-       local rtpend
-       local externhost
-
-       config_get bindport advanced bindport
-       config_get externhost advanced externhost
-       config_get rtpstart advanced rtpstart
-       config_get rtpend   advanced rtpend
-
-       # We need all of these parameters to be set in order to consider inserting firewall rules.
-       if [ -z "$externhost" -o -z "$bindport" -o -z "$rtpstart" -o -z "$rtpend" ] ; then
-               rm -f $FIREWALL_PATH
-               return
-       fi
-
-       sed "s/|SIPPORT|/$bindport/g" $TMPL_FIREWALL |\
-            sed "s/|RTPRANGE|/$rtpstart:$rtpend/g" > $WORKDIR/firewall.$MODULENAME
-
-       # Make sure there is an include section in the firewall configuration
-       # to include the file we just created.
-       i=0 ; found_path=0
-       while p=`uci get firewall.@include[$i].path 2>/dev/null` ; do
-               if [ "$p" = "$FIREWALL_PATH" ] ; then
-                       found_path=1
-                       break
-               fi
-               i=`expr $i + 1`
-       done
-
-       # If no include section was found which mentions $FIREWALL_PATH, add one.
-       if [ $found_path -eq 0 ] ; then
-               uci add firewall include   1>/dev/null 2>/dev/null
-               uci set firewall.@include[-1].path="$FIREWALL_PATH"
-               uci commit firewall
-       fi
-}
 
 start() {
        mkdir -p $WORKDIR
 
 start() {
        mkdir -p $WORKDIR
diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_outgoing_context_header.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_outgoing_context_header.conf.TEMPLATE
deleted file mode 100644 (file)
index a7f36cf..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-[context-outgoing-|NAME|]
diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/firewall.home-pbx.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/firewall.home-pbx.TEMPLATE
deleted file mode 100644 (file)
index 91e9f66..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-iptables -I INPUT 3 -p udp -s 0/0 -d 0/0 --dport |SIPPORT|  -j ACCEPT
-iptables -I INPUT 3 -p udp -s 0/0 -d 0/0 --dport |RTPRANGE| -j ACCEPT