aboutsummaryrefslogtreecommitdiffstats
path: root/packages/freeswitch/freeswitch_status.tmp
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 /packages/freeswitch/freeswitch_status.tmp
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.
Diffstat (limited to 'packages/freeswitch/freeswitch_status.tmp')
-rw-r--r--packages/freeswitch/freeswitch_status.tmp58
1 files changed, 57 insertions, 1 deletions
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";