aboutsummaryrefslogtreecommitdiffstats
path: root/packages/freeswitch
diff options
context:
space:
mode:
authorMark Crane <mcrane@pfsense.org>2008-12-11 12:05:44 +0000
committerMark Crane <mcrane@pfsense.org>2008-12-11 12:05:44 +0000
commit734d2b9891f769f72c02776d2eaefad3d42b18ff (patch)
treec943c001f074c9d0024ad9a928c586e86068e722 /packages/freeswitch
parent1c024d3e3e6928111dd2670cb7ce95225c19f3b6 (diff)
downloadpfsense-packages-734d2b9891f769f72c02776d2eaefad3d42b18ff.tar.gz
pfsense-packages-734d2b9891f769f72c02776d2eaefad3d42b18ff.tar.bz2
pfsense-packages-734d2b9891f769f72c02776d2eaefad3d42b18ff.zip
FreeSWITCH package if the backup file exists during the install auto restore it. Also adjusted timeout option for the auto attendant.
Diffstat (limited to 'packages/freeswitch')
-rw-r--r--packages/freeswitch/freeswitch.inc76
-rw-r--r--packages/freeswitch/freeswitch.xml2
2 files changed, 50 insertions, 28 deletions
diff --git a/packages/freeswitch/freeswitch.inc b/packages/freeswitch/freeswitch.inc
index 754ffb7a..32349c0d 100644
--- a/packages/freeswitch/freeswitch.inc
+++ b/packages/freeswitch/freeswitch.inc
@@ -994,7 +994,7 @@ function sync_package_freeswitch_ivr()
$tmp .= " if (dtmf.digits == 0) {\n";
//$tmp .= " console_log( "info", "time out option: " + dtmf.digits + "\n" );\n";
-
+ $a_ivr_options = &$config['installedpackages']['freeswitchivroptions']['config'];
//find the timeout IVR options with the correct action
if (count($a_ivr_options) > 0) {
foreach($a_ivr_options as $row) {
@@ -1002,7 +1002,7 @@ function sync_package_freeswitch_ivr()
if ($row['ivrid'] == $rowhelper['ivrid']) {
if ($row['optionaction'] == "action") {
-
+ if ($row['optionnumber'] == "t") {
if ($row['optiontype'] == "extension") {
$tmp .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
}
@@ -1010,8 +1010,8 @@ function sync_package_freeswitch_ivr()
//$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
$tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
}
-
- } //end anti-action
+ }
+ } //end anti-action
} //end ivrid
@@ -1064,17 +1064,17 @@ function sync_package_freeswitch_ivr()
//$tmpaction .= "\n";
switch ($row['optionnumber']) {
- case "t":
+ //case "t":
- if ($row['optiontype'] == "extension") {
- $tmpactiondefault .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
- }
- if ($row['optiontype'] == "voicemail") {
- //$tmpactiondefault .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
- $tmpactiondefault .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- }
+ //if ($row['optiontype'] == "extension") {
+ // $tmpactiondefault .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
+ //}
+ //if ($row['optiontype'] == "voicemail") {
+ // //$tmpactiondefault .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
+ // $tmpactiondefault .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
+ //}
- break;
+ //break;
default:
//$tmpaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n";
if ($x == 0) {
@@ -1146,11 +1146,11 @@ function sync_package_freeswitch_ivr()
//find the timeout IVR options with the correct action
if (count($a_ivr_options) > 0) {
foreach($a_ivr_options as $row) {
-
if ($row['ivrid'] == $rowhelper['ivrid']) {
if ($row['optionaction'] == "anti-action") {
+ if ($row['optionnumber'] == "t") {
if ($row['optiontype'] == "extension") {
$tmp .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
@@ -1159,11 +1159,10 @@ function sync_package_freeswitch_ivr()
//$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
$tmp .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
}
-
- } //end anti-action
+ }
+ } //end anti-action
} //end ivrid
-
} //end for each
} //if count
@@ -1221,17 +1220,17 @@ function sync_package_freeswitch_ivr()
if ($row['optionaction'] == "anti-action") {
switch ($row['optionnumber']) {
- case "t":
+ //case "t":
- if ($row['optiontype'] == "extension") {
- $tmpantiactiondefault .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
- }
- if ($row['optiontype'] == "voicemail") {
- //$tmpantiactiondefault .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
- $tmpantiactiondefault .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
- }
+ //if ($row['optiontype'] == "extension") {
+ // $tmpantiactiondefault .= " session.execute(\"transfer\", \"".$row['optiondest']." XML default\"); //".$row['optiondescr']."\n";
+ //}
+ //if ($row['optiontype'] == "voicemail") {
+ // //$tmpantiactiondefault .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n";
+ // $tmpantiactiondefault .= " session.execute(\"voicemail\", \"default \"+domain+\" ".$row['optiondest']."\");\n";
+ //}
- break;
+ //break;
default:
//$tmpantiaction .= " //console_log( \"info\", \"IVR Detected 1 digit \\n\" );\n";
@@ -1871,6 +1870,29 @@ function freeswitch_php_install_command()
$config['installedpackages']['freeswitchmodules']['config'][0]['mod_say_zh'] = "disable";
}
+ // if backup file exists restore it
+ $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/');
+
+ unset($filename);
+ }
+
write_rcfile(array(
"file" => "freeswitch.sh",
"start" => "/usr/local/freeswitch/bin/./freeswitch -nc",
@@ -1889,7 +1911,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.4.0";
+ $config['installedpackages']['freeswitchsettings']['config'][0]['freeswitch_package_version'] = "0.4.1";
conf_mount_ro();
diff --git a/packages/freeswitch/freeswitch.xml b/packages/freeswitch/freeswitch.xml
index c8e6a5b8..f24ffcc6 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.4.0</version>
+ <version>0.4.1</version>
<title>FreeSWITCH: Settings</title>
<include_file>/usr/local/pkg/freeswitch.inc</include_file>
<menu>