aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch
diff options
context:
space:
mode:
Diffstat (limited to 'config/freeswitch')
-rw-r--r--config/freeswitch/freeswitch.inc153
-rw-r--r--config/freeswitch/freeswitch.xml4
-rw-r--r--config/freeswitch/freeswitch_dialplan.tmp163
-rw-r--r--config/freeswitch/freeswitch_dialplan.xml124
-rw-r--r--config/freeswitch/freeswitch_dialplan_includes.tmp16
-rw-r--r--config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_dialplan_includes_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_extensions.tmp14
-rw-r--r--config/freeswitch/freeswitch_extensions_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_features.tmp14
-rw-r--r--config/freeswitch/freeswitch_gateways.tmp14
-rw-r--r--config/freeswitch/freeswitch_gateways_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_ivr.tmp14
-rw-r--r--config/freeswitch/freeswitch_ivr_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_ivr_options_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_modules.xml2
-rw-r--r--config/freeswitch/freeswitch_profile_edit.tmp28
-rw-r--r--config/freeswitch/freeswitch_profiles.tmp17
-rw-r--r--config/freeswitch/freeswitch_public.tmp162
-rw-r--r--config/freeswitch/freeswitch_public.xml123
-rw-r--r--config/freeswitch/freeswitch_public_includes.tmp16
-rw-r--r--config/freeswitch/freeswitch_public_includes_details_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_public_includes_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_recordings.tmp14
-rw-r--r--config/freeswitch/freeswitch_recordings_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_status.tmp14
-rw-r--r--config/freeswitch/freeswitch_time_conditions.tmp14
-rw-r--r--config/freeswitch/freeswitch_time_conditions_edit.tmp14
-rw-r--r--config/freeswitch/freeswitch_vars.tmp162
-rw-r--r--config/freeswitch/freeswitch_vars.xml124
30 files changed, 681 insertions, 651 deletions
diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc
index a9799e9f..37615396 100644
--- a/config/freeswitch/freeswitch.inc
+++ b/config/freeswitch/freeswitch.inc
@@ -9,9 +9,7 @@
FreeSWITCH (TM)
http://www.freeswitch.org/
- */
-/* ========================================================================== */
-/*
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -34,6 +32,73 @@
POSSIBILITY OF SUCH DAMAGE.
*/
+function build_menu() {
+
+ //$script_name_array = split ("/", $_SERVER["SCRIPT_NAME"]);
+ //$script_name = $script_name_array[count($script_name_array)-1];
+ //echo "script_name: ".$script_name."<br />";
+
+ $tab_array = array();
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/pkg_edit.php?xml=freeswitch.xml&amp;id=0") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Settings"), $menu_selected, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_dialplan_includes.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_dialplan.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_dialplan_includes_edit.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_dialplan_includes_details_edit.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Dialplan"), $menu_selected, "/packages/freeswitch/freeswitch_dialplan_includes.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_extensions.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_extensions_edit.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Extensions"), $menu_selected, "/packages/freeswitch/freeswitch_extensions.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_features.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_ivr.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_ivr_edit.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_ivr_options_edit.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_recordings.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_recordings_edit.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Features"), $menu_selected, "/packages/freeswitch/freeswitch_features.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_gateways.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_gateways_edit.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Gateways"), $menu_selected, "/packages/freeswitch/freeswitch_gateways.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_profiles.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_profile_edit.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Profiles"), $menu_selected, "/packages/freeswitch/freeswitch_profiles.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public_includes.php") { $menu_selected = true; }
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_public.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Public"), $menu_selected, "/packages/freeswitch/freeswitch_public_includes.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_status.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Status"), $menu_selected, "/packages/freeswitch/freeswitch_status.php");
+ unset($menu_selected);
+
+ $menu_selected = false;
+ if ($_SERVER["SCRIPT_NAME"] == "/packages/freeswitch/freeswitch_vars.php") { $menu_selected = true; }
+ $tab_array[] = array(gettext("Vars"), $menu_selected, "/packages/freeswitch/freeswitch_vars.php");
+ unset($menu_selected);
+
+ return $tab_array;
+}
+
function guid()
{
@@ -1707,10 +1772,36 @@ function sync_package_freeswitch()
}
+function create_lan_sip_profile()
+{
+ global $config;
+ //create the LAN profile if it doesn't exist
+ if (!file_exists('/usr/local/freeswitch/conf/sip_profiles/lan.xml')) {
+ $lan_ip = $config['interfaces']['lan']['ipaddr'];
+
+ $filename = "/usr/local/freeswitch/conf/sip_profiles/lan.xml";
+ $handle = fopen($filename,"rb");
+ $contents = fread($handle, filesize($filename));
+ fclose($handle);
+
+ $handle = fopen($filename,"w");
+ $contents = str_replace("<profile name=\"internal\">", "<profile name=\"lan\">", $contents);
+ $contents = str_replace("<alias name=\"default\"/>", "", $contents);
+ $contents = str_replace("<X-PRE-PROCESS cmd=\"include\" data=\"internal/*.xml\"/>", "<X-PRE-PROCESS cmd=\"include\" data=\"lan/*.xml\"/>", $contents);
+ $contents = str_replace("<param name=\"rtp-ip\" value=\"$${local_ip_v4}\"/>", "<param name=\"rtp-ip\" value=\"".$lan_ip."\"/>", $contents);
+ $contents = str_replace("<param name=\"sip-ip\" value=\"$${local_ip_v4}\"/>", "<param name=\"sip-ip\" value=\"".$lan_ip."\"/>", $contents);
+ fwrite($handle, $contents);
+ unset($contents);
+ fclose($handle);
+ unset($filename);
+ }
+
+}
+
function freeswitch_php_install_command()
{
global $config;
- $freeswitch_package_version = "0.8.6.1";
+ $freeswitch_package_version = "0.8.7";
$freeswitch_build_version = "1.0.4 pre 6";
$freeswitch_build_revision = "13238";
@@ -1782,12 +1873,12 @@ function freeswitch_php_install_command()
//download xml package files
//exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch.inc");
//exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch.xml");
- exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan.xml");
+ //exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan.xml");
//exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_external.xml");
//exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_internal.xml");
exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_modules.xml");
- exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_public.xml");
- exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_vars.xml");
+ //exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_public.xml");
+ //exec("cd /usr/local/pkg/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_vars.xml");
//misc files
if (!is_dir('/usr/local/www/edit_area/')) {
@@ -1810,6 +1901,10 @@ function freeswitch_php_install_command()
exec("cp /tmp/freeswitch_cmd.tmp /usr/local/www/packages/freeswitch/freeswitch_cmd.php");
unlink_if_exists("/tmp/freeswitch_cmd.tmp");
+ exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan.tmp");
+ exec("cp /tmp/freeswitch_dialplan.tmp /usr/local/www/packages/freeswitch/freeswitch_dialplan.php");
+ unlink_if_exists("/tmp/freeswitch_dialplan.tmp");
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes_details.tmp");
exec("cp /tmp/freeswitch_dialplan_includes_details.tmp /usr/local/www/packages/freeswitch/freeswitch_dialplan_includes_details.php");
unlink_if_exists("/tmp/freeswitch_dialplan_includes_details.tmp");
@@ -1821,15 +1916,15 @@ function freeswitch_php_install_command()
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes.tmp");
exec("cp /tmp/freeswitch_dialplan_includes.tmp /usr/local/www/packages/freeswitch/freeswitch_dialplan_includes.php");
unlink_if_exists("/tmp/freeswitch_dialplan_includes.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_dialplan_includes_edit.tmp");
exec("cp /tmp/freeswitch_dialplan_includes_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_dialplan_includes_edit.php");
unlink_if_exists("/tmp/freeswitch_dialplan_includes_edit.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_extensions.tmp");
exec("cp /tmp/freeswitch_extensions.tmp /usr/local/www/packages/freeswitch/freeswitch_extensions.php");
unlink_if_exists("/tmp/freeswitch_extensions.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_extensions_edit.tmp");
exec("cp /tmp/freeswitch_extensions_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_extensions_edit.php");
unlink_if_exists("/tmp/freeswitch_extensions_edit.tmp");
@@ -1837,15 +1932,15 @@ function freeswitch_php_install_command()
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_features.tmp");
exec("cp /tmp/freeswitch_features.tmp /usr/local/www/packages/freeswitch/freeswitch_features.php");
unlink_if_exists("/tmp/freeswitch_features.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_gateways.tmp");
exec("cp /tmp/freeswitch_gateways.tmp /usr/local/www/packages/freeswitch/freeswitch_gateways.php");
unlink_if_exists("/tmp/freeswitch_gateways.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_gateways_edit.tmp");
exec("cp /tmp/freeswitch_gateways_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_gateways_edit.php");
unlink_if_exists("/tmp/freeswitch_gateways_edit.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr.tmp");
exec("cp /tmp/freeswitch_ivr.tmp /usr/local/www/packages/freeswitch/freeswitch_ivr.php");
unlink_if_exists("/tmp/freeswitch_ivr.tmp");
@@ -1853,7 +1948,7 @@ function freeswitch_php_install_command()
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr_edit.tmp");
exec("cp /tmp/freeswitch_ivr_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_ivr_edit.php");
unlink_if_exists("/tmp/freeswitch_ivr_edit.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_ivr_options.tmp");
exec("cp /tmp/freeswitch_ivr_options.tmp /usr/local/www/packages/freeswitch/freeswitch_ivr_options.php");
unlink_if_exists("/tmp/freeswitch_ivr_options.tmp");
@@ -1870,10 +1965,14 @@ function freeswitch_php_install_command()
exec("cp /tmp/freeswitch_profile_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_profile_edit.php");
unlink_if_exists("/tmp/freeswitch_profile_edit.tmp");
+ exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_public.tmp");
+ exec("cp /tmp/freeswitch_public.tmp /usr/local/www/packages/freeswitch/freeswitch_public.php");
+ unlink_if_exists("/tmp/freeswitch_public.tmp");
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_public_includes.tmp");
exec("cp /tmp/freeswitch_public_includes.tmp /usr/local/www/packages/freeswitch/freeswitch_public_includes.php");
unlink_if_exists("/tmp/freeswitch_public_includes.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_public_includes_edit.tmp");
exec("cp /tmp/freeswitch_public_includes_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_public_includes_edit.php");
unlink_if_exists("/tmp/freeswitch_public_includes_edit.tmp");
@@ -1889,15 +1988,15 @@ function freeswitch_php_install_command()
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_mailto.tmp");
exec("cp /tmp/freeswitch_mailto.tmp /usr/local/www/packages/freeswitch/freeswitch_mailto.php");
unlink_if_exists("/tmp/freeswitch_mailto.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_recordings.tmp");
exec("cp /tmp/freeswitch_recordings.tmp /usr/local/www/packages/freeswitch/freeswitch_recordings.php");
unlink_if_exists("/tmp/freeswitch_recordings.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_recordings_edit.tmp");
exec("cp /tmp/freeswitch_recordings_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_recordings_edit.php");
unlink_if_exists("/tmp/freeswitch_recordings_edit.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_recordings_play.tmp");
exec("cp /tmp/freeswitch_recordings_play.tmp /usr/local/www/packages/freeswitch/freeswitch_recordings_play.php");
unlink_if_exists("/tmp/freeswitch_recordings_play.tmp");
@@ -1905,15 +2004,19 @@ function freeswitch_php_install_command()
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_status.tmp");
exec("cp /tmp/freeswitch_status.tmp /usr/local/www/packages/freeswitch/freeswitch_status.php");
unlink_if_exists("/tmp/freeswitch_status.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_time_conditions.tmp");
exec("cp /tmp/freeswitch_time_conditions.tmp /usr/local/www/packages/freeswitch/freeswitch_time_conditions.php");
unlink_if_exists("/tmp/freeswitch_time_conditions.tmp");
-
+
exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_time_conditions_edit.tmp");
exec("cp /tmp/freeswitch_time_conditions_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_time_conditions_edit.php");
unlink_if_exists("/tmp/freeswitch_time_conditions_edit.tmp");
-
+
+ exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_vars.tmp");
+ exec("cp /tmp/freeswitch_vars.tmp /usr/local/www/packages/freeswitch/freeswitch_vars.php");
+ unlink_if_exists("/tmp/freeswitch_vars.tmp");
+
exec("cd /usr/local/freeswitch/scripts/;fetch http://www.pfsense.com/packages/config/freeswitch/disa.js");
exec("cp /usr/local/freeswitch/htdocs/slim.swf /usr/local/www/packages/freeswitch/slim.swf");
@@ -1957,7 +2060,7 @@ function freeswitch_php_install_command()
$xml_rpc_auth_user = $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_user'];
$xml_rpc_auth_pass = $config['installedpackages']['freeswitchsettings']['config'][0]['xml_rpc_auth_pass'];
$admin_pin = $config['installedpackages']['freeswitchsettings']['config'][0]['admin_pin'];
-
+
//write the recording.js script
recording_js();
@@ -2316,15 +2419,17 @@ function freeswitch_php_install_command()
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/music/8000/');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl/');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/sip_profiles/');
-
//Optional
//system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/');
//system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/');
//system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/');
-
+
unset($filename);
}
+
+ //Create the LAN SIP Profile
+ create_lan_sip_profile();
write_rcfile(array(
"file" => "freeswitch.sh",
diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml
index 3ca8042f..bf4982a6 100644
--- a/config/freeswitch/freeswitch.xml
+++ b/config/freeswitch/freeswitch.xml
@@ -44,7 +44,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>FreeSWITCH Settings</name>
- <version>0.8.6.1</version>
+ <version>0.8.7</version>
<title>FreeSWITCH: Settings</title>
<include_file>/usr/local/pkg/freeswitch.inc</include_file>
<menu>
@@ -96,7 +96,7 @@
</tab>
<tab>
<text>Vars</text>
- <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ <url>/packages/freeswitch/freeswitch_vars.php</url>
</tab>
</tabs>
<configpath>installedpackages->package->$packagename->configuration->freeswitchsettings</configpath>
diff --git a/config/freeswitch/freeswitch_dialplan.tmp b/config/freeswitch/freeswitch_dialplan.tmp
new file mode 100644
index 00000000..7c33a28e
--- /dev/null
+++ b/config/freeswitch/freeswitch_dialplan.tmp
@@ -0,0 +1,163 @@
+<?php
+/* $Id$ */
+/*
+ freeswitch_dialplan.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+require("/usr/local/pkg/freeswitch.inc");
+
+//$a_extensions = &$config['installedpackages']['freeswitchprofiles']['config'];
+
+if ($_GET['a'] == "default") {
+ conf_mount_rw();
+ exec("cp /usr/local/freeswitch/conf.orig/dialplan/default.xml /usr/local/freeswitch/conf/dialplan/default.xml");
+ $savemsg = "Dialplan default.xml: Set as Default";
+ conf_mount_ro();
+}
+
+if ($_POST['a'] == "save") {
+ conf_mount_rw();
+ $content = ereg_replace("\r","",$_POST['code']);
+ $fd = fopen("/usr/local/freeswitch/conf/dialplan/default.xml", "w");
+ fwrite($fd, $content);
+ fclose($fd);
+ $savemsg = "Saved text to the dialplan default.xml";
+ conf_mount_ro();
+}
+
+
+$fd = fopen("/usr/local/freeswitch/conf/dialplan/default.xml", "r");
+$content = fread($fd, filesize("/usr/local/freeswitch/conf/dialplan/default.xml"));
+fclose($fd);
+
+include("head.inc");
+
+?>
+
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+
+<script language="Javascript">
+function sf() { document.forms[0].savetopath.focus(); }
+</script>
+<script language="Javascript" type="text/javascript" src="/edit_area/edit_area_full.js"></script>
+<script language="Javascript" type="text/javascript">
+ // initialisation
+ editAreaLoader.init({
+ id: "code" // id of the textarea to transform
+ ,start_highlight: false
+ ,allow_toggle: false
+ ,language: "en"
+ ,syntax: "html"
+ ,toolbar: "search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
+ ,syntax_selection_allow: "css,html,js,php,xml,c,cpp,sql"
+ ,show_line_colors: true
+ });
+</script>
+
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">FreeSWITCH: Dialplan</p>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+
+display_top_tabs(build_menu());
+
+?>
+</td></tr>
+</table>
+
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+
+<form action="freeswitch_dialplan.php" method="post" name="iform" id="iform">
+<?php
+
+?>
+ <table width="98%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width='90%'><p><span class="vexpl"><span class="red"><strong>Default Dialplan<br>
+ </strong></span>
+ The default dialplan is used to setup call destinations based on conditions and context.
+ You can use the dialplan to send calls to gateways, IVRs, external numbers, to scripts, or any destination.
+ </p>
+ </td>
+ <td width='10%' align='right' valign='middle'><input type="submit" value="save" /></td>
+ </tr>
+ </table>
+ <br />
+ <br />
+
+ <textarea style="width:98%" id="code" name="code" rows="30" cols="<?php echo $cols; ?>" name="content"><?php echo htmlentities($content); ?></textarea>
+ <br />
+ <br />
+
+ <table width="98%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td>/usr/local/freeswitch/conf/dialplan/default.xml</td>
+ <td align='right'>
+ <input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
+ <input type="hidden" name="a" value="save" />
+ <?php
+ echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_dialplan.php?a=default&f=default.xml';\" />";
+ ?>
+ </td>
+ </tr>
+ </table>
+
+</form>
+
+<br>
+<br>
+
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+
+</td>
+</tr>
+</table>
+
+</div>
+
+
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/freeswitch/freeswitch_dialplan.xml b/config/freeswitch/freeswitch_dialplan.xml
deleted file mode 100644
index ef62f844..00000000
--- a/config/freeswitch/freeswitch_dialplan.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- freeswitch_dialplan.xml
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
- FreeSWITCH (TM)
- http://www.freeswitch.org/
-
-
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
-*/
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>freeswitchdialplan</name>
- <version>0.1</version>
- <title>FreeSWITCH: Dialplan</title>
- <aftersaveredirect>pkg_edit.php?xml=freeswitch_dialplan.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/freeswitch.inc</include_file>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Dialplan</text>
- <url>/packages/freeswitch/freeswitch_dialplan_includes.php</url>
- <active/>
- </tab>
- <tab>
- <text>Extensions</text>
- <url>/packages/freeswitch/freeswitch_extensions.php</url>
- </tab>
- <tab>
- <text>Features</text>
- <url>/packages/freeswitch/freeswitch_features.php</url>
- </tab>
- <tab>
- <text>Gateways</text>
- <url>/packages/freeswitch/freeswitch_gateways.php</url>
- </tab>
- <tab>
- <text>Profiles</text>
- <url>/packages/freeswitch/freeswitch_profiles.php</url>
- </tab>
- <tab>
- <text>Public</text>
- <url>/packages/freeswitch/freeswitch_public_includes.php</url>
- </tab>
- <tab>
- <text>Status</text>
- <url>/packages/freeswitch/freeswitch_status.php</url>
- </tab>
- <tab>
- <text>Vars</text>
- <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->freeswitchdialplan</configpath>
- <fields>
- <field>
- <fielddescr>&lt;b&gt;Default Dialplan&lt;/b&gt; &lt;br /&gt; &lt;br /&gt; The default dialplan is used to setup call destinations based on conditions and context. You can use the dialplan to send calls to gateways, IVRs, external numbers, to scripts, or any destination. </fielddescr>
- <fieldname>dialplan_default_xml</fieldname>
- <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/dialplan/default.xml &lt;br /&gt;&lt;br /&gt;</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <wrap>off</wrap>
- <size>30</size>
- <cols>70</cols>
- <rows>33</rows>
- </field>
- </fields>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_php_after_head_command>
- sync_package_freeswitch_dialplan();
- </custom_php_after_head_command>
- <custom_php_after_form_command>
- </custom_php_after_form_command>
- <custom_php_validation_command>
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- sync_package_freeswitch_dialplan();
- </custom_php_resync_config_command>
-</packagegui> \ No newline at end of file
diff --git a/config/freeswitch/freeswitch_dialplan_includes.tmp b/config/freeswitch/freeswitch_dialplan_includes.tmp
index 7519d052..55379ea5 100644
--- a/config/freeswitch/freeswitch_dialplan_includes.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes.tmp
@@ -111,18 +111,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), true, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
@@ -163,7 +153,7 @@ include("head.inc");
</strong></span></span>
</td>
<td align='right'>
- <input type='button' value='default.xml' onclick="document.location.href='/pkg_edit.php?xml=freeswitch_dialplan.xml&id=0';">
+ <input type='button' value='default.xml' onclick="document.location.href='/packages/freeswitch/freeswitch_dialplan.php';">
</td>
</tr>
<tr>
diff --git a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp
index e100ff40..bd719273 100644
--- a/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes_details_edit.tmp
@@ -129,18 +129,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), true, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp
index 491dba21..11ca828b 100644
--- a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp
+++ b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp
@@ -180,18 +180,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), true, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_extensions.tmp b/config/freeswitch/freeswitch_extensions.tmp
index a45f1a9c..eea7699e 100644
--- a/config/freeswitch/freeswitch_extensions.tmp
+++ b/config/freeswitch/freeswitch_extensions.tmp
@@ -60,18 +60,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), true, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_extensions_edit.tmp b/config/freeswitch/freeswitch_extensions_edit.tmp
index 66cacfd9..deb7a597 100644
--- a/config/freeswitch/freeswitch_extensions_edit.tmp
+++ b/config/freeswitch/freeswitch_extensions_edit.tmp
@@ -131,18 +131,8 @@ function show_advanced_config() {
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), true, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_features.tmp b/config/freeswitch/freeswitch_features.tmp
index 4a55c15a..c55e4aa4 100644
--- a/config/freeswitch/freeswitch_features.tmp
+++ b/config/freeswitch/freeswitch_features.tmp
@@ -60,18 +60,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), true, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp
index 05ccbf8f..66b30bda 100644
--- a/config/freeswitch/freeswitch_gateways.tmp
+++ b/config/freeswitch/freeswitch_gateways.tmp
@@ -60,18 +60,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), true, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_gateways_edit.tmp b/config/freeswitch/freeswitch_gateways_edit.tmp
index f5a54881..28c0a74a 100644
--- a/config/freeswitch/freeswitch_gateways_edit.tmp
+++ b/config/freeswitch/freeswitch_gateways_edit.tmp
@@ -273,18 +273,8 @@ function show_advanced_config() {
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), true, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_ivr.tmp b/config/freeswitch/freeswitch_ivr.tmp
index e6dd6a0f..38309ab5 100644
--- a/config/freeswitch/freeswitch_ivr.tmp
+++ b/config/freeswitch/freeswitch_ivr.tmp
@@ -61,18 +61,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), true, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_ivr_edit.tmp b/config/freeswitch/freeswitch_ivr_edit.tmp
index e4e8abbf..679f090e 100644
--- a/config/freeswitch/freeswitch_ivr_edit.tmp
+++ b/config/freeswitch/freeswitch_ivr_edit.tmp
@@ -207,18 +207,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), true, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_ivr_options_edit.tmp b/config/freeswitch/freeswitch_ivr_options_edit.tmp
index 3d649a3a..1e3313d0 100644
--- a/config/freeswitch/freeswitch_ivr_options_edit.tmp
+++ b/config/freeswitch/freeswitch_ivr_options_edit.tmp
@@ -115,18 +115,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), true, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_modules.xml b/config/freeswitch/freeswitch_modules.xml
index 1f14c25e..8c211820 100644
--- a/config/freeswitch/freeswitch_modules.xml
+++ b/config/freeswitch/freeswitch_modules.xml
@@ -102,7 +102,7 @@
</tab>
<tab>
<text>Vars</text>
- <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
+ <url>/packages/freeswitch/freeswitch_vars.php</url>
</tab>
</tabs>
<configpath>installedpackages->package->$packagename->configuration->freeswitchmodules</configpath>
diff --git a/config/freeswitch/freeswitch_profile_edit.tmp b/config/freeswitch/freeswitch_profile_edit.tmp
index b1461dd3..a1faa4de 100644
--- a/config/freeswitch/freeswitch_profile_edit.tmp
+++ b/config/freeswitch/freeswitch_profile_edit.tmp
@@ -1,12 +1,12 @@
<?php
/* $Id$ */
/*
- freeswitch_extensions.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
+ freeswitch_profile_edit.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
- FreeSWITCH (TM)
- http://www.freeswitch.org/
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -71,18 +71,8 @@ function sf() { document.forms[0].savetopath.focus(); }
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
@@ -119,7 +109,9 @@ function sf() { document.forms[0].savetopath.focus(); }
<td>/usr/local/freeswitch/conf/sip_profiles/<?php echo $_GET['f']; ?></td>
<td align='right'>
<input type="hidden" name="a" value="save" />
- <input type="submit" value="save" />
+ <?php
+ echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_profiles.php?a=default&f=".$_GET['f']."';\" />";
+ ?>
</td>
</tr>
</table>
diff --git a/config/freeswitch/freeswitch_profiles.tmp b/config/freeswitch/freeswitch_profiles.tmp
index da57b249..9bcbd48d 100644
--- a/config/freeswitch/freeswitch_profiles.tmp
+++ b/config/freeswitch/freeswitch_profiles.tmp
@@ -1,12 +1,12 @@
<?php
/* $Id$ */
/*
- freeswitch_profiles.php
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
+ freeswitch_profiles.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
- FreeSWITCH (TM)
- http://www.freeswitch.org/
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -60,6 +60,13 @@ function ListFiles($dir) {
}
+if ($_GET['a'] == "default") {
+ conf_mount_rw();
+ exec("cp /usr/local/freeswitch/conf.orig/sip_profiles/".$_GET['f']." /usr/local/freeswitch/conf/sip_profiles/".$_GET['f']);
+ $savemsg = $_POST['f'].": Set as Default";
+ conf_mount_ro();
+}
+
if ($_POST['a'] == "save") {
conf_mount_rw();
$content = ereg_replace("\r","",$_POST['code']);
diff --git a/config/freeswitch/freeswitch_public.tmp b/config/freeswitch/freeswitch_public.tmp
new file mode 100644
index 00000000..66b577f5
--- /dev/null
+++ b/config/freeswitch/freeswitch_public.tmp
@@ -0,0 +1,162 @@
+<?php
+/* $Id$ */
+/*
+ freeswitch_public.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+require("/usr/local/pkg/freeswitch.inc");
+
+//$a_extensions = &$config['installedpackages']['freeswitchprofiles']['config'];
+
+if ($_GET['a'] == "default") {
+ conf_mount_rw();
+ exec("cp /usr/local/freeswitch/conf.orig/dialplan/public.xml /usr/local/freeswitch/conf/dialplan/public.xml");
+ $savemsg = "dialplan public.xml: Set as Default";
+ conf_mount_ro();
+}
+
+if ($_POST['a'] == "save") {
+ conf_mount_rw();
+ $content = ereg_replace("\r","",$_POST['code']);
+ $fd = fopen("/usr/local/freeswitch/conf/dialplan/public.xml", "w");
+ fwrite($fd, $content);
+ fclose($fd);
+ $savemsg = "Saved text to the dialplan public.xml";
+ conf_mount_ro();
+}
+
+
+$fd = fopen("/usr/local/freeswitch/conf/dialplan/public.xml", "r");
+$content = fread($fd, filesize("/usr/local/freeswitch/conf/dialplan/public.xml"));
+fclose($fd);
+
+include("head.inc");
+
+?>
+
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+
+<script language="Javascript">
+function sf() { document.forms[0].savetopath.focus(); }
+</script>
+<script language="Javascript" type="text/javascript" src="/edit_area/edit_area_full.js"></script>
+<script language="Javascript" type="text/javascript">
+ // initialisation
+ editAreaLoader.init({
+ id: "code" // id of the textarea to transform
+ ,start_highlight: false
+ ,allow_toggle: false
+ ,language: "en"
+ ,syntax: "html"
+ ,toolbar: "search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
+ ,syntax_selection_allow: "css,html,js,php,xml,c,cpp,sql"
+ ,show_line_colors: true
+ });
+</script>
+
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">FreeSWITCH: Public</p>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+
+display_top_tabs(build_menu());
+
+?>
+</td></tr>
+</table>
+
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+
+<form action="freeswitch_public.php" method="post" name="iform" id="iform">
+<?php
+
+?>
+ <table width="98%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width='90%'><p><span class="vexpl"><span class="red"><strong>Public<br>
+ </strong></span>
+ Directs inbound calls to extensions, IVRs, external numbers, and scripts.
+ </p>
+ </td>
+ <td width='10%' align='right' valign='middle'><input type="submit" value="save" /></td>
+ </tr>
+ </table>
+ <br />
+ <br />
+
+ <textarea style="width:98%" id="code" name="code" rows="30" cols="<?php echo $cols; ?>" name="content"><?php echo htmlentities($content); ?></textarea>
+ <br />
+ <br />
+
+ <table width="98%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td>/usr/local/freeswitch/conf/dialplan/public.xml</td>
+ <td align='right'>
+ <input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
+ <input type="hidden" name="a" value="save" />
+ <?php
+ echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_public.php?a=default&f=public.xml';\" />";
+ ?>
+ </td>
+ </tr>
+ </table>
+
+</form>
+
+<br>
+<br>
+
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+
+</td>
+</tr>
+</table>
+
+</div>
+
+
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/freeswitch/freeswitch_public.xml b/config/freeswitch/freeswitch_public.xml
deleted file mode 100644
index 5db5aa1b..00000000
--- a/config/freeswitch/freeswitch_public.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- freeswitch_public.xml
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
- FreeSWITCH (TM)
- http://www.freeswitch.org/
-
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>freeswitchpublic</name>
- <version>0.1</version>
- <title>FreeSWITCH: Public</title>
- <aftersaveredirect>pkg_edit.php?xml=freeswitch_public.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/freeswitch.inc</include_file>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Dialplan</text>
- <url>/packages/freeswitch/freeswitch_dialplan_includes.php</url>
- </tab>
- <tab>
- <text>Extensions</text>
- <url>/packages/freeswitch/freeswitch_extensions.php</url>
- </tab>
- <tab>
- <text>Features</text>
- <url>/packages/freeswitch/freeswitch_features.php</url>
- </tab>
- <tab>
- <text>Gateways</text>
- <url>/packages/freeswitch/freeswitch_gateways.php</url>
- </tab>
- <tab>
- <text>Profiles</text>
- <url>/packages/freeswitch/freeswitch_profiles.php</url>
- </tab>
- <tab>
- <text>Public</text>
- <url>/packages/freeswitch/freeswitch_public_includes.php</url>
- <active/>
- </tab>
- <tab>
- <text>Status</text>
- <url>/packages/freeswitch/freeswitch_status.php</url>
- </tab>
- <tab>
- <text>Vars</text>
- <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->freeswitchpublic</configpath>
- <fields>
- <field>
- <fielddescr>&lt;b&gt;Public&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;Directs inbound calls to extensions, IVRs, external numbers, and scripts. </fielddescr>
- <fieldname>public_xml</fieldname>
- <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/dialplan/public.xml &lt;br /&gt;&lt;br /&gt;</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <wrap>off</wrap>
- <size>30</size>
- <cols>70</cols>
- <rows>33</rows>
- </field>
- </fields>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_php_after_head_command>
- sync_package_freeswitch_public();
- </custom_php_after_head_command>
- <custom_php_after_form_command>
- </custom_php_after_form_command>
- <custom_php_validation_command>
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- sync_package_freeswitch_public();
- </custom_php_resync_config_command>
-</packagegui> \ No newline at end of file
diff --git a/config/freeswitch/freeswitch_public_includes.tmp b/config/freeswitch/freeswitch_public_includes.tmp
index 09c6c8bb..5b32e710 100644
--- a/config/freeswitch/freeswitch_public_includes.tmp
+++ b/config/freeswitch/freeswitch_public_includes.tmp
@@ -113,18 +113,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), true, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
@@ -165,7 +155,7 @@ include("head.inc");
</strong></span></span>
</td>
<td align='right'>
- <input type='button' value='public.xml' alt='' onclick="document.location.href='/pkg_edit.php?xml=freeswitch_public.xml&id=0';">
+ <input type='button' value='public.xml' alt='' onclick="document.location.href='/packages/freeswitch/freeswitch_public.php';">
</td>
</tr>
<tr>
diff --git a/config/freeswitch/freeswitch_public_includes_details_edit.tmp b/config/freeswitch/freeswitch_public_includes_details_edit.tmp
index 2b5068cb..30d07f99 100644
--- a/config/freeswitch/freeswitch_public_includes_details_edit.tmp
+++ b/config/freeswitch/freeswitch_public_includes_details_edit.tmp
@@ -129,18 +129,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), true, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_public_includes_edit.tmp b/config/freeswitch/freeswitch_public_includes_edit.tmp
index d045290e..3e0644c3 100644
--- a/config/freeswitch/freeswitch_public_includes_edit.tmp
+++ b/config/freeswitch/freeswitch_public_includes_edit.tmp
@@ -182,18 +182,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), true, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_recordings.tmp b/config/freeswitch/freeswitch_recordings.tmp
index a5081993..15f3be5e 100644
--- a/config/freeswitch/freeswitch_recordings.tmp
+++ b/config/freeswitch/freeswitch_recordings.tmp
@@ -158,18 +158,8 @@ function EvalSound(soundobj) {
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), true, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_recordings_edit.tmp b/config/freeswitch/freeswitch_recordings_edit.tmp
index 4d7f565d..1e38d616 100644
--- a/config/freeswitch/freeswitch_recordings_edit.tmp
+++ b/config/freeswitch/freeswitch_recordings_edit.tmp
@@ -107,18 +107,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), true, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp
index 67107d3e..20e286ca 100644
--- a/config/freeswitch/freeswitch_status.tmp
+++ b/config/freeswitch/freeswitch_status.tmp
@@ -127,18 +127,8 @@ if ($savemsg) {
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), true, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_time_conditions.tmp b/config/freeswitch/freeswitch_time_conditions.tmp
index 69da11a0..17787ad3 100644
--- a/config/freeswitch/freeswitch_time_conditions.tmp
+++ b/config/freeswitch/freeswitch_time_conditions.tmp
@@ -62,18 +62,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_time_conditions_edit.tmp b/config/freeswitch/freeswitch_time_conditions_edit.tmp
index bd9bb261..45631929 100644
--- a/config/freeswitch/freeswitch_time_conditions_edit.tmp
+++ b/config/freeswitch/freeswitch_time_conditions_edit.tmp
@@ -114,18 +114,8 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<?php
-
- $tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=freeswitch.xml&amp;id=0");
- $tab_array[] = array(gettext("Dialplan"), false, "/packages/freeswitch/freeswitch_dialplan_includes.php");
- $tab_array[] = array(gettext("Extensions"), false, "/packages/freeswitch/freeswitch_extensions.php");
- $tab_array[] = array(gettext("Features"), false, "/packages/freeswitch/freeswitch_features.php");
- $tab_array[] = array(gettext("Gateways"), false, "/packages/freeswitch/freeswitch_gateways.php");
- $tab_array[] = array(gettext("Profiles"), false, "/packages/freeswitch/freeswitch_profiles.php");
- $tab_array[] = array(gettext("Public"), false, "/packages/freeswitch/freeswitch_public_includes.php");
- $tab_array[] = array(gettext("Status"), false, "/packages/freeswitch/freeswitch_status.php");
- $tab_array[] = array(gettext("Vars"), false, "/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0");
- display_top_tabs($tab_array);
+
+display_top_tabs(build_menu());
?>
</td></tr>
diff --git a/config/freeswitch/freeswitch_vars.tmp b/config/freeswitch/freeswitch_vars.tmp
new file mode 100644
index 00000000..00f2caca
--- /dev/null
+++ b/config/freeswitch/freeswitch_vars.tmp
@@ -0,0 +1,162 @@
+<?php
+/* $Id$ */
+/*
+ freeswitch_vars.php
+ Copyright (C) 2008 Mark J Crane
+ All rights reserved.
+
+ FreeSWITCH (TM)
+ http://www.freeswitch.org/
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+require("guiconfig.inc");
+require("/usr/local/pkg/freeswitch.inc");
+
+//$a_extensions = &$config['installedpackages']['freeswitchprofiles']['config'];
+
+if ($_GET['a'] == "default") {
+ conf_mount_rw();
+ exec("cp /usr/local/freeswitch/conf.orig/vars.xml /usr/local/freeswitch/conf/vars.xml");
+ $savemsg = "vars.xml: Set as Default";
+ conf_mount_ro();
+}
+
+if ($_POST['a'] == "save") {
+ conf_mount_rw();
+ $content = ereg_replace("\r","",$_POST['code']);
+ $fd = fopen("/usr/local/freeswitch/conf/vars.xml", "w");
+ fwrite($fd, $content);
+ fclose($fd);
+ $savemsg = "Saved text to the vars.xml";
+ conf_mount_ro();
+}
+
+
+$fd = fopen("/usr/local/freeswitch/conf/vars.xml", "r");
+$content = fread($fd, filesize("/usr/local/freeswitch/conf/vars.xml"));
+fclose($fd);
+
+include("head.inc");
+
+?>
+
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+
+<script language="Javascript">
+function sf() { document.forms[0].savetopath.focus(); }
+</script>
+<script language="Javascript" type="text/javascript" src="/edit_area/edit_area_full.js"></script>
+<script language="Javascript" type="text/javascript">
+ // initialisation
+ editAreaLoader.init({
+ id: "code" // id of the textarea to transform
+ ,start_highlight: false
+ ,allow_toggle: false
+ ,language: "en"
+ ,syntax: "html"
+ ,toolbar: "search, go_to_line,|, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
+ ,syntax_selection_allow: "css,html,js,php,xml,c,cpp,sql"
+ ,show_line_colors: true
+ });
+</script>
+
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">FreeSWITCH: Variables</p>
+
+<div id="mainlevel">
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabnavtbl">
+<?php
+
+display_top_tabs(build_menu());
+
+?>
+</td></tr>
+</table>
+
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="tabcont" >
+
+<form action="freeswitch_vars.php" method="post" name="iform" id="iform">
+<?php
+
+?>
+ <table width="98%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td width='90%'><p><span class="vexpl"><span class="red"><strong>Variables<br>
+ </strong></span>
+ Define preprocessor variables here. Can be accessed in the xml configation with $${var_name}.
+ </p>
+ </td>
+ <td width='10%' align='right' valign='middle'><input type="submit" value="save" /></td>
+ </tr>
+ </table>
+ <br />
+ <br />
+
+ <textarea style="width:98%" id="code" name="code" rows="30" cols="<?php echo $cols; ?>" name="content"><?php echo htmlentities($content); ?></textarea>
+ <br />
+ <br />
+
+ <table width="98%" border="0" cellpadding="6" cellspacing="0">
+ <tr>
+ <td>/usr/local/freeswitch/conf/vars.xml</td>
+ <td align='right'>
+ <input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
+ <input type="hidden" name="a" value="save" />
+ <?php
+ echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_vars.php?a=default&f=vars.xml';\" />";
+ ?>
+ </td>
+ </tr>
+ </table>
+
+</form>
+
+<br>
+<br>
+
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+
+</td>
+</tr>
+</table>
+
+</div>
+
+
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/freeswitch/freeswitch_vars.xml b/config/freeswitch/freeswitch_vars.xml
deleted file mode 100644
index da90b3bc..00000000
--- a/config/freeswitch/freeswitch_vars.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
-
- freeswitch_vars.xml
- Copyright (C) 2008 Mark J Crane
- All rights reserved.
-
- FreeSWITCH (TM)
- http://www.freeswitch.org/
-
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-*/
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>FreeSWITCH is an open source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>freeswitchvars</name>
- <version>0.1</version>
- <title>FreeSWITCH: Vars</title>
- <aftersaveredirect>pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/freeswitch.inc</include_file>
- <tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=freeswitch.xml&amp;id=0</url>
- </tab>
- <tab>
- <text>Dialplan</text>
- <url>/packages/freeswitch/freeswitch_dialplan_includes.php</url>
- </tab>
- <tab>
- <text>Extensions</text>
- <url>/packages/freeswitch/freeswitch_extensions.php</url>
- </tab>
- <tab>
- <text>Features</text>
- <url>/packages/freeswitch/freeswitch_features.php</url>
- </tab>
- <tab>
- <text>Gateways</text>
- <url>/packages/freeswitch/freeswitch_gateways.php</url>
- </tab>
- <tab>
- <text>Profiles</text>
- <url>/packages/freeswitch/freeswitch_profiles.php</url>
- </tab>
- <tab>
- <text>Public</text>
- <url>/packages/freeswitch/freeswitch_public_includes.php</url>
- </tab>
- <tab>
- <text>Status</text>
- <url>/packages/freeswitch/freeswitch_status.php</url>
- </tab>
- <tab>
- <text>Vars</text>
- <url>/pkg_edit.php?xml=freeswitch_vars.xml&amp;id=0</url>
- <active/>
- </tab>
- </tabs>
- <configpath>installedpackages->package->$packagename->configuration->freeswitchvars</configpath>
- <fields>
- <field>
- <fielddescr>&lt;b&gt;Vars&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;Define preprocessor variables here. Can be accessed in the xml configation with $${var_name}.</fielddescr>
- <fieldname>vars_xml</fieldname>
- <description>&lt;br /&gt;Path: /usr/local/freeswitch/conf/vars.xml &lt;br /&gt;&lt;br /&gt;</description>
- <type>textarea</type>
- <encoding>base64</encoding>
- <wrap>off</wrap>
- <size>30</size>
- <cols>70</cols>
- <rows>33</rows>
- </field>
- </fields>
- <custom_php_command_before_form>
- </custom_php_command_before_form>
- <custom_php_after_head_command>
- sync_package_freeswitch_vars();
- </custom_php_after_head_command>
- <custom_php_after_form_command>
- </custom_php_after_form_command>
- <custom_php_validation_command>
- </custom_php_validation_command>
- <custom_php_resync_config_command>
- sync_package_freeswitch_vars();
- </custom_php_resync_config_command>
-</packagegui> \ No newline at end of file