From a24a6994a246ee3d869a17540a916288032dbfc6 Mon Sep 17 00:00:00 2001 From: mcrane Date: Wed, 10 Jun 2009 05:39:33 -0600 Subject: FreeSWITCH package add tiff2png for fax conversion, hunt group fix warning messages when adding next hunt groups, delete from hunt group list, IVR add examples for sip uri, IVR add call timeout, direct dial, and ring back tone. Hunt group add additional examples for sip uri. --- config/freeswitch/freeswitch.inc | 72 +++++++-- config/freeswitch/freeswitch.xml | 2 +- config/freeswitch/freeswitch_hunt_group.tmp | 2 +- .../freeswitch_hunt_group_destinations_edit.tmp | 11 +- config/freeswitch/freeswitch_ivr_edit.tmp | 162 +++++++++++++++++---- config/freeswitch/freeswitch_ivr_options_edit.tmp | 14 +- 6 files changed, 215 insertions(+), 48 deletions(-) (limited to 'config') diff --git a/config/freeswitch/freeswitch.inc b/config/freeswitch/freeswitch.inc index 4813dfac..15adc5f2 100644 --- a/config/freeswitch/freeswitch.inc +++ b/config/freeswitch/freeswitch.inc @@ -1534,7 +1534,9 @@ function sync_package_freeswitch_ivr() $rowhelper['ivrname'] $rowhelper['recordingid'] $rowhelper['ivrtimeout'] + $rowhelper['ivrcalltimeout'] $rowhelper['ivrcontext'] + $rowhelper['ivrdirectdial'] $rowhelper['ivrconditionjs'] $rowhelper['ivrdescr'] */ @@ -1695,8 +1697,29 @@ function sync_package_freeswitch_ivr() $tmp .= " caller_id_name = session.getVariable(\"caller_id_name\");\n"; $tmp .= " caller_id_number = session.getVariable(\"caller_id_number\");\n"; $tmp .= "\n"; - $tmp .= " session.execute(\"set\", \"ringback=\"+us_ring); //set to ringtone\n"; - $tmp .= " session.execute(\"set\", \"transfer_ringback=\"+us_ring); //set to ringtone\n"; + + $tmp .= " session.execute(\"set\", \"continue_on_fail=true\");\n"; + if (strlen($rowhelper['ivrcalltimeout']) == 0){ + $tmp .= " session.execute(\"set\", \"call_timeout=30\");\n"; //ivrcalltimeout + } + else { + $tmp .= " session.execute(\"set\", \"call_timeout=".$rowhelper['ivrcalltimeout']."\");\n"; //ivrcalltimeout + } + + if (isset($rowhelper['ivrringback'])){ + if ($rowhelper['ivrringback'] == "ring"){ + $tmp .= " session.execute(\"set\", \"ringback=\"+us_ring); //set to ringtone\n"; + $tmp .= " session.execute(\"set\", \"transfer_ringback=\"+us_ring); //set to ringtone\n"; + } + if ($rowhelper['ivrringback'] == "music"){ + $tmp .= " session.execute(\"set\", \"ringback=\${hold_music}\"); //set to ringtone\n"; + $tmp .= " session.execute(\"set\", \"transfer_ringback=\${hold_music}\"); //set to ringtone\n"; + } + } + else { + $tmp .= " session.execute(\"set\", \"ringback=\${hold_music}\"); //set to ringtone\n"; + $tmp .= " session.execute(\"set\", \"transfer_ringback=\${hold_music}\"); //set to ringtone\n"; + } $tmp .= "\n"; $tmp .= "//console_log( \"info\", \"IVR Server Time is: \"+Hours+\":\"+Mins+\" \\n\" );\n"; $tmp .= "\n"; @@ -1763,6 +1786,7 @@ function sync_package_freeswitch_ivr() if ($actiondirecttype == "extension") { $tmp .= " sofia_contact_".$actiondirectdest." = get_sofia_contact(\"".$actiondirectdest."\",domain_name, \"".$actiondirectprofile."\");\n"; $tmp .= " session.execute(\"bridge\", sofia_contact_".$actiondirectdest."); //".$actiondirectdest."\n"; + $tmp .= " session.execute(\"voicemail\", \"".$actiondirectdest." XML default\");\n"; //$tmp .= " session.execute(\"transfer\", \"".$actiondirectdest." XML default\"); //".$actiondirectdest."\n"; } if ($actiondirecttype == "voicemail") { @@ -1808,6 +1832,7 @@ function sync_package_freeswitch_ivr() if ($row['optiontype'] == "extension") { $tmp .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; $tmp .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + $tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; } if ($row['optiontype'] == "voicemail") { //$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; @@ -1883,6 +1908,7 @@ function sync_package_freeswitch_ivr() if ($row['optiontype'] == "extension") { $tmpaction .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; $tmpaction .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + $tmpaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; } if ($row['optiontype'] == "voicemail") { //$tmpaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; @@ -1907,10 +1933,12 @@ function sync_package_freeswitch_ivr() } //end if count $tmp .= $tmpaction; - $tmp .= " else {\n"; - $tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n"; - //$tmp .= $tmpactiondefault; - $tmp .= " }\n"; + if ($rowhelper['ivrdirectdial'] == "true") { + $tmp .= " else {\n"; + $tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n"; + //$tmp .= $tmpactiondefault; + $tmp .= " }\n"; + } $tmp .= "\n"; unset($tmpaction); @@ -1957,6 +1985,7 @@ function sync_package_freeswitch_ivr() if ($actiondirecttype == "extension") { $tmp .= " sofia_contact_".$actiondirectdest." = get_sofia_contact(\"".$actiondirectdest."\",domain_name, \"".$actiondirectprofile."\");\n"; $tmp .= " session.execute(\"bridge\", sofia_contact_".$actiondirectdest."); //".$actiondirectdest."\n"; + $tmp .= " session.execute(\"voicemail\", \"".$actiondirectdest." XML default\");\n"; //$tmp .= " session.execute(\"transfer\", \"".$actiondirectdest." XML default\"); //".$actiondirectdest."\n"; } if ($actiondirecttype == "voicemail") { @@ -1999,6 +2028,7 @@ function sync_package_freeswitch_ivr() if ($row['optiontype'] == "extension") { $tmp .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; $tmp .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + $tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; } if ($row['optiontype'] == "voicemail") { //$tmp .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; @@ -2030,7 +2060,7 @@ function sync_package_freeswitch_ivr() $tmp .= " //pickup the remaining digits\n"; $tmp .= " //http://wiki.freeswitch.org/wiki/Session_getDigits\n"; $tmp .= " //getDigits(length, terminators, timeout, digit_timeout, abs_timeout)\n"; - $tmp .= " dtmf.digits += session.getDigits(3, \"#\", 3000);\n"; + $tmp .= " dtmf.digits += session.getDigits(4, \"#\", 3000);\n"; $tmp .= "\n"; $tmp .= " console_log( \"info\", \"IVR Digit Pressed: \" + dtmf.digits + \"\\n\" );\n"; $tmp .= "\n"; @@ -2074,6 +2104,7 @@ function sync_package_freeswitch_ivr() if ($row['optiontype'] == "extension") { $tmpantiaction .= " sofia_contact_".$row['optiondest']." = get_sofia_contact(\"".$row['optiondest']."\",domain_name, \"".$row['optionprofile']."\");\n"; $tmpantiaction .= " session.execute(\"bridge\", sofia_contact_".$row['optiondest']."); //".$row['optiondescr']."\n"; + $tmpantiaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; } if ($row['optiontype'] == "voicemail") { //$tmpantiaction .= " session.execute(\"voicemail\", \"".$row['optiondest']." XML default\");\n"; @@ -2097,10 +2128,12 @@ function sync_package_freeswitch_ivr() } //if count $tmp .= $tmpantiaction; - $tmp .= " else {\n"; - $tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n"; - //$tmp .= $tmpantiactiondefault; - $tmp .= " }\n"; + if ($rowhelper['ivrdirectdial'] == "true") { + $tmp .= " else {\n"; + $tmp .= " session.execute(\"transfer\", dtmf.digits+\" XML default\");\n"; + //$tmp .= $tmpantiactiondefault; + $tmp .= " }\n"; + } $tmp .= "\n"; unset($tmpantiaction); @@ -2421,7 +2454,7 @@ function sync_package_freeswitch() function freeswitch_php_install_command() { global $config; - $freeswitch_package_version = "0.8.9"; + $freeswitch_package_version = "0.9.0"; $freeswitch_build_version = "1.0.4 pre 6"; $freeswitch_build_revision = "13238"; @@ -2435,6 +2468,9 @@ function freeswitch_php_install_command() conf_mount_rw(); config_lock(); + //used with fax to png, and fax to pdf conversion + exec("pkg_add -r tiff2png"); + if (!is_dir('/usr/local/www/packages/')) { exec("mkdir /usr/local/www/packages/"); } @@ -2557,6 +2593,18 @@ function freeswitch_php_install_command() exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_extensions_edit.tmp"); exec("cp /tmp/freeswitch_extensions_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_extensions_edit.php"); unlink_if_exists("/tmp/freeswitch_extensions_edit.tmp"); + + exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_fax.tmp"); + exec("cp /tmp/freeswitch_fax.tmp /usr/local/www/packages/freeswitch/freeswitch_fax.php"); + unlink_if_exists("/tmp/freeswitch_fax.tmp"); + + exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_fax_edit.tmp"); + exec("cp /tmp/freeswitch_fax_edit.tmp /usr/local/www/packages/freeswitch/freeswitch_fax_edit.php"); + unlink_if_exists("/tmp/freeswitch_fax_edit.tmp"); + + exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/fax_to_email.tmp"); + exec("cp /tmp/fax_to_email.tmp /usr/local/www/packages/freeswitch/fax_to_email.php"); + unlink_if_exists("/tmp/fax_to_email.tmp"); exec("cd /tmp/;fetch http://www.pfsense.com/packages/config/freeswitch/freeswitch_features.tmp"); exec("cp /tmp/freeswitch_features.tmp /usr/local/www/packages/freeswitch/freeswitch_features.php"); diff --git a/config/freeswitch/freeswitch.xml b/config/freeswitch/freeswitch.xml index 7479a58f..bdd69937 100644 --- a/config/freeswitch/freeswitch.xml +++ b/config/freeswitch/freeswitch.xml @@ -44,7 +44,7 @@ Describe your package requirements here Currently there are no FAQ items provided. FreeSWITCH Settings - 0.8.9 + 0.9.0 FreeSWITCH: Settings /usr/local/pkg/freeswitch.inc diff --git a/config/freeswitch/freeswitch_hunt_group.tmp b/config/freeswitch/freeswitch_hunt_group.tmp index 5448396a..911b7d5b 100644 --- a/config/freeswitch/freeswitch_hunt_group.tmp +++ b/config/freeswitch/freeswitch_hunt_group.tmp @@ -40,7 +40,7 @@ $a_hunt_group = &$config['installedpackages']['freeswitchhuntgroup']['config']; if ($_GET['act'] == "del") { if ($_GET['type'] == 'huntgroup') { if ($a_hunt_group[$_GET['id']]) { - if file_exists("/usr/local/freeswitch/scripts/huntgroup_".$_GET['huntgroupid'].".js")) { + if (file_exists("/usr/local/freeswitch/scripts/huntgroup_".$_GET['huntgroupid'].".js")) { unlink("/usr/local/freeswitch/scripts/huntgroup_".$_GET['huntgroupid'].".js"); } unset($a_hunt_group[$_GET['id']]); diff --git a/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp b/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp index 1188438c..aa4117fa 100644 --- a/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp +++ b/config/freeswitch/freeswitch_hunt_group_destinations_edit.tmp @@ -132,8 +132,15 @@ display_top_tabs(build_menu()); Destination -
Destination
- e.g. 1001
+
+ + + extension: 1001
+ voicemail: 1001
+ sip uri (voicemail): sofia/default/*98@${domain}
+ sip uri (external number): sofia/gateway/gatewayname/12081231234
+ sip uri (auto attendant): sofia/default/5002@${domain}
+
Type diff --git a/config/freeswitch/freeswitch_ivr_edit.tmp b/config/freeswitch/freeswitch_ivr_edit.tmp index 603e4af5..87dd1394 100644 --- a/config/freeswitch/freeswitch_ivr_edit.tmp +++ b/config/freeswitch/freeswitch_ivr_edit.tmp @@ -130,9 +130,12 @@ if (isset($id) && $a_ivr[$id]) { $pconfig['ivrextension'] = $a_ivr[$id]['ivrextension']; $pconfig['ivrname'] = $a_ivr[$id]['ivrname']; $pconfig['recordingidaction'] = $a_ivr[$id]['recordingidaction']; - $pconfig['recordingidantiaction'] = $a_ivr[$id]['recordingidantiaction']; + $pconfig['recordingidantiaction'] = $a_ivr[$id]['recordingidantiaction']; $pconfig['ivrtimeout'] = $a_ivr[$id]['ivrtimeout']; - $pconfig['ivrcontext'] = $a_ivr[$id]['ivrcontext']; + $pconfig['ivrcalltimeout'] = $a_ivr[$id]['ivrcalltimeout']; + $pconfig['ivrcontext'] = $a_ivr[$id]['ivrcontext']; + $pconfig['ivrdirectdial'] = $a_ivr[$id]['ivrdirectdial']; + $pconfig['ivrringback'] = $a_ivr[$id]['ivrringback']; $pconfig['ivrconditionjs'] = ($a_ivr[$id]['ivrconditionjs']); $pconfig['ivrdescr'] = $a_ivr[$id]['ivrdescr']; } @@ -170,7 +173,10 @@ if ($_POST) { $ivrent['recordingidaction'] = $_POST['recordingidaction']; $ivrent['recordingidantiaction'] = $_POST['recordingidantiaction']; $ivrent['ivrtimeout'] = $_POST['ivrtimeout']; + $ivrent['ivrcalltimeout'] = $_POST['ivrcalltimeout']; $ivrent['ivrcontext'] = $_POST['ivrcontext']; + $ivrent['ivrdirectdial'] = $_POST['ivrdirectdial']; + $ivrent['ivrringback'] = $_POST['ivrringback']; $ivrent['ivrconditionjs'] = base64_encode($_POST['ivrconditionjs']); $ivrent['ivrdescr'] = $_POST['ivrdescr']; @@ -195,8 +201,25 @@ if ($_POST) { include("head.inc"); ?> - + + + +

FreeSWITCH: IVR: Edit

@@ -288,39 +311,112 @@ display_top_tabs(build_menu()); } ?> - Timeout + IVR Timeout -
After the recording concludes the +
+ After the recording concludes the timeout sets the time in seconds to continue to wait for DTMF. If the DTMF is
not detected during that time the 't' - timeout option is executed.
+ timeout option is executed. +
+ + + + Call Timeout + + +
+ + Call timeout is the time in seconds to ring the destination. After this time is exceeded calls + to extensions will be sent to voicemail. default: 30 seconds + - Context + Context
e.g. default - Description + Direct Dial + + \n"; + echo " \n"; + if (strlen($pconfig['ivrdirectdial']) == 0) { //set default + echo " \n"; + echo " \n"; + } + else { + if (htmlspecialchars($pconfig['ivrdirectdial']) == "true") { + echo " \n"; + } + else { + echo " \n"; + } + if (htmlspecialchars($pconfig['ivrdirectdial']) == "false") { + echo " \n"; + } + else { + echo " \n"; + } + } + + echo " \n"; + ?> +
Allows callers to dial directly to extensions and feature codes that are up to 5 digits in length. + + + + Ring Back + + \n"; + echo " \n"; + if (htmlspecialchars($pconfig['ivrringback']) == "ring") { + echo " \n"; + } + else { + echo " \n"; + } + if (htmlspecialchars($pconfig['ivrringback']) == "music") { + echo " \n"; + } + else { + echo " \n"; + } + echo " \n"; + ?> +
+ + Defines what the caller will hear while destination is being called. The choices are music + (music on hold) ring (ring tone.) default: music + + + + + + Description -
You may enter a description here - for your reference (not parsed). +
+ + You may enter a description here for your reference (not parsed). + + - - Javascript Condition + Javascript Condition ".$ivrconditionjs."\n"; + echo "\n"; } else { - echo "\n"; + echo "\n"; } ?>
A simple valid condition is: @@ -387,11 +483,12 @@ display_top_tabs(build_menu()); - - - - - + + + + +
OptionTypeDestinationDescription + OptionTypeProfileDestinationDescription @@ -414,6 +511,9 @@ display_top_tabs(build_menu()); + @@ -436,7 +536,7 @@ display_top_tabs(build_menu()); } ?> - +
  +   +  
@@ -449,7 +549,7 @@ display_top_tabs(build_menu()); - +
@@ -485,11 +585,12 @@ display_top_tabs(build_menu()); - - - - - + + + + +
OptionTypeDestinationDescription + OptionTypeProfileDestinationDescription @@ -499,7 +600,7 @@ display_top_tabs(build_menu()); - 0) { foreach ($a_ivr_options as $ent) { @@ -512,6 +613,9 @@ display_top_tabs(build_menu()); + @@ -534,7 +638,7 @@ display_top_tabs(build_menu()); } ?> - + +
+ + + extension: 1001
+ voicemail: 1001
+ sip uri (voicemail): sofia/default/*98@${domain}
+ sip uri (external number): sofia/gateway/gatewayname/12081231234
+ sip uri (auto attendant): sofia/default/5002@${domain}
+
+ -- cgit v1.2.3
  +   +  
@@ -547,7 +651,7 @@ display_top_tabs(build_menu()); - +
diff --git a/config/freeswitch/freeswitch_ivr_options_edit.tmp b/config/freeswitch/freeswitch_ivr_options_edit.tmp index 1a7af9d5..8f925813 100644 --- a/config/freeswitch/freeswitch_ivr_options_edit.tmp +++ b/config/freeswitch/freeswitch_ivr_options_edit.tmp @@ -154,7 +154,7 @@ display_top_tabs(build_menu()); else { echo " \n"; } - if (htmlspecialchars($pconfig['huntgrouptimeouttype']) == "sip uri") { + if (htmlspecialchars($pconfig['optiontype']) == "sip uri") { echo " \n"; } else { @@ -192,8 +192,16 @@ display_top_tabs(build_menu());
Destination -
Destination
- e.g. 1001
Description