Example #1
0
$confno = Aastra_getvar_safe('confno');
$action = Aastra_getvar_safe('action', 'select');
$page = Aastra_getvar_safe('page', '1');
$user_id = Aastra_getvar_safe('user_id');
$ext = Aastra_getvar_safe('ext');
$number = Aastra_getvar_safe('number', '');
$selection = Aastra_getvar_safe('selection');
if ($confno == '' and $selection != '') {
    $confno = $selection;
}
$pin = Aastra_getvar_safe('pin');
$mode = Aastra_getvar_safe('mode');
# Local variables
$refresh = 1;
# Trace
Aastra_trace_call('meetme_asterisk', 'confno=' . $confno . ', action=' . $action . ', user_id=' . $user_id . ',selection=' . $selection . ',ext=' . $ext . ', mode=' . $mode . ', number=' . $number);
# Retrieve phone information
$header = Aastra_decode_HTTP_header();
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '1.4.2.', '3' => '', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Keep callback URI
$XML_SERVER .= '?ext=' . $ext;
# Authenticate user
Aastra_check_signature_Asterisk($ext);
# Compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
# Pre-process action
switch ($action) {
Example #2
0
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'init');
$input = Aastra_getvar_safe('input');
$choice = Aastra_getvar_safe('choice');
$page = Aastra_getvar_safe('page', '0');
$selection = Aastra_getvar_safe('selection');
# Get user if not provided
$header = Aastra_decode_HTTP_header();
if ($user == '') {
    $user = $header['mac'];
}
# Update URI
$XML_SERVER .= '?user='******'currency', 'user='******', action=' . $action . ', selection=' . $selection . ', input=' . $input);
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '', '3' => '', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Retrieve user context
$data = Aastra_get_user_context($user, 'currency');
if ($data['last']['source'] == '') {
    $data['last']['source'] = 'USD';
}
if ($data['last']['target'] == '') {
    $data['last']['target'] = 'EUR';
}
Aastra_save_user_context($user, 'currency', $data);
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
Example #3
0
#############################################################################
# Collect user input
$bdate = Aastra_getvar_safe('bdate');
$I = Aastra_getvar_safe('I', '1');
$E = Aastra_getvar_safe('E', '1');
$P = Aastra_getvar_safe('P', '1');
$user = Aastra_getvar_safe('user');
# Retrieve phone information
$header = Aastra_decode_HTTP_header();
if ($user == '') {
    $user = $header['mac'];
}
# Keep return URI
$XML_SERVER .= '?user='******'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);
$page = Aastra_getvar_safe('page', '1');
$speed = Aastra_getvar_safe('speed');
$back = Aastra_getvar_safe('back');
$mode = Aastra_getvar_safe('mode');
$passwd = Aastra_getvar_safe('passwd');
# Test if Asterisk mode
$asterisk = False;
if (file_exists('../include/AastraAsterisk.php')) {
    $asterisk = True;
    require_once 'AastraAsterisk.php';
}
# Log call to the application
if ($asterisk) {
    Aastra_trace_call('asterisk_csv_dir', 'action=' . $action . ', lookup=' . $lookup . ', page=' . $page . ', index=' . $index . ', lastn=' . $lastn . ', firstn=' . $firstn . ', user='******', speed=' . $speed);
} else {
    Aastra_trace_call('csv_directory', 'action=' . $action . ', lookup=' . $lookup . ', page=' . $page . ', index=' . $index . ', lastn=' . $lastn . ', firstn=' . $firstn . ', user='******', speed=' . $speed);
}
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Get global compatibility
$is_multipleinputfields = Aastra_is_multipleinputfields_supported();
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
$is_lockin = Aastra_is_lockin_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
$is_formatted_textscreen = Aastra_is_formattedtextscreen_supported();
$is_textmenu_wrapitem = Aastra_is_textmenu_wrapitem_supported();
# Retrieve the size of the display
$chars_supported = Aastra_size_display_line();
Example #5
0
$menu_page = Aastra_getvar_safe('menu_page', '1');
$menu_page2 = Aastra_getvar_safe('menu_page2', '1');
$menu_action = Aastra_getvar_safe('menu_action', 'list');
$menu_set = Aastra_getvar_safe('menu_set', '1');
$menu_pos = Aastra_getvar_safe('menu_pos');
$menu_mode = Aastra_getvar_safe('menu_mode', 'dynamic');
$selection = Aastra_getvar_safe('selection');
# Get MAC address and type of phone
$header = Aastra_decode_HTTP_header();
if ($menu_user == '') {
    $menu_user = $header['mac'];
}
# Get Language
$language = Aastra_get_language();
# Trace
Aastra_trace_call('mymenu', 'menu_source=' . $menu_source . ', menu_user='******', menu_action=' . $menu_action . ', selection=' . $selection . ', menu_pos=' . $menu_pos . ', menu_page=' . $menu_page);
# Test menu_user Agent
Aastra_test_phone_version('1.4.2.', 0);
# Get global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
# To handle non softkey phones
if ($nb_softkeys) {
    $MaxLines = AASTRA_MAXLINES;
} else {
    $MaxLines = AASTRA_MAXLINES - 2;
}
# Update URI
$XML_SERVER .= '?menu_source=' . $menu_source . '&menu_user='******'&menu_mode=' . $menu_mode;
# Process menu_action
switch ($menu_action) {
Example #6
0
    ini_set('include_path', ini_get('include_path') . ';include;..\\include');
}
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraCommon.php';
require_once 'AastraIPPhoneTextScreen.class.php';
require_once 'AastraIPPhoneInputScreen.class.php';
#############################################################################
# Beginning of the active code
#############################################################################
# Retrieve parameters
$area = Aastra_getvar_safe('area');
# Trace
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]);
Example #7
0
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action');
$value = Aastra_getvar_safe('value');
$linestate = Aastra_getvar_safe('linestate');
$autopick = Aastra_getvar_safe('autopick');
# Initial action
if ($action == '') {
    if ($linestate == 'CONNECTED') {
        $action = 'park';
    } else {
        $action = 'list';
    }
}
# Trace
Aastra_trace_call('park_asterisk', 'user='******', linestate=' . $linestate);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Retrieve phone information
$header = Aastra_decode_HTTP_header();
# Get phone language
$language = Aastra_get_language();
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
# Keep URL
$XML_SERVER .= '?user='******'park':
        # Retrieve parking lot
Example #8
0
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Body
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'main');
$state = Aastra_getvar_safe('state');
$value1 = Aastra_getvar_safe('value1');
$value2 = Aastra_getvar_safe('value2');
$step = Aastra_getvar_safe('step', '1');
$type = Aastra_getvar_safe('type');
$selection = Aastra_getvar_safe('selection');
# Trace
Aastra_trace_call('away_asterisk', 'user='******', action=' . $action . ', state=' . $state . ', value1=' . $value1);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_sip_notify = Aastra_is_sip_notify_supported();
# Check if presence is configured
if (!$AA_PRESENCE_STATE and $action == 'main') {
    # Display error message
    require_once 'AastraIPPhoneTextScreen.class.php';
    $object = new AastraIPPhoneTextScreen();
    $object->setDestroyOnExit();
    $object->setTitle(Aastra_get_label('System Error', $language));
    $object->setText(Aastra_get_label('Presence is not enabled on your system. Please contact your administrator.', $language));
Example #9
0
$step = Aastra_getvar_safe('step', '1');
$page = Aastra_getvar_safe('page', '1');
$lang = Aastra_getvar_safe('lang');
$cl = Aastra_getvar_safe('cl');
# No action yet
if ($action == '') {
    # Select the right action
    $code = Aastra_ask_language_Asterisk();
    if ($code[0]) {
        $action = 'language';
    } else {
        $action = 'input';
    }
}
# Trace
Aastra_trace_call('startup_asterisk', 'extension=' . $extension . ', password='******', action=' . $action . ', page=' . $page . ', cl=' . $cl);
# Get MAC address and type of phone
$header = Aastra_decode_HTTP_header();
# To handle non softkey phones
$nb_softkeys = Aastra_number_softkeys_supported();
if ($nb_softkeys) {
    $MaxLines = AASTRA_MAXLINES;
} else {
    $MaxLines = AASTRA_MAXLINES - 2;
}
$is_doneAction = Aastra_is_doneAction_supported();
# Test User Agent
if ($AA_FREEPBX_MODE == '1') {
    Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
} else {
    Aastra_test_phone_versions(array('1' => '', '2' => '', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
Example #10
0
    ini_set('include_path', ini_get('include_path') . ';include;..\\include');
}
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Active code
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'change');
$status = Aastra_getvar_safe('status');
# Trace
Aastra_trace_call('dnd_asterisk', 'user='******', action=' . $action . ', status=' . $status);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Authenticate user
if ($action == 'change') {
    Aastra_check_signature_Asterisk($user);
}
# Get language
$language = Aastra_get_language();
# Update callback
$XML_SERVER .= '?user='******'msg':
        # Update idle screen
Example #11
0
    }
    # Return formatted text
    return $return;
}
#############################################################################
# Body
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$password = Aastra_getvar_safe('password');
$action = Aastra_getvar_safe('action', 'input');
$page = Aastra_getvar_safe('page', '1');
$value = Aastra_getvar_safe('value');
$origin = Aastra_getvar_safe('origin');
# Trace
Aastra_trace_call('logout_asterisk', 'user='******', password='******', action=' . $action);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get MAC address and type of phone
$header = Aastra_decode_HTTP_header();
# Save return URI
$XML_SERVER .= '?user='******'2') {
    $device_info = Aastra_get_device_info_Asterisk($user);
    if ($device_info['type'] != 'adhoc') {
Example #12
0
require_once 'AastraIPPhoneTextMenu.class.php';
require_once 'AastraIPPhoneInputScreen.class.php';
require_once 'AastraIPPhoneExecute.class.php';
#############################################################################
# Main code
#############################################################################
# Retrieve parameters
$device = Aastra_getvar_safe('device');
$user = Aastra_getvar_safe('user');
$password = Aastra_getvar_safe('password');
$action = Aastra_getvar_safe('action');
$step = Aastra_getvar_safe('step', '1');
$lang = Aastra_getvar_safe('lang');
$cl = Aastra_getvar_safe('cl');
# Trace
Aastra_trace_call('login_asterisk', 'device=' . $device . ', user='******', password='******', action=' . $action);
# Keep the URL
$XML_SERVER .= '?device=' . $device;
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
# No action yet
if ($action == '') {
    $code = Aastra_ask_language_Asterisk();
    if ($code[0]) {
        $action = 'language';
    } else {
        $action = 'input';
    }
}
Example #13
0
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Body
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action');
$value = Aastra_getvar_safe('value');
$type = Aastra_getvar_safe('type');
$selection = Aastra_getvar_safe('selection');
# Trace
Aastra_trace_call('cfwd_asterisk', 'user='******', action=' . $action . ', value=' . $value . ', type=' . $type . ', selection=' . $selection);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Get global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
# Check launch mode
if ($action == '') {
    if ($value != '') {
        # Get current status
        $cf = Aastra_manage_cf_Asterisk($user, 'main', $value);
        # Toggle
        if ($cf == '') {
Example #14
0
    # Return processed string
    return $string;
}
#############################################################################
# Beginning of the active code
#############################################################################
# Collect parameters
$index = Aastra_getvar_safe('index');
$last_index = Aastra_getvar_safe('last_index');
$rank = Aastra_getvar_safe('rank');
$last_rank = Aastra_getvar_safe('last_rank');
$feed = Aastra_getvar_safe('feed');
$page = Aastra_getvar_safe('page', '1');
$set = Aastra_getvar_safe('set', '1');
# Trace
Aastra_trace_call('rss', 'feed=' . $feed . ', index=' . $index . ', rank=' . $rank . ', last_rank=' . $last_rank . ', page=' . $page);
# Test User Agent
Aastra_test_phone_version('1.4.2.', 0);
# Keep callback
$XML_SERVER .= '?feed=' . $feed;
# Init data
$file = $feed . '.rss';
# Get Language
$header = Aastra_decode_HTTP_header();
$language = Aastra_get_language();
# IF RSS config exists
if (file_exists($file)) {
    $array = Aastra_readINIfile($file, '#', '=');
    reset($array);
    $i = 0;
    $pattern[0] = 0;
Example #15
0
    $replace = array('', '', '\\1', '"', '&', '<', '>', ' ', chr(161), chr(162), chr(163), chr(169), 'chr(\\1)');
    $string = preg_replace($search, $replace, $string);
    $string = preg_replace($search, $replace, $string);
    $string = preg_replace('/\\n/', ' ', $string);
    return $string;
}
#############################################################################
# Beginning of the active code
#############################################################################
# Collect parameters
$header = Aastra_decode_HTTP_header();
$user = Aastra_getvar_safe('user', $header['mac']);
$index = Aastra_getvar_safe('index');
$zip = Aastra_getvar_safe('zip');
# Trace
Aastra_trace_call('weather', 'zip=' . $zip . ', index=' . $index);
# Test User Agent
Aastra_test_phone_version('1.4.2.', 0);
# Get Language
$language = Aastra_get_language();
# Get global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
# Callback
$XML_SERVER .= '?user='******'') {
    # Input zip code
    $object = new AastraIPPhoneInputScreen();
    $object->setTitle(Aastra_get_label('US Local Weather', $language));
    $object->setPrompt(Aastra_get_label('Enter ZIP code', $language));
    $object->setParameter('zip');
    ini_set('include_path', ini_get('include_path') . ';include;..\\include');
}
error_reporting(E_ERROR | E_WARNING | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraCommon.php';
require_once 'AastraIPPhoneTextScreen.class.php';
require_once 'AastraIPPhoneScrollableTextMenu.class.php';
require_once 'AastraIPPhoneScrollableDirectory.class.php';
$cookie = Aastra_getvar_safe('listCookie');
$page = Aastra_getvar_safe('listPage');
$zoomIndex = Aastra_getvar_safe('zoomIndex');
$recentSelection = Aastra_getvar_safe('recentSelection');
$recentPage = Aastra_getvar_safe('recentPage');
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.
Example #17
0
#############################################################################
# Retrieve parameters
$ext = Aastra_getvar_safe('ext');
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'list');
$page = Aastra_getvar_safe('page', '1');
$orig_d = Aastra_getvar_safe('orig_d');
$orig_p = Aastra_getvar_safe('orig_p');
$msg = Aastra_getvar_safe('msg');
$cause = Aastra_getvar_safe('cause', 'end');
$last_msg = Aastra_getvar_safe('last_msg');
$dpage = Aastra_getvar_safe('dpage', '1');
$dindex = Aastra_getvar_safe('dindex');
$set = Aastra_getvar_safe('set', '1');
# Trace
Aastra_trace_call('vmail_2_asterisk', 'ext=' . $ext . ', user='******' ,action=' . $action . ' ,msg=' . $msg);
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '1.4.2.', '3' => '', '4' => '', '5' => ''), '0');
# Get Language
$language = Aastra_get_language();
# Keep URL
$XML_SERVER .= '?ext=' . $ext . '&user='******'play_exit') {
    # New message to move?
    if ($cause != 'delete') {
        sscanf($msg, '%4s-%s', $msg_id, $msg_folder);
        if ($msg_folder == 'INBOX') {
            # Move message
Example #18
0
    ini_set('include_path', ini_get('include_path') . ';include;..\\include');
}
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraCommon.php';
require_once 'AastraIPPhoneExecute.class.php';
#############################################################################
# Retrieve parameters
$number = Aastra_getvar_safe('number');
$name = Aastra_getvar_safe('name');
# Not identified yet
$found = 0;
# Trace
Aastra_trace_call('incoming_asterisk', 'number=[' . $number . '], name=[' . $name . ']');
# VoiceMail old code
if ($name == 'VoiceMail') {
    # Retrieve session
    $array = Aastra_read_session('vmail', $user);
    # Call initial script
    if ($array['uri_incoming'] != '') {
        $object = new AastraIPPhoneExecute();
        $object->addEntry($array['uri_incoming']);
        $found = 1;
    }
}
# ALERT SYSTEM
if (file_exists('../alert/alert.php') and $name == 'Alert Server') {
    # Call initial script
    $object = new AastraIPPhoneExecute();
Example #19
0
# Script was called with query string ?number=xxxx
$number_original = preg_replace('/[^0-9]/', '', $_GET['number']);
# Script was called with query string ?/xxxx.png or similar match xxxx.png pattern in the query string
if (empty($number_original)) {
    if (preg_match('/([0-9*#]+)\\.png/', $_SERVER['QUERY_STRING'], $matches)) {
        $number_original = $matches[1];
    }
}
# No number
if (empty($number_original)) {
    # Send a 404 and exit
    send404();
    exit;
}
# Trace
Aastra_trace_call('pcallerID_asterisk', 'number=' . $number_original);
# Retrieve directory configuration
$array_config = Aastra_readINIfile(AASTRA_CONFIG_DIRECTORY . 'pictureID.conf', '#', '=');
# Absolute or relative path to the cache directory. Must be writable by the Web server.
if ($array_config['General']['cache'] != '') {
    $CACHE_DIR = $array_config['General']['cache'];
} else {
    $CACHE_DIR = AASTRA_PATH_CACHE . 'imagecache';
}
# Absolute or relative path to the picture library directory. This is read-only.
if ($array_config['General']['pictures'] != '') {
    $PICTURES_DIR = $array_config['General']['pictures'];
} else {
    $PICTURES_DIR = AASTRA_PATH_CACHE . 'pictures';
}
# Rescale image smaller than 150x200
Example #20
0
##########################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'input');
$page = Aastra_getvar_safe('page', '1');
$selection = Aastra_getvar_safe('selection');
$symbol = strtoupper(Aastra_getvar_safe('symbol'));
# Get user if not provided
$header = Aastra_decode_HTTP_header();
if ($user == '') {
    $user = $header['mac'];
}
# Update URI
$XML_SERVER .= '?user='******'stock', 'user='******', symbol=' . $symbol);
# 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();
# Pre-Process special actions
switch ($action) {
    # Store favorite
    case 'set':
        # Retrieve favorites
        $data = Aastra_get_user_context($user, 'stock');
        $data['favorites'][$selection] = $symbol;
        Aastra_save_user_context($user, 'stock', $data);
        $action = 'favorites';
Example #21
0
    return $index;
}
#############################################################################
# Body
#############################################################################
# Retrieve parameters
$user = $_GET['user'];
$action = $_GET['action'];
$value = $_GET['value'];
$page = $_GET['page'];
$score = $_GET['score'];
if ($page == '') {
    $page = 1;
}
# Trace
Aastra_trace_call('Yahtzee', 'user='******', action=' . $action . ', value=' . $value);
# Test User Agent
Aastra_test_phone_version('2.2.0.', 0);
Aastra_test_phone_model(array('Aastra55i', 'Aastra57i', 'Aastra57iCT', 'Aastra8000i'), True, 0);
Aastra_test_php_function('imagecreate', 'PHP-GD extension not installed.');
# Get Language
$language = Aastra_get_language();
# Retrieve phone information
$header = Aastra_decode_HTTP_header();
if ($user == '') {
    $user = $header['mac'];
}
# Keep return URI
$XML_SERVER .= '?user=' . $user;
# Number of softkeys
$nb_softkeys = Aastra_number_softkeys_supported($header);
Example #22
0
    if ($lookup) {
        $query .= "and last_name like '{$lookup}%' ";
    }
    $query = getRowSQL($query, 'sugarcrm');
    return $query['COUNT(id)'];
}
#############################################################
# Global Variables
# Collect parameters
$lookup = Aastra_getvar_safe('lookup');
$page = Aastra_getvar_safe('page', '1');
$index = Aastra_getvar_safe('index');
$selection = Aastra_getvar_safe('selection');
$action = Aastra_getvar_safe('action', 'input');
# Log call to the application
Aastra_trace_call('sugarCRM', 'lookup=' . $lookup . ', action=' . $action);
# Test User Agent
Aastra_test_phone_version('1.4.2.', 0);
# Test phone type
Aastra_test_phone_model(array('Aastra9112i', 'Aastra9133i'), False, 0);
# Retrieve phone information
$header = Aastra_decode_HTTP_header();
# Get Language
$language = Aastra_get_language();
# Get global compatibility
$is_softkeys = Aastra_is_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
# Compute MaxLines
if ($is_softkeys) {
    $MaxLines = AASTRA_MAXLINES;
Example #23
0
}
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Main code
#############################################################################
# Retrieve parameters
$ext = Aastra_getvar_safe('ext');
$pin = Aastra_getvar_safe('pin');
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'init');
# Trace
Aastra_trace_call('vmail_login-asterisk', 'action=' . $action . ', ext=' . $ext . ', user='******', pin=' . $pin);
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '1.4.2.', '3' => '2.5.3', '4' => '2.5.3.', '5' => '3.0.1'), '0');
# Get Language
$language = Aastra_get_language();
# Keep URL
$XML_SERVER .= '?ext=' . $ext;
# Compatibility with non softkey phones and 6739i
$nb_softkeys = Aastra_number_softkeys_supported();
# Check if ext is configured
if ($ext == '') {
    # Display error
    $action = 'error';
    $err_title = Aastra_get_label('Configuration Error', $language);
    $err_text = Aastra_get_label('Please contact your administrator.', $language);
    if ($nb_softkeys) {
Example #24
0
#############################################################################
# Includes
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Active code
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action');
$status = Aastra_getvar_safe('status');
$index = Aastra_getvar_safe('index');
$mode = Aastra_getvar_safe('mode');
$password = Aastra_getvar_safe('password');
# Trace
Aastra_trace_call('day/night_asterisk', 'user='******', action=' . $action . ', index=' . $index . ', status=' . $status . ', password='******'1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get language
$language = Aastra_get_language();
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
# Initial action
if ($action == '') {
    # Set mode
    if ($index == '') {
        $mode = 'ALL';
    } else {
        $mode = 'SINGLE';
    }
Example #25
0
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Main code
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$page = Aastra_getvar_safe('page', '1');
$action = Aastra_getvar_safe('action', 'init');
$speed = Aastra_getvar_safe('speed');
$selection = Aastra_getvar_safe('selection');
$origin = Aastra_getvar_safe('origin');
$orig_s = Aastra_getvar_safe('orig_s');
$lookup = Aastra_getvar_safe('lookup', '');
# Trace
Aastra_trace_call('directory_5_asterisk', 'user='******', action=' . $action . ', speed=' . $speed . ', selection=' . $selection);
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '', '3' => '', '4' => '', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Save return URI
$XML_SERVER .= '?user='******'&origin=' . $origin;
# Compute MaxLines
$MaxLines = AASTRA_MAXLINES;
# Initial call
if ($action == 'init') {
    # Retrieve current configuration
    $mode = Aastra_get_user_context(Aastra_get_userdevice_Asterisk($user), 'pbx_directory');
    if ($mode == '') {
        $mode = '1';
        Aastra_save_user_context(Aastra_get_userdevice_Asterisk($user), 'pbx_directory', $mode);
Example #26
0
    $string = preg_replace($search, $replace, $string);
    return $string;
}
#############################################################################
# Main Code
#############################################################################
# Retrieve parameters
$question = Aastra_getvar_safe('question');
$user = Aastra_getvar_safe('user');
if ($user == '') {
    $header = Aastra_decode_HTTP_header();
    $user = $header['mac'];
}
$XML_SERVER .= '?user='******'google', 'user='******', question=' . $question);
# Test User Agent
Aastra_test_phone_version('1.4.2.', 0);
# Get Phone language
$language = Aastra_get_language();
# Global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
# Initial call test on parameter passed
if (!$question) {
    # Input Question
    $object = new AastraIPPhoneInputScreen();
    $object->setDestroyOnExit();
    $object->setType('string');
    $object->setTitle(Aastra_get_label('Ask Google', $language));
    $object->setPrompt(Aastra_get_label('Enter your question', $language));
    $object->setParameter('question');
Example #27
0
require_once 'AastraCommon.php';
require_once 'AastraAsterisk.php';
#############################################################################
# Body
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action');
$value = Aastra_getvar_safe('value');
$selection = Aastra_getvar_safe('selection');
$page = Aastra_getvar_safe('page', '1');
$type = Aastra_getvar_safe('type');
# Maximum number of phones in the follow-me list
$MAX_NUMBERS = 10;
# Trace
Aastra_trace_call('follow_asterisk', 'user='******', action=' . $action . ', value=' . $value . ', selection=' . $selection);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get global compatibility
$nb_softkeys = Aastra_number_softkeys_supported();
$is_icons = Aastra_is_icons_supported();
$is_style_textmenu = Aastra_is_style_textmenu_supported();
# Initial call
if ($action == '') {
    if ($nb_softkeys) {
        $action = 'main';
    } else {
        $action = 'change_status2';
    }
}
# Get Language
Example #28
0
        }
    }
    return $key;
}
######################################################################
# Beginning of the active code
######################################################################
# Collect parameters
$city = Aastra_getvar_safe('city');
$page = Aastra_getvar_safe('page', '1');
$selection = Aastra_getvar_safe('selection');
$action = Aastra_getvar_safe('action', 'list');
$user = Aastra_getvar_safe('user');
$rank = Aastra_getvar_safe('rank');
# Trace call to the function
Aastra_trace_call('clock', 'city=' . $city . ', page=' . $page . ', action=' . $action . ', user='******', selection=' . $selection . ', rank=' . $rank);
# Test User Agent
Aastra_test_phone_version('1.4.2.', 0);
# Get header info
$header = Aastra_decode_HTTP_header();
# Get Phone language
$language = Aastra_get_language();
# Set user use MAC if not set
if ($user == '') {
    $user = $header['mac'];
}
# Compute MaxLines
if (Aastra_is_softkeys_supported()) {
    $MaxLines = AASTRA_MAXLINES;
} else {
    $MaxLines = AASTRA_MAXLINES - 2;
Example #29
0
# Retrieve parameters
$ext = Aastra_getvar_safe('ext');
$user = Aastra_getvar_safe('user');
$action = Aastra_getvar_safe('action', 'list');
$page = Aastra_getvar_safe('page', '1');
$orig_d = Aastra_getvar_safe('orig_d');
$orig_p = Aastra_getvar_safe('orig_p');
$msg = Aastra_getvar_safe('msg');
$cause = Aastra_getvar_safe('cause', 'end');
$paused = Aastra_getvar_safe('paused', 'no');
$last_msg = Aastra_getvar_safe('last_msg');
$dpage = Aastra_getvar_safe('dpage', '1');
$dindex = Aastra_getvar_safe('dindex');
$set = Aastra_getvar_safe('set', '1');
# Trace
Aastra_trace_call('vmail_4_asterisk', 'ext=' . $ext . ', user='******' ,action=' . $action);
# Test User Agent
Aastra_test_phone_versions(array('1' => '', '2' => '', '3' => '', '4' => '2.5.3.', '5' => ''), '0');
# Get Language
$language = Aastra_get_language();
# Keep URL
$XML_SERVER .= '?ext=' . $ext . '&user='******'play_exit') {
    # New message to move?
    if ($cause != 'delete') {
        sscanf($msg, '%4s-%s', $msg_id, $msg_folder);
        if ($msg_folder == 'INBOX') {
            # Move message
Example #30
0
        }
    }
}
#############################################################################
# Body
#############################################################################
$action = Aastra_getvar_safe('action', 'show_queues');
$agent = Aastra_getvar_safe('agent');
$password = Aastra_getvar_safe('password');
$q_pass = Aastra_getvar_safe('q_pass');
$q_desc = Aastra_getvar_safe('q_desc');
$queue = Aastra_getvar_safe('queue');
$page = Aastra_getvar_safe('page', '1');
$menu_set = Aastra_getvar_safe('menu_set', '1');
# Trace
Aastra_trace_call('agent_asterisk', 'agent=' . $agent . ', action=' . $action . ', queue=' . $queue . ', page=' . $page);
# Test User Agent
Aastra_test_phone_versions(array('1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Get Language
$language = Aastra_get_language();
# Keep callback
$XML_SERVER .= '?agent=' . $agent;
# Local variables
$refresh = 1;
$header = Aastra_decode_HTTP_header();
# Compatibility
$is_icons = Aastra_is_icons_supported();
$nb_softkeys = Aastra_number_softkeys_supported();
if ($nb_softkeys) {
    $MaxLines = AASTRA_MAXLINES;
} else {