aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Crane <mcrane@pfsense.org>2008-12-11 11:18:55 +0000
committerMark Crane <mcrane@pfsense.org>2008-12-11 11:18:55 +0000
commit1c024d3e3e6928111dd2670cb7ce95225c19f3b6 (patch)
treefd1627eb6ca69fd5dcec823413aac948b610a325
parent1860a8c95f4de3333b8e5a6bb1f311b826b525a3 (diff)
downloadpfsense-packages-1c024d3e3e6928111dd2670cb7ce95225c19f3b6.tar.gz
pfsense-packages-1c024d3e3e6928111dd2670cb7ce95225c19f3b6.tar.bz2
pfsense-packages-1c024d3e3e6928111dd2670cb7ce95225c19f3b6.zip
FreeSWITCH package previous commit bug fix and freeswitch status add backup and restore.
-rw-r--r--packages/freeswitch/freeswitch.inc6
-rw-r--r--packages/freeswitch/freeswitch.xml2
-rw-r--r--packages/freeswitch/freeswitch_status.tmp58
-rw-r--r--pkg_config.7.xml2
4 files changed, 62 insertions, 6 deletions
diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc
index 3d91c781..754ffb7a 100644
--- a/packages/freeswitch/freeswitch.inc
+++ b/packages/freeswitch/freeswitch.inc
@@ -990,7 +990,7 @@ function sync_package_freeswitch_ivr()
$tmp .= " session.streamFile( \"/usr/local/freeswitch/recordings/".$recording_action_filename."\", mycb, \"dtmf ".$rowhelper['ivrtimeout']."\" );\n";
$tmp .= " if (session.ready()) {\n";
$tmp .= " if (dtmf.digits == 0) {\n";
- $tmp .= " dtmf.digits += session.getDigits(1, "#", ".($rowhelper['ivrtimeout']*1000)."); // ".$rowhelper['ivrtimeout']." seconds\n";
+ $tmp .= " dtmf.digits += session.getDigits(1, \"#\", ".($rowhelper['ivrtimeout']*1000)."); // ".$rowhelper['ivrtimeout']." seconds\n";
$tmp .= " if (dtmf.digits == 0) {\n";
//$tmp .= " console_log( "info", "time out option: " + dtmf.digits + "\n" );\n";
@@ -1138,7 +1138,7 @@ function sync_package_freeswitch_ivr()
$tmp .= " session.streamFile( \"/usr/local/freeswitch/recordings/".$recording_antiaction_filename."\", mycb, \"dtmf ".$rowhelper['ivrtimeout']."\" );\n";
$tmp .= " if (session.ready()) {\n";
$tmp .= " if (dtmf.digits == 0) {\n";
- $tmp .= " dtmf.digits += session.getDigits(1, "#", ".($rowhelper['ivrtimeout']*1000)."); // ".$rowhelper['ivrtimeout']." seconds\n";
+ $tmp .= " dtmf.digits += session.getDigits(1, \"#\", ".($rowhelper['ivrtimeout']*1000)."); // ".$rowhelper['ivrtimeout']." seconds\n";
$tmp .= " if (dtmf.digits == 0) {\n";
//$tmp .= " console_log( "info", "time out option: " + dtmf.digits + "\n" );\n";
@@ -1889,7 +1889,7 @@ function freeswitch_php_install_command()
}
$config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_version'] = "1.0.1 revision 10638.";
- $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.3.9";
+ $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.4.0";
conf_mount_ro();
diff --git a/packages/freeswitch/freeswitch.xml b/packages/freeswitch/freeswitch.xml
index e3675b73..c8e6a5b8 100644
--- a/packages/freeswitch/freeswitch.xml
+++ b/packages/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.3.9</version>
+ <version>0.4.0</version>
<title>FreeSWITCH: Settings</title>
<include_file>/usr/local/pkg/freeswitch.inc</include_file>
<menu>
diff --git a/packages/freeswitch/freeswitch_status.tmp b/packages/freeswitch/freeswitch_status.tmp
index 91fe2852..d5dd7a80 100644
--- a/packages/freeswitch/freeswitch_status.tmp
+++ b/packages/freeswitch/freeswitch_status.tmp
@@ -43,7 +43,12 @@ if ($_GET['a'] == "download") {
if ($_GET['t'] == "cdrcsv") {
$tmp = '/usr/local/freeswitch/log/cdr-csv/';
$filename = 'Master.csv';
- }
+ }
+ if ($_GET['t'] == "backup") {
+ $tmp = '/tmp/';
+ $filename = 'freeswitch.bak.tgz';
+ system('cd /usr/local/;tar cvzf /tmp/freeswitch.bak.tgz freeswitch');
+ }
session_cache_limiter('public');
$fd = fopen($tmp.$filename, "rb");
header("Content-Type: binary/octet-stream");
@@ -53,6 +58,37 @@ if ($_GET['a'] == "download") {
exit;
}
+if ($_GET['a'] == "other") {
+ if ($_GET['t'] == "restore") {
+ $tmp = '/tmp/';
+ $filename = 'freeswitch.bak.tgz';
+
+ //extract a specific directory to /usr/local/freeswitch
+ if (file_exists('/tmp/'.$filename)) {
+ //echo "The file $filename exists";
+
+ //Recommended
+ system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/db/');
+ system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/log/');
+ system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/recordings/');
+ system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/scripts/');
+ system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/storage/');
+
+ //Optional
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/conf/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/grammar/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/htdocs/');
+ //system('cd /usr/local; tar xvpfz /tmp/'.$filename.' freeswitch/sounds/');
+
+ header( 'Location: freeswitch_status.php?savemsg=Backup+has+been+restored.' ) ;
+ }
+ else {
+ header( 'Location: freeswitch_status.php?savemsg=Restore+failed.+Backup+file+not+found.' ) ;
+ }
+
+ exit;
+ }
+}
include("head.inc");
@@ -219,6 +255,26 @@ echo "<br /><br />\n\n";
echo "<table width='690' cellpadding='0' cellspacing='0' border='0'>\n";
echo "<tr>\n";
+echo "<td width='80%'>\n";
+echo "<b>Backup / Restore</b><br />\n";
+echo "The 'backup' button will tar gzip /usr/local/freeswitch/ to /tmp/freeswitch.bak.tgz it then presents a file to download. \n";
+echo "If the backup file does not exist in /tmp/freeswitch.bak.tgz then the 'restore' button will be hidden. \n";
+echo "Use Diagnostics->Command->File to upload: to browse to the file and then click on upload it now ready to be restored. \n";
+echo "<br /><br />\n";
+echo "</td>\n";
+echo "<td width='20%' valign='middle' align='right'>\n";
+echo " <input type='button' value='backup' onclick=\"document.location.href='/freeswitch/freeswitch_status.php?a=download&t=backup';\" />\n";
+if (file_exists('/tmp/freeswitch.bak.tgz')) {
+ echo " <input type='button' value='restore' onclick=\"document.location.href='/freeswitch/freeswitch_status.php?a=other&t=restore';\" />\n";
+}
+echo "</td>\n";
+echo "</tr>\n";
+echo "</table>\n";
+echo "<br /><br />\n\n";
+
+
+echo "<table width='690' cellpadding='0' cellspacing='0' border='0'>\n";
+echo "<tr>\n";
echo "<td width='50%'>\n";
echo "<b>Call Detail Records</b><br />\n";
echo "/usr/local/freeswitch/log/cdr-csv/Master.csv<br /><br />\n";
diff --git a/pkg_config.7.xml b/pkg_config.7.xml
index f950d703..b426033f 100644
--- a/pkg_config.7.xml
+++ b/pkg_config.7.xml
@@ -49,7 +49,7 @@
<category>Services</category>
<config_file>http://www.pfsense.com/packages/config/freeswitch/freeswitch.xml</config_file>
<depends_on_package_base_url>http://files.pfsense.org/packages/7/All/</depends_on_package_base_url>
- <version>0.3.9</version>
+ <version>0.4.0</version>
<status>Beta</status>
<required_version>1.2.1</required_version>
<maintainer>markjcrane@gmail.com</maintainer>