From a36f2343c6ba49eaf4d4c9fe05e6752e6e15f197 Mon Sep 17 00:00:00 2001 From: mcrane Date: Wed, 13 May 2009 15:36:31 -0600 Subject: FreeSWITCH package change wording from Set to Default to Restore Default, adjustments to the LAN profile --- config/freeswitch/freeswitch.inc | 108 +++++++++++++------------- config/freeswitch/freeswitch.xml | 2 +- config/freeswitch/freeswitch_dialplan.tmp | 6 +- config/freeswitch/freeswitch_profile_edit.tmp | 2 +- config/freeswitch/freeswitch_profiles.tmp | 4 +- config/freeswitch/freeswitch_public.tmp | 6 +- config/freeswitch/freeswitch_vars.tmp | 6 +- pkg_config.7.xml | 2 +- 8 files changed, 68 insertions(+), 68 deletions(-) diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index 2ef39a8c..20c75803 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -253,6 +253,35 @@ function byte_convert( $bytes ) { return round($bytes/pow($convention,$e),2).' '.$s[$e]; } +function 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']; + if (strlen($lan_ip) > 0) { + exec("cp /usr/local/freeswitch/conf/sip_profiles/internal.xml /usr/local/freeswitch/conf/sip_profiles/lan.xml"); + + $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("", "", $contents); + $contents = str_replace("", "", $contents); + $contents = str_replace("", "", $contents); + $contents = str_replace("", "", $contents); + $contents = str_replace("", "", $contents); + fwrite($handle, $contents); + unset($contents); + fclose($handle); + unset($filename); + } + } + +} + function recording_js() { @@ -1772,39 +1801,10 @@ 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']; - if (strlen($lan_ip) > 0) { - exec("cp /usr/local/freeswitch/conf/sip_profiles/internal.xml /usr/local/freeswitch/conf/sip_profiles/lan.xml"); - - $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("", "", $contents); - $contents = str_replace("", "", $contents); - $contents = str_replace("", "", $contents); - $contents = str_replace("", "", $contents); - $contents = str_replace("", "", $contents); - fwrite($handle, $contents); - unset($contents); - fclose($handle); - unset($filename); - } - } - -} - function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.7.1"; + $freeswitch_package_version = "0.8.7.2"; $freeswitch_build_version = "1.0.4 pre 6"; $freeswitch_build_revision = "13238"; @@ -2401,41 +2401,40 @@ function freeswitch_php_install_command() } // if backup file exists restore it - $filename = 'freeswitch.bak.tgz'; - if (!is_dir('/root/backup/')) { + $filename = 'freeswitch.bak.tgz'; + if (!is_dir('/root/backup/')) { exec("rm -R /usr/local/freeswitch/conf/sip_profiles/"); exec("rm -R /usr/local/freeswitch/sounds/music/"); exec("mkdir /root/backup/"); } - //extract a specific directory to /usr/local/freeswitch - if (file_exists('/root/backup/'.$filename)) { - //echo "The file $filename exists"; + //extract a specific directory to /usr/local/freeswitch + if (file_exists('/root/backup/'.$filename)) { + //echo "The file $filename exists"; - //Recommended - system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/'); - system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/'); - system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/'); - system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/'); - system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/'); - system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/'); + //Recommended + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/'); + system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/'); 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/ssl/'); system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/sip_profiles/'); system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/vars.xml'); system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/dialplan/default.xml'); system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/dialplan/public.xml'); - //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/'); + //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", @@ -2449,13 +2448,15 @@ function freeswitch_php_install_command() unlink_if_exists("/usr/local/freeswitch/conf/directory/default/brian.xml"); unlink_if_exists("/usr/local/freeswitch/conf/directory/default/example.com.xml"); unlink_if_exists("/usr/local/freeswitch/conf/dialplan/default/99999_enum.xml"); - + write_rcfile(array( "file" => "freeswitch.sh", "start" => "/usr/local/freeswitch/bin/./freeswitch -nc", "stop" => "/usr/local/freeswitch/bin/./freeswitch -stop" ) ); + + lan_sip_profile(); sync_package_freeswitch(); $handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r"); @@ -2465,7 +2466,6 @@ function freeswitch_php_install_command() sync_package_freeswitch_ivr(); } - $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = $freeswitch_build_version." revision ".$freeswitch_build_revision."."; $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = $freeswitch_package_version; @@ -2518,7 +2518,7 @@ function freeswitch_deinstall_command() unlink_if_exists("/usr/local/www/packages/freeswitch/freeswitch_time_conditions_edit.php"); unlink_if_exists("/usr/local/www/packages/freeswitch/freeswitch_status.php"); unlink_if_exists("/usr/local/www/packages/freeswitch/slim.swf"); - + exec("rm -R /usr/local/freeswitch/"); exec("rm -R /usr/local/www/packages/freeswitch/"); unlink_if_exists("/usr/local/etc/rc.d/freeswitch.sh"); diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index bf4982a6..ff4b89eb 100644 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.7 + 0.8.7.2 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc diff --git a/config/freeswitch/freeswitch_dialplan.tmp b/config/freeswitch/freeswitch_dialplan.tmp index 7c33a28e..fcfb3192 100644 --- a/config/freeswitch/freeswitch_dialplan.tmp +++ b/config/freeswitch/freeswitch_dialplan.tmp @@ -38,7 +38,7 @@ require("/usr/local/pkg/freeswitch.inc"); 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"; + $savemsg = "Default Restored"; conf_mount_ro(); } @@ -48,7 +48,7 @@ if ($_POST['a'] == "save") { $fd = fopen("/usr/local/freeswitch/conf/dialplan/default.xml", "w"); fwrite($fd, $content); fclose($fd); - $savemsg = "Saved text to the dialplan default.xml"; + $savemsg = "Saved"; conf_mount_ro(); } @@ -130,7 +130,7 @@ display_top_tabs(build_menu()); "; + echo ""; ?> diff --git a/config/freeswitch/freeswitch_profile_edit.tmp b/config/freeswitch/freeswitch_profile_edit.tmp index a1faa4de..2466f115 100644 --- a/config/freeswitch/freeswitch_profile_edit.tmp +++ b/config/freeswitch/freeswitch_profile_edit.tmp @@ -110,7 +110,7 @@ display_top_tabs(build_menu()); "; + echo ""; ?> diff --git a/config/freeswitch/freeswitch_profiles.tmp b/config/freeswitch/freeswitch_profiles.tmp index 9bcbd48d..bcfcf021 100644 --- a/config/freeswitch/freeswitch_profiles.tmp +++ b/config/freeswitch/freeswitch_profiles.tmp @@ -63,7 +63,7 @@ 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"; + $savemsg = "Restore Default"; conf_mount_ro(); } @@ -73,7 +73,7 @@ if ($_POST['a'] == "save") { $fd = fopen("/usr/local/freeswitch/conf/sip_profiles/".$_POST['f'], "w"); fwrite($fd, $content); fclose($fd); - $savemsg = "Saved text to " . $_POST['f']; + $savemsg = "Saved"; conf_mount_ro(); } diff --git a/config/freeswitch/freeswitch_public.tmp b/config/freeswitch/freeswitch_public.tmp index 66b577f5..0c05fe47 100644 --- a/config/freeswitch/freeswitch_public.tmp +++ b/config/freeswitch/freeswitch_public.tmp @@ -38,7 +38,7 @@ require("/usr/local/pkg/freeswitch.inc"); 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"; + $savemsg = "Default Restored"; conf_mount_ro(); } @@ -48,7 +48,7 @@ if ($_POST['a'] == "save") { $fd = fopen("/usr/local/freeswitch/conf/dialplan/public.xml", "w"); fwrite($fd, $content); fclose($fd); - $savemsg = "Saved text to the dialplan public.xml"; + $savemsg = "Saved"; conf_mount_ro(); } @@ -129,7 +129,7 @@ display_top_tabs(build_menu()); "; + echo ""; ?> diff --git a/config/freeswitch/freeswitch_vars.tmp b/config/freeswitch/freeswitch_vars.tmp index 00f2caca..5e7a5744 100644 --- a/config/freeswitch/freeswitch_vars.tmp +++ b/config/freeswitch/freeswitch_vars.tmp @@ -38,7 +38,7 @@ require("/usr/local/pkg/freeswitch.inc"); 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"; + $savemsg = "Default Restored"; conf_mount_ro(); } @@ -48,7 +48,7 @@ if ($_POST['a'] == "save") { $fd = fopen("/usr/local/freeswitch/conf/vars.xml", "w"); fwrite($fd, $content); fclose($fd); - $savemsg = "Saved text to the vars.xml"; + $savemsg = "Saved"; conf_mount_ro(); } @@ -129,7 +129,7 @@ display_top_tabs(build_menu()); "; + echo ""; ?> diff --git a/pkg_config.7.xml b/pkg_config.7.xml index e88afcab..08e93a8d 100755 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -92,7 +92,7 @@ http://doc.pfsense.org/index.php/FreeSWITCH http://www.pfsense.com/packages/config/freeswitch/freeswitch.xml http://files.pfsense.org/packages/7/All/ - 0.8.7.1 + 0.8.7.2 Beta 1.2.1 markjcrane@gmail.com -- cgit v1.2.3