From d9f07bd4d5b9c5d69176d7badb07c8310ed38ddf Mon Sep 17 00:00:00 2001 From: mcrane Date: Sat, 4 Jul 2009 04:24:59 -0600 Subject: FreeSWITCH package add ping parameter to advanced gateway options helps keep connections alive behind NAT, fix warning message when a gateway is disabled and later deleted, add effective_caller_id_name, effective_caller_id_number, outbound_caller_id_name, outbound_caller_id_number to the gateway --- config/freeswitch/freeswitch.inc | 9 ++- config/freeswitch/freeswitch.xml | 2 +- config/freeswitch/freeswitch_gateways.tmp | 7 ++- config/freeswitch/freeswitch_gateways_edit.tmp | 77 ++++++++++++++++++++++---- 4 files changed, 77 insertions(+), 18 deletions(-) (limited to 'config/freeswitch') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index fcba145e..9e4f0627 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -704,14 +704,17 @@ function sync_package_freeswitch_gateways() if (strlen($rowhelper['extension']) > 0) { $tmpxml .= " \n"; } + if (strlen($rowhelper['ping']) > 0) { + $tmpxml .= " \n"; + } if (strlen($rowhelper['context']) > 0) { $tmpxml .= " \n"; } if (strlen($rowhelper['caller-id-in-from']) > 0) { - $tmpxml .= " \n"; + $tmpxml .= " \n"; } if (strlen($rowhelper['supress-cng']) > 0) { - $tmpxml .= " \n"; + $tmpxml .= " \n"; } $tmpxml .= " \n"; @@ -2641,7 +2644,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.9.3.1"; + $freeswitch_package_version = "0.9.4"; $freeswitch_build_version = "1.0.4 pre 8"; $freeswitch_build_revision = "13784"; diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index 393f8620..2d58fd83 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.9.3.1 + 0.9.4 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc diff --git a/config/freeswitch/freeswitch_gateways.tmp b/config/freeswitch/freeswitch_gateways.tmp index 279be301..16d933fd 100644 --- a/config/freeswitch/freeswitch_gateways.tmp +++ b/config/freeswitch/freeswitch_gateways.tmp @@ -38,8 +38,11 @@ $a_gateways = &$config['installedpackages']['freeswitchgateways']['config']; if ($_GET['act'] == "del") { if ($_GET['type'] == 'gateways') { - if ($a_gateways[$_GET['id']]) { - unlink("/usr/local/freeswitch/conf/sip_profiles/external/".$_GET['gateway'].".xml"); + if ($a_gateways[$_GET['id']]) { + $tmp_file_name = "/usr/local/freeswitch/conf/sip_profiles/external/".$_GET['gateway'].".xml"; + if (file_exists($tmp_file_name)) { + unlink($tmp_file_name); + } unset($a_gateways[$_GET['id']]); write_config(); header("Location: freeswitch_gateways.php"); diff --git a/config/freeswitch/freeswitch_gateways_edit.tmp b/config/freeswitch/freeswitch_gateways_edit.tmp index 1fef05f3..73792c1a 100644 --- a/config/freeswitch/freeswitch_gateways_edit.tmp +++ b/config/freeswitch/freeswitch_gateways_edit.tmp @@ -45,22 +45,29 @@ if (isset($_POST['id'])) { if (isset($id) && $a_gateways[$id]) { $pconfig['gatewayid'] = $a_gateways[$id]['gatewayid']; - $gatewayid = $a_gateways[$id]['gatewayid']; + $gatewayid = $a_gateways[$id]['gatewayid']; $pconfig['gateway'] = $a_gateways[$id]['gateway']; $pconfig['username'] = $a_gateways[$id]['username']; $pconfig['password'] = $a_gateways[$id]['password']; - $pconfig['realm'] = $a_gateways[$id]['realm']; + $pconfig['realm'] = $a_gateways[$id]['realm']; $pconfig['from-user'] = $a_gateways[$id]['from-user']; - $pconfig['from-domain'] = $a_gateways[$id]['from-domain']; + $pconfig['from-domain'] = $a_gateways[$id]['from-domain']; $pconfig['proxy'] = $a_gateways[$id]['proxy']; $pconfig['expire-seconds'] = $a_gateways[$id]['expire-seconds']; $pconfig['register'] = $a_gateways[$id]['register']; $pconfig['register-transport'] = $a_gateways[$id]['register-transport']; $pconfig['retry-seconds'] = $a_gateways[$id]['retry-seconds']; $pconfig['extension'] = $a_gateways[$id]['extension']; - $pconfig['context'] = $a_gateways[$id]['context']; + $pconfig['ping'] = $a_gateways[$id]['ping']; $pconfig['caller-id-in-from'] = $a_gateways[$id]['caller-id-in-from']; $pconfig['supress-cng'] = $a_gateways[$id]['supress-cng']; + + $pconfig['effective_caller_id_name'] = $a_gateways[$id]['effective_caller_id_name']; + $pconfig['effective_caller_id_number'] = $a_gateways[$id]['effective_caller_id_number']; + $pconfig['outbound_caller_id_name'] = $a_gateways[$id]['outbound_caller_id_name']; + $pconfig['outbound_caller_id_number'] = $a_gateways[$id]['outbound_caller_id_number']; + + $pconfig['context'] = $a_gateways[$id]['context']; $pconfig['enabled'] = $a_gateways[$id]['enabled']; $pconfig['description'] = $a_gateways[$id]['description']; } @@ -70,16 +77,21 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; - if (!$input_errors) { + $effective_caller_id_number = $_POST['effective_caller_id_number']; + $outbound_caller_id_number = $_POST['outbound_caller_id_number']; + $replace_array = array("(", ")", " ", "-"); + $effective_caller_id_number = str_replace($replace_array, "", $effective_caller_id_number); + $outbound_caller_id_number = str_replace($replace_array, "", $outbound_caller_id_number); + $ent = array(); if (strlen($_POST['ivrid']) > 0) { $ent['gatewayid'] = $_POST['ivrid']; } else { - $ent['gatewayid'] = guid(); - } + $ent['gatewayid'] = guid(); + } $ent['gateway'] = $_POST['gateway']; $ent['username'] = $_POST['username']; $ent['password'] = $_POST['password']; @@ -92,13 +104,19 @@ if ($_POST) { $ent['register-transport'] = $_POST['register-transport']; $ent['retry-seconds'] = $_POST['retry-seconds']; $ent['extension'] = $_POST['extension']; - $ent['context'] = $_POST['context']; + $ent['ping'] = $_POST['ping']; $ent['caller-id-in-from'] = $_POST['caller-id-in-from']; $ent['supress-cng'] = $_POST['supress-cng']; + + $ent['effective_caller_id_name'] = $_POST['effective_caller_id_name']; + $ent['effective_caller_id_number'] = $effective_caller_id_number; + $ent['outbound_caller_id_name'] = $_POST['outbound_caller_id_name']; + $ent['outbound_caller_id_number'] = $outbound_caller_id_number; + + $ent['context'] = $_POST['context']; $ent['enabled'] = $_POST['enabled']; $ent['description'] = $_POST['description']; - if (isset($id) && $a_gateways[$id]) { //update $a_gateways[$id] = $ent; @@ -107,9 +125,8 @@ if ($_POST) { //add $a_gateways[] = $ent; } - - + if (strlen(trim($_POST['dialplan_expression']))> 0) { $gatewayid = $_POST['gatewayid']; @@ -389,6 +406,35 @@ display_top_tabs(build_menu()); + + Effective Caller ID Name + + +
Enter the effective caller ID name here.
+ + + + Effective Caller ID Number + + +
Enter the effective caller ID number here.
+ + + + Outbound Caller ID Name + + +
Enter the outbound caller ID name here.
+ + + + Outbound Caller ID Number + + +
Enter the outbound caller ID number here.
+ + + Context @@ -439,7 +485,7 @@ display_top_tabs(build_menu()); ?> Choose whether to register-transport. - + Extension @@ -447,6 +493,13 @@ display_top_tabs(build_menu());
Enter the extension here.
+ + Ping + + +
Enter the ping interval here in seconds.
+ + Caller-id-in-from -- cgit v1.2.3