function Aastra_test_phone_versions($versions, $type, $header = NULL)
{
    # Start with the HTTP header
    if (!$header) {
        $header = Aastra_decode_HTTP_header();
    }
    # Retrieve phone type and requested version
    $model_type = Aastra_phone_type($header);
    # Perform the check
    if ($versions[$model_type] or $model_type == '0') {
        return Aastra_test_phone_version($versions[$model_type], $type, $header);
    } else {
        switch ($model_type) {
            case '1':
                $models = array('Aastra9112i', 'Aastra9133i');
                break;
            case '2':
                $models = array('Aastra480i', 'Aastra480i Cordless');
                break;
            case '3':
                $models = array('Aastra6730i', 'Aastra6731i', 'Aastra51i', 'Aastra53i');
                break;
            case '4':
                $models = array('Aastra55i', 'Aastra57iCTi', 'Aastra9480i', 'Aastra9480iCT', 'Aastra6735i', 'Aastra6737i');
                break;
            case '5':
                $models = array('Aastra6739i', 'Aastra8000i');
                break;
        }
        return Aastra_test_phone_model($models, False, $type);
    }
}
Esempio n. 2
0
    # Error
    case 'error':
        # New text screen
        require_once 'AastraIPPhoneTextScreen.class.php';
        $object = new AastraIPPhoneTextScreen();
        $object->setDestroyOnExit();
        $object->setTitle($err_title);
        $object->setText($err_text);
        if ($nb_softkeys) {
            $object->addSoftkey($err_key[0], $err_key[1], $err_key[2]);
        } else {
            if ($err_key[2] != 'SoftKey:Exit') {
                $object->setDoneAction($err_key[2]);
            }
        }
        break;
        # Launch
    # Launch
    case 'launch':
        # Launch application
        require_once 'AastraIPPhoneExecute.class.php';
        $object = new AastraIPPhoneExecute();
        $object->addEntry($XML_SERVER_PATH . 'vmail_' . Aastra_phone_type() . '.php?ext=' . $ext . '&user=' . $user);
        break;
}
# Output XML object
$object->output();
exit;
?>

Esempio n. 3
0
     if ($array_user[$key] != '') {
         $label = $array_user[$key];
     } else {
         $label = '.....................';
     }
     if ($is_icons) {
         $icon = $value[0];
     } else {
         $icon = '';
         $label = $value[1] . ' ' . $label;
     }
     $object->addEntry($label, $XML_SERVER . '&action=edit_info&type=' . $key, $key, $icon);
 }
 # Icons
 if ($is_icons) {
     if (Aastra_phone_type() != 5) {
         $object->addIcon(1, Aastra_get_custom_icon('Cellphone'));
         $object->addIcon(2, Aastra_get_custom_icon('Home'));
         $object->addIcon(3, Aastra_get_custom_icon('Phone'));
     } else {
         $object->addIcon(1, 'Icon:CellPhone');
         $object->addIcon(2, 'Icon:Home');
         $object->addIcon(3, 'Icon:PhoneOnHook');
     }
 }
 # Softkeys
 if ($nb_softkeys) {
     if ($nb_softkeys == 6) {
         $object->addSoftkey('1', Aastra_get_label('Edit', $language), 'SoftKey:Select');
         $object->addSoftkey('2', Aastra_get_label('Clear', $language), $XML_SERVER . '&action=clear_info');
         $object->addSoftkey('5', Aastra_get_label('Back', $language), $XML_SERVER);
Esempio n. 4
0
     } else {
         # Display first item
         $object = new AastraIPPhoneExecute();
         $object->addEntry($XML_SERVER . '&zip=' . $zip . '&index=1');
     }
 } else {
     # 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));
 function _setupSoftKeys()
 {
     if (Aastra_is_softkeys_supported()) {
         if (Aastra_phone_type() != 5) {
             # non 6739i
             $this->addSoftkey($this->_selectKeyPosition, Aastra_get_label($this->_selectKeyLabel, $this->_language), 'SoftKey:Select');
             if (!$this->_exitKeyDisabled) {
                 $this->addSoftkey($this->_exitKeyPosition, Aastra_get_label('Exit', $this->_language), 'SoftKey:Exit');
             }
             if (!empty($this->_backCancelURL)) {
                 $this->addSoftkey($this->_backKeyPosition, Aastra_get_label('Back', $this->_language), $this->_backCancelURL);
             }
         } else {
             # 6739i SoftKey:Select not yet supported
             #$this->addSoftkey($this->_selectKeyPosition, Aastra_get_label($this->_selectKeyLabel,$this->_language), 'SoftKey:Select',$this->_selectKeyIconIndex);
             if (!$this->_exitKeyDisabled) {
                 $this->addSoftkey($this->_exitKeyPosition, Aastra_get_label('Exit', $this->_language), 'SoftKey:Exit', $this->_exitKeyIconIndex);
             }
             if (!empty($this->_backCancelURL)) {
                 $this->addSoftkey($this->_backKeyPosition, Aastra_get_label('Back', $this->_language), $this->_backCancelURL, $this->_backKeyIconIndex);
             }
         }
     }
 }
 function _setupSoftKeys()
 {
     # Check if softkeys and the Dial2 softkey is supported. Don't put dial key on 6739i
     if (Aastra_is_softkeys_supported() && !Aastra_test_phone_version('2.0.1.', 1) && Aastra_phone_type() != 5) {
         $this->addSoftkey($this->_dialKeyPosition, Aastra_get_label('Dial', $this->_language), 'SoftKey:Dial2');
     }
     parent::_setupSoftKeys();
 }
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;
}
Esempio n. 8
0
#############################################################################
# PHP customization for includes and warnings
#############################################################################
$os = strtolower(PHP_OS);
if (strpos($os, "win") === false) {
    ini_set('include_path', ini_get('include_path') . ':include:../include');
} else {
    ini_set('include_path', ini_get('include_path') . ';include;..\\include');
}
error_reporting(E_ERROR | E_PARSE);
#############################################################################
# Includes
#############################################################################
require_once 'AastraAsterisk.php';
#############################################################################
# Main code
#############################################################################
# Retrieve parameters
$user = Aastra_getvar_safe('user');
$origin = Aastra_getvar_safe('origin');
# Trace
Aastra_trace_call('directory_asterisk', 'user='******'1' => '1.4.2.', '2' => '1.4.2.', '3' => '2.5.3.', '4' => '2.5.3.', '5' => '3.0.1.'), '0');
# Launch application
require_once 'AastraIPPhoneExecute.class.php';
$object = new AastraIPPhoneExecute();
$object->addEntry($XML_SERVER_PATH . 'directory_' . Aastra_phone_type() . '.php?user='******'&origin=' . $origin);
# Output XML object
$object->output();
exit;