</select></td><td align="left" width="40%"> <input type="submit" value="<?php echo _("Search"); ?> " /> </td></td></table> </td> </tr> </table> </fieldset> </form> </td> </tr> </table> <script>var supportedHTML5 = "<?php echo implode(",", FreePBX::Media()->getSupportedHTML5Formats()); ?> ";</script> <?php } // Determine all CEL events associated with this uid, and then get all CDR records related to this event stream // to display below // if (isset($amp_conf['CEL_ENABLED']) && $amp_conf['CEL_ENABLED'] && !isset($_POST['need_html']) && $action == 'cel_show') { echo '<a id="CEL"></a>'; $cdr_uids = array(); $uid = $dbcdr->escapeSimple($_REQUEST['uid']); $db_cel_name = !empty($amp_conf['CELDBNAME']) ? $amp_conf['CELDBNAME'] : "asteriskcdrdb"; $db_cel_table_name = !empty($amp_conf['CELDBTABLENAME']) ? $amp_conf['CELDBTABLENAME'] : "cel"; $cel = cdr_get_cel($uid, $db_cel_name . '.' . $db_cel_table_name); $tot_cel_events = count($cel);
function ivr_configprocess() { if (isset($_REQUEST['display']) && $_REQUEST['display'] == 'ivr') { global $db; //get variables $get_var = array('id', 'name', 'alertinfo', 'description', 'announcement', 'directdial', 'invalid_loops', 'invalid_retry_recording', 'invalid_destination', 'invalid_recording', 'retvm', 'timeout_time', 'timeout_recording', 'timeout_retry_recording', 'timeout_destination', 'timeout_loops', 'timeout_append_announce', 'invalid_append_announce', 'timeout_ivr_ret', 'invalid_ivr_ret'); foreach ($get_var as $var) { $vars[$var] = isset($_REQUEST[$var]) ? $_REQUEST[$var] : ''; } $vars['timeout_append_announce'] = empty($vars['timeout_append_announce']) ? '0' : '1'; $vars['invalid_append_announce'] = empty($vars['invalid_append_announce']) ? '0' : '1'; $vars['timeout_ivr_ret'] = empty($vars['timeout_ivr_ret']) ? '0' : '1'; $vars['invalid_ivr_ret'] = empty($vars['invalid_ivr_ret']) ? '0' : '1'; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $entries = isset($_REQUEST['entries']) ? $_REQUEST['entries'] : ''; switch ($action) { case 'save': if (isset($_REQUEST['announcementrecording'])) { $filepath = FreePBX::Config()->get("ASTSPOOLDIR") . "/tmp/" . $_REQUEST['announcementrecording']; $soundspath = FreePBX::Config()->get("ASTVARLIBDIR") . "/sounds"; $codec = "wav"; if (file_exists($filepath)) { FreePBX::Media()->load($filepath); $filename = "ivr-" . $vars['name'] . "-recording-" . time(); FreePBX::Media()->convert($soundspath . "/en/custom/" . $filename . "." . $codec); $id = FreePBX::Recordings()->addRecording("ivr-" . $vars['name'] . "-recording-" . time(), sprintf(_("Recording created for IVR named '%s'"), $vars['name']), "custom/" . $filename); $vars['announcement'] = $id; } else { $vars['announcement'] = ''; } } //get real dest $vars['id'] = ivr_save_details($vars); ivr_save_entries($vars['id'], $entries); needreload(); $this_dest = ivr_getdest($vars['id']); fwmsg::set_dest($this_dest[0]); break; case 'delete': ivr_delete($vars['id']); isset($_REQUEST['id']) ? $_REQUEST['id'] = null : ''; isset($_REQUEST['action']) ? $_REQUEST['action'] = null : ''; needreload(); break; } } }
protected function execute(InputInterface $input, OutputInterface $output) { $args = $input->getArgument('args'); $command = isset($args[0]) ? $args[0] : ''; switch ($command) { case 'cleanplaybackcache': $output->writeln(_("Starting Cache cleanup")); $days = \FreePBX::Config()->get("CACHE_CLEANUP_DAYS"); $time = $days * 24 * 60 * 60; $path = \FreePBX::Config()->get("AMPPLAYBACK"); $path = trim($path); $user = \FreePBX::Config()->get("AMPASTERISKWEBUSER"); $formats = \FreePBX::Media()->getSupportedHTML5Formats(); if (empty($path) || $path == "/") { $output->writeln("<error>" . sprintf(_("Invalid path %s"), $path) . "</error>"); exit(1); } if (file_exists($path)) { foreach (new \DirectoryIterator($path) as $fileInfo) { if ($fileInfo->isDot()) { continue; } $info = posix_getpwuid($fileInfo->getOwner()); if ($info['name'] != $user) { continue; } $extension = pathinfo($fileInfo->getFilename(), PATHINFO_EXTENSION); if ($fileInfo->isFile() && in_array($extension, $formats) && time() - $fileInfo->getCTime() >= $time) { $output->writeln(sprintf(_("Removing file %s"), basename($fileInfo->getRealPath()))); unlink($fileInfo->getRealPath()); } } } $output->writeln(_("Finished cleaning up cache")); break; case 'signaturecheck': \module_functions::create()->getAllSignatures(false, true); break; case 'tablefix': if (posix_geteuid() != 0) { $output->writeln("<error>You need to be root to run this command</error>"); exit(1); } $process = new Process('mysqlcheck --repair --all-databases'); try { $output->writeln(_("Attempting to repair MySQL Tables this may take a while")); $process->mustRun(); $output->writeln(_("MySQL Tables Repaired")); } catch (ProcessFailedException $e) { $output->writeln(sprintf(_("MySQL table repair Failed: %s"), $e->getMessage())); } break; case "zendid": $output->writeln("==========================="); foreach (zend_get_id() as $id) { $output->writeln($id); } $output->writeln("==========================="); break; default: $output->writeln('Invalid argument'); break; } }
$ivr['directdial'] = 'ext-local'; $ivr['timeout_time'] = '5'; $ivr['alertinfo'] = ''; $ivr['invalid_loops'] = '3'; $ivr['invalid_retry_recording'] = 'default'; $ivr['invalid_append_announce'] = ''; $ivr['invalid_ivr_ret'] = ''; $ivr['invalid_recording'] = ''; $ivr['timeout_loops'] = '3'; $ivr['timeout_retry_recording'] = 'default'; $ivr['timeout_append_announce'] = ''; $ivr['timeout_ivr_ret'] = ''; $ivr['timeout_recording'] = 'default'; $ivr['retvm'] = ''; $ivr['announcement'] = ''; } else { } $supported = FreePBX::Media()->getSupportedFormats(); include __DIR__ . "/simple_form.php"; } else { include __DIR__ . "/advanced_form.php"; } ?> </form> </div> </div> </div> </div> </div> </div>