4.1.0 version.

This commit is contained in:
2018-02-15 23:18:23 +01:00
parent fc521a47e0
commit fe1dabf59a
6 changed files with 821 additions and 597 deletions

View File

@ -54,6 +54,7 @@
# Returns the number of lines available for formatted text screen
# Aastra_size_display_line()
# Returns the number of characters per line on the display
# Aastra_size_graphical_display(mode,header)
# Aastra_get_custom_icon(icon_name)
# Returns hex representation of icon matching the given name. If no icon found, empty icon is returned.
# Aastra_push2phone(server,phone,data)
@ -243,7 +244,7 @@ else
$return=1;
if($type==0)
{
echo "This XML application works better when using an Aastra SIP phone, not a Web browser.<p>See <a href=\"http://www.aastratelecom.com/cps/rde/xchg/SID-3D8CCB73-C78FC1E1/03/hs.xsl/23485.htm\">here</a> for instructions and information.<p>Copyright Aastra Telecom 2005-2011.";
echo "This XML application works better when using a Mitel SIP phone, not a Web browser.<p>See <a href=\"http://www.mitel.com/node/35841\">here</a> for instructions and information.<p>Copyright Mitel Networks 2005-2014.";
exit;
}
}
@ -617,6 +618,79 @@ switch($header['model'])
return($return);
}
###################################################################################################
# Aastra_is_dot_icons_supported(header)
#
# Parameters
# header phone HTTP header (optional)
#
# Returns
# Boolean
###################################################################################################
function Aastra_is_dot_icons_supported($header=NULL)
{
# False by default
$return=False;
# Get header info if needed
if(!$header) $header=Aastra_decode_HTTP_header();
# Test Model/version
switch($header['model'])
{
case 'Aastra55i':
case 'Aastra57i':
case 'Aastra57iCT':
case 'Aastra9480i':
case 'Aastra9480iCT':
if(Aastra_test_phone_version('2.0.2.',1,$header)==0) $return=True;
break;
case 'Aastra6735i':
case 'Aastra6737i':
$return=True;
break;
}
# Return result
return($return);
}
###################################################################################################
# Aastra_is_graphic_icons_supported(header)
#
# Parameters
# header phone HTTP header (optional)
#
# Returns
# Boolean
###################################################################################################
function Aastra_is_graphic_icons_supported($header=NULL)
{
# False by default
$return=False;
# Get header info if needed
if(!$header) $header=Aastra_decode_HTTP_header();
# Test Model/version
switch($header['model'])
{
case 'Aastra6867i':
case 'Aastra6869i':
$return=True;
break;
case 'Aastra6739i':
if(Aastra_test_phone_version('3.2.0.',1,$header)==0) $return=True;
break;
case 'Aastra8000i':
$return=True;
break;
}
# Return result
return($return);
}
###################################################################################################
# Aastra_is_pixmap_graphics_supported(header)
#
@ -1626,6 +1700,58 @@ switch($header['model'])
return($return);
}
###################################################################################################
# Aastra_size_graphical_display(mode)
#
# Returns the number of characters per line on the display
#
# Parameters
# Mode ImageScreen/ImageMenu mode regular/extended/fullscreen
#
# Returns
# Returns an array with width and height
###################################################################################################
function Aastra_size_graphical_display($mode='regular',$header=NULL)
{
$return=0;
# Get info header if needed
if(!$header) $header=Aastra_decode_HTTP_header();
switch($header['model'])
{
case 'Aastra6867i':
if($mode=='regular') {
$array=array( 'width'=>'320','height'=>'184');
} else if($mode=='extended') {
$array=array( 'width'=>'320','height'=>'184');
} else if($mode=='fullscreen') {
$array=array( 'width'=>'320','height'=>'240');
}
break;
case 'Aastra6869i':
if($mode=='regular') {
$array=array( 'width'=>'480','height'=>'204');
} else if($mode=='extended') {
$array=array( 'width'=>'480','height'=>'204');
} else if($mode=='fullscreen') {
$array=array( 'width'=>'480','height'=>'272');
}
break;
case 'Aastra6739i':
if($mode=='regular') {
$array=array( 'width'=>'380','height'=>'340');
} else if($mode=='extended') {
$array=array( 'width'=>'640','height'=>'340');
} else if($mode=='fullscreen') {
$array=array( 'width'=>'640','height'=>'480');
}
break;
}
return($array);
}
###################################################################################################
# Aastra_max_items_textmenu()
#

View File

@ -91,22 +91,37 @@ class AastraIPPhoneGDImage
var $_img;
var $_white;
var $_black;
var $_blackNoAntiAliasing;
var $_red;
var $_green;
var $_blue;
var $_font;
var $_fontpath;
var $_color;
function AastraIPPhoneGDImage()
function AastraIPPhoneGDImage($width=144,$height=40,$color=False)
{
# create the actual image
$this->_img=imagecreate(144, 40);
$this->_color=$color;
if($color) {
$this->_img=imagecreatetruecolor($width, $height);
} else {
$this->_img=imagecreate($width, $height);
}
# define black and white
$this->_white = imagecolorallocate($this->_img, 255, 255, 255);
$this->_black = imagecolorallocate($this->_img, 0, 0, 0);
if($color) {
$this->_red = imagecolorallocate($this->_img, 255, 0, 0);
$this->_green = imagecolorallocate($this->_img, 0, 255, 0);
$this->_blue = imagecolorallocate($this->_img, 0, 0, 255);
}
# Black and White only so disable anti-aliasing
$this->_black = $this->_black * -1;
$this->_white = $this->_white * -1;
if(!$color) {
$this->_black = $this->_black * -1;
$this->_white = $this->_white * -1;
}
# define a default font path
$os = strtolower(PHP_OS);
@ -121,11 +136,6 @@ function importFromPng($file,$x,$y)
imagecopy($this->_img,$image,$x,$y,0,0,imagesx($image),imagesy($image));
}
function exportToPng($file,$file)
{
imagepng($this->_img);
}
function setFontPath($fontpath)
{
$this->_fontpath=$fontpath;
@ -153,6 +163,11 @@ function getGDImage()
return $this->_img;
}
function savePNGImage($filename)
{
imagepng($this->_img,$filename);
}
function rectangle($x1, $y1, $x2, $y2, $colorIndex, $filled=False)
{
if($filled) imagefilledrectangle($this->_img, $x1, $y1, $x2, $y2, $this->getColor($colorIndex));
@ -178,7 +193,11 @@ function line($x1, $y1, $x2, $y2, $colorIndex, $dashed=False)
function getColor($index)
{
if ($index == 0) return $this->_white; else return $this->_black;
if ($index == 0) return $this->_white;
else if ($index == 1) return $this->_black;
else if ($index == 2) return $this->_red;
else if ($index == 3) return $this->_green;
else if ($index == 4) return $this->_blue;
}
}
?>