diff options
author | mcrane <mctch@yahoo.com> | 2009-05-13 14:20:14 -0600 |
---|---|---|
committer | mcrane <mctch@yahoo.com> | 2009-05-13 14:20:14 -0600 |
commit | cddd115318c9277375a7ad472ff88528470831fd (patch) | |
tree | 588005ad4dbc17a6ea6e29287977b03247229f7e /config/freeswitch/freeswitch.inc | |
parent | dd9fec53a4df9ea6fbc4c7b56165c330011a2584 (diff) | |
download | pfsense-packages-cddd115318c9277375a7ad472ff88528470831fd.tar.gz pfsense-packages-cddd115318c9277375a7ad472ff88528470831fd.tar.bz2 pfsense-packages-cddd115318c9277375a7ad472ff88528470831fd.zip |
FreeSWITCH package copy internal profile to lan profile, status add more lines to log view and option for toggle editor
Diffstat (limited to 'config/freeswitch/freeswitch.inc')
-rw-r--r-- | config/freeswitch/freeswitch.inc | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index fd962df9..2ef39a8c 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1778,30 +1778,33 @@ function create_lan_sip_profile() //create the LAN profile if it doesn't exist if (!file_exists('/usr/local/freeswitch/conf/sip_profiles/lan.xml')) { $lan_ip = $config['interfaces']['lan']['ipaddr']; - - $filename = "/usr/local/freeswitch/conf/sip_profiles/lan.xml"; - $handle = fopen($filename,"rb"); - $contents = fread($handle, filesize($filename)); - fclose($handle); - - $handle = fopen($filename,"w"); - $contents = str_replace("<profile name=\"internal\">", "<profile name=\"lan\">", $contents); - $contents = str_replace("<alias name=\"default\"/>", "", $contents); - $contents = str_replace("<X-PRE-PROCESS cmd=\"include\" data=\"internal/*.xml\"/>", "<X-PRE-PROCESS cmd=\"include\" data=\"lan/*.xml\"/>", $contents); - $contents = str_replace("<param name=\"rtp-ip\" value=\"$${local_ip_v4}\"/>", "<param name=\"rtp-ip\" value=\"".$lan_ip."\"/>", $contents); - $contents = str_replace("<param name=\"sip-ip\" value=\"$${local_ip_v4}\"/>", "<param name=\"sip-ip\" value=\"".$lan_ip."\"/>", $contents); - fwrite($handle, $contents); - unset($contents); - fclose($handle); - unset($filename); + if (strlen($lan_ip) > 0) { + exec("cp /usr/local/freeswitch/conf/sip_profiles/internal.xml /usr/local/freeswitch/conf/sip_profiles/lan.xml"); + + $filename = "/usr/local/freeswitch/conf/sip_profiles/lan.xml"; + $handle = fopen($filename,"rb"); + $contents = fread($handle, filesize($filename)); + fclose($handle); + + $handle = fopen($filename,"w"); + $contents = str_replace("<profile name=\"internal\">", "<profile name=\"lan\">", $contents); + $contents = str_replace("<alias name=\"default\"/>", "", $contents); + $contents = str_replace("<X-PRE-PROCESS cmd=\"include\" data=\"internal/*.xml\"/>", "<X-PRE-PROCESS cmd=\"include\" data=\"lan/*.xml\"/>", $contents); + $contents = str_replace("<param name=\"rtp-ip\" value=\"$${local_ip_v4}\"/>", "<param name=\"rtp-ip\" value=\"".$lan_ip."\"/>", $contents); + $contents = str_replace("<param name=\"sip-ip\" value=\"$${local_ip_v4}\"/>", "<param name=\"sip-ip\" value=\"".$lan_ip."\"/>", $contents); + fwrite($handle, $contents); + unset($contents); + fclose($handle); + unset($filename); + } } - + } function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.7"; + $freeswitch_package_version = "0.8.7.1"; $freeswitch_build_version = "1.0.4 pre 6"; $freeswitch_build_revision = "13238"; |