From 2716f5c5716977c220668d919d63c4b57583791c Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 1 Nov 2008 05:58:10 +0000 Subject: FreeSWITCH package option to disable gateways --- packages/freeswitch/freeswitch.inc | 108 ++++++++++++++-------------- packages/freeswitch/freeswitch_gateways.xml | 11 ++- pkg_config.7.xml | 2 +- 3 files changed, 66 insertions(+), 55 deletions(-) diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc index e94362c9..cfbe2ab8 100644 --- a/packages/freeswitch/freeswitch.inc +++ b/packages/freeswitch/freeswitch.inc @@ -320,59 +320,63 @@ function sync_package_freeswitch_gateways() unlink_if_exists("/usr/local/freeswitch/conf/sip_profiles/external/*.xml"); foreach($config['installedpackages']['freeswitchgateways']['config'] as $rowhelper) { - $fout = fopen("/usr/local/freeswitch/conf/sip_profiles/external/".$rowhelper['gateway'].".xml","w"); - $tmpxml .= "\n"; - $tmpxml .= " \n"; - if (strlen($rowhelper['username']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['password']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['realm']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['from-user']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['from-domain']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['proxy']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['expire-seconds']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['register']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['register-transport']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['retry-seconds']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['extension']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['context']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['caller-id-in-from']) > 0) { - $tmpxml .= " \n"; - } - if (strlen($rowhelper['supress-cng']) > 0) { - $tmpxml .= " \n"; - } - - $tmpxml .= " \n"; - $tmpxml .= ""; - - fwrite($fout, $tmpxml); - unset($tmpxml); - fclose($fout); + if ($rowhelper['disabled'] != "on") { + $fout = fopen("/usr/local/freeswitch/conf/sip_profiles/external/".$rowhelper['gateway'].".xml","w"); + + $tmpxml .= "\n"; + $tmpxml .= " \n"; + if (strlen($rowhelper['username']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['password']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['realm']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['from-user']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['from-domain']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['proxy']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['expire-seconds']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['register']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['register-transport']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['retry-seconds']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['extension']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['context']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['caller-id-in-from']) > 0) { + $tmpxml .= " \n"; + } + if (strlen($rowhelper['supress-cng']) > 0) { + $tmpxml .= " \n"; + } + + $tmpxml .= " \n"; + $tmpxml .= ""; + + fwrite($fout, $tmpxml); + unset($tmpxml); + fclose($fout); + } + } conf_mount_ro(); diff --git a/packages/freeswitch/freeswitch_gateways.xml b/packages/freeswitch/freeswitch_gateways.xml index 4db6c3b5..e91c921c 100644 --- a/packages/freeswitch/freeswitch_gateways.xml +++ b/packages/freeswitch/freeswitch_gateways.xml @@ -52,7 +52,7 @@ Describe your package requirements here Currently there are no FAQ items provided. freeswitchgateways - 0.2 + 0.2.1 FreeSWITCH: Gateways /usr/local/pkg/freeswitch.inc @@ -266,7 +266,14 @@ false - + + + Disabled + disabled + Set this option to disable this gateway without removing it from the list. + checkbox + tmp + Gateway Description description diff --git a/pkg_config.7.xml b/pkg_config.7.xml index 54eeaa89..23100fb1 100644 --- a/pkg_config.7.xml +++ b/pkg_config.7.xml @@ -21,7 +21,7 @@ Services http://www.pfsense.com/packages/config/freeswitch/freeswitch.xml http://files.pfsense.org/packages/7/All/ - 0.2.2 + 0.2.3 Beta 1.2.1 markjcrane@gmail.com -- cgit v1.2.3