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 ++- 2 files changed, 65 insertions(+), 54 deletions(-) (limited to 'packages/freeswitch') 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 -- cgit v1.2.3