aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/freeswitch/freeswitch.inc43
-rw-r--r--config/freeswitch/freeswitch.xml2
-rw-r--r--config/freeswitch/freeswitch_profiles.tmp2
-rw-r--r--config/freeswitch/freeswitch_status.tmp67
4 files changed, 55 insertions, 59 deletions
diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc
index 20c75803..4ed56349 100644
--- a/config/freeswitch/freeswitch.inc
+++ b/config/freeswitch/freeswitch.inc
@@ -282,6 +282,30 @@ function lan_sip_profile()
}
+function ListFiles($dir) {
+
+ if($dh = opendir($dir)) {
+
+ $files = Array();
+ $inner_files = Array();
+
+ while($file = readdir($dh)) {
+ if($file != "." && $file != ".." && $file[0] != '.') {
+ if(is_dir($dir . "/" . $file)) {
+ //$inner_files = ListFiles($dir . "/" . $file); //recursive
+ if(is_array($inner_files)) $files = array_merge($files, $inner_files);
+ } else {
+ array_push($files, $file);
+ //array_push($files, $dir . "/" . $file);
+ }
+ }
+ }
+
+ closedir($dh);
+ return $files;
+ }
+}
+
function recording_js()
{
@@ -1804,7 +1828,7 @@ function sync_package_freeswitch()
function freeswitch_php_install_command()
{
global $config;
- $freeswitch_package_version = "0.8.7.2";
+ $freeswitch_package_version = "0.8.7.3";
$freeswitch_build_version = "1.0.4 pre 6";
$freeswitch_build_revision = "13238";
@@ -2400,18 +2424,19 @@ function freeswitch_php_install_command()
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_say_zh'] = "disable";
}
- // if backup file exists restore it
- $filename = 'freeswitch.bak.tgz';
+ // if backup file exists restore it
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
+ $filename = 'freeswitch.bak.tgz';
if (file_exists('/root/backup/'.$filename)) {
//echo "The file $filename exists";
+ exec("rm -R /usr/local/freeswitch/conf/sip_profiles/");
+ exec("rm -R /usr/local/freeswitch/sounds/music/");
+
//Recommended
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/db/');
system('cd /usr/local; tar xvpfz /root/backup/'.$filename.' freeswitch/log/');
@@ -2435,14 +2460,6 @@ function freeswitch_php_install_command()
}
-
- write_rcfile(array(
- "file" => "freeswitch.sh",
- "start" => "/usr/local/freeswitch/bin/./freeswitch -nc",
- "stop" => "/usr/local/freeswitch/bin/./freeswitch -stop"
- )
- );
-
exec("rm -R /freeswitch");
exec("cp /usr/local/freeswitch/conf/directory/default/brian.xml /usr/local/freeswitch/conf/directory/default/brian.xml.noload");
unlink_if_exists("/usr/local/freeswitch/conf/directory/default/brian.xml");
diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml
index ff4b89eb..02e236c1 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.2</version>
+ <version>0.8.7.3</version>
<title>FreeSWITCH: Settings</title>
<include_file>/usr/local/pkg/freeswitch.inc</include_file>
<menu>
diff --git a/config/freeswitch/freeswitch_profiles.tmp b/config/freeswitch/freeswitch_profiles.tmp
index bcfcf021..31ee99a1 100644
--- a/config/freeswitch/freeswitch_profiles.tmp
+++ b/config/freeswitch/freeswitch_profiles.tmp
@@ -148,8 +148,6 @@ include("head.inc");
<?php
-
-
foreach (ListFiles('/usr/local/freeswitch/conf/sip_profiles') as $key=>$file){
?>
diff --git a/config/freeswitch/freeswitch_status.tmp b/config/freeswitch/freeswitch_status.tmp
index ceccd89a..3c6b5231 100644
--- a/config/freeswitch/freeswitch_status.tmp
+++ b/config/freeswitch/freeswitch_status.tmp
@@ -181,50 +181,31 @@ echo "</pre>\n";
fclose($fp);
echo "<br /><br />\n\n";
+foreach (ListFiles('/usr/local/freeswitch/conf/sip_profiles') as $key=>$sip_profile_file){
+
+ $sip_profile_name = str_replace(".xml", "", $sip_profile_file);
+ $fp = event_socket_create($host, $port, $password);
+ $cmd = "api sofia status profile ".$sip_profile_name;
+ $response = event_socket_request($fp, $cmd);
+ echo "<table width='690' cellpadding='0' cellspacing='0' border='0'>\n";
+ echo "<tr>\n";
+ echo "<td width='50%'>\n";
+ echo " <b>sofia status profile $sip_profile_name</b> \n";
+ echo "</td>\n";
+ echo "<td width='50%' align='right'>\n";
+ echo " <input type='button' value='start' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+".$sip_profile_name."+start';\" />\n";
+ echo " <input type='button' value='stop' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+".$sip_profile_name."+stop';\" />\n";
+ echo " <input type='button' value='flush_inbound_reg' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+".$sip_profile_name."+flush_inbound_reg';\" />\n";
+ echo "</td>\n";
+ echo "</tr>\n";
+ echo "</table>\n";
+ echo "<pre style=\"font-size: 9pt;\">\n";
+ echo $response;
+ echo "</pre>\n";
+ fclose($fp);
+ echo "<br /><br />\n\n";
-$fp = event_socket_create($host, $port, $password);
-$cmd = "api sofia status profile internal";
-$response = event_socket_request($fp, $cmd);
-echo "<table width='690' cellpadding='0' cellspacing='0' border='0'>\n";
-echo "<tr>\n";
-echo "<td width='50%'>\n";
-echo " <b>sofia status profile internal</b> \n";
-echo "</td>\n";
-echo "<td width='50%' align='right'>\n";
-echo " <input type='button' value='start' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+internal+start';\" />\n";
-echo " <input type='button' value='stop' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+internal+stop';\" />\n";
-echo " <input type='button' value='flush_inbound_reg' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+internal+flush_inbound_reg';\" />\n";
-echo "</td>\n";
-echo "</tr>\n";
-echo "</table>\n";
-echo "<pre style=\"font-size: 9pt;\">\n";
-echo $response;
-echo "</pre>\n";
-fclose($fp);
-echo "<br /><br />\n\n";
-
-
-$fp = event_socket_create($host, $port, $password);
-$cmd = "api sofia status profile external";
-$response = event_socket_request($fp, $cmd);
-echo "<table width='690' cellpadding='0' cellspacing='0' border='0'>\n";
-echo "<tr>\n";
-echo "<td width='50%'>\n";
-echo " <b>sofia status profile external</b> \n";
-echo "</td>\n";
-echo "<td width='50%' align='right'>\n";
-echo " <input type='button' value='start' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+external+start+reloadxml';\" />\n";
-echo " <input type='button' value='stop' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+external+stop';\" />\n";
-echo " <input type='button' value='restart' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+external+restart+reloadxml';\" />\n";
-echo " <input type='button' value='rescan' onclick=\"document.location.href='/packages/freeswitch/freeswitch_cmd.php?cmd=api+sofia+profile+external+rescan+reloadxml';\" />\n";
-echo "</td>\n";
-echo "</tr>\n";
-echo "</table>\n";
-echo "<pre style=\"font-size: 9pt;\">\n";
-echo $response;
-echo "</pre>\n";
-fclose($fp);
-echo "<br /><br />\n\n";
+}
$fp = event_socket_create($host, $port, $password);