diff options
author | Ermal <eri@pfsense.org> | 2010-03-23 15:46:26 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-03-23 15:46:26 +0000 |
commit | 901e3c1b93b1d8fe35f8b95ebff931f33dc86ec3 (patch) | |
tree | 7f58ec83fcc7b519218bbc39d665bcf2082c2d6e | |
parent | 399ca88cb617836fdbf08fd0288200ec74541c3f (diff) | |
download | pfsense-packages-901e3c1b93b1d8fe35f8b95ebff931f33dc86ec3.tar.gz pfsense-packages-901e3c1b93b1d8fe35f8b95ebff931f33dc86ec3.tar.bz2 pfsense-packages-901e3c1b93b1d8fe35f8b95ebff931f33dc86ec3.zip |
Point siproxd to the correct package url and fix whitespace while here. Reported-by: http://forum.pfsense.org/index.php/topic,23789.0.html
-rw-r--r-- | config/siproxd.inc | 184 | ||||
-rwxr-xr-x | pkg_config.8.xml | 4 |
2 files changed, 92 insertions, 96 deletions
diff --git a/config/siproxd.inc b/config/siproxd.inc index 50ca53d8..9fed8e10 100644 --- a/config/siproxd.inc +++ b/config/siproxd.inc @@ -32,7 +32,6 @@ if(!function_exists("filter_configure")) function sync_package_sipproxd_users() { conf_mount_rw(); - config_lock(); global $config; $fout = fopen("/usr/local/etc/siproxd_passwd.cfg","w"); fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n"); @@ -43,7 +42,6 @@ function sync_package_sipproxd_users() { } fclose($fout); conf_mount_ro(); - config_unlock(); system("/usr/bin/killall -HUP siproxd"); } @@ -81,8 +79,8 @@ function siproxd_generate_rules($type) { foreach ($ifaces as $iface) { if($iface <> "") { $rules .= "# allow SIP signaling and RTP traffic\n"; - $rules .= "pass in quick on {$iface} proto udp from any to any port = {$port}\n"; - $rules .= "pass in quick on {$iface} proto udp from any to any port {$rtplower}:{$rtpupper}\n"; + $rules .= "pass in on {$iface} proto udp from any to any port = {$port}\n"; + $rules .= "pass in on {$iface} proto udp from any to any port {$rtplower}:{$rtpupper}\n"; } } break; @@ -95,109 +93,107 @@ function siproxd_generate_rules($type) { } function sync_package_siproxd() { - global $config; + global $config; - conf_mount_rw(); - - unlink_if_exists("/usr/local/etc/rc.d/siproxd"); - - $conf = &$config['installedpackages']['siproxd']['config'][0]; - $fout = fopen("/usr/local/etc/siproxd.conf","w"); + conf_mount_rw(); + unlink_if_exists("/usr/local/etc/rc.d/siproxd"); + $conf = &$config['installedpackages']['siproxd']['config'][0]; + $fout = fopen("/usr/local/etc/siproxd.conf","w"); - fwrite($fout, "# This file was automatically generated by the pfSense\n"); - fwrite($fout, "# package management system.\n\n"); + 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($_POST['rtpenable'] == "0") { - fclose($fout); - return; - } + /* proxy is turned off in package settings */ + if($_POST['rtpenable'] == "0") { + fclose($fout); + return; + } - if($_POST['if_inbound'] != "") { - fwrite($fout, "if_inbound = " . convert_friendly_interface_to_real_interface_name($_POST['if_inbound']) . "\n"); - } + if($_POST['if_inbound'] != "") { + fwrite($fout, "if_inbound = " . convert_friendly_interface_to_real_interface_name($_POST['if_inbound']) . "\n"); + } - if($_POST['if_outbound'] != "") { - if($config['interfaces'][$_POST['if_outbound']]['ipaddr'] == "pppoe") { - fwrite($fout, "if_outbound = ng0\n"); + if($_POST['if_outbound'] != "") { + if($config['interfaces'][$_POST['if_outbound']]['ipaddr'] == "pppoe") { + fwrite($fout, "if_outbound = ng0\n"); } else { - fwrite($fout, "if_outbound = " . convert_friendly_interface_to_real_interface_name($_POST['if_outbound']) . "\n"); - } - } + fwrite($fout, "if_outbound = " . convert_friendly_interface_to_real_interface_name($_POST['if_outbound']) . "\n"); + } + } - if($_POST['port'] != "") { - fwrite($fout, "sip_listen_port = " . $_POST['port'] . "\n"); - } else { - fwrite($fout, "sip_listen_port = 5060\n"); - } - - fwrite($fout, "daemonize = 1\n"); - fwrite($fout, "silence_log = 0\n"); - fwrite($fout, "log_calls = 1\n"); - fwrite($fout, "user = nobody\n"); - fwrite($fout, "chrootjail = /usr/local/siproxd/\n"); - fwrite($fout, "registration_file = siproxd_registrations\n"); - fwrite($fout, "pid_file = siproxd.pid\n"); - - if($_POST['rtpenable'] != "") { - fwrite($fout, "rtp_proxy_enable = " . $_POST['rtpenable'] . "\n"); - } else { - fwrite($fout, "rtp_proxy_enable = 1\n"); - } - - if($_POST['rtplower'] != "") { - if($_POST['rtpupper'] != "") { - fwrite($fout, "rtp_port_low = " . $_POST['rtplower'] . "\n"); - fwrite($fout, "rtp_port_high = " . $_POST['rtpupper'] . "\n"); - } - } - - if($_POST['rtptimeout'] != "") { - fwrite($fout, "rtp_timeout = " . $_POST['rtptimeout'] . "\n"); - } else { - fwrite($fout, "rtp_timeout = 300\n"); - } - - if($_POST['defaulttimeout'] != "") { - fwrite($fout, "default_expires = " . $_POST['defaulttimeout'] . "\n"); - } else { - fwrite($fout, "default_expires = 600\n"); - } - - if($_POST['authentication']) { - fwrite($fout, "proxy_auth_realm = Authentication_Realm\n"); - fwrite($fout, "proxy_auth_pwfile = /usr/local/etc/siproxd_passwd.cfg\n"); - } - - fwrite($fout, "debug_level = 0x00000000\n"); - if($_POST['outboundproxyhost'] != "") { - if($_POST['outboundproxyport'] != "") { - fwrite($fout, "outbound_proxy_host = " . $_POST['outboundproxyhost'] . "\n"); - fwrite($fout, "outbound_proxy_port = " . $_POST['outboundproxyport'] . "\n"); - } - } + if($_POST['port'] != "") { + fwrite($fout, "sip_listen_port = " . $_POST['port'] . "\n"); + } else { + fwrite($fout, "sip_listen_port = 5060\n"); + } - if($_POST['expeditedforwarding'] != "") - fwrite($fout, "rtp_dscp = 46\n"); + fwrite($fout, "daemonize = 1\n"); + fwrite($fout, "silence_log = 0\n"); + fwrite($fout, "log_calls = 1\n"); + fwrite($fout, "user = nobody\n"); + fwrite($fout, "chrootjail = /usr/local/siproxd/\n"); + fwrite($fout, "registration_file = siproxd_registrations\n"); + fwrite($fout, "pid_file = siproxd.pid\n"); + + if($_POST['rtpenable'] != "") { + fwrite($fout, "rtp_proxy_enable = " . $_POST['rtpenable'] . "\n"); + } else { + fwrite($fout, "rtp_proxy_enable = 1\n"); + } + + if($_POST['rtplower'] != "") { + if($_POST['rtpupper'] != "") { + fwrite($fout, "rtp_port_low = " . $_POST['rtplower'] . "\n"); + fwrite($fout, "rtp_port_high = " . $_POST['rtpupper'] . "\n"); + } + } + + if($_POST['rtptimeout'] != "") { + fwrite($fout, "rtp_timeout = " . $_POST['rtptimeout'] . "\n"); + } else { + fwrite($fout, "rtp_timeout = 300\n"); + } + + if($_POST['defaulttimeout'] != "") { + fwrite($fout, "default_expires = " . $_POST['defaulttimeout'] . "\n"); + } else { + fwrite($fout, "default_expires = 600\n"); + } + + if($_POST['authentication']) { + fwrite($fout, "proxy_auth_realm = Authentication_Realm\n"); + fwrite($fout, "proxy_auth_pwfile = /usr/local/etc/siproxd_passwd.cfg\n"); + } + + fwrite($fout, "debug_level = 0x00000000\n"); + if($_POST['outboundproxyhost'] != "") { + if($_POST['outboundproxyport'] != "") { + fwrite($fout, "outbound_proxy_host = " . $_POST['outboundproxyhost'] . "\n"); + fwrite($fout, "outbound_proxy_port = " . $_POST['outboundproxyport'] . "\n"); + } + } + + if($_POST['expeditedforwarding'] != "") + fwrite($fout, "rtp_dscp = 46\n"); - fclose($fout); + fclose($fout); - write_rcfile(array( - "file" => "siproxd.sh", - "start" => "/usr/local/sbin/siproxd -c /usr/local/etc/siproxd.conf &", - "stop" => "/usr/bin/killall siproxd" - ) - ); + write_rcfile(array( + "file" => "siproxd.sh", + "start" => "/usr/local/sbin/siproxd -c /usr/local/etc/siproxd.conf &", + "stop" => "/usr/bin/killall siproxd" + ) + ); - exec("killall siproxd"); + exec("killall siproxd"); - sleep(1); - - start_service("siproxd"); + sleep(1); - filter_configure(); + start_service("siproxd"); - conf_mount_ro(); - } + filter_configure(); + + conf_mount_ro(); +} ?> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 997caefc..3756b1ee 100755 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -294,9 +294,9 @@ <category>Services</category> <config_file>http://www.pfsense.com/packages/config/siproxd.xml</config_file> <depends_on_package_base_url>http://files.pfsense.org/packages/80/All/</depends_on_package_base_url> - <depends_on_package>siproxd-0.7.0_1.tbz</depends_on_package> + <depends_on_package>siproxd-0.7.1_1.tbz</depends_on_package> <pkginfolink>http://doc.pfsense.org/index.php/Siproxd_package</pkginfolink> - <version>0.7.2</version> + <version>0.7.3</version> <status>Beta</status> <required_version>1.2.1</required_version> <configurationfile>siproxd.xml</configurationfile> |