# Cancel recording require_once 'AastraIPPhoneExecute.class.php'; $object = new AastraIPPhoneExecute(); $object->addEntry('Key:Goodbye'); $object->setTriggerDestroyonExit(); break; # Callback # Callback case 'callback': # Input Screen require_once 'AastraIPPhoneInputScreen.class.php'; $object = new AastraIPPhoneInputScreen(); $object->setDestroyOnExit(); # Input number $object->setTitle(Aastra_get_label('Edit Number', $language)); $object->setType('number'); $object->setPrompt(Aastra_get_label('Number to dial', $language)); $object->setParameter('paused'); $object->setURL($XML_SERVER . '&action=dial&msg=' . $msg . '&cause=' . $cause); $object->setDefault($cause); # Common Softkeys $object->addSoftkey('1', Aastra_get_label('Backspace', $language), 'SoftKey:BackSpace'); $object->addSoftkey('5', Aastra_get_label('Dial', $language), 'SoftKey:Submit'); $object->addSoftkey('6', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=detail&msg=' . $msg); break; # Dial # Dial case 'dial': # PhoneExecute require_once 'AastraIPPhoneExecute.class.php'; $object = new AastraIPPhoneExecute();
# Trace Aastra_trace_call('biorhytm', 'user='******'1.4.2.', 0); Aastra_test_php_function('imagecreate', Aastra_get_label('PHP-GD extension not installed.', $language)); $nb_softkeys = Aastra_number_softkeys_supported(); # Nothing entered if ($bdate == '') { $date = Aastra_get_user_context($user, 'biorhytm'); $object = new AastraIPPhoneInputScreen(); $object->setTitle(Aastra_get_label('Biorhythms', $language)); $object->setPrompt(Aastra_get_label('Birth Date (MM/DD/YYYY)', $language)); $object->setParameter('bdate'); $object->setType('dateUS'); $object->setURL($XML_SERVER); $object->setDefault($date); $object->setDestroyOnExit(); if ($nb_softkeys == 10) { $object->addSoftkey('10', Aastra_get_label('Exit', $language), "SoftKey:Exit"); } } else { # Save user context Aastra_save_user_context($user, 'biorhytm', $bdate); # Extract day/month/year $birthMonth = substr($bdate, 0, 2); $birthDay = substr($bdate, 3, 2); $birthYear = substr($bdate, 6, 4); # check date for validity, display error message if invalid if (!@checkDate($birthMonth, $birthDay, $birthYear)) {
Aastra_save_user_context(Aastra_get_userdevice_Asterisk($user), 'pbx_directory', $speed); # Next action $action = 'list'; break; } # Process action switch ($action) { # Search the directory case 'search': # InputScreen require_once 'AastraIPPhoneInputScreen.class.php'; $object = new AastraIPPhoneInputScreen(); $object->setTitle(Aastra_get_label('Directory Lookup', $language)); $object->setURL($XML_SERVER . '&action=list'); $object->setDestroyOnExit(); $object->setType('string'); $object->setPrompt(Aastra_get_label('Letters in name', $language)); $object->setParameter('lookup'); if ($lookup != '') { $object->setDefault($lookup); } # Softkeys $object->addSoftkey('5', Aastra_get_label('List Mode', $language), $XML_SERVER . '&action=list', 1); $object->addSoftkey('6', Aastra_get_label('Search', $language), 'SoftKey:Submit', 2); $object->addSoftkey('9', Aastra_get_label('Cancel', $language), $XML_SERVER . '&action=list', 3); $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 4); $object->setCancelAction($XML_SERVER . '&action=list'); $object->addIcon(1, 'Icon:Book'); $object->addIcon(2, 'Icon:Search'); $object->addIcon(3, 'Icon:ArrowLeft'); $object->addIcon(4, 'Icon:CircleRed');
} else { $object->addSoftkey('6', Aastra_get_label('Reboot', $language), $XML_SERVER . '&action=reboot'); } } if ($nb_softkeys == 6) { $object->addSoftkey('1', Aastra_get_label('Backspace', $language), 'SoftKey:BackSpace'); $object->addSoftkey('6', Aastra_get_label('Submit', $language), 'SoftKey:Submit'); } break; case '2': $object = new AastraIPPhoneInputScreen(); $object->setTitle(Aastra_get_label('Initial Startup', $language)); $object->setPrompt(Aastra_get_label('Enter password', $language)); $object->setParameter('password'); if ($AA_FREEPBX_MODE == '1') { $object->setType('number'); } else { $object->setType('string'); } $object->setPassword(); $object->setURL($XML_SERVER . '&action=input&step=3&extension=' . $extension); $object->setDestroyOnExit(); if (Aastra_is_lockin_supported()) { $object->setLockIn(); if ($nb_softkeys == 6) { $object->addSoftkey('3', Aastra_get_label('Reboot', $language), $XML_SERVER . '&action=reboot'); } else { $object->addSoftkey('6', Aastra_get_label('Reboot', $language), $XML_SERVER . '&action=reboot'); } } if ($nb_softkeys == 6) {
if ($searchmethod) { $searchmethod = implode(",", $searchmethod); } } //step 1&2: ensure that the search term hasnt been entered yet, and promt for it. If //we dont have a search method either, return default to prompt for method if (!$search) { switch ($searchmethod) { case 't9': $sql = 'DELETE FROM contactdir_details WHERE extension = ? and type = ?'; $db->query($sql, array($user, 'searchmethod')); $sql = 'INSERT INTO contactdir_details (extension, type, val) VALUES (?, ?, ?)'; $db->query($sql, array($user, 'searchmethod', 't9')); $input->setTitle('Contact Directory'); $input->setPrompt('Enter first three chars.'); $input->setType('string'); $input->setParameter('search'); $input->setDefault($searchterm); $input->setURL($XML_SERVER_PATH . 'contactdir.php?searchmethod=t9'); $input->setDestroyOnExit(); $input->addSoftkey('1', 'One-Touch', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=onetouch'); $input->addSoftkey('5', 'Back', $XML_SERVER_PATH . 'contactdir.php'); $input->addSoftkey('4', 'Search', 'SoftKey:Submit'); $input->addSoftkey('6', 'BKSpace', 'SoftKey:BackSpace'); $input->addSoftkey('3', 'Exit', 'SoftKey:Exit'); $input->output(); break; case 'onetouch': $sql = 'DELETE FROM contactdir_details WHERE extension = ? and type = ?'; $db->query($sql, array($user, 'searchmethod')); $sql = 'INSERT INTO contactdir_details (extension, type, val) VALUES (?, ?, ?)';
$input->setParameter('param'); $input->setType('string'); $input->setURL('http://myserver.com/script.php?test=1'); $input->setPassword(); $input->setDestroyOnExit(); $input->setDefault(''); $input->setCancelAction($XML_SERVER); $input->output(); break; case 'inputscreen2': require_once 'AastraIPPhoneInputScreen.class.php'; $input = new AastraIPPhoneInputScreen(); $input->setTitle('Title'); $input->setPrompt('Enter the date'); $input->setParameter('param'); $input->setType('dateUS'); $input->setURL('http://myserver.com/script.php'); $input->setDestroyOnExit(); $input->setCancelAction($XML_SERVER); $input->output(); break; case 'inputscreen3': require_once 'AastraIPPhoneInputScreen.class.php'; $input = new AastraIPPhoneInputScreen(); $input->setTitle('Restricted application'); $input->setDisplayMode('condensed'); $input->setURL($XML_SERVER); $input->setDestroyOnExit(); $input->addField('empty'); $input->addField('string'); $input->setFieldSelection('1');