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; } } $pgtitle = "FreeSWITCH: IVR: Edit"; include("head.inc"); ?>

General Settings:
Interactive voice response general settings.


Extension
e.g. 5001
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"; ?>
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']) { ?>
Option Type Destination Description
     

"; //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']) { ?>
Option Type Destination Description