aboutsummaryrefslogtreecommitdiffstats
path: root/packages/freeswitch
diff options
context:
space:
mode:
authorMark Crane <mcrane@pfsense.org>2008-11-01 05:58:10 +0000
committerMark Crane <mcrane@pfsense.org>2008-11-01 05:58:10 +0000
commit2716f5c5716977c220668d919d63c4b57583791c (patch)
tree851ef4072f7d1b24fdbb0a455c9c4cd72175a840 /packages/freeswitch
parent6a4e12ded87b91841f6e6dc8766d5883d3b6c1f1 (diff)
downloadpfsense-packages-2716f5c5716977c220668d919d63c4b57583791c.tar.gz
pfsense-packages-2716f5c5716977c220668d919d63c4b57583791c.tar.bz2
pfsense-packages-2716f5c5716977c220668d919d63c4b57583791c.zip
FreeSWITCH package option to disable gateways
Diffstat (limited to 'packages/freeswitch')
-rw-r--r--packages/freeswitch/freeswitch.inc108
-rw-r--r--packages/freeswitch/freeswitch_gateways.xml11
2 files changed, 65 insertions, 54 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>