aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeswitch
diff options
context:
space:
mode:
Diffstat (limited to 'config/freeswitch')
-rw-r--r--config/freeswitch/freeswitch.inc108
-rw-r--r--config/freeswitch/freeswitch.xml2
-rw-r--r--config/freeswitch/freeswitch_dialplan.tmp6
-rw-r--r--config/freeswitch/freeswitch_profile_edit.tmp2
-rw-r--r--config/freeswitch/freeswitch_profiles.tmp4
-rw-r--r--config/freeswitch/freeswitch_public.tmp6
-rw-r--r--config/freeswitch/freeswitch_vars.tmp6
7 files changed, 67 insertions, 67 deletions
diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc
index 2ef39a8c..20c75803 100644
--- a/config/freeswitch/freeswitch.inc
+++ b/config/freeswitch/freeswitch.inc
@@ -253,6 +253,35 @@ function byte_convert( $bytes ) {
return round($bytes/pow($convention,$e),2).' '.$s[$e];
}
+function lan_sip_profile()
+{
+ global $config;
+ //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'];
+ 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 recording_js()
{
@@ -1772,39 +1801,10 @@ function sync_package_freeswitch()
}
-function create_lan_sip_profile()
-{
- global $config;
- //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'];
- 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.1";
+ $freeswitch_package_version = "0.8.7.2";
$freeswitch_build_version = "1.0.4 pre 6";
$freeswitch_build_revision = "13238";
@@ -2401,41 +2401,40 @@ function freeswitch_php_install_command()
}
// if backup file exists restore it
- $filename = 'freeswitch.bak.tgz';
- if (!is_dir('/root/backup/')) {
+ $filename = 'freeswitch.bak.tgz';
+ if (!is_dir('/root/backup/')) {
exec("rm -R /usr/local/freeswitch/conf/sip_profiles/");
exec("rm -R /usr/local/freeswitch/sounds/music/");
exec("mkdir /root/backup/");
}
- //extract a specific directory to /usr/local/freeswitch
- if (file_exists('/root/backup/'.$filename)) {
- //echo "The file $filename exists";
+ //extract a specific directory to /usr/local/freeswitch
+ if (file_exists('/root/backup/'.$filename)) {
+ //echo "The file $filename exists";
- //Recommended
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/');
+ //Recommended
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/recordings/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/scripts/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/storage/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/custom/8000/');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/sounds/music/8000/');
- system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl/');
+ system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/ssl/');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/sip_profiles/');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/vars.xml');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/dialplan/default.xml');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/dialplan/public.xml');
- //Optional
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/');
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/');
- //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/');
+ //Optional
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/conf/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/grammar/');
+ //system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/htdocs/');
unset($filename);
- }
-
- //Create the LAN SIP Profile
- create_lan_sip_profile();
+ }
+
+
write_rcfile(array(
"file" => "freeswitch.sh",
@@ -2449,13 +2448,15 @@ function freeswitch_php_install_command()
unlink_if_exists("/usr/local/freeswitch/conf/directory/default/brian.xml");
unlink_if_exists("/usr/local/freeswitch/conf/directory/default/example.com.xml");
unlink_if_exists("/usr/local/freeswitch/conf/dialplan/default/99999_enum.xml");
-
+
write_rcfile(array(
"file" => "freeswitch.sh",
"start" => "/usr/local/freeswitch/bin/./freeswitch -nc",
"stop" => "/usr/local/freeswitch/bin/./freeswitch -stop"
)
);
+
+ lan_sip_profile();
sync_package_freeswitch();
$handle = popen("/usr/local/etc/rc.d/freeswitch.sh start", "r");
@@ -2465,7 +2466,6 @@ function freeswitch_php_install_command()
sync_package_freeswitch_ivr();
}
-
$config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = $freeswitch_build_version." revision ".$freeswitch_build_revision.".";
$config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = $freeswitch_package_version;
@@ -2518,7 +2518,7 @@ function freeswitch_deinstall_command()
unlink_if_exists("/usr/local/www/packages/freeswitch/freeswitch_time_conditions_edit.php");
unlink_if_exists("/usr/local/www/packages/freeswitch/freeswitch_status.php");
unlink_if_exists("/usr/local/www/packages/freeswitch/slim.swf");
-
+
exec("rm -R /usr/local/freeswitch/");
exec("rm -R /usr/local/www/packages/freeswitch/");
unlink_if_exists("/usr/local/etc/rc.d/freeswitch.sh");
diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml
index bf4982a6..ff4b89eb 100644
--- a/config/freeswitch/freeswitch.xml
+++ b/config/freeswitch/freeswitch.xml
@@ -44,7 +44,7 @@
<requirements>Describe your package requirements here</requirements>
<faq>Currently there are no FAQ items provided.</faq>
<name>FreeSWITCH Settings</name>
- <version>0.8.7</version>
+ <version>0.8.7.2</version>
<title>FreeSWITCH: Settings</title>
<include_file>/usr/local/pkg/freeswitch.inc</include_file>
<menu>
diff --git a/config/freeswitch/freeswitch_dialplan.tmp b/config/freeswitch/freeswitch_dialplan.tmp
index 7c33a28e..fcfb3192 100644
--- a/config/freeswitch/freeswitch_dialplan.tmp
+++ b/config/freeswitch/freeswitch_dialplan.tmp
@@ -38,7 +38,7 @@ require("/usr/local/pkg/freeswitch.inc");
if ($_GET['a'] == "default") {
conf_mount_rw();
exec("cp /usr/local/freeswitch/conf.orig/dialplan/default.xml /usr/local/freeswitch/conf/dialplan/default.xml");
- $savemsg = "Dialplan default.xml: Set as Default";
+ $savemsg = "Default Restored";
conf_mount_ro();
}
@@ -48,7 +48,7 @@ if ($_POST['a'] == "save") {
$fd = fopen("/usr/local/freeswitch/conf/dialplan/default.xml", "w");
fwrite($fd, $content);
fclose($fd);
- $savemsg = "Saved text to the dialplan default.xml";
+ $savemsg = "Saved";
conf_mount_ro();
}
@@ -130,7 +130,7 @@ display_top_tabs(build_menu());
<input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
<input type="hidden" name="a" value="save" />
<?php
- echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_dialplan.php?a=default&f=default.xml';\" />";
+ echo "<input type='button' value='Restore Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_dialplan.php?a=default&f=default.xml';\" />";
?>
</td>
</tr>
diff --git a/config/freeswitch/freeswitch_profile_edit.tmp b/config/freeswitch/freeswitch_profile_edit.tmp
index a1faa4de..2466f115 100644
--- a/config/freeswitch/freeswitch_profile_edit.tmp
+++ b/config/freeswitch/freeswitch_profile_edit.tmp
@@ -110,7 +110,7 @@ display_top_tabs(build_menu());
<td align='right'>
<input type="hidden" name="a" value="save" />
<?php
- echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_profiles.php?a=default&f=".$_GET['f']."';\" />";
+ echo "<input type='button' value='Restore Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_profiles.php?a=default&f=".$_GET['f']."';\" />";
?>
</td>
</tr>
diff --git a/config/freeswitch/freeswitch_profiles.tmp b/config/freeswitch/freeswitch_profiles.tmp
index 9bcbd48d..bcfcf021 100644
--- a/config/freeswitch/freeswitch_profiles.tmp
+++ b/config/freeswitch/freeswitch_profiles.tmp
@@ -63,7 +63,7 @@ function ListFiles($dir) {
if ($_GET['a'] == "default") {
conf_mount_rw();
exec("cp /usr/local/freeswitch/conf.orig/sip_profiles/".$_GET['f']." /usr/local/freeswitch/conf/sip_profiles/".$_GET['f']);
- $savemsg = $_POST['f'].": Set as Default";
+ $savemsg = "Restore Default";
conf_mount_ro();
}
@@ -73,7 +73,7 @@ if ($_POST['a'] == "save") {
$fd = fopen("/usr/local/freeswitch/conf/sip_profiles/".$_POST['f'], "w");
fwrite($fd, $content);
fclose($fd);
- $savemsg = "Saved text to " . $_POST['f'];
+ $savemsg = "Saved";
conf_mount_ro();
}
diff --git a/config/freeswitch/freeswitch_public.tmp b/config/freeswitch/freeswitch_public.tmp
index 66b577f5..0c05fe47 100644
--- a/config/freeswitch/freeswitch_public.tmp
+++ b/config/freeswitch/freeswitch_public.tmp
@@ -38,7 +38,7 @@ require("/usr/local/pkg/freeswitch.inc");
if ($_GET['a'] == "default") {
conf_mount_rw();
exec("cp /usr/local/freeswitch/conf.orig/dialplan/public.xml /usr/local/freeswitch/conf/dialplan/public.xml");
- $savemsg = "dialplan public.xml: Set as Default";
+ $savemsg = "Default Restored";
conf_mount_ro();
}
@@ -48,7 +48,7 @@ if ($_POST['a'] == "save") {
$fd = fopen("/usr/local/freeswitch/conf/dialplan/public.xml", "w");
fwrite($fd, $content);
fclose($fd);
- $savemsg = "Saved text to the dialplan public.xml";
+ $savemsg = "Saved";
conf_mount_ro();
}
@@ -129,7 +129,7 @@ display_top_tabs(build_menu());
<input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
<input type="hidden" name="a" value="save" />
<?php
- echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_public.php?a=default&f=public.xml';\" />";
+ echo "<input type='button' value='Restore Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_public.php?a=default&f=public.xml';\" />";
?>
</td>
</tr>
diff --git a/config/freeswitch/freeswitch_vars.tmp b/config/freeswitch/freeswitch_vars.tmp
index 00f2caca..5e7a5744 100644
--- a/config/freeswitch/freeswitch_vars.tmp
+++ b/config/freeswitch/freeswitch_vars.tmp
@@ -38,7 +38,7 @@ require("/usr/local/pkg/freeswitch.inc");
if ($_GET['a'] == "default") {
conf_mount_rw();
exec("cp /usr/local/freeswitch/conf.orig/vars.xml /usr/local/freeswitch/conf/vars.xml");
- $savemsg = "vars.xml: Set as Default";
+ $savemsg = "Default Restored";
conf_mount_ro();
}
@@ -48,7 +48,7 @@ if ($_POST['a'] == "save") {
$fd = fopen("/usr/local/freeswitch/conf/vars.xml", "w");
fwrite($fd, $content);
fclose($fd);
- $savemsg = "Saved text to the vars.xml";
+ $savemsg = "Saved";
conf_mount_ro();
}
@@ -129,7 +129,7 @@ display_top_tabs(build_menu());
<input type="hidden" name="f" value="<?php echo $_GET['f']; ?>" />
<input type="hidden" name="a" value="save" />
<?php
- echo "<input type='button' value='Set as Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_vars.php?a=default&f=vars.xml';\" />";
+ echo "<input type='button' value='Restore Default' onclick=\"document.location.href='/packages/freeswitch/freeswitch_vars.php?a=default&f=vars.xml';\" />";
?>
</td>
</tr>