$callerid[$param['Section']] = $callerid[$param['Section']] . "{$text}"; break; case 'replace': $callerid[$param['Section']] = "{$text}"; break; } $agi->request['calledid_name'] = $callerid['name']; $agi->request['agi_callerid'] = $callerid['number']; $agi->set_callerid("\"{$callerid['name']}\"<{$callerid['number']}>"); } set_time_limit(300); error_reporting(E_ALL); $agi = new AGI(); $logger = new AGI_Logger($agi); $cdr = new AGI_CDR($agi); $agi->answer(); $ext = $agi->request['agi_extension']; // Get 'Extension' table info $query = "SELECT PK_Extension, Extension, Type FROM Extensions WHERE Extension = '{$ext}' LIMIT 1"; $result = $mysqli->query($query) or $logger->error_sql("", $query, __FILE__, __LINE__); $Extension = $result->fetch_assoc(); // Get Starting Parameters $query = "SELECT * FROM Ext_IVR WHERE PK_Extension = '{$Extension['PK_Extension']}' LIMIT 1"; $result = $mysqli->query($query) or $logger->error_sql("", $query, __FILE__, __LINE__); $Ext_IVR = $result->fetch_assoc(); // Get Starting Order $query = "SELECT `Order` FROM IVR_Actions WHERE PK_Action = {$Ext_IVR['FK_Action']} LIMIT 1"; $result = $mysqli->query($query) or $logger->error_sql("", $query, __FILE__, __LINE__); if ($mysqli->numrows($result) == 1) { $step = $mysqli->fetch_array($result); $step = $step[0];
// Copyright 2013 Schmooze Com Inc. // // Bootstrap FreePBX but don't include any modules (so you won't get anything // from the functions.inc.php files of all the modules.) // $restrict_mods = true; if (!@(include_once getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) { include_once '/etc/asterisk/freepbx.conf'; } set_time_limit(0); error_reporting(0); // Connect to AGI: // require_once "phpagi.php"; $AGI = new AGI(); $AGI->answer(); $lang = $AGI->request['agi_language']; if ($lang == 'ja') { sim_playback($AGI, "this-is-yr-wakeup-call"); } else { sim_playback($AGI, "hello&this-is-yr-wakeup-call"); } $time_wakeup = time(); if ($lang == 'ja') { $digit = sim_background($AGI, "wakeup-menu", "1234", 1); } else { // Default back to English if channel doesn't match other languages $digit = sim_background($AGI, "to-cancel-wakeup&press-1&to-snooze-for&digits/5&minutes&press-2&to-snooze-for&digits/10&minutes&press-3&to-snooze-for&digits/15&minutes&press-4", "1234", 1); } $number = $AGI->request['agi_extension']; switch ($digit) {