diff options
author | Mark Crane <mcrane@pfsense.org> | 2008-11-01 05:58:10 +0000 |
---|---|---|
committer | Mark Crane <mcrane@pfsense.org> | 2008-11-01 05:58:10 +0000 |
commit | 2716f5c5716977c220668d919d63c4b57583791c (patch) | |
tree | 851ef4072f7d1b24fdbb0a455c9c4cd72175a840 | |
parent | 6a4e12ded87b91841f6e6dc8766d5883d3b6c1f1 (diff) | |
download | pfsense-packages-2716f5c5716977c220668d919d63c4b57583791c.tar.gz pfsense-packages-2716f5c5716977c220668d919d63c4b57583791c.tar.bz2 pfsense-packages-2716f5c5716977c220668d919d63c4b57583791c.zip |
FreeSWITCH package option to disable gateways
-rw-r--r-- | packages/freeswitch/freeswitch.inc | 108 | ||||
-rw-r--r-- | packages/freeswitch/freeswitch_gateways.xml | 11 | ||||
-rw-r--r-- | 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 .= "<include>\n"; - $tmpxml .= " <gateway name=\"" . $rowhelper['gateway'] . "\">\n"; - if (strlen($rowhelper['username']) > 0) { - $tmpxml .= " <param name=\"username\" value=\"" . $rowhelper['username'] . "\"/>\n"; - } - if (strlen($rowhelper['password']) > 0) { - $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n"; - } - if (strlen($rowhelper['realm']) > 0) { - $tmpxml .= " <param name=\"realm\" value=\"" . $rowhelper['realm'] . "\"/>\n"; - } - if (strlen($rowhelper['from-user']) > 0) { - $tmpxml .= " <param name=\"from-user\" value=\"" . $rowhelper['from-user'] . "\"/>\n"; - } - if (strlen($rowhelper['from-domain']) > 0) { - $tmpxml .= " <param name=\"from-domain\" value=\"" . $rowhelper['from-domain'] . "\"/>\n"; - } - if (strlen($rowhelper['proxy']) > 0) { - $tmpxml .= " <param name=\"proxy\" value=\"" . $rowhelper['proxy'] . "\"/>\n"; - } - if (strlen($rowhelper['expire-seconds']) > 0) { - $tmpxml .= " <param name=\"expire-seconds\" value=\"" . $rowhelper['expire-seconds'] . "\"/>\n"; - } - if (strlen($rowhelper['register']) > 0) { - $tmpxml .= " <param name=\"register\" value=\"" . $rowhelper['register'] . "\"/>\n"; - } - if (strlen($rowhelper['register-transport']) > 0) { - $tmpxml .= " <param name=\"register-transport\" value=\"" . $rowhelper['register-transport'] . "\"/>\n"; - } - if (strlen($rowhelper['retry-seconds']) > 0) { - $tmpxml .= " <param name=\"retry-seconds\" value=\"" . $rowhelper['retry-seconds'] . "\"/>\n"; - } - if (strlen($rowhelper['extension']) > 0) { - $tmpxml .= " <param name=\"extension\" value=\"" . $rowhelper['extension'] . "\"/>\n"; - } - if (strlen($rowhelper['context']) > 0) { - $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; - } - if (strlen($rowhelper['caller-id-in-from']) > 0) { - $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; - } - if (strlen($rowhelper['supress-cng']) > 0) { - $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; - } - - $tmpxml .= " </gateway>\n"; - $tmpxml .= "</include>"; - - 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 .= "<include>\n"; + $tmpxml .= " <gateway name=\"" . $rowhelper['gateway'] . "\">\n"; + if (strlen($rowhelper['username']) > 0) { + $tmpxml .= " <param name=\"username\" value=\"" . $rowhelper['username'] . "\"/>\n"; + } + if (strlen($rowhelper['password']) > 0) { + $tmpxml .= " <param name=\"password\" value=\"" . $rowhelper['password'] . "\"/>\n"; + } + if (strlen($rowhelper['realm']) > 0) { + $tmpxml .= " <param name=\"realm\" value=\"" . $rowhelper['realm'] . "\"/>\n"; + } + if (strlen($rowhelper['from-user']) > 0) { + $tmpxml .= " <param name=\"from-user\" value=\"" . $rowhelper['from-user'] . "\"/>\n"; + } + if (strlen($rowhelper['from-domain']) > 0) { + $tmpxml .= " <param name=\"from-domain\" value=\"" . $rowhelper['from-domain'] . "\"/>\n"; + } + if (strlen($rowhelper['proxy']) > 0) { + $tmpxml .= " <param name=\"proxy\" value=\"" . $rowhelper['proxy'] . "\"/>\n"; + } + if (strlen($rowhelper['expire-seconds']) > 0) { + $tmpxml .= " <param name=\"expire-seconds\" value=\"" . $rowhelper['expire-seconds'] . "\"/>\n"; + } + if (strlen($rowhelper['register']) > 0) { + $tmpxml .= " <param name=\"register\" value=\"" . $rowhelper['register'] . "\"/>\n"; + } + if (strlen($rowhelper['register-transport']) > 0) { + $tmpxml .= " <param name=\"register-transport\" value=\"" . $rowhelper['register-transport'] . "\"/>\n"; + } + if (strlen($rowhelper['retry-seconds']) > 0) { + $tmpxml .= " <param name=\"retry-seconds\" value=\"" . $rowhelper['retry-seconds'] . "\"/>\n"; + } + if (strlen($rowhelper['extension']) > 0) { + $tmpxml .= " <param name=\"extension\" value=\"" . $rowhelper['extension'] . "\"/>\n"; + } + if (strlen($rowhelper['context']) > 0) { + $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + } + if (strlen($rowhelper['caller-id-in-from']) > 0) { + $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + } + if (strlen($rowhelper['supress-cng']) > 0) { + $tmpxml .= " <param name=\"context\" value=\"" . $rowhelper['context'] . "\"/>\n"; + } + + $tmpxml .= " </gateway>\n"; + $tmpxml .= "</include>"; + + 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 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>freeswitchgateways</name> - <version>0.2</version> + <version>0.2.1</version> <title>FreeSWITCH: Gateways</title> <include_file>/usr/local/pkg/freeswitch.inc</include_file> <tabs> @@ -266,7 +266,14 @@ <value>false</value> </option> </options> - </field> + </field> + <field> + <fielddescr>Disabled</fielddescr> + <fieldname>disabled</fieldname> + <description>Set this option to disable this gateway without removing it from the list.</description> + <type>checkbox</type> + <value>tmp</value> + </field> <field> <fielddescr>Gateway Description</fielddescr> <fieldname>description</fieldname> 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 @@ <category>Services</category> <config_file>http://www.pfsense.com/packages/config/freeswitch/freeswitch.xml</config_file> <depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url> - <version>0.2.2</version> + <version>0.2.3</version> <status>Beta</status> <required_version>1.2.1</required_version> <maintainer>markjcrane@gmail.com</maintainer> |