?> <tr> <td><a href="#" class="info"><?php echo _("Join Message:"); ?> <span><?php echo _("Message to be played to the caller before joining the conference.<br><br>To add additional recordings please use the \"System Recordings\" MENU to the left"); ?> </span></a></td> <td> <select name="joinmsg_id" tabindex="<?php echo ++$tabindex; ?> "> <?php $tresults = recordings_list(); echo '<option value="">' . _("None") . "</option>"; if (isset($tresults[0])) { foreach ($tresults as $tresult) { echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $joinmsg_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } ?> </select> </td> </tr> <?php } else { ?> <tr>
function ivr_show_edit($id, $nbroptions, $post) { global $db; global $tabindex; $ivr_details = ivr_get_details($id); $ivr_dests = ivr_get_dests($id); ?> <div class="content"> <h2><?php echo _("Digital Receptionist"); ?> </h2> <h3><?php echo _("Edit Menu") . " " . $ivr_details['displayname']; ?> </h3> <?php ?> <form name="prompt" action="<?php $_SERVER['PHP_SELF']; ?> " method="post" onsubmit="return prompt_onsubmit();"> <input type="hidden" name="action" value="edited" /> <input type="hidden" name="display" value="ivr" /> <input type="hidden" name="id" value="<?php echo $id; ?> " /> <input name="Submit" type="submit" value="<?php echo _("Save"); ?> " tabindex="<?php echo ++$tabindex; ?> " disabled> <?php $usage_list = array(); if (function_exists('queues_ivr_usage')) { $usage_list = queues_ivr_usage($id); } if (count($usage_list)) { ?> <a href="#" class="info"><?php echo _("Queue Breakout Menu Usage List"); ?> <span><?php echo _("This IVR is being used by the following Queues, providing an ability for callers to hear this Queue's announcement periodically and giving callers an option to break out of the queue into this IVR's menu options. This queue can not be deleted when being used in this mode"); ?> </span></a> <?php $count = 0; foreach ($usage_list as $link) { $label = '<span><img width="16" height="16" border="0" title="' . $link['description'] . '" alt="" src="images/queue_link.png"/> ' . $link['description'] . '</span>'; echo "<br /><a href=" . $link['url_query'] . ">" . $label . "</a>"; } echo "<br />"; } else { ?> <input name="delete" type="submit" value="<?php echo _("Delete") . " " . _("Digital Receptionist") . " {$ivr_details['displayname']}"; ?> " disabled/> <?php } if ($id) { $usage_list = framework_display_destination_usage(ivr_getdest($id)); if (!empty($usage_list)) { ?> <br /><a href="#" class="info"><?php echo $usage_list['text']; ?> :<span><?php echo $usage_list['tooltip']; ?> </span></a> <?php } } ?> <table> <tr><td colspan=2><hr /></td></tr> <tr> <td><a href="#" class="info"><?php echo _("Change Name"); ?> <span><?php echo _("This changes the short name, visible on the right, of this IVR"); ?> </span></a></td> <td><input type="text" name="displayname" value="<?php echo $ivr_details['displayname']; ?> " tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <?php $annmsg_id = isset($ivr_details['announcement_id']) ? $ivr_details['announcement_id'] : ''; if (function_exists('recordings_list')) { //only include if recordings is enabled ?> <tr> <td><a href="#" class="info"><?php echo _("Announcement"); ?> <span><?php echo _("Message to be played to the caller. To add additional recordings please use the \"System Recordings\" MENU to the left"); ?> </span></a></td> <td> <select name="annmsg_id" tabindex="<?php echo ++$tabindex; ?> "> <?php $tresults = recordings_list(); echo '<option value="">' . _("None") . "</option>"; if (isset($tresults[0])) { foreach ($tresults as $tresult) { echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $annmsg_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } ?> </select> </td> </tr> <?php } else { ?> <tr> <td><a href="#" class="info"><?php echo _("Announcement"); ?> <span><?php echo _("Message to be played to the caller.<br><br>You must install and enable the \"Systems Recordings\" Module to edit this option"); ?> </span></a></td> <td> <?php $default = isset($annmsg_id) ? $annmsg_id : ''; ?> <input type="hidden" name="annmsg_id" value="<?php echo $default; ?> "><?php echo $default != '' ? $default : 'None'; ?> </td> </tr> <?php } ?> <tr> <td><a href="#" class="info"><?php echo _("Timeout"); ?> <span><?php echo _("The amount of time (in seconds) before the 't' option, if specified, is used"); ?> </span></a></td> <td><input type="text" name="timeout" value="<?php echo $ivr_details['timeout']; ?> " tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <?php if ($ivr_details['enable_directory'] && function_exists('voicemail_getVoicemail')) { ?> <tr> <td><a href="#" class="info"><?php echo _("Enable Directory"); ?> <span><?php echo _("Let callers into the IVR dial '#' to access the directory. WARNING: this feature is deprecated and will be removed from future versions. You should install the Directory module and assign an IVR destination to use Directory functionality."); ?> </span></a></td> <td><input type="checkbox" name="ena_directory" <?php echo $ivr_details['enable_directory']; ?> tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <tr> <td><a href="#" class="info"><?php echo _("Directory Context"); ?> <span><?php echo _("When # is selected, this is the voicemail directory context that is used"); ?> </span></a></td> <td> <select name="dircontext" tabindex="<?php echo ++$tabindex; ?> "> <?php $vm_results = voicemail_getVoicemail(); $vmcontexts = array_keys($vm_results); foreach ($vmcontexts as $vmc) { if ($vmc != 'general' && $vmc != 'zonemessages') { echo '<option value="' . $vmc . '"' . ($vmc == $ivr_details['dircontext'] ? ' SELECTED' : '') . '>' . $vmc . "</option>\n"; } } ?> </select> </td> </tr> <?php } ?> <tr> <td><a href="#" class="info"><?php echo _("VM Return to IVR"); ?> <span><?php echo _("If checked, upon exiting voicemail a caller will be returned to this IVR if they got a users voicemail"); ?> </span></a></td> <td><input type="checkbox" name="retvm" <?php echo $ivr_details['retvm']; ?> tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <?php if (!function_exists('directory_list')) { ?> <tr> <td><a href="#" class="info"><?php echo _("Enable Direct Dial"); ?> <span><?php echo _("Let callers into the IVR dial an extension directly"); ?> </span></a></td> <td><input type="checkbox" name="ena_directdial" <?php echo $ivr_details['enable_directdial']; ?> tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <?php } else { ?> <tr> <td><a href="#" class="info"><?php echo _("Direct Dial Options"); ?> <span><?php echo _("Provides options for callers to direct dial an extension. Direct dialing can be completely disabled, it can be enabled for all extensions on a system, or it can be tied to a Company Directory allowing any member listed in that directory to be dialed directly if their extension is known. If an extension in the chosen directory is overridden, only that overridden number is dialable"); ?> </span></a></td> <td> <select name="ena_directdial" tabindex="<?php echo ++$tabindex; ?> "> <?php $dlist = directory_list(); echo '<option value=""' . ($ivr_details['enable_directdial'] == '' ? ' SELECTED' : '') . '>' . _('Disabled') . "</option>\n"; echo '<option value="CHECKED"' . (strtoupper($ivr_details['enable_directdial']) == 'CHECKED' ? ' SELECTED' : '') . '>' . _('All Extensions') . "</option>\n"; foreach ($dlist as $dir) { echo '<option value="' . $dir['id'] . '"' . ($ivr_details['enable_directdial'] == $dir['id'] ? ' SELECTED' : '') . '>' . $dir['dirname'] . "</option>\n"; } ?> </select> </td> </tr> <?php } ?> <tr> <td><a href="#" class="info"><?php echo _("Loop Before t-dest"); ?> <span><?php echo _("If checked, and there is a 't' (timeout) destination defined below, the IVR will loop back to the beginning if no input is provided for the designated loop counts prior to going to the timeout (t) destination."); ?> </span></a></td> <td><input type="checkbox" name="alt_timeout" <?php echo $ivr_details['alt_timeout']; ?> tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <?php $timeout_id = isset($ivr_details['timeout_id']) ? $ivr_details['timeout_id'] : ''; if (function_exists('recordings_list')) { //only include if recordings is enabled ?> <tr> <td><a href="#" class="info"><?php echo _("Timeout Message"); ?> <span><?php echo _("If a timeout occurs and a message is selected, it will be played in place of the announcement message when looping back to the top of the IVR. It will not be played if the t destination is the next target."); ?> </span></a></td> <td> <select name="timeout_id" tabindex="<?php echo ++$tabindex; ?> "> <?php //$tresults obtained above echo '<option value="">' . _("None") . "</option>"; if (isset($tresults[0])) { foreach ($tresults as $tresult) { echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $timeout_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } ?> </select> </td> </tr> <?php } ?> <tr> <td><a href="#" class="info"><?php echo _("Loop Before i-dest"); ?> <span><?php echo _("If checked, and there is an 'i' (invalid extension) destination defined below, the IVR will play invalid option and then loop back to the beginning for the designated loop counts prior to going to the invalid (i) destination."); ?> </span></a></td> <td><input type="checkbox" name="alt_invalid" <?php echo $ivr_details['alt_invalid']; ?> tabindex="<?php echo ++$tabindex; ?> "></td> </tr> <?php $invalid_id = isset($ivr_details['invalid_id']) ? $ivr_details['invalid_id'] : ''; if (function_exists('recordings_list')) { //only include if recordings is enabled ?> <tr> <td><a href="#" class="info"><?php echo _("Invalid Message"); ?> <span><?php echo _("If an invalid extension is pressed and a message is selected, it will be played in place of the announcement message when looping back to the top of the IVR. It will not be played if the t destination is the next target. If nothing is selected, the system will play a default invalid extension message before going back to the main announcement"); ?> </span></a></td> <td> <select name="invalid_id" tabindex="<?php echo ++$tabindex; ?> "> <?php //$tresults obtained above echo '<option value="">' . _("None") . "</option>"; if (isset($tresults[0])) { foreach ($tresults as $tresult) { echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $invalid_id ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } ?> </select> </td> </tr> <?php } ?> <tr> <td><a href="#" class="info"><?php echo _("Repeat Loops:"); ?> <span><?php echo _("The number of times we should loop when invalid input or no input has been entered before going to the defined or default generated 'i' or 't' options. If the 'i' or 't' options are defined, the above check boxes must be checked in order to loop."); ?> </span></a></td> <td> <select name="loops" tabindex="<?php echo ++$tabindex; ?> "> <?php $default = isset($ivr_details['loops']) ? $ivr_details['loops'] : 2; for ($i = 0; $i <= 9; $i++) { echo '<option value="' . $i . '" ' . ($i == $default ? 'SELECTED' : '') . '>' . $i . '</option>'; } ?> </select> </td> </tr> <tr><td colspan=2><hr /></td></tr> <tr><td colspan=2> <input name="increase" type="submit" value="<?php echo _("Increase Options"); ?> " disabled> <input name="Submit" type="submit" value="<?php echo _("Save"); ?> " tabindex="<?php echo ++$tabindex; ?> " disabled> <?php if ($nbroptions > 1) { ?> <input name="decrease" type="submit" value="<?php echo _("Decrease Options"); ?> " disabled> <?php } ?> </td> </tr> <tr><td colspan=2><hr /></td></tr></table> <style type="text/css"> #ivr-dests tr:nth-child(odd){ background-color: #FCE7CE; } </style> <table id="ivr-dests"> <?php // Draw the destinations $dests = ivr_get_dests($id); $count = 0; if (!empty($dests)) { foreach ($dests as $dest) { drawdestinations($count, $dest['selection'], $dest['dest'], $dest['ivr_ret']); $count++; } } while ($count < $nbroptions) { drawdestinations($count, null, null, 0); $count++; } ?> </table> <?php if ($nbroptions < $count) { echo "<input type='hidden' name='nbroptions' value={$count} />\n"; } else { echo "<input type='hidden' name='nbroptions' value={$nbroptions} />\n"; } global $module_hook; echo $module_hook->hookHtml; ?> <input name="increase" type="submit" value="<?php echo _("Increase Options"); ?> " disabled> <input name="Submit" type="submit" value="<?php echo _("Save"); ?> " disabled> <?php if ($nbroptions > 1) { ?> <input name="decrease" type="submit" value="<?php echo _("Decrease Options"); ?> " disabled> <?php } ?> <script language="javascript"> <!-- $(document).ready(function() { $(':submit:disabled').removeAttr('disabled'); }); function delEntry(e){ $('[name=option'+e+'],[name=goto'+e+']').val('').parent().parent().fadeOut(500,function(){$(this).remove();}); } var theForm = document.prompt; theForm.displayname.focus(); function prompt_onsubmit() { var msgInvalidOption = "<?php echo _("Invalid option"); ?> "; defaultEmptyOK = true; // go thru the form looking for options // where the option isn't blank (as that will be removed) do the validation var allelems = theForm.elements; if (allelems != null) { var i, elem; for (i = 0; elem = allelems[i]; i++) { if (elem.type == 'text' && elem.name.indexOf('option') == 0) { if (elem.value != '') { if (!isIVROption(elem.value)) return warnInvalid(elem, msgInvalidOption); var gotoNum = elem.name.charAt(6); var isok = validateSingleDestination(theForm,gotoNum,true); if (!isok) return false; } } } } return true; } //--> </script> </form> </div> <?php }
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This file is part of FBilling. recordings.php - Reponsible for managing recordings associated with each hangup cause */ include "shared.php"; // get list of recordings and draw rnav // of course we could name this files cause.php, and whole section whould be cause management, which would be, em, not pretty // anyways above can be done bit later $cause_list = fbilling_get_list('causes'); echo "<div class='rnav'><ul>"; foreach ($cause_list as $cause) { echo "<li class='current'><a href=/admin/config.php?display={$display}&cat={$cat}&action=edit&id={$cause['id']}>{$cause['name']}</a></li>"; } echo "</ul></div>"; $recording_list = recordings_list(); if ($action == 'edit') { // start edit cause $cause_data = fbilling_get_data_by_id('causes', $id); ?> <form name='cause' method='GET'> <table> <tr> <td> <a href='#' class='info'><?php echo _("Cause Name"); ?> <span><?php echo _("Selected recording will be played whenever extension will hit that cause"); ?>
function daynight_show_edit($post, $add = "") { global $db; global $itemid; $fcc = new featurecode('daynight', 'toggle-mode-' . $itemid); $code = $fcc->getCodeActive(); unset($fcc); $dests = daynight_get_obj($itemid); $password = isset($dests['password']) ? $dests['password'] : ''; $fc_description = isset($dests['fc_description']) ? $dests['fc_description'] : ''; $state = isset($dests['state']) ? $dests['state'] : 'DAY'; $day_recording_id = isset($dests['day_recording_id']) ? $dests['day_recording_id'] : ''; $night_recording_id = isset($dests['night_recording_id']) ? $dests['night_recording_id'] : ''; ?> <div class="content"> <h2><?php echo _("Day / Night Mode Control"); ?> </h2> <?php if ($itemid != "") { $delURL = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'] . '&action=delete'; $tlabel = sprintf(_("Delete Day/Night Feature Code %s"), $code); $label = '<span><img width="16" height="16" border="0" title="' . $tlabel . '" alt="" src="images/core_delete.png"/> ' . $tlabel . '</span>'; ?> <a href="<?php echo $delURL; ?> "><?php echo $label; ?> </a><br /> <?php $usage_list = framework_display_destination_usage(daynight_getdest($itemid)); if (!empty($usage_list)) { ?> <a href="#" class="info"><?php echo $usage_list['text'] . '<br />'; ?> <span><?php echo $usage_list['tooltip']; ?> </span></a> <?php } $timeconditions_refs = daynight_list_timecondition($itemid); if (!empty($timeconditions_refs)) { echo "<br />"; foreach ($timeconditions_refs as $ref) { $dmode = $ref['dmode'] == 'timeday' ? _("Forces to Day Mode") : _("Forces to Night Mode"); $timecondition_id = $ref['dest']; $tcURL = $_SERVER['PHP_SELF'] . '?' . "display=timeconditions&itemid={$timecondition_id}"; $label = '<span><img width="16" height="16" border="0" title="' . sprintf(_("Linked to Time Condition %s - %s"), $timecondition_id, $dmode) . '" alt="" src="images/clock_link.png"/> ' . sprintf(_("Linked to Time Condition %s - %s"), $timecondition_id, $dmode) . '</span>'; ?> <a href="<?php echo $tcURL; ?> "><?php echo $label; ?> </a><br /> <?php } } } ?> <form name="prompt" action="<?php $_SERVER['PHP_SELF']; ?> " method="post" onsubmit="return prompt_onsubmit();"> <input type="hidden" name="action" value="edited" /> <input type="hidden" name="display" value="daynight" /> <input name="Submit" type="submit" style="display:none;" value="save" /> <table> <tr> <td colspan=2><hr /> </td> </tr> <tr> <td colspan="2"> <input name="Submit" type="submit" value="<?php echo _("Save"); ?> "> <?php if ($itemid != '') { echo "  " . sprintf(_("Use feature code: %s to toggle DAY/NIGHT mode"), "<strong>" . $code . "</strong>"); } ?> </td> </tr> <tr> <td colspan=2> <hr /> </td> </tr> <tr> <td><a href="#" class="info"><?php echo _("Day/Night Feature Code Index:"); ?> <span><?php echo _("There are a total of 10 Feature code objects, 0-9, each can control a call flow and be toggled using the day/night feature code plus the index."); ?> </span></a> </td> <td> <?php if ($add == "add" && $itemid == "") { ?> <select name="itemid" tabindex="<?php echo ++$tabindex; ?> "> <?php $ids = daynight_get_avail(); foreach ($ids as $id) { echo '<option value="' . $id . '" >' . $id . '</option>'; } ?> </select> <?php } else { ?> <input readonly="yes" size="1" type="text" name="itemid" value="<?php echo $itemid; ?> "> <?php } ?> </td> </tr> <tr> <td><a href="#" class="info"><?php echo _("Description"); ?> :<span><?php echo _("Description for this Day/Night Control"); ?> </span></a></td> <td><input size="40" type="text" name="fc_description" value="<?php echo $fc_description; ?> " tabindex="<?php echo ++$tabindex; ?> "> </td> </tr> <tr> <td><a href="#" class="info"><?php echo _("Current Mode:"); ?> <span><?php echo _("This will change the current state for this Day/Night Mode Control, or set the initial state when creating a new one."); ?> </span></a> </td> <td> <select name="state" tabindex="<?php echo ++$tabindex; ?> "> <option value="DAY" <?php echo $state == 'DAY' ? 'SELECTED' : ''; ?> ><?php echo _("Day"); ?> </option> <option value="NIGHT" <?php echo $state == 'NIGHT' ? 'SELECTED' : ''; ?> ><?php echo _("Night"); ?> </option> </select> </td> </tr> <?php if (function_exists('recordings_list')) { //only include if recordings are enabled ?> <tr> <td><a href="#" class="info"><?php echo _("Recording for Day Mode"); ?> <span><?php echo _("Message to be played.<br>To add additional recordings use the \"System Recordings\" MENU to the left"); ?> </span></a></td> <td> <select name="day_recording_id" tabindex="<?php echo ++$tabindex; ?> "> <?php $tresults = recordings_list(); $default = isset($day_recording_id) ? $day_recording_id : ''; echo '<option value="0">' . _("Default") . "</option>\n"; if (isset($tresults[0])) { foreach ($tresults as $tresult) { echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $default ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } ?> </select> </td> </tr> <tr> <td><a href="#" class="info"><?php echo _("Recording for Night Mode"); ?> <span><?php echo _("Message to be played.<br>To add additional recordings use the \"System Recordings\" MENU to the left"); ?> </span></a></td> <td> <select name="night_recording_id" tabindex="<?php echo ++$tabindex; ?> "> <?php $default = isset($night_recording_id) ? $night_recording_id : ''; echo '<option value="0">' . _("Default") . "</option>\n"; if (isset($tresults[0])) { foreach ($tresults as $tresult) { echo '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $default ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } ?> </select> </td> </tr> <?php } ?> <tr> <td><a href="#" class="info"><?php echo _("Optional Password"); ?> :<span><?php echo _('You can optionally include a password to authenticate before toggling the day/night mode. If left blank anyone can use the feature code and it will be un-protected'); ?> </span></a></td> <td><input size="12" type="text" name="password" value="<?php echo $password; ?> " tabindex="<?php echo ++$tabindex; ?> "> </td> </tr> <tr> <td colspan=2> <hr /> </td> </tr> <?php // Draw the destinations // returns an array, $dest['day'], $dest['night'] // and puts null if nothing set drawdestinations(0, _("DAY"), isset($dests['day']) ? $dests['day'] : ''); drawdestinations(1, _("NIGHT"), isset($dests['night']) ? $dests['night'] : ''); //TODO: Check to make sure a destination radio button was checked, and if custom, that it was not blank // ?> <tr> <td colspan=2> <input name="Submit" type="submit" value="<?php echo _("Save"); ?> "> <?php if ($itemid != '') { echo "  " . sprintf(_("Use feature code: %s to toggle DAY/NIGHT mode"), "<strong>" . $code . "</strong>"); } ?> </td> </tr> <tr> <td colspan=2> <hr /> </td> </tr> </table> <script language="javascript"> <!-- var theForm = document.prompt; function prompt_onsubmit() { var msgInvalidPassword = "******"; defaultEmptyOK = true; if (!isInteger(theForm.password.value)) return warnInvalid(theForm.password, msgInvalidPassword); return true; } //--> </script> </form> <?php }
function recordings_get_config($engine) { global $ext; // is this the best way to pass this? global $recordings_save_path; global $version; $ast_ge_14 = version_compare($version, '1.4', 'ge'); $modulename = "recordings"; $appcontext = "app-recordings"; switch ($engine) { case "asterisk": // FeatureCodes for save / check $fcc = new featurecode($modulename, 'record_save'); $fc_save = $fcc->getCodeActive(); unset($fcc); $fcc = new featurecode($modulename, 'record_check'); $fc_check = $fcc->getCodeActive(); unset($fcc); if ($fc_save != '' || $fc_check != '') { $ext->addInclude('from-internal-additional', 'app-recordings'); // Add the include from from-internal if ($fc_save != '') { $ext->add($appcontext, $fc_save, '', new ext_macro('user-callerid')); $ext->add($appcontext, $fc_save, '', new ext_wait('2')); $ext->add($appcontext, $fc_save, '', new ext_macro('systemrecording', 'dorecord')); } if ($fc_check != '') { $ext->add($appcontext, $fc_check, '', new ext_macro('user-callerid')); $ext->add($appcontext, $fc_check, '', new ext_wait('2')); $ext->add($appcontext, $fc_check, '', new ext_macro('systemrecording', 'docheck')); } } // Now generate the Feature Codes to edit recordings // $recordings = recordings_list(); foreach ($recordings as $item) { // Get the feature code, and do a sanity check if it is not suppose to be active and delete it // if ($item['fcode'] != 0) { $fcc = new featurecode($modulename, 'edit-recording-' . $item['id']); $fcode = $fcc->getCodeActive(); unset($fcc); } else { $fcc = new featurecode('recordings', 'edit-recording-' . $item['id']); $fcc->delete(); unset($fcc); continue; // loop back to foreach } if ($fcode != '') { // Do a sanity check, there should be no compound files // if (strpos($item['filename'], '&') === false && trim($item['filename']) != '') { $fcode_pass = trim($item['fcode_pass']) != '' ? ',' . $item['fcode_pass'] : ''; $ext->add($appcontext, $fcode, '', new ext_macro('user-callerid')); $ext->add($appcontext, $fcode, '', new ext_wait('2')); $ext->add($appcontext, $fcode, '', new ext_macro('systemrecording', 'docheck,' . $item['filename'] . $fcode_pass)); //$ext->add($appcontext, $fcode, '', new ext_macro('hangup')); } } } // moved from modules/core to modules/recordings // since it really belongs here and not there // also provides direct access to $recordings_save_path // which removes a hard-coded value in the macro $context = 'macro-systemrecording'; $ext->add($context, 's', '', new ext_setvar('RECFILE', '${IF($["${ARG2}" = ""]?' . $recordings_save_path . '${AMPUSER}-ivrrecording:${ARG2})}')); $ext->add($context, 's', '', new ext_execif('$["${ARG3}" != ""]', 'Authenticate', '${ARG3}')); $ext->add($context, 's', '', new ext_goto(1, '${ARG1}')); $exten = 'dorecord'; // Delete all versions of the current sound file (does not consider languages though // otherwise you might have some versions that are not re-recorded // $ext->add($context, $exten, '', new ext_system('rm ${ASTVARLIBDIR}/sounds/${RECFILE}.*')); $ext->add($context, $exten, '', new ext_record('${RECFILE}:wav')); $ext->add($context, $exten, '', new ext_wait(1)); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'docheck'; $ext->add($context, $exten, '', new ext_playback('beep')); if ($ast_ge_14) { $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${CHANNEL(language)},macro-systemrecording')); } else { $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${LANGUAGE},macro-systemrecording')); } $ext->add($context, $exten, '', new ext_wait(1)); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'confmenu'; if ($ast_ge_14) { $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${CHANNEL(language)},macro-systemrecording')); } else { $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-rerecord-it&press-star&astcc-followed-by-pound,m,${LANGUAGE},macro-systemrecording')); } $ext->add($context, $exten, '', new ext_read('RECRESULT', '', 1, '', '', 4)); $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x*"]', 'dorecord,1')); $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x1"]', 'docheck,2')); $ext->add($context, $exten, '', new ext_goto(1)); $ext->add($context, '1', '', new ext_goto('dc_start', 'docheck')); $ext->add($context, '*', '', new ext_goto(1, 'dorecord')); $ext->add($context, 't', '', new ext_playback('goodbye')); $ext->add($context, 't', '', new ext_hangup()); $ext->add($context, 'i', '', new ext_playback('pm-invalid-option')); $ext->add($context, 'i', '', new ext_goto(1, 'confmenu')); $ext->add($context, 'h', '', new ext_hangup()); break; } }
function recording_sidebar($id, $num) { ?> <div class="rnav"><ul> <li><a id="<?php echo empty($id) ? 'current' : 'nul'; ?> " href="config.php?display=recordings&usersnum=<?php echo urlencode($num); ?> "><?php echo _("Add Recording"); ?> </a></li> <li><a id="<?php echo $id === -1 ? 'current' : 'nul'; ?> " href="config.php?display=recordings&action=system"><?php echo _("Built-in Recordings"); ?> </a></li> <?php $wrapat = 18; $tresults = recordings_list(); if (isset($tresults)) { foreach ($tresults as $tresult) { echo "<li>"; echo "<a id=\"" . ($id == $tresult[0] ? 'current' : 'nul') . "\" href=\"config.php?display=recordings&"; echo "action=edit&"; echo "usersnum=" . urlencode($num) . "&"; // echo "filename=".urlencode($tresult[2])."&"; echo "id={$tresult[0]}\">"; $dispname = $tresult[1]; while (strlen($dispname) > 1 + $wrapat) { $part = substr($dispname, 0, $wrapat); echo htmlspecialchars($part); $dispname = substr($dispname, $wrapat); if ($dispname != '') { echo "<br>"; } } echo htmlspecialchars($dispname); echo "</a>"; echo "</li>\n"; } } echo "</ul></div>\n"; }
$selected_dev = $notselected_dev = ''; $pl_options = ''; foreach ($device_list as $ext => $name) { $selected = in_array((string) $ext, $devices, true) ? 'SELECTED' : ''; $pl_options .= '<option value = ' . $ext . ' ' . $selected . '>' . $name . '</option>'; } $class = ' class="device_list ui-sortable ui-menu ui-widget ui-widget-content ui-corner-all" '; $devhtml .= '<h4>' . _('Selected') . '</h4><fieldset id="selected_dev" ' . $class . '>' . $selected_dev . '</fieldset>'; $devhtml .= '<h4>' . _('Not Selected') . '</h4><fieldset id="notselected_dev" ' . $class . '>' . $notselected_dev . '</fieldset>'; $rec_list['none'] = _('None'); $rec_list['default'] = _('Default'); $rec_list['beep'] = _('Beep'); $thisGRP['announcement'] = !empty($thisGRP['announcement']) ? $thisGRP['announcement'] : 'default'; if (function_exists('recordings_list')) { //build recordings list $rl = recordings_list(); $rl = is_array($rl) ? $rl : array(); foreach ($rl as $rec) { $rec_list[$rec['id']] = $rec['displayname']; } } $aopts = ''; foreach ($rec_list as $key => $value) { $aopts .= '<option value=' . $key . ' ' . ($key == $thisGRP['announcement'] ? 'SELECTED' : '') . '>' . $value . '</option>'; } ?> <form class="fpbx-submit" name="page_opts_form" id="page_opts_form" data-fpbx-delete="<?php echo $delURL; ?> " method="POST"> <input type="hidden" name="view" value="form">
function recordings_get_config($engine) { global $ext; // is this the best way to pass this? global $recordings_save_path; global $version; $ast_ge_14 = version_compare($version, '1.4', 'ge'); $ast_ge_16 = version_compare($version, '1.6', 'ge'); $modulename = "recordings"; $appcontext = "app-recordings"; switch ($engine) { case "asterisk": // Now generate the Feature Codes to edit recordings // $recordings = recordings_list(); $ext->addInclude('from-internal-additional', 'app-recordings'); // Add the include from from-internal foreach ($recordings as $item) { // Get the feature code, and do a sanity check if it is not suppose to be active and delete it // if ($item['fcode'] != 0) { $fcc = new featurecode($modulename, 'edit-recording-' . $item['id']); $fcode = $fcc->getCodeActive(); unset($fcc); } else { $fcc = new featurecode('recordings', 'edit-recording-' . $item['id']); $fcc->delete(); unset($fcc); continue; // loop back to foreach } if ($fcode != '') { // Do a sanity check, there should be no compound files // if (strpos($item['filename'], '&') === false && trim($item['filename']) != '') { $fcode_pass = trim($item['fcode_pass']) != '' ? ',' . $item['fcode_pass'] : ''; $ext->add($appcontext, $fcode, '', new ext_macro('user-callerid')); $ext->add($appcontext, $fcode, '', new ext_wait('2')); $ext->add($appcontext, $fcode, '', new ext_macro('systemrecording', 'docheck,' . $item['filename'] . $fcode_pass)); //$ext->add($appcontext, $fcode, '', new ext_macro('hangup')); } } } // moved from modules/core to modules/recordings // since it really belongs here and not there // also provides direct access to $recordings_save_path // which removes a hard-coded value in the macro $context = 'systemrecording-gui'; $exten = 'dorecord'; $ext->add($context, $exten, '', new ext_record('${RECFILE}.wav,,,k')); $ext->add($context, 'h', '', new ext_system('touch ${RECFILE}.finished')); $ext->add($context, 'h', 'exit', new ext_hangup()); $context = 'macro-systemrecording'; $ext->add($context, 's', '', new ext_gotoif('$["${ARG2}" = ""]', 'invalid')); $ext->add($context, 's', '', new ext_setvar('TMPLANG', '${CHANNEL(language)}')); $ext->add($context, 's', '', new ext_setvar('RECFILE', '${TMPLANG}/${ARG2}')); $ext->add($context, 's', '', new ext_setvar('LISTEN', 'docheck')); $ext->add($context, 's', '', new ext_execif('$["${ARG3}" != ""]', 'Authenticate', '${ARG3}')); $ext->add($context, 's', '', new ext_goto(1, '${ARG1}')); $exten = 'dorecord'; // Delete all versions of the current sound file (does not consider languages though // otherwise you might have some versions that are not re-recorded // $ext->add($context, $exten, '', new ext_setvar('TMPRECFILE', '${RECFILE}-TMP')); $ext->add($context, $exten, '', new ext_background('say-temp-msg-prs-pound,,${CHANNEL(language)}')); $ext->add($context, $exten, '', new ext_record('${TMPRECFILE}.wav,,,k')); $ext->add($context, $exten, '', new ext_setvar('LISTEN', 'dochecknolanguage')); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'dochecknolanguage'; $ext->add($context, $exten, '', new ext_playback('beep')); $ext->add($context, $exten, 'dc_start', new ext_background('${TMPRECFILE},m,,macro-systemrecording')); $ext->add($context, $exten, '', new ext_wait(1)); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'docheck'; $ext->add($context, $exten, '', new ext_playback('beep')); $ext->add($context, $exten, 'dc_start', new ext_background('${RECFILE},m,${CHANNEL(language)},macro-systemrecording')); $ext->add($context, $exten, '', new ext_wait(1)); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'confmenu'; $ext->add($context, $exten, '', new ext_background('to-listen-to-it&press-1&to-accept-recording&press-2&to-rerecord-it&press-star&language&press-3,m,${CHANNEL(language)},macro-systemrecording')); $ext->add($context, $exten, '', new ext_read('RECRESULT', '', 1, '', '', 4)); $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x*"]', 'dorecord,1')); $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x1"]', '${LISTEN},2')); $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x2"]', 'doaccept,1')); $ext->add($context, $exten, '', new ext_gotoif('$["x${RECRESULT}"="x3"]', 'switchlang,1')); $ext->add($context, $exten, '', new ext_goto(1)); $exten = 'doaccept'; $ext->add($context, $exten, '', new ext_setvar('EXISTS', '${STAT(e,${ASTVARLIBDIR}/sounds/${TMPRECFILE}.wav)}')); $ext->add($context, $exten, '', new ext_noop('${EXISTS}')); $ext->add($context, $exten, '', new ext_gotoif('$["${EXISTS}" != "1"]', 'exit')); $ext->add($context, $exten, '', new ext_system('touch ${ASTVARLIBDIR}/sounds/${RECFILE}.finished')); $ext->add($context, $exten, '', new ext_gotoif('$["x${TMPRECFILE}"="x"]', 'exit')); $ext->add($context, $exten, '', new ext_system('mv ${ASTVARLIBDIR}/sounds/${TMPRECFILE}.wav ${ASTVARLIBDIR}/sounds/${RECFILE}.wav')); $ext->add($context, $exten, '', new ext_setvar('TMPRECFILE', '${RECFILE}')); $ext->add($context, $exten, 'exit', new ext_playback('auth-thankyou')); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'switchlang'; $ext->add($context, $exten, '', new ext_playback('language&is-set-to')); $ext->add($context, $exten, '', new ext_sayalpha('${TMPLANG}')); $ext->add($context, $exten, '', new ext_playback('after-the-tone')); $langs = \FreePBX::Soundlang()->getLanguages(); $c = 1; foreach ($langs as $l => $d) { $ext->add($context, $exten, '', new ext_background('press-' . $c)); $ext->add($context, $exten, '', new ext_sayalpha($l)); $c++; } $ext->add($context, $exten, '', new ext_playback('beep')); $ext->add($context, $exten, '', new ext_read('LANGRESULT', '', 1, '', '', 4)); $c = 1; foreach ($langs as $l => $d) { $ext->add($context, $exten, '', new ext_execif('$["x${LANGRESULT}"="x' . $c . '"]', 'Set', 'TMPLANG=' . $l)); $c++; } $ext->add($context, $exten, '', new ext_setvar('RECFILE', '${TMPLANG}/${ARG2}')); $ext->add($context, $exten, '', new ext_playback('language&is-set-to')); $ext->add($context, $exten, '', new ext_sayalpha('${TMPLANG}')); $ext->add($context, $exten, '', new ext_goto(1, 'confmenu')); $exten = 'invalid'; $ext->add($context, $exten, '', new ext_playback('pm-invalid-option')); $ext->add($context, $exten, '', new ext_hangup()); $ext->add($context, '1', '', new ext_goto('dc_start', '${LISTEN}')); $ext->add($context, '2', '', new ext_goto(1, 'doaccept')); $ext->add($context, '3', '', new ext_goto(1, 'switchlang')); $ext->add($context, '*', '', new ext_goto(1, 'dorecord')); $ext->add($context, 't', '', new ext_playback('goodbye')); $ext->add($context, 't', '', new ext_hangup()); $ext->add($context, 'i', '', new ext_playback('pm-invalid-option')); $ext->add($context, 'i', '', new ext_goto(1, 'confmenu')); $ext->add($context, 'h', '', new ext_system('touch ${ASTVARLIBDIR}/sounds/${RECFILE}.finished')); $ext->add($context, 'h', '', new ext_gotoif('$["x${TMPRECFILE}"="x"]', 'exit')); $ext->add($context, 'h', '', new ext_system('mv ${ASTVARLIBDIR}/sounds/${TMPRECFILE}.wav ${ASTVARLIBDIR}/sounds/${CHANNEL(language)}/${RECFILE}.wav')); $ext->add($context, 'h', 'exit', new ext_hangup()); break; } }
function directory_draw_entries_tr($id, $realid, $name = '', $foreign_name, $audio = '', $num = '', $e_id = '', $reuse_audio = false, $dataname = null) { global $amp_conf, $directory_draw_recordings_list, $audio_select; if (!$directory_draw_recordings_list) { $directory_draw_recordings_list = recordings_list(); } $e_id = $e_id ? $e_id : directory_get_next_id($realid); if (!$audio_select || !$reuse_audio) { unset($audio_select); $audio_select = '<select name="entries[' . $e_id . '][audio]" class="form-control">'; $audio_select .= '<option value="vm" ' . ($audio == 'vm' ? 'SELECTED' : '') . '>' . _('Voicemail Greeting') . '</option>'; $audio_select .= '<option value="tts" ' . ($audio == 'tts' ? 'SELECTED' : '') . '>' . _('Text to Speech') . '</option>'; $audio_select .= '<option value="spell" ' . ($audio == 'spell' ? 'SELECTED' : '') . '>' . _('Spell Name') . '</option>'; $audio_select .= '<optgroup label="' . _('System Recordings:') . '">'; foreach ($directory_draw_recordings_list as $r) { $audio_select .= '<option value="' . $r['id'] . '" ' . ($audio == $r['id'] ? 'SELECTED' : '') . '>' . $r['displayname'] . '</option>'; } $audio_select .= '</select>'; } if ($realid != 'custom') { $user_type = (isset($amp_conf['AMPEXTENSION']) && $amp_conf['AMPEXTENSION']) == 'deviceanduser' ? 'user' : 'extension'; $tlabel = sprintf(_("Edit %s: %s"), $user_type, $realid); $user = '******' . $user_type . 's&skip=0&extdisplay=' . $realid . '"><i class="fa fa-user"></i></a> '; } else { $user = ''; } $delete = '<i alt="' . _('remove') . '" title="' . _('Click here to remove this entry') . '" class="trash-tr fa fa-trash" style="color:#2779aa;" data-name="' . $dataname . '"></i>'; $t1_class = $name == '' ? ' class = "dpt-title form-control" ' : 'class="form-control"'; $t2_class = $realid == 'custom' ? ' placeholder="Custom Dialstring" ' : ' placeholder="' . $realid . '" '; if (trim($num) == '') { $t2_class .= '" class = "dpt-title form-control" '; } else { $t2_class .= '" class = "form-control"'; } $td[] = '<input type="hidden" readonly="readonly" name="entries[' . $e_id . '][foreign_id]" value="' . $realid . '" /><input type="text" name="entries[' . $e_id . '][name]" placeholder="' . $foreign_name . '"' . $t1_class . ' value="' . $name . '" />'; $td[] = $audio_select; $td[] = '<input type="text" name="entries[' . $e_id . '][num]" ' . $t2_class . ' value="' . $num . '" />'; $opts = array('id' => $id, 'e_id' => $e_id, 'realid' => $realid, 'name' => $name, 'audio' => $audio, 'num' => $num); $more_td = mod_func_iterator('draw_entries_tr_directory', $opts); foreach ($more_td as $mod) { foreach ($mod as $m) { $td[] = $m; } } $td[] = $delete . $user; //build html $html = '<tr class="entrie' . $e_id . '">'; foreach ($td as $t) { if (is_array($t)) { $html .= '<td ' . $t['attr'] . '/>'; $html .= $t['val']; $html .= '</td>'; } else { $html .= '<td>' . $t . '</td>'; } } $html .= '</tr>'; return $html; }
function vmblast_get_config($engine) { global $ext; // is this the best way to pass this? switch ($engine) { case "asterisk": $ext->addInclude('from-internal-additional', 'vmblast-grp'); $contextname = 'vmblast-grp'; $vmlist = vmblast_list(); if (function_exists('recordings_list')) { $recordings_installed = true; $got_recordings = false; } else { $recordings_installed = false; } if (is_array($vmlist)) { foreach ($vmlist as $item) { $grpnum = ltrim($item['0']); $grp = vmblast_get($grpnum); $grplist = $grp['grplist']; $ext->add($contextname, $grpnum, '', new ext_macro('user-callerid')); $ext->add($contextname, $grpnum, '', new ext_answer('')); $ext->add($contextname, $grpnum, '', new ext_wait('1')); if (isset($grp['password']) && trim($grp['password']) != "" && ctype_digit(trim($grp['password']))) { $ext->add($contextname, $grpnum, '', new ext_authenticate($grp['password'])); } $ext->add($contextname, $grpnum, '', new ext_setvar('GRPLIST', '')); foreach ($grplist as $exten) { $ext->add($contextname, $grpnum, '', new ext_macro('get-vmcontext', $exten)); $ext->add($contextname, $grpnum, '', new ext_setvar('GRPLIST', '${GRPLIST}&' . $exten . '@${VMCONTEXT}')); } // Add a message and confirmation so they know what group they are in // if ($grp['audio_label'] == -2) { $ext->add($contextname, $grpnum, '', new ext_goto('1', '1', 'app-vmblast')); } elseif ($grp['audio_label'] == -1 || !$recordings_installed) { $ext->add($contextname, $grpnum, '', new ext_setvar('DIGITS', $grpnum)); $ext->add($contextname, $grpnum, '', new ext_goto('digits', 'vmblast', 'app-vmblast')); } else { if (!$got_recordings) { $recordings = recordings_list(); $got_recordings = true; $recording_hash = array(); foreach ($recordings as $recording) { $recording_hash[$recording[0]] = $recording[2]; } } if (isset($recording_hash[$grp['audio_label']])) { $ext->add($contextname, $grpnum, '', new ext_setvar('VMBMSG', $recording_hash[$grp['audio_label']])); $ext->add($contextname, $grpnum, '', new ext_goto('msg', 'vmblast', 'app-vmblast')); } else { $ext->add($contextname, $grpnum, '', new ext_setvar('DIGITS', $grpnum)); $ext->add($contextname, $grpnum, '', new ext_goto('digits', 'vmblast', 'app-vmblast')); } } } $contextname = 'app-vmblast'; $ext->add($contextname, 'vmblast', 'digits', new ext_execif('$["${DIGITS}" != ""]', 'SayDigits', '${DIGITS}')); $ext->add($contextname, 'vmblast', 'msg', new ext_execif('$["${VMBMSG}" != ""]', 'Background', '${VMBMSG}')); $ext->add($contextname, 'vmblast', '', new ext_background('if-correct-press&digits/1')); $ext->add($contextname, 'vmblast', '', new ext_waitexten('20')); $ext->add($contextname, 'vmblast', '', new ext_playback('sorry-youre-having-problems&goodbye')); $ext->add($contextname, 'vmblast', '', new ext_hangup('')); $ext->add($contextname, '1', '', new ext_vm('${GRPLIST:1},s')); $ext->add($contextname, '1', '', new ext_hangup('')); } break; } }
function findmefollow_users_configpageload($pagename) { global $currentcomponent; global $amp_conf; global $extdisplay; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $extdisplay = isset($_REQUEST['extdisplay']) ? $_REQUEST['extdisplay'] : null; $extension = isset($_REQUEST['extension']) ? $_REQUEST['extension'] : null; $tech_hardware = isset($_REQUEST['tech_hardware']) ? $_REQUEST['tech_hardware'] : null; $fmfm = isset($extdisplay) && trim($extdisplay) != '' ? findmefollow_get($extdisplay, 1) : array(); if (empty($fmfm) && (!isset($extdisplay) || trim($extdisplay) == '')) { $fmfm = array("ddial" => $amp_conf['FOLLOWME_DISABLED'] && !$amp_conf['FOLLOWME_AUTO_CREATE'] ? "CHECKED" : "", "strategy" => $amp_conf['FOLLOWME_RG_STRATEGY'], "grptime" => $amp_conf['FOLLOWME_TIME'], "pre_ring" => $amp_conf['FOLLOWME_PRERING']); } elseif (empty($fmfm) && isset($extdisplay) && trim($extdisplay) != '') { $fmfm = array("ddial" => $amp_conf['FOLLOWME_DISABLED'] && !$amp_conf['FOLLOWME_AUTO_CREATE'] ? "CHECKED" : "", 'grplist' => $extdisplay, 'postdest' => "ext-local," . $extdisplay . ",dest", "strategy" => $amp_conf['FOLLOWME_RG_STRATEGY'], "grptime" => $amp_conf['FOLLOWME_TIME'], "pre_ring" => $amp_conf['FOLLOWME_PRERING']); } $moh = music_list(); $recordings = recordings_list(); $recordingslist = array(); $recordingslist[] = array("value" => "", "text" => _("None")); if (!empty($recordings)) { foreach ($recordings as $recording) { $recordingslist[] = array("value" => $recording['id'], "text" => $recording['displayname']); } } $disabled = $fmfm['ddial'] == "CHECKED"; $category = "findmefollow"; $currentcomponent->addTabTranslation($category, _("Find Me/Follow Me")); findmefollow_draw_general($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh); findmefollow_draw_confirm($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh); findmefollow_draw_cid($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh); findmefollow_draw_destinations($fmfm, $currentcomponent, $category, $disabled, $recordingslist, $moh); }
<?php // Delete them all even if they should not exist just in case // $recordings = recordings_list(); foreach ($recordings as $item) { $fcc = new featurecode('recordings', 'edit-recording-' . $item['id']); $fcc->delete(); unset($fcc); } sql('DROP TABLE IF EXISTS recordings');
} else { //build recordings list foreach (recordings_list() as $rec) { $rec_list[$rec['id']] = $rec['displayname']; } //get paging defaults $def = paging_get_autoanswer_defaults(true); $announce = 'beep'; if (isset($def['DOPTIONS'])) { preg_match('/A\\((.*?)\\)/', $def['DOPTIONS'], $m); //blank file? That would be 'none' if (isset($m[0]) && (!isset($m[1]) || !$m[1])) { $announce = 'none'; //otherwise, get the ID of the system recording } elseif (isset($m[0], $m[1])) { foreach (recordings_list() as $raw) { if ($raw['filename'] == $m[1]) { $announce = $raw['id']; break; } } } } } $aopts = ''; foreach ($rec_list as $key => $value) { $aopts .= '<option value=' . $key . ' ' . ($key == $announce ? 'SELECTED' : '') . '>' . $value . '</option>'; } $drop_silence = \FreePBX::Paging()->getDropSilence(); ?> <h3><?php
<input type="radio" id="skip_joinannounce-ready" name="skip_joinannounce" value="ready" ' . ($skip_joinannounce == 'ready' ? 'checked' : '') . '><label for="skip_joinannounce-ready">' . _('When No Ready Agents') . '</label> </span> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <span id="joinannounce_id-help" class="help-block fpbx-help-block">' . _("Announcement played to callers prior to joining the queue. This can be skipped if there are agents ready to answer a call (meaning they still may be wrapping up from a previous call) or when they are free to answer the call right now. To add additional recordings please use the \"System Recordings\" MENU.") . '</span> </div> </div> </div> <!--END Join Announcement--> '; $tresults = recordings_list(false); $aaopts = ''; $default = isset($agentannounce_id) ? $agentannounce_id : ''; $aaopts .= '<option value="">' . _("None") . '</option>'; if (isset($tresults[0])) { foreach ($tresults as $tresult) { $aaopts .= '<option value="' . $tresult['id'] . '"' . ($tresult['id'] == $default ? ' SELECTED' : '') . '>' . $tresult['displayname'] . "</option>\n"; } } $aahtml = ' <!--Agent Announcement--> <div class="element-container"> <div class="row"> <div class="col-md-12"> <div class="row"> <div class="form-group">