aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorRoss Williams <ross@ross-williams.net>2013-08-17 17:48:06 -0400
committerRoss Williams <ross@ross-williams.net>2013-08-17 18:08:21 -0400
commit06404172446e9cbb8cd9960c03bca75761064ef3 (patch)
tree09401e0884126af346adb902996ab1ffdfc8e6fe /config
parenta2072a21d04e8513300a8e7b7cef329ac657f52d (diff)
downloadpfsense-packages-06404172446e9cbb8cd9960c03bca75761064ef3.tar.gz
pfsense-packages-06404172446e9cbb8cd9960c03bca75761064ef3.tar.bz2
pfsense-packages-06404172446e9cbb8cd9960c03bca75761064ef3.zip
siproxd: separate enable/disable of RTP proxy from rest of daemon
Diffstat (limited to 'config')
-rw-r--r--config/siproxd.inc14
-rw-r--r--config/siproxd.xml10
2 files changed, 21 insertions, 3 deletions
diff --git a/config/siproxd.inc b/config/siproxd.inc
index c99514fc..1fb5f4b2 100644
--- a/config/siproxd.inc
+++ b/config/siproxd.inc
@@ -69,6 +69,12 @@ function siproxd_generate_rules($type) {
return;
}
+ /* proxy is turned off in package settings */
+ if($siproxd_conf['sipenable'] == "0") {
+ log_error("WARNING: siproxd proxy has not been enabled. Not installing rules.");
+ return "\n";
+ }
+
$ifaces = explode(",", $siproxd_conf['if_inbound']);
$ifaces = array_map('convert_friendly_interface_to_real_interface_name', $ifaces);
$rtplower = ($siproxd_conf['rtplower'] ? $siproxd_conf['rtplower'] : 7070);
@@ -120,6 +126,12 @@ function sync_package_siproxd() {
fwrite($fout, "# This file was automatically generated by the pfSense\n");
fwrite($fout, "# package management system.\n\n");
+ /* proxy is turned off in package settings */
+ if($siproxd_conf['sipenable'] == "0") {
+ fclose($fout);
+ return;
+ }
+
if($siproxd_conf['if_inbound'] != "") {
fwrite($fout, "if_inbound = " . convert_friendly_interface_to_real_interface_name($siproxd_conf['if_inbound']) . "\n");
}
@@ -150,7 +162,7 @@ function sync_package_siproxd() {
if($siproxd_conf['rtpenable'] != "") {
fwrite($fout, "rtp_proxy_enable = " . $siproxd_conf['rtpenable'] . "\n");
} else {
- fwrite($fout, "rtp_proxy_enable = 1\n");
+ fwrite($fout, "rtp_proxy_enable = 0\n");
}
if(($siproxd_conf['rtplower'] != "") && ($siproxd_conf['rtpupper'] != "")) {
diff --git a/config/siproxd.xml b/config/siproxd.xml
index 1176a423..15688ab6 100644
--- a/config/siproxd.xml
+++ b/config/siproxd.xml
@@ -84,6 +84,12 @@
</additional_files_needed>
<fields>
<field>
+ <fielddescr>Enable siproxd</fielddescr>
+ <fieldname>sipenable</fieldname>
+ <description>Enable or disable siproxd</description>
+ <type>checkbox</type>
+ </field>
+ <field>
<fielddescr>Inbound interface</fielddescr>
<fieldname>if_inbound</fieldname>
<description>Select the inbound interface.</description>
@@ -114,7 +120,7 @@
<field>
<fielddescr>Enable RTP proxy</fielddescr>
<fieldname>rtpenable</fieldname>
- <description>Enable or disable the RTP proxy. (default is enabled)</description>
+ <description>Enable or disable the RTP proxy. (default is disabled)</description>
<type>select</type>
<options>
<option>
@@ -335,4 +341,4 @@
<custom_php_validation_command>
validate_form_siproxd($_POST, &amp;$input_errors);
</custom_php_validation_command>
-</packagegui> \ No newline at end of file
+</packagegui>