From 55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Fri, 6 Feb 2009 19:18:00 -0600 Subject: mv packages to config dir to match web layout --- config/freeswitch/freeswitch_ivr_edit.tmp | 582 ++++++++++++++++++++++++++++++ 1 file changed, 582 insertions(+) create mode 100644 config/freeswitch/freeswitch_ivr_edit.tmp (limited to 'config/freeswitch/freeswitch_ivr_edit.tmp') diff --git a/config/freeswitch/freeswitch_ivr_edit.tmp b/config/freeswitch/freeswitch_ivr_edit.tmp new file mode 100644 index 00000000..f9d4652d --- /dev/null +++ b/config/freeswitch/freeswitch_ivr_edit.tmp @@ -0,0 +1,582 @@ + 1 && Day < 7) {\n"; + $ivrconditionjs .= " return true;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= " else {\n"; + $ivrconditionjs .= " return false;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "function isweekend( Day ) {\n"; + $ivrconditionjs .= " if (Day > 1 && Day < 7) {\n"; + $ivrconditionjs .= " return false;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= " else {\n"; + $ivrconditionjs .= " return true;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "function isofficehours( Hours ) {\n"; + $ivrconditionjs .= " if (Hours >= 9 && Hours < 17) {\n"; + $ivrconditionjs .= " return true;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= " else {\n"; + $ivrconditionjs .= " return false;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "function isafterhours( Hours ) {\n"; + $ivrconditionjs .= " if (Hours >= 9 && Hours < 17) {\n"; + $ivrconditionjs .= " return false;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= " else {\n"; + $ivrconditionjs .= " return true;\n"; + $ivrconditionjs .= " }\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "//set default\n"; + $ivrconditionjs .= "condition = true;\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "//Holiday?\n"; + $ivrconditionjs .= "if (isholiday( Month, Date )) {\n"; + $ivrconditionjs .= " console_log( \"info\", \"holiday\\n\" );\n"; + $ivrconditionjs .= " condition = false;\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "//Weekend?\n"; + $ivrconditionjs .= "if (isweekend( Day )) {\n"; + $ivrconditionjs .= " console_log( \"info\", \"weekend\\n\" );\n"; + $ivrconditionjs .= " condition = false;\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + $ivrconditionjs .= "// After Hours?\n"; + $ivrconditionjs .= "if (isafterhours( Hours )) {\n"; + $ivrconditionjs .= " console_log( \"info\", \"after hours\\n\" );\n"; + $ivrconditionjs .= " condition = false;\n"; + $ivrconditionjs .= "}\n"; + $ivrconditionjs .= "\n"; + + +if (isset($id) && $a_ivr[$id]) { + $pconfig['ivrid'] = $a_ivr[$id]['ivrid']; + $ivrid = $a_ivr[$id]['ivrid']; + $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['ivrtimeout'] = $a_ivr[$id]['ivrtimeout']; + $pconfig['ivrcontext'] = $a_ivr[$id]['ivrcontext']; + $pconfig['ivrconditionjs'] = ($a_ivr[$id]['ivrconditionjs']); + $pconfig['ivrdescr'] = $a_ivr[$id]['ivrdescr']; +} + +if ($_POST) { + + unset($input_errors); + $pconfig = $_POST; + + + if ($_GET['act'] == "del") { + if ($_GET['type'] == 'options') { + if ($a_ivroptions[$_GET['optionid']]) { + unset($a_ivr_options[$_GET['optionid']]); + write_config(); + sync_package_freeswitch_ivr(); + //touch($d_hostsdirty_path); + header("Location: freeswitch_ivr_edit.php?id=".$_GET['id']); + exit; + } + } + } + + + if (!$input_errors) { + + $ivrent = array(); + if (strlen($_POST['ivrid']) > 0) { + $ivrent['ivrid'] = $_POST['ivrid']; + } + else { + $ivrent['ivrid'] = guid(); + } + $ivrent['ivrextension'] = $_POST['ivrextension']; + $ivrent['ivrname'] = $_POST['ivrname']; + $ivrent['recordingidaction'] = $_POST['recordingidaction']; + $ivrent['recordingidantiaction'] = $_POST['recordingidantiaction']; + $ivrent['ivrtimeout'] = $_POST['ivrtimeout']; + $ivrent['ivrcontext'] = $_POST['ivrcontext']; + $ivrent['ivrconditionjs'] = base64_encode($_POST['ivrconditionjs']); + $ivrent['ivrdescr'] = $_POST['ivrdescr']; + + if (isset($id) && $a_ivr[$id]) { + //update + $a_ivr[$id] = $ivrent; + } + else { + //add + $a_ivr[] = $ivrent; + } + + //touch($d_hostsdirty_path); + write_config(); + sync_package_freeswitch_ivr(); + + header("Location: freeswitch_ivr.php"); + exit; + } +} + +include("head.inc"); + +?> + + + +

FreeSWITCH: IVR: Edit

+ + + +
+ + +
+ +
+ + + + +
+ + + + + +

General Settings:
+
+ Interactive voice response general settings. +

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Extension + +
e.g. 5002
IVR Name + +
Recording Action + \n"; + echo " \n"; + if (count($a_recordings) > 0) { + foreach ($a_recordings as $ent) { + if (htmlspecialchars($pconfig['recordingidaction']) == $ent['recordingid']) { + echo " \n"; + } + else { + echo " \n"; + } + } + } + echo " \n"; + ?> +
Recording Anti-Action + \n"; + echo " \n"; + if (count($a_recordings) > 0) { + foreach ($a_recordings as $ent) { + if (htmlspecialchars($pconfig['recordingidantiaction']) == $ent['recordingid']) { + echo " \n"; + } + else { + echo " \n"; + } + } + } + echo " \n"; + ?> +
Timeout + +
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.
+
Context + +
e.g. default
Description + +
You may enter a description here + for your reference (not parsed).
Javascript Condition + ".$ivrconditionjs."\n"; + } + else { + echo "\n"; + } + ?> +
A simple valid condition is: + condition=true; To re-populate the default simply empty the + textarea and click on save. The following javascript variables + have been defined: Hours, Mins, Seconds, Month, Date, Year, + and Day.
  + + + + + +
+
+ +
+
+ +
+ "; + //print_r ($a_ivr); + //echo ""; + + //if ($savemsg) print_info_box($savemsg); + //if (file_exists($d_hostsdirty_path)): echo"

"; + //print_info_box_np("The FreeSWITCH recordings have been changed.
You must apply the changes in order for them to take effect."); + //echo"
"; + //endif; + + ?> + + + + + +


+
+ Options are the choices that are available to the caller when they + are calling the auto attendant. If the caller presses 2 then the call + is directed to the corresponding destination. +

+ + + + + + +

Action
+
+ The options that are executed when the condition matches. +

+
+ + + + + + + + + + + 0) { + foreach ($a_ivr_options as $ent) { + if ($ent['optionaction'] == "action" && $ivrid == $ent['ivrid']) { + ?> + + + + + + + + + + + + + + + + + + +
OptionTypeDestinationDescription + + + + + +
+
+ + +   + +   + +   + + + + + + +
+
+ + + + + +
+
+ +

+ + + +
+ "; + //print_r ($a_ivr); + //echo ""; + + //if ($savemsg) print_info_box($savemsg); + //if (file_exists($d_hostsdirty_path)): echo"

"; + //print_info_box_np("The FreeSWITCH recordings have been changed.
You must apply the changes in order for them to take effect."); + //echo"
"; + //endif; + + ?> + + + + +

Anti-Action
+
+ The options that are executed when the condition does NOT match. +

+
+ + + + + + + + + + + 0) { + foreach ($a_ivr_options as $ent) { + if ($ent['optionaction'] == "anti-action" && $ivrid == $ent['ivrid']) { + ?> + + + + + + + + + + + + + + + + + + +
OptionTypeDestinationDescription + + + + + +
+
+ + +   + +   + +   + + + + + + +
+
+ + + + + +
+
+ +

+ +
+
+ +
+ +
+ + + + -- cgit v1.2.3