Aastra_trace_call('LDAP directory', $_SERVER['REQUEST_URI']);
# Get Language and HTTP header
$language = Aastra_get_language();
$header = Aastra_decode_HTTP_header();
# Load user context
$menu = Aastra_get_user_context($header['mac'], 'scrollableTextMenuData');
if (!is_object($menu)) {
    # If not an object: Something went wrong when fetching the user context. Display error and exit.
    $object = new AastraIPPhoneTextScreen();
    $object->setTitle(Aastra_get_label('Server error', $language));
    $object->setText(Aastra_get_label('Context not found. Check cache directory settings.', $language));
    $object->output();
    exit;
}
if (!$menu->verifyCookie($cookie)) {
    # If cookie does not match: Display error and exit.
    $object = new AastraIPPhoneTextScreen();
    $object->setTitle(Aastra_get_label('Server error', $language));
    $object->setText(Aastra_get_label('Session not found. Please try again.', $language));
    $object->output();
    exit;
}
if ($recentSelection != "") {
    $menu->setDefaultIndex($recentSelection);
}
if ($zoomIndex != "") {
    $menu->zoom($zoomIndex, $recentPage, $recentSelection);
} else {
    $menu->output($page);
}
exit;
Ejemplo n.º 2
0
                    }
                    $object->addLine(sprintf(Aastra_get_label('I=%+.3f %s', $language), $array['day']['I'], $array['trend']['I']));
                    $object->addLine(sprintf(Aastra_get_label('E=%+.3f %s', $language), $array['day']['E'], $array['trend']['E']));
                    $object->addLine(sprintf(Aastra_get_label('P=%+.3f %s', $language), $array['day']['P'], $array['trend']['P']));
                } else {
                    $object->setScrollStart('2');
                    $object->addLine(sprintf(Aastra_get_label('I=%+.3f %s', $language), $array['day']['I'], $array['trend']['I']));
                    $object->addLine(sprintf(Aastra_get_label('E=%+.3f %s', $language), $array['day']['E'], $array['trend']['E']));
                    $object->addLine(sprintf(Aastra_get_label('P=%+.3f %s', $language), $array['day']['P'], $array['trend']['P']));
                    $object->setScrollEnd();
                }
            } else {
                # create object
                $object = new AastraIPPhoneTextScreen();
                $object->setTitle(Aastra_get_language('BIORHYTHMS', $language));
                $object->setText(sprintf(Aastra_get_label('I=%+.3f, E=%+.3f, P=%+.3f', $language), $array['day']['I'], $array['day']['E'], $array['day']['P']));
            }
        }
    }
    # Common parameters
    $object->setDestroyOnExit();
    if ($nb_softkeys) {
        if ($nb_softkeys == 6) {
            $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER);
            $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
        } else {
            $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER);
            $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
        }
    }
}
Ejemplo n.º 3
0
    # Redirect
    case 'redirect':
        # Redirect the call
        if (Aastra_redirect_Asterisk($member, Aastra_get_userdevice_Asterisk($user), '1', 'default')) {
            # Remove display
            require_once 'AastraIPPhoneExecute.class.php';
            $object = new AastraIPPhoneExecute();
            $object->setTriggerDestroyOnExit('');
            $object->addEntry('');
        } else {
            # Error message
            require_once 'AastraIPPhoneTextScreen.class.php';
            $object = new AastraIPPhoneTextScreen();
            $object->setDestroyOnExit();
            $object->setTitle(Aastra_get_label('Pickup failed', $language));
            $object->setText(Aastra_get_label('Failed to intercept the caller in the queue.', $language));
            # Softkeys
            if ($nb_softkeys == 6) {
                $object->addSoftKey('6', Aastra_get_label('Close', $language), $XML_SERVER . '&action=show_queues&queue=' . $queue);
            } else {
                $object->addSoftKey('10', Aastra_get_label('Close', $language), $XML_SERVER . '&action=show_queues&queue=' . $queue);
                $object->setCancelAction($XML_SERVER . '&action=show_queues&queue=' . $queue);
            }
        }
        break;
}
# Display XML object
if ($refresh == 1) {
    $object->output();
} else {
    # Do nothing
Ejemplo n.º 4
0
     $object->addEntry($XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2);
     break;
     # Info on a menu
 # Info on a menu
 case 'details':
     # Load menu config file
     $all = Aastra_readINIfile($menu_source . '.menu', '#', '=');
     foreach ($all as $key => $value) {
         $all[$key]['info'] = Aastra_get_label($all[$key]['info'], $language);
     }
     # Display Help
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     $object->setTitle($selection);
     if ($all[$selection]['info'] != '') {
         $object->setText($all[$selection]['info']);
     } else {
         $object->setText(Aastra_get_label('No information available', $language));
     }
     # Softkeys
     if ($nb_softkeys) {
         if ($nb_softkeys == 6) {
             $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2);
             $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
             $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2);
             $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             $object->setCancelAction($XML_SERVER . '&menu_action=add&menu_page2=' . $menu_page2);
         }
     }
     break;
Ejemplo n.º 5
0
         }
         $object->setScrollStart();
         $object->addLine('');
         $object->addLine(Aastra_get_label('Last Trade', $language) . ': ' . $return[1][0][1]);
         $object->addLine(Aastra_get_label('Ask', $language) . ': ' . $return[1][0][4]);
         $object->addLine(Aastra_get_label('Bid', $language) . ': ' . $return[1][0][5]);
         $object->addLine(Aastra_get_label('Date', $language) . ': ' . $return[1][0][2]);
         $object->addLine(Aastra_get_label('Time', $language) . ': ' . $return[1][0][3]);
         $object->setScrollEnd();
         $object->addLine(Aastra_get_label('Powered by Yahoo', $language), '', 'center');
     }
 } else {
     # Prepare result screen
     $object = new AastraIPPhoneTextScreen();
     $object->setTitle(Aastra_get_label('Currency converter', $language));
     $object->setText(Aastra_get_label('Information not available at this time. Please try again later.', $language));
 }
 # Add remaining softkeys
 if ($nb_softkeys == 6) {
     if ($action == 'display') {
         $object->addSoftkey('4', Aastra_get_label('New Lookup', $language), $XML_SERVER . '&action=init');
     } else {
         $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&action=favorites&selection=' . $selection);
     }
     $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
 } else {
     if ($action == 'display') {
         $object->addSoftkey('6', Aastra_get_label('New Lookup', $language), $XML_SERVER . '&action=init');
     } else {
         $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&action=favorites&selection=' . $selection);
     }
Ejemplo n.º 6
0
 # shift $index
 $index--;
 # Display article
 $object = new AastraIPPhoneTextScreen();
 $object->setDestroyOnExit();
 if (Aastra_is_wrap_title_supported()) {
     $object->setTitleWrap();
 }
 # Title
 if (Aastra_phone_type() == 5) {
     $object->setTitle($array_rss[$index]['title']);
 } else {
     $object->setTitle($array_rss[99]['title'] . ' - ' . $array_rss[$index]['title']);
 }
 # Content
 $object->setText($array_rss[$index]['description']);
 # Softkeys
 if ($nb_softkeys) {
     if ($nb_softkeys == 6) {
         if ($index != 0) {
             $object->addSoftkey('2', Aastra_get_label('Previous', $language), $XML_SERVER . '&zip=' . $zip . '&index=' . $index);
         }
         $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&zip=' . $zip);
         if ($index != count($array_rss) - 2) {
             $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&zip=' . $zip . '&index=' . ($index + 2));
         }
         $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
     } else {
         $softkey = 1;
         foreach ($array_rss as $key => $value) {
             if ($key != '99') {
Ejemplo n.º 7
0
     exit;
     break;
     # Parked calls
 # Parked calls
 case 'list':
     # Get Parked calls
     $park = Aastra_get_parked_calls_Asterisk();
     $count = count($park);
     # Update display
     if ($count == 0) {
         # No park calls
         require_once 'AastraIPPhoneTextScreen.class.php';
         $object = new AastraIPPhoneTextScreen();
         $object->setDestroyOnExit();
         $object->setTitle(Aastra_get_label('Parked Calls', $language));
         $object->setText(Aastra_get_label('No parked calls on the platform.', $language));
         # Softkeys
         if ($nb_softkeys) {
             if ($nb_softkeys == 6) {
                 $object->addSoftkey(4, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list');
                 $object->addSoftkey(6, Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             } else {
                 $object->addSoftkey(6, Aastra_get_label('Refresh', $language), $XML_SERVER . '&action=list');
                 $object->addSoftkey(10, Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             }
         }
     } else {
         # Only one and autopick
         if ($count == 1 and $autopick == '1') {
             # Dial the orbit
             require_once 'AastraIPPhoneExecute.class.php';
Ejemplo n.º 8
0
     # Display conference room
 # Display conference room
 case 'refresh':
     $refresh = 0;
 case 'display':
     # Get an updated list
     $meetmechannel = Aastra_get_meetme_list_Asterisk($confno);
     $nbuser = count($meetmechannel);
     # Display list
     if ($nbuser == 0) {
         # No user
         require_once 'AastraIPPhoneTextScreen.class.php';
         $object = new AastraIPPhoneTextScreen();
         $object->setDestroyOnExit();
         $object->setTitle(sprintf(Aastra_get_label('Conference %s', $language), $confno));
         $object->setText(Aastra_get_label('No user in this conference room.', $language));
         # Softkeys
         if ($nb_softkeys == 6) {
             $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER . '&confno=' . $confno);
             $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
             $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&confno=' . $confno);
             $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             $object->setCancelAction($XML_SERVER . '&confno=' . $confno);
         }
     } else {
         # Retrieve last page
         $last = intval($nbuser / AASTRA_MAXLINES);
         if ($nbuser - $last * AASTRA_MAXLINES != 0) {
             $last++;
         }
Ejemplo n.º 9
0
 # Display article
 $object = new AastraIPPhoneTextScreen();
 $object->setDestroyOnExit();
 if (Aastra_is_wrap_title_supported()) {
     $object->setTitleWrap();
 }
 if (Aastra_number_softkeys_supported() < 7) {
     $object->setTitle($array_rss[$rank]['title']);
 } else {
     if (count($array_rss) > 1) {
         $object->setTitle($Title[$index] . ' (' . ($rank + 1) . '/' . count($array_rss) . ') - ' . $array_rss[$rank]['title']);
     } else {
         $object->setTitle($Title[$index] . ' - ' . $array_rss[$rank]['title']);
     }
 }
 $object->setText($array_rss[$rank]['description']);
 if ($rank != 0 or $rank != count($array_rss) - 1) {
     $back = $XML_SERVER . '&index=' . ($index + 1) . '&last_rank=' . ($rank + 1);
 } else {
     $back = $XML_SERVER . '&last_index=' . ($index + 1);
 }
 if (Aastra_is_softkeys_supported()) {
     if (Aastra_number_softkeys_supported() < 7) {
         if ($rank != 0) {
             $object->addSoftkey('2', Aastra_get_label('Previous', $language), $XML_SERVER . '&index=' . ($index + 1) . '&rank=' . $rank);
         }
         $object->addSoftkey('4', Aastra_get_label('Back', $language), $back);
         if ($rank != count($array_rss) - 1) {
             $object->addSoftkey('5', Aastra_get_label('Next', $language), $XML_SERVER . '&index=' . ($index + 1) . '&rank=' . ($rank + 2));
         }
         $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
Ejemplo n.º 10
0
function display_message($title, $message, $backURL = NULL)
{
    global $LANGUAGE;
    # Depending on phone type
    if (Aastra_phone_type() != 5) {
        # non 6739i
        require_once 'AastraIPPhoneTextScreen.class.php';
        $object = new AastraIPPhoneTextScreen();
        $object->setTitle($title);
        $object->setText($message);
        $object->addSoftkey('5', Aastra_get_label('Back', $LANGUAGE), $backURL);
        $object->addSoftkey('6', Aastra_get_label('Exit', $LANGUAGE), 'SoftKey:Exit');
    } else {
        # 6739i/8000i
        require_once 'AastraIPPhoneFormattedTextScreen.class.php';
        $object = new AastraIPPhoneFormattedTextScreen();
        $object->addLine('', 'double', 'center');
        $object->addLine($title, 'double', 'center', 'red');
        $object->setScrollStart('3');
        $object->addLine('');
        $object->addLine('');
        $object->addLine($message, NULL, 'center');
        $object->setScrollEnd();
        $object->addLine('', NULL, 'center');
        $object->addSoftkey('9', Aastra_get_label('Back', $LANGUAGE), $backURL, 1);
        $object->addSoftkey('10', Aastra_get_label('Exit', $LANGUAGE), 'SoftKey:Exit', 2);
        $object->addIcon(1, 'Icon:ArrowLeft');
        $object->addIcon(2, 'Icon:CircleRed');
    }
    # Common parameters
    $object->setDestroyOnExit();
    $object->setCancelAction($backURL);
    $object->output();
    exit;
}
Ejemplo n.º 11
0
             $object->setTitle(Aastra_get_label('No ACD Queue', $language));
             $object->setText(Aastra_get_label('You are not allowed to connect to any ACD queue on this platform. Please contact your administrator.', $language));
             # Softkeys
             if ($nb_softkeys == 6) {
                 $object->addSoftKey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             } else {
                 $object->addSoftKey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             }
         }
     } else {
         # The agent is not a member of any queues or no queues
         require_once 'AastraIPPhoneTextScreen.class.php';
         $object = new AastraIPPhoneTextScreen();
         $object->setDestroyOnExit();
         $object->setTitle(Aastra_get_label('No ACD Queue', $language));
         $object->setText(Aastra_get_label('There are no ACD queue configured on your system. Please contact your administrator.', $language));
         # Softkeys
         if ($nb_softkeys == 6) {
             $object->addSoftKey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         } else {
             $object->addSoftKey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
         }
     }
     break;
     # Pause or unpause
 # Pause or unpause
 case 'pause':
     # Get agent status for this queue
     $status = get_agent_status($queue, $agent);
     # Agent logged?
     if ($status['Logged']) {
Ejemplo n.º 12
0
     $menu->setDestroyOnExit();
     $menu->setDefaultIndex('2');
     $menu->addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2', '1');
     $menu->addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1', '2');
     $menu->addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3', '3');
     $menu->natsortByName();
     $menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
     $menu->addSoftkey('9', 'Back', $XML_SERVER);
     $menu->addSoftkey('10', 'Exit', 'SoftKey:Exit');
     $menu->output();
     break;
 case 'textscreen':
     require_once 'AastraIPPhoneTextScreen.class.php';
     $text = new AastraIPPhoneTextScreen();
     $text->setTitle('Title');
     $text->setText('The screen object can be implemented similar to the firmware info screen.');
     $text->setDestroyOnExit();
     $text->addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1');
     $text->addSoftkey('6', 'Exit', 'SoftKey:Exit');
     $text->output();
     break;
 case 'inputscreen1':
     require_once 'AastraIPPhoneInputScreen.class.php';
     $input = new AastraIPPhoneInputScreen();
     $input->setTitle('Title');
     $input->setPrompt('Enter your password');
     $input->setParameter('param');
     $input->setType('string');
     $input->setURL('http://myserver.com/script.php?test=1');
     $input->setPassword();
     $input->setDestroyOnExit();
Ejemplo n.º 13
0
                 $index++;
             }
             $object->setScrollEnd();
         }
     }
 } else {
     # Use a TextScreen
     require_once 'AastraIPPhoneTextScreen.class.php';
     $object = new AastraIPPhoneTextScreen();
     # Internal call
     if ($callerid_type == 'internal') {
         # Presence enabled
         if ($AA_PRESENCE_STATE) {
             $away = Aastra_manage_presence_Asterisk($number, 'get', 'status');
             $object->setTitle($callerid);
             $object->setText('Ext.' . $number);
             if ($away['status'] != AA_PRESENCE_AVAILABLE) {
                 $line = Aastra_format_presence_dt_Asterisk($away['return']);
                 $dt = $line[0];
                 if ($line[1] != '') {
                     $dt .= ' ' . $line[1];
                 }
                 $text = sprintf(Aastra_get_label('Currently %s. %s.', $language), $status_text[$away['status']]['label'], $dt);
             } else {
                 $text = sprintf(Aastra_get_label('Currently %s.', $language), $status_text[$away['status']]['label']);
             }
             $object->setText($text);
         } else {
             $object->setTitle($callerid);
             $object->setText('Ext.' . $number);
         }
Ejemplo n.º 14
0
                     $object->addIcon(2, Aastra_get_custom_icon('Cellphone'));
                     $object->addIcon(3, Aastra_get_custom_icon('Home'));
                     $object->addIcon(4, Aastra_get_custom_icon('Phone'));
                 } else {
                     $object->addIcon(1, 'Icon:Office');
                     $object->addIcon(2, 'Icon:CellPhone');
                     $object->addIcon(3, 'Icon:Home');
                     $object->addIcon(4, 'Icon:PhoneOnHook');
                 }
             }
         } else {
             # Display error
             require_once 'AastraIPPhoneTextScreen.class.php';
             $object = new AastraIPPhoneTextScreen();
             $object->setTitle($data[$selection]['name']);
             $object->setText(Aastra_get_label('No phone number associated to this name.', $language));
             $object->addSoftkey('6', Aastra_get_label('Done', $language), $XML_SERVER . '&action=list&selection=' . $selection);
         }
     } else {
         # Back to the list
         require_once 'AastraIPPhoneExecute.class.php';
         $object = new AastraIPPhoneExecute();
         $object->addEntry($XML_SERVER . '&action=list&selection=' . $selection);
     }
     break;
     # List of speed dial
 # List of speed dial
 case 'list':
     # Display speeddials as a list
     require_once 'AastraIPPhoneTextMenu.class.php';
     $object = new AastraIPPhoneTextMenu();
Ejemplo n.º 15
0
         $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '?action=input&lookup=' . $lookup);
         $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
     }
     break;
     # Contact details
 # Contact details
 case 'zoom':
     # Retrieve Contact
     $Contact = getRecord($index);
     # Any number at all?
     if ($Contact['phone_home'] == '' and $Contact['phone_work'] != '' and $Contact['phone_mobile'] != '' and $Contact['phone_other'] != '') {
         # Error Message
         $object = new AastraIPPhoneTextScreen();
         $object->setDestroyOnExit();
         $object->setTitle($Contact['last_name'] . ' ' . $Contact['first_name']);
         $object->setText(Aastra_get_label('No attached phone number.', $language));
     } else {
         # Retrieve configuration
         $array_config_asterisk = Aastra_readINIfile(AASTRA_CONFIG_DIRECTORY . 'directory.conf', '#', '=');
         $conf = $array_config_asterisk['Dialplan'];
         # Prepare display
         if ($Contact['phone_home'] != '') {
             $display['home'] = prepare_number($Contact['phone_home'], 1, $conf);
             $dial['home'] = prepare_number($Contact['phone_home'], 0, $conf);
         }
         if ($Contact['phone_work'] != '') {
             $display['work'] = prepare_number($Contact['phone_work'], 1, $conf);
             $dial['work'] = prepare_number($Contact['phone_work'], 0, $conf);
         }
         if ($Contact['phone_mobile'] != '') {
             $display['mobile'] = prepare_number($Contact['phone_mobile'], 1, $conf);
Ejemplo n.º 16
0
     if ($value != '') {
         $change = 'select';
     }
     break;
 }
 # Retrieve current status
 $cf = Aastra_manage_cf_Asterisk($user, $action, $value);
 # Softkeys?
 if ($nb_softkeys) {
     # Textscreen for softkey phones
     require_once 'AastraIPPhoneTextScreen.class.php';
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     $object->setTitle(sprintf(Aastra_get_label('Call Forward for %s', $language), Aastra_get_userdevice_Asterisk($user)));
     if ($cf == '') {
         $object->setText(Aastra_get_label('Call Forward is currently deactivated.', $language));
         $object->addSoftkey('1', Aastra_get_label('Activate', $language), $XML_SERVER . '&action=' . $change);
     } else {
         $array_user = array_flip($array_user);
         $text = sprintf(Aastra_get_label('Call Forward is currently set to %s', $language), $cf);
         if ($array_user[$cf] != '') {
             $array_label = array('cell' => Aastra_get_label('Cell', $language), 'home' => Aastra_get_label('Home', $language), 'other' => Aastra_get_label('Other', $language));
             $text .= ' (' . $array_label[$array_user[$cf]] . ')';
         }
         $object->setText($text);
         $object->addSoftkey('1', Aastra_get_label('Change', $language), $XML_SERVER . '&action=' . $change);
         $object->addSoftkey('2', Aastra_get_label('Deactivate', $language), $XML_SERVER . '&action=cancel');
     }
     if ($nb_softkeys == 6) {
         $object->addSoftkey('3', Aastra_get_label('My Numbers', $language), $XML_SERVER . '&action=info');
         $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
Ejemplo n.º 17
0
                        } else {
                            $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '?selection=' . $selection . '&user='******'&action=favorites');
                            $object->setCancelAction($XML_SERVER . '?selection=' . $selection . '&user='******'&action=favorites');
                        }
                        $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                    }
                }
            } else {
                # Display error
                $object = new AastraIPPhoneTextScreen();
                $object->setDestroyOnExit();
                $object->setTitle(Aastra_get_label('Application error', $language));
                $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language));
            }
        } else {
            # Display error
            $object = new AastraIPPhoneTextScreen();
            $object->setDestroyOnExit();
            $object->setTitle(Aastra_get_label('Application error', $language));
            $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language));
        }
        break;
}
# Top title
if (Aastra_is_top_title_supported()) {
    $object->setTopTitle(Aastra_get_label('World Clock'), '', '1');
    $object->addIcon('1', 'http://' . $AA_XML_SERVER . '/' . $AA_XMLDIRECTORY . '/icons/clock.png');
}
# Display object
$object->output();
exit;
Ejemplo n.º 18
0
     $object->setTriggerDestroyOnExit();
     $object->addEntry('');
     break;
     # Submit password
 # Submit password
 case 'submit':
     # MODE USER
     if ($AA_FREEPBX_MODE == '1') {
         # Authentication failed
         if (!Aastra_verify_user_Asterisk($user, $password, 'login')) {
             # Display error
             require_once 'AastraIPPhoneTextScreen.class.php';
             $object = new AastraIPPhoneTextScreen();
             $object->setDestroyOnExit();
             $object->setTitle(Aastra_get_label('Authentication failed', $language));
             $object->setText(Aastra_get_label('Wrong credentials.', $language));
             # Softkeys
             if ($nb_softkeys) {
                 if ($nb_softkeys == 6) {
                     $object->addSoftkey('5', Aastra_get_label('Cancel', $language), 'SoftKey:Exit');
                     $object->addSoftkey('6', Aastra_get_label('Close', $language), $XML_SERVER);
                 } else {
                     $object->addSoftkey('9', Aastra_get_label('Cancel', $language), 'SoftKey:Exit');
                     $object->addSoftkey('10', Aastra_get_label('Close', $language), $XML_SERVER);
                 }
             }
         } else {
             # Only if auto-logout is supported//configured
             if ($is_sip_notify and $AA_AUTOLOGOUT) {
                 # Confirm logout
                 require_once 'AastraIPPhoneTextMenu.class.php';
Ejemplo n.º 19
0
Aastra_trace_call('area', 'area=' . $area);
# Test User Agent
Aastra_test_phone_version('1.4.2.', 0);
# Get language
$language = Aastra_get_language();
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
# Test parameter
if ($area) {
    # Load area codes
    $array = Aastra_readINIfile('area_codes.txt', '#', '=');
    $object = new AastraIPPhoneTextScreen();
    $object->setDestroyOnExit();
    $object->setTitle(sprintf(Aastra_get_label('Area code %s', $language), $area));
    if ($array[''][$area] != '') {
        $object->setText($array[''][$area]);
    } else {
        $object->setText(sprintf(Aastra_get_label('Area code %s not found.', $language), $area));
    }
    # Softkeys
    if ($nb_softkeys > 0) {
        if ($nb_softkeys < 7) {
            $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER);
            $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
        } else {
            $object->addSoftkey('9', Aastra_get_label('New Lookup', $language), $XML_SERVER);
            $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
        }
    }
    $object->setCancelAction($XML_SERVER);
} else {
Ejemplo n.º 20
0
     $input->setPrompt('Enter first three chars.');
     $input->setType('number');
     $input->setParameter('search');
     $input->setDefault($searchterm);
     $input->setURL($XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=onetouch');
     $input->addSoftkey('1', 'T9', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=t9');
     //$input->addSoftkey('2', 'History', $XML_SERVER_PATH.'contactdir.php?user='******'&searchmethod=t9&history=show');
     $input->addSoftkey('5', 'Back', $XML_SERVER_PATH . 'contactdir.php?user='******'4', 'Search', 'SoftKey:Submit');
     $input->addSoftkey('6', 'BKSpace', 'SoftKey:BackSpace');
     $input->addSoftkey('3', 'Exit', 'SoftKey:Exit');
     $input->output();
     break;
 case 'help':
     $text->setTitle('Contact Directory');
     $text->setText('To search for contacts, use one of the following methods: One-touch: allows you to press each key once for the desired letter (i.e. to spell boy: \'2\' for \'b\', \'6\' for \'o\', \'9\' for \'y\'). T9: hit each number untill the desired letter appears on the screen (i.e. to spell boy: \'22\' for \'b\', \'666\' for \'o\', \'999\' for \'y\').');
     $text->setDestroyOnExit();
     $text->addSoftkey('3', 'Back', $XML_SERVER_PATH . 'contactdir.php?user='******'Contact Directory');
     $text->setText('Chose input method to use for search:');
     $text->setDestroyOnExit();
     $text->addSoftkey('1', 'One-Touch', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=onetouch');
     $text->addSoftkey('2', 'T9', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=t9');
     $text->addSoftkey('3', 'Help', $XML_SERVER_PATH . 'contactdir.php?user='******'&searchmethod=help');
     $text->addSoftkey('6', 'Exit', 'SoftKey:Exit');
     $text->output();
     break;
Ejemplo n.º 21
0
 }
 if ($directory[$index]['home'] != '') {
     $conf_speed[$speed]['home'] = prepare_number($directory[$index]['home'], 2, $ARRAY_CONFIG['Dialplan']);
 }
 $conf_speed[$speed]['other'] = '';
 if ($asterisk) {
     Aastra_save_user_context(Aastra_get_userdevice_Asterisk($user), 'speed', $conf_speed);
 } else {
     Aastra_save_user_context($user, 'speed', $conf_speed);
 }
 # Display update
 require_once 'AastraIPPhoneTextScreen.class.php';
 $object = new AastraIPPhoneTextScreen();
 $object->setDestroyOnExit();
 $object->setTitle(Aastra_get_label('List Updated', $language));
 $object->setText(sprintf(Aastra_get_label('%s stored in speed dial list at position %d.', $language), $name, $speed + 1));
 # Softkeys
 if ($nb_softkeys) {
     if ($nb_softkeys == 6) {
         $object->addSoftkey('4', Aastra_get_label('Back', $language), $XML_SERVER . '&action=zoom');
         $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
     } else {
         $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&action=zoom', 1);
         $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 2);
         $object->setCancelAction($XML_SERVER . '&action=zoom');
         $object->addIcon(1, 'Icon:ArrowLeft');
         $object->addIcon(2, 'Icon:CircleRed');
     }
 }
 break;
 # Default
Ejemplo n.º 22
0
     if (Aastra_size_formattedtextscreen() > 2) {
         $object->addLine('');
     }
     if (Aastra_is_formattedtextscreen_color_supported()) {
         $object->addLine('');
         $object->addLine('');
         $object->addLine('');
         $object->addLine(Aastra_get_label('Welcome Back', $language), 'large', 'center', 'green');
     } else {
         $object->addLine(Aastra_get_label('Welcome Back', $language), 'double', 'center');
     }
 } else {
     require_once 'AastraIPPhoneTextScreen.class.php';
     $object = new AastraIPPhoneTextScreen();
     $object->setTitle(Aastra_get_label('Presence', $language));
     $object->setText(Aastra_get_label('Welcome Back', $language));
 }
 $object->setDestroyOnExit();
 # Time-out on the display
 if (Aastra_is_timeout_supported()) {
     $object->setTimeout('3');
 }
 # Softkeys
 if ($nb_softkeys) {
     if ($nb_softkeys == 6) {
         if (Aastra_is_timeout_supported()) {
             $object->addSoftKey('6', '', 'SoftKey:Exit');
         } else {
             $object->addSoftKey('6', Aastra_get_label('Close', $language), 'SoftKey:Exit');
         }
     } else {
Ejemplo n.º 23
0
         $object->addIcon(13, 'Icon:ArrowLeft');
         $object->addIcon(14, 'Icon:ArrowUp');
         $object->addIcon(15, 'Icon:Search');
         $object->addIcon(16, 'Icon:Book');
         $object->addIcon(17, 'Icon:Settings');
         $object->addIcon(18, 'Icon:ArrowDown');
         $object->addIcon(19, 'Icon:CircleRed');
     }
 } else {
     # Display error
     require_once 'AastraIPPhoneTextScreen.class.php';
     $object = new AastraIPPhoneTextScreen();
     $object->setDestroyOnExit();
     if ($lookup == '') {
         $object->setTitle(Aastra_get_label('Directory error', $language));
         $object->setText(Aastra_get_label('Directory list is empty. Please contact your administrator.', $language));
     } else {
         $object->setTitle(Aastra_get_label('Lookup error', $language));
         $object->setText(Aastra_get_label('Sorry no match.', $language));
     }
     # Softkey
     if ($lookup != '') {
         $object->addSoftkey('5', Aastra_get_label('List Mode', $language), $XML_SERVER . '&action=list', 1);
         $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&action=search&lookup=' . $lookup, 2);
         $object->setCancelAction($XML_SERVER . '&action=search&lookup=' . $lookup);
     }
     $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 3);
     $object->addIcon(1, 'Icon:Book');
     $object->addIcon(2, 'Icon:ArrowLeft');
     $object->addIcon(b, 'Icon:CircleRed');
 }
Ejemplo n.º 24
0
            }
            break;
        default:
            unset($ARRAY_CONFIG[$source]);
            break;
    }
}
# Depending on how many directories are configured
switch (count($ARRAY_CONFIG)) {
    # No directory
    case '0':
        require_once 'AastraIPPhoneTextScreen.class.php';
        $object = new AastraIPPhoneTextScreen();
        $object->setDestroyOnExit();
        $object->setTitle(Aastra_get_label('Error', $language));
        $object->setText(Aastra_get_label('No directory configured. Please contact your administrator.', $language));
        if ($nb_softkeys) {
            if ($nb_softkeys == 6) {
                $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
            } else {
                $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit', 1);
                $object->addIcon(1, 'Icon:CircleRed');
            }
        }
        break;
        # Just one
    # Just one
    case '1':
        # Straight to the directory
        require_once 'AastraIPPhoneExecute.class.php';
        $object = new AastraIPPhoneExecute();
Ejemplo n.º 25
0
     break;
     # Default is Current status
 # Default is Current status
 case 'main':
     # Authenticate user
     Aastra_check_signature_Asterisk($user);
     # Display current status
     $array_fm = Aastra_manage_followme_Asterisk($user, 'get_all');
     # Check if configured
     if ($array_fm['status'] == '2') {
         # Error: Not configured
         require_once 'AastraIPPhoneTextScreen.class.php';
         $object = new AastraIPPhoneTextScreen();
         $object->setDestroyOnExit();
         $object->setTitle(Aastra_get_label('Follow-me', $language));
         $object->setText(Aastra_get_label('This feature is not configured for your phone. Please contact your administrator.', $language));
         if ($nb_softkeys) {
             if ($nb_softkeys == 6) {
                 $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             } else {
                 $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             }
         }
     } else {
         # Configured: List of options
         require_once 'AastraIPPhoneTextMenu.class.php';
         $object = new AastraIPPhoneTextMenu();
         $object->setDestroyOnExit();
         $object->setStyle('none');
         $object->setTitle(sprintf(Aastra_get_label('Follow-me for %s', $language), Aastra_get_userdevice_Asterisk($user)));
         if ($array_fm['status'] == '1') {
Ejemplo n.º 26
0
             } else {
                 # Reboot needed
                 $object = new AastraIPPhoneExecute();
                 $object->addEntry($XML_SERVER . '&action=display');
                 if (Aastra_is_fastreboot_supported()) {
                     $object->AddEntry('Command: FastReboot');
                 } else {
                     $object->AddEntry('Command: Reset');
                 }
             }
         } else {
             # Display error as a TextScreen
             $object = new AastraIPPhoneTextScreen();
             $object->setDestroyOnExit();
             $object->setTitle(Aastra_get_label('Configuration error', $language));
             $object->setText(Aastra_get_label('Configuration file cannot be generated. Please contact your administrator.', $language));
             # Softkeys
             if ($nb_softkeys) {
                 if ($nb_softkeys == 6) {
                     $object->addSoftkey('6', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                 } else {
                     $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
                 }
             }
         }
     }
     break;
     # Configuration
 # Configuration
 case 'configuration':
     # Read MAC.cfg
Ejemplo n.º 27
0
        # Display message
        $action = 'flash';
        $flash_next = $XML_SERVER . '&action=detail&msg=' . $msg;
        $flash_text = Aastra_get_label('Message forwarded to the selected user(s).', $language);
        break;
}
# Post-process action
switch ($action) {
    # Error message
    case 'error':
        # New text screen
        require_once 'AastraIPPhoneTextScreen.class.php';
        $object = new AastraIPPhoneTextScreen();
        $object->setDestroyOnExit();
        $object->setTitle($err_title);
        $object->setText($err_text);
        $object->addSoftkey($err_key[0], $err_key[1], $err_key[2]);
        break;
        # Flash message
    # Flash message
    case 'flash':
        # New formatted text screen
        require_once 'AastraIPPhoneFormattedTextScreen.class.php';
        $object = new AastraIPPhoneFormattedTextScreen();
        $object->setDestroyOnExit();
        $size = Aastra_size_display_line();
        if (strlen($flash_text) > $size) {
            $temp = wordwrap($flash_text, $size, "\n", True);
            $lines = explode("\n", $temp);
        } else {
            $lines[0] = $flash_text;
Ejemplo n.º 28
0
                 $object->addSoftkey('9', Aastra_get_label('Back', $language), $XML_SERVER . '&selection=' . $selection . '&action=edit&step=1&type=' . $type . '&set=' . $set);
                 $object->addSoftkey('10', Aastra_get_label('Exit', $language), 'SoftKey:Exit');
             }
         } else {
             $object->setCancelAction($XML_SERVER . '&selection=' . $selection . '&action=edit&step=1&type=' . $type . '&set=' . $set);
             if ($page != $last) {
                 $object->addEntry(Aastra_get_label('Next Page', $language), $XML_SERVER . '&selection=' . $selection . '&action=edit&step=2&type=' . $type . '&page=' . ($page + 1) . '&set=' . $set . '&input1=' . $input1);
             }
         }
     } else {
         # Display error
         require_once 'AastraIPPhoneTextScreen.class.php';
         $object = new AastraIPPhoneTextScreen();
         $object->setDestroyOnExit();
         $object->setTitle(Aastra_get_label('BLF error', $language));
         $object->setText(Aastra_get_label('You already have a BLF on every possible user of the platform.', $language));
         $object->addSoftkey('6', Aastra_get_label('Close', $language), $XML_SERVER . '&selection=' . $selection . '&action=edit&step=1&type=' . $type . '&set=' . $set);
     }
     break;
     # SPEEDDIAL
 # SPEEDDIAL
 case 'speeddial':
 case 'speeddialconf':
 case 'speeddialxfer':
     # Input number
     require_once 'AastraIPPhoneInputScreen.class.php';
     $object = new AastraIPPhoneInputScreen();
     $object->setDestroyOnExit();
     $object->setTitle($array_title[$input1]);
     $object->setType('number');
     $object->setPrompt(Aastra_get_label('Enter phone number', $language));