aboutsummaryrefslogtreecommitdiffstats
path: root/packages/siproxd.xml
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-01-14 23:26:27 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-01-14 23:26:27 +0000
commitc72205192bf0bbcbcd027d45422a91dba838c254 (patch)
tree759af194fa6d34e87abcae3035b9824b667083ca /packages/siproxd.xml
parentfffa703d3196322062754f0dd6886e97eae9e405 (diff)
downloadpfsense-packages-c72205192bf0bbcbcd027d45422a91dba838c254.tar.gz
pfsense-packages-c72205192bf0bbcbcd027d45422a91dba838c254.tar.bz2
pfsense-packages-c72205192bf0bbcbcd027d45422a91dba838c254.zip
Seperate out php functions into sipproxd.inc.
Cleanup this file while here.
Diffstat (limited to 'packages/siproxd.xml')
-rw-r--r--packages/siproxd.xml93
1 files changed, 14 insertions, 79 deletions
diff --git a/packages/siproxd.xml b/packages/siproxd.xml
index 1333963a..42e93b9f 100644
--- a/packages/siproxd.xml
+++ b/packages/siproxd.xml
@@ -42,8 +42,9 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>siproxd</name>
- <version>0.5.13_pfs1</version>
+ <version>0.5.13_pfs2</version>
<title>siproxd: Settings</title>
+ <include_file>/usr/local/pkg/sipproxd.inc</include_file>
<aftersaveredirect>pkg_edit.php?xml=siproxd.xml&amp;id=0</aftersaveredirect>
<menu>
<name>siproxd</name>
@@ -53,21 +54,21 @@
<url>/pkg_edit.php?xml=siproxd.xml&amp;id=0</url>
</menu>
<service>
- <name>siproxd</name>
- <rcfile>siproxd.sh</rcfile>
- <executable>siproxd</executable>
- </service>
+ <name>siproxd</name>
+ <rcfile>siproxd.sh</rcfile>
+ <executable>siproxd</executable>
+ </service>
<tabs>
- <tab>
- <text>Settings</text>
- <url>/pkg_edit.php?xml=siproxd.xml&amp;id=0</url>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=siproxd.xml&amp;id=0</url>
<active/>
- </tab>
+ </tab>
<tab>
<text>Users</text>
<url>/pkg.php?xml=siproxdusers.xml</url>
</tab>
- </tabs>
+ </tabs>
<configpath>installedpackages->package->$packagename->configuration->settings</configpath>
<additional_files_needed>
<prefix>/usr/local/pkg/</prefix>
@@ -158,77 +159,11 @@
</field>
</fields>
<custom_php_global_functions>
- function sync_package_siproxd() {
- conf_mount_rw();
- config_lock();
- global $config;
- $conf =&amp; $config['installedpackages']['siproxd']['config'][0];
- $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'] != "") {
- 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\n");
- } else {
- fwrite($fout, "if_outbound = " . convert_friendly_interface_to_real_interface_name($_POST['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);
- write_rcfile(array(
- "file" => "siproxd.sh",
- "start" => "/usr/local/sbin/siproxd",
- "stop" => "/usr/bin/killall siproxd"
- )
- );
- restart_service("siproxd");
- conf_mount_ro();
- config_unlock();
- }
</custom_php_global_functions>
<custom_add_php_command>
- sync_package_siproxd();
+ sync_package_siproxd();
</custom_add_php_command>
<custom_php_resync_config_command>
- sync_package_siproxd();
+ sync_package_siproxd();
</custom_php_resync_config_command>
-</packagegui>
-
+</packagegui> \ No newline at end of file