diff options
-rw-r--r-- | packages/siproxd.xml | 162 | ||||
-rw-r--r-- | packages/siproxdusers.xml | 68 | ||||
-rw-r--r-- | pkg_config.xml | 12 |
3 files changed, 242 insertions, 0 deletions
diff --git a/packages/siproxd.xml b/packages/siproxd.xml new file mode 100644 index 00000000..c14918bc --- /dev/null +++ b/packages/siproxd.xml @@ -0,0 +1,162 @@ +<packagegui> + <name>siproxd</name> + <title>siproxd: Settings</title> + <version>0.5.9</version> + <aftersaveredirect>pkg_edit.php?xml=freeradiussettings.xml&id=0</aftersaveredirect> + <tabs> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=freeradiussettings.xml&id=0</url> + <active/> + </tab> + <tab> + <text>Users</text> + <url>/pkg.php?xml=siproxdusers.xml</url> + </tab> + </tabs> + <additional_files_needed> + <item>http://www.pfsense.com/packages/config/siproxdusers.xml</item> + </additional_files_needed> + <configpath>installedpackages->package->$packagename->configuration->settings</configpath> + <fields> + <field> + <fielddescr>Inbound interface</fielddescr> + <fieldname>if_inbound</fieldname> + <description>Select the inbound interface.</description> + <type>interfaces_selection</type> + </field> + <field> + <fielddescr>Outbound interface</fielddescr> + <fieldname>if_outbound</fieldname> + <description>Select the outbound interface.</description> + <type>interfaces_selection</type> + </field> + <field> + <fielddescr>Listening port</fielddescr> + <fieldname>port</fieldname> + <description>Enter the port on which to listen for SIP traffic (default 5060). Do not change this unless you know what you're doing.</description> + <type>input</type> + </field> + <field> + <fielddescr>Enable RTP proxy</fielddescr> + <fieldname>rtpenable</fieldname> + <description>Enable or disable the RTP proxy. (default is enabled)</description> + <type>select</type> + <options> + <option> + <name>Enable</name> + <value>1</value> + </option> + <option> + <name>Disable</name> + <value>0</value> + </option> + </options> + </field> + <field> + <fielddescr>RTP port range</fielddescr> + <fieldname>rtplower</fieldname> + <description>Enter the bottom edge of the port range siproxd will allocate for incoming RTP traffic. This range must be one not blocked by the firewall (default 7070).</description> + <type>input</type> + </field> + <field> + <fieldname>rtpupper</fieldname> + <description>Enter the top edge of the port range siproxd will allocate for incoming RTP traffic. This range must be one not blocked by the firewall (default 7079).</description> + <type>input</type> + </field> + <field> + <fielddescr>RTP stream timeout</fielddescr> + <fieldname>rtptimeout</fieldname> + <description>After this number of seconds, an RTP stream is considered dead and proxying it will be stopped (default 300sec). + <type>input</type> + </field> + <field> + <fielddescr>Default expiration timeout</fielddescr> + <fieldname>defaulttimeout</fieldname> + <description>If a REGISTER request dose not contain an Expires header or expires= parameter, this number of seconds will be used and reported back to the UA in the answer.</description> + <type>input</type> + </field> + <field> + <fielddescr>Enable proxy authentication</fielddescr> + <fieldname>authentication</fieldname> + <description>If this is checked, clients will be forced to authenticate themselves at the proxy (for registration only).</description> + <type>checkbox</type> + </field> + <field> + <fielddescr>Outbound proxy hostname</fielddescr> + <fieldname>outboundproxyhost</fieldname> + <type>input</type> + </field> + <field> + <fielddescr>Outbound proxy port</fielddescr> + <fieldname>outboundproxyport</fieldname> + <description>Enter the hostname and port of an outbound proxy to send all traffic to. This is only useful if you have multiple masquerading firewalls to cross.</description> + </fields> + <custom_php_install_command> + mwexec("rm /usr/local/etc/rc.d/siproxd.sh"); + $fout = fopen("/usr/local/etc/rc.d/siproxd.sh","w"); + fwrite($fout, "#!/bin/sh\n\n/usr/local/sbin/siproxd\n"); + fclose($fout); + </custom_php_install_command> + <custom_add_php_command> + function sync_package() { + conf_mount_rw(); + config_lock(); + global $config; + $fout = fopen("/usr/local/etc/siproxd.conf","w"); + fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n"); + if($_POST['if_inbound'] != "") { + $if_inbound = find_interface_ip($_POST['if_inbound']); + fwrite($fout, "if_inbound = " . $if_inbound . "\n"); + } + if($_POST['if_outbound'] != "") { + $if_outbound = find_interface_ip($_POST['if_outbound']); + fwrite($fout, "if_outbound = " . $if_outbound . "\n\n"); + } + if($_POST['port'] != "") { + fwrite($fout, "sip_listen_port = " . $_POST['port'] . "\n\n"); + } else { + fwrite($fout, "sip_listen_port = 5060\n\n"); + } + fwrite($fout, "daemonize = 1\n\nsilence_log = 0\n\nlog_calls = 1\n\nuser = nobody\nchrootjail = /usr/local/siproxd/\n\nregistration_file = siproxd_registrations\n\npid_file = siproxd.pid\n\n"); + if($_POST['rtpenable'] != "") { + fwrite($fout, "rtp_proxy_enable = " . $_POST['rtpenable'] . "\n\n"); + } else { + fwrite($fout, "rtp_proxy_enable = 1\n\n"); + } + if($_POST['rtplower'] != "") { + if($_POST['rtpupper'] != "") { + fwrite($fout, "rtp_port_low = " . $_POST['rtplower'] . "\n"); + fwrite($fout, "rtp_port_high = " . $_POST['rtpupper'] . "\n\n"); + } + } + if($_POST['rtptimeout'] != "") { + fwrite($fout, "rtp_timeout = " . $_POST['rtptimeout'] . "\n\n"); + } else { + fwrite($fout, "rtp_timeout = 300\n\n"); + } + if($_POST['defaulttimeout'] != "") { + fwrite($fout, "default_expires = " . $_POST['defaulttimeout'] . "\n\n"); + } else { + fwrite($fout, "default_expires = 600\n\n"); + } + if($_POST['authentication']) { + fwrite($fout, "proxy_auth_realm = Authentication_Realm\nproxy_auth_pwfile = /usr/local/etc/siproxd_passwd.cfg\n\n"); + } + fwrite($fout, "debug_level = 0x00000000\n\n"); + if($_POST['outboundproxyhost'] != "") { + if($_POST['outboundproxyport'] != "") { + fwrite($fout, "outbound_proxy_host = " . $_POST['outboundproxyhost'] . "\n"); + fwrite($fout, "outbound_proxy_port = " . $_POST['outboundproxyport'] . "\n"); + } + } + fclose($fout); + mwexec("killall siproxd"); + mwexec("/usr/local/etc/rc.d/siproxd.sh"); + conf_mount_ro(); + config_unlock(); + } + sync_package(); + </custom_add_php_command> +</packagegui> + diff --git a/packages/siproxdusers.xml b/packages/siproxdusers.xml new file mode 100644 index 00000000..9209bf84 --- /dev/null +++ b/packages/siproxdusers.xml @@ -0,0 +1,68 @@ +<packagegui> + <name>siproxdusers</name> + <version>0.5.9</version> + <title>siproxd: Users</title> + <tabs> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=siproxd.xml&id=0</url> + </tab> + <tab> + <text>Users</text> + <url>/pkg.php?xml=siproxdusers.xml</url> + <active/> + </tab> + </tabs> + <configpath>installedpackages->package->$packagename->configuration->settings</configpath> + <adddeleteeditpagefields> + <columnitem> + <fielddescr>Username</fielddescr> + <fieldname>username</fieldname> + </columnitem> + <columnitem> + <fielddescr>Description</fielddescr> + <fieldname>description</fieldname> + </columnitem> + </adddeleteeditpagefields> + <fields> + <field> + <fielddescr>Username</fielddescr> + <fieldname>username</fieldname> + <description>Enter the username here</description> + <type>input</type> + </field> + <field> + <fielddescr>Password</fielddescr> + <fieldname>password</fieldname> + <description>Enter the password here</description> + <type>password</type> + </field> + <field> + <fielddescr>Username Description</fielddescr> + <fieldname>description</fieldname> + <description>Enter the description of the user here</description> + <type>input</type> + </field> + </fields> + <custom_add_php_command> + function sync_package() + { + 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"); + if($config['installedpackages']['siproxdusers']['config'] != "") { + foreach($config['installedpackages']['siproxdusers']['config'] as $rowhelper) { + fwrite($fout, $rowhelper['username'] . " " . $rowhelper['password'] . "\n"); + } + } + fclose($fout); + conf_mount_ro(); + config_unlock(); + system("/usr/bin/killall -HUP siproxd"); + } + sync_package(); + </custom_add_php_command> +</packagegui> + diff --git a/pkg_config.xml b/pkg_config.xml index 73608027..738a54bf 100644 --- a/pkg_config.xml +++ b/pkg_config.xml @@ -176,5 +176,17 @@ <status>BETA</status> <configurationfile>pfflowd.xml</configurationfile> </package> + <package> + <name>siproxd</name> + <website>http://siproxd.sourceforge.net/</website> + <descr>Siproxd is a proxy/masquerading daemon for the SIP protocol. It handles registrations of SIP clients on a private IP network and performs rewriting of the SIP message bodies to make SIP connections possible via a masquerading firewall. It allows SIP clients (like kphone, linphone) to work behind an IP masquerading firewall or router.</descr> + <category>Services</category> + <config_file>http://www.pfsense.com/packages/config/siproxd.xml</config_file> + <depends_on_package_base_url>http://www.pfsense.com/~colin/All/</depends_on_package_base_url> + <depends_on_package>siproxd-0.5.9.tbz</depends_on_package> + <version>0.5.9</version> + <status>ALPHA</status> + <configurationfile>siproxd.xml</configurationfile> + </package> </packages> </pfsensepkgs> |