From 0e432ea1d03bc9e0093498d887a03ac89f3e6baa Mon Sep 17 00:00:00 2001 From: mcrane Date: Thu, 14 May 2009 23:47:20 -0600 Subject: FreeSWITCH package make sure xml config file are deleted when they are deleted in the GUI --- config/freeswitch/freeswitch.inc | 2 +- config/freeswitch/freeswitch.xml | 2 +- .../freeswitch_dialplan_includes_edit.tmp | 2 +- config/freeswitch/freeswitch_extensions.tmp | 5 +-- config/freeswitch/freeswitch_gateways.tmp | 5 +-- config/freeswitch/freeswitch_gateways_edit.tmp | 36 +++++++++---------- config/freeswitch/freeswitch_ivr.tmp | 42 +++++----------------- config/freeswitch/freeswitch_ivr_edit.tmp | 1 - config/freeswitch/freeswitch_public_includes.tmp | 4 +-- 9 files changed, 37 insertions(+), 62 deletions(-) (limited to 'config/freeswitch') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index c030f034..4e0ab1ab 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1828,7 +1828,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.7.4"; + $freeswitch_package_version = "0.8.7.5"; $freeswitch_build_version = "1.0.4 pre 6"; $freeswitch_build_revision = "13238"; diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index f3861ed5..a8e57203 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.4 + 0.8.7.5 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc diff --git a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp index 11ca828b..1901608f 100644 --- a/config/freeswitch/freeswitch_dialplan_includes_edit.tmp +++ b/config/freeswitch/freeswitch_dialplan_includes_edit.tmp @@ -252,7 +252,7 @@ display_top_tabs(build_menu()); \n"; - echo " \n"; + //echo " \n"; if (strlen(htmlspecialchars($pconfig['order']))> 0) { echo " \n"; } diff --git a/config/freeswitch/freeswitch_extensions.tmp b/config/freeswitch/freeswitch_extensions.tmp index eea7699e..8ef415fd 100644 --- a/config/freeswitch/freeswitch_extensions.tmp +++ b/config/freeswitch/freeswitch_extensions.tmp @@ -38,7 +38,8 @@ $a_extensions = &$config['installedpackages']['freeswitchextensions']['confi if ($_GET['act'] == "del") { if ($_GET['type'] == 'extensions') { - if ($a_extensions[$_GET['id']]) { + if ($a_extensions[$_GET['id']]) { + unlink("/usr/local/freeswitch/conf/directory/default/".$_GET['extension'].".xml"); unset($a_extensions[$_GET['id']]); write_config(); header("Location: freeswitch_extensions.php"); @@ -160,7 +161,7 @@ if ($config_change == 1) { - +
diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp index 66b30bda..279be301 100644 --- a/config/freeswitch/freeswitch_gateways.tmp +++ b/config/freeswitch/freeswitch_gateways.tmp @@ -38,7 +38,8 @@ $a_gateways = &$config['installedpackages']['freeswitchgateways']['config']; if ($_GET['act'] == "del") { if ($_GET['type'] == 'gateways') { - if ($a_gateways[$_GET['id']]) { + if ($a_gateways[$_GET['id']]) { + unlink("/usr/local/freeswitch/conf/sip_profiles/external/".$_GET['gateway'].".xml"); unset($a_gateways[$_GET['id']]); write_config(); header("Location: freeswitch_gateways.php"); @@ -154,7 +155,7 @@ if ($config_change == 1) { - +
diff --git a/config/freeswitch/freeswitch_gateways_edit.tmp b/config/freeswitch/freeswitch_gateways_edit.tmp index 28c0a74a..ea2b7efe 100644 --- a/config/freeswitch/freeswitch_gateways_edit.tmp +++ b/config/freeswitch/freeswitch_gateways_edit.tmp @@ -197,36 +197,36 @@ if ($_POST) { $dialplanincludeid = guid(); $ent['dialplanincludeid'] = $dialplanincludeid; - $ent['extensionname'] = $gateway.".".$abbrv; - $ent['order'] = '9002'; //if update use the existing order number and extension name and desc - $ent['context'] = $context; - $ent['enabled'] = 'true'; - $ent['descr'] = $label.' '.$gateway; - $ent['opt1name'] = 'gatewayid'; - $ent['opt1value'] = $gatewayid; - $a_dialplan_includes[] = $ent; - unset($ent); + $ent['extensionname'] = $gateway.".".$abbrv; + $ent['order'] = '9002'; //if update use the existing order number and extension name and desc + $ent['context'] = $context; + $ent['enabled'] = 'true'; + $ent['descr'] = $label.' '.$gateway; + $ent['opt1name'] = 'gatewayid'; + $ent['opt1value'] = $gatewayid; + $a_dialplan_includes[] = $ent; + unset($ent); $ent = array(); $ent['dialplanincludeid'] = $dialplanincludeid; $ent['tag'] = 'condition'; //condition, action, antiaction $ent['fieldtype'] = 'destination_number'; $ent['fielddata'] = $dialplan_expression; - $a_dialplan_include_details[] = $ent; - unset($ent); + $a_dialplan_include_details[] = $ent; + unset($ent); $ent = array(); $ent['dialplanincludeid'] = $dialplanincludeid; $ent['tag'] = 'action'; //condition, action, antiaction $ent['fieldtype'] = 'bridge'; $ent['fielddata'] = $action_data; - $a_dialplan_include_details[] = $ent; - unset($ent); - - unset($label); - unset($abbrv); - unset($dialplan_expression); - unset($action_data); + $a_dialplan_include_details[] = $ent; + unset($ent); + + unset($label); + unset($abbrv); + unset($dialplan_expression); + unset($action_data); } //if strlen } //end for each } diff --git a/config/freeswitch/freeswitch_ivr.tmp b/config/freeswitch/freeswitch_ivr.tmp index 38309ab5..67084f07 100644 --- a/config/freeswitch/freeswitch_ivr.tmp +++ b/config/freeswitch/freeswitch_ivr.tmp @@ -40,6 +40,7 @@ $a_ivr = &$config['installedpackages']['freeswitchivr']['config']; if ($_GET['act'] == "del") { if ($_GET['type'] == 'ivr') { if ($a_ivr[$_GET['id']]) { + unlink("/usr/local/freeswitch/scripts/ivr_".$_GET['ivrid'].".js"); unset($a_ivr[$_GET['id']]); write_config(); sync_package_freeswitch_ivr(); @@ -73,37 +74,7 @@ display_top_tabs(build_menu());
-"; -//print_r ($a_ivr); -//echo ""; - -//build a list of recordings from the config.xml -//$config_recording_list = ''; -//$i = 0; -//if (count($a_ivr) > 0) { -// foreach ($a_ivr as $ivrent) { -// $config_recording_list .= $ivrent['filename']."|"; -// $i++; -// } -//} -//echo "config recording list: ".$config_recording_list."
\n"; - - -//if ($config_change == 1) { -// write_config(); -// $config_change = 0; -//} -//if ($savemsg) print_info_box($savemsg); -//if (file_exists($d_hostsdirty_path)): echo"

"; -//print_info_box_np("The FreeSWITCH recordings have been changed.
You must apply the changes in order for them to take effect."); -//echo"
"; -//endif; - -?>

IVR
@@ -130,20 +101,23 @@ display_top_tabs(build_menu());

- + - 0) { foreach ($a_ivr as $ent) { if (strlen($ent['ivrid']) > 0) { + + $ivrid = str_replace(array("{", "}"), "", $ent['ivrid']); + ?> -   +      @@ -152,7 +126,7 @@ display_top_tabs(build_menu()); - +
diff --git a/config/freeswitch/freeswitch_ivr_edit.tmp b/config/freeswitch/freeswitch_ivr_edit.tmp index 679f090e..603e4af5 100644 --- a/config/freeswitch/freeswitch_ivr_edit.tmp +++ b/config/freeswitch/freeswitch_ivr_edit.tmp @@ -149,7 +149,6 @@ if ($_POST) { unset($a_ivr_options[$_GET['optionid']]); write_config(); sync_package_freeswitch_ivr(); - //touch($d_hostsdirty_path); header("Location: freeswitch_ivr_edit.php?id=".$_GET['id']); exit; } diff --git a/config/freeswitch/freeswitch_public_includes.tmp b/config/freeswitch/freeswitch_public_includes.tmp index 5b32e710..51a535d4 100644 --- a/config/freeswitch/freeswitch_public_includes.tmp +++ b/config/freeswitch/freeswitch_public_includes.tmp @@ -87,8 +87,8 @@ if ($_GET['act'] == "del") { } //if the public include xml file exists then delete it - if (file_exists("/usr/local/freeswitch/conf/public/default/".$publicincludefilename)) { - unlink("/usr/local/freeswitch/conf/public/default/".$publicincludefilename); + if (file_exists("/usr/local/freeswitch/conf/dialplan/public/".$publicincludefilename)) { + unlink("/usr/local/freeswitch/conf/dialplan/public/".$publicincludefilename); } unset($publicincludefilename); -- cgit v1.2.3