5.0.0 version.

This commit is contained in:
2018-02-15 23:22:08 +01:00
parent 071529b1e8
commit 8273ee8749
21 changed files with 10229 additions and 10343 deletions

View File

@ -10,11 +10,11 @@
# @title string
# @color string, "red", "blue", ... (optional)
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen
# @title string
# @color string, "red", "blue", ... (optional)
# @icon_index integer, icon number
# setBackgroundColor(color) to change the XML object background color (optional 6739i only)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
# @uri string
@ -23,6 +23,8 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
@ -65,14 +67,15 @@ class AastraIPPhone {
var $_cancelAction='';
var $_refreshTimeout=0;
var $_refreshURL='';
var $_beep='';
var $_beep='';
var $_lockin='';
var $_callprotection='';
var $_timeout=0;
var $_allowAnswer='';
var $_allowDrop='';
var $_allowXfer='';
var $_allowConf='';
var $_bcolor='';
var $_background_color='';
var $_toptitle='';
var $_toptitle_icon='';
var $_toptitle_color='';
@ -88,7 +91,7 @@ class AastraIPPhone {
$this->_destroyOnExit='';
$this->_refreshTimeout=0;
$this->_refreshURL='';
$this->_beep='';
$this->_beep='';
$this->_lockin='';
$this->_lockin_uri='';
$this->_timeout=0;
@ -105,7 +108,7 @@ class AastraIPPhone {
function setBackgroundColor($color)
{
$this->_bcolor = $color;
$this->_background_color = $color;
}
function setTitle($title,$color='')
@ -159,6 +162,15 @@ class AastraIPPhone {
$this->_lockin='call';
}
function setCallProtection($notif=False)
{
if($notif==True) {
$this->_callprotection='notif';
} else {
$this->_callprotection='yes';
}
}
function setTimeout($timeout)
{
$this->_timeout=$timeout;
@ -213,7 +225,8 @@ class AastraIPPhone {
function addIcon($index, $icon)
{
if(Aastra_is_icons_supported()) $this->_icons[$index] = new AastraIPPhoneIconEntry($index, $icon);
# if(Aastra_is_icons_supported()) $this->_icons[$index] = new AastraIPPhoneIconEntry($index, $icon);
$this->_icons[$index] = new AastraIPPhoneIconEntry($index, $icon);
}
function escape($string)

File diff suppressed because it is too large Load Diff

View File

@ -19,12 +19,16 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
@ -42,16 +46,20 @@
# @flush boolean optional, output buffer to be flushed out or not.
#
# Specific to the object
# addLine(text,size,align,color) to add a formatted line
# addLine(text,size,align,color,wrap,blink) to add a formatted line
# @text string
# @size string, optional, "small", "double" or "large"
# @align string, optional, "left", "right" or "center"
# @color string, optional, "red", "black", ...
# addText(text,size,align,$color) to add a formatted text as formatted lines
# @wrap boolean, optional, "yes", "no" (default)
# @blink string, optional, "slow", "fast" or "no" (default)
# addText(text,size,align,$color,wrap,blink) to add a formatted text as formatted lines
# @text string, can include carriage returns
# @size string, optional, "double"
# @align string, optional, "left", "right" or "center"
# @color string, optional, "red", "black", ...
# @wrap boolean, optional, "yes", "no" (default)
# @blink string, optional, "slow", "fast" or "no" (default)
# setScrollStart(height) to define the beginning of the scrolling section and its height
# @height integer
# setScrollEnd() to define the end of the scrolling section
@ -105,25 +113,25 @@ class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
var $_dialLine='';
var $_fontMono='';
function addLine($text, $size=NULL, $align=NULL, $color=NULL)
function addLine($text, $size=NULL, $align=NULL, $color=NULL, $wrap=NULL, $blink=NULL)
{
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $color, 'normal');
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $color, $wrap, $blink, 'normal');
}
function addText($text, $size=NULL, $align=NULL, $color=NULL)
function addText($text, $size=NULL, $align=NULL, $color=NULL, $wrap=NULL, $blink=NULL)
{
$pieces=explode("\n",wordwrap($text,$this->_display_size,"\n",True));
foreach($pieces as $value) $this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($value, $size, $align, $color, 'normal');
foreach($pieces as $value) $this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry($value, $size, $align, $color, $wrap, $blink, 'normal');
}
function setScrollStart($height)
{
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, $height, NULL, NULL, 'scrollstart');
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, $height, NULL, NULL, NULL, NULL, 'scrollstart');
}
function setScrollEnd()
{
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, NULL, NULL, NULL, 'scrollend');
$this->_entries[] = new AastraIPPhoneFormattedTextScreenEntry(NULL, NULL, NULL, NULL, NULL, NULL, 'scrollend');
}
function setDoneAction($uri)
@ -198,6 +206,11 @@ class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# AllowAnswer
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
@ -212,6 +225,9 @@ class AastraIPPhoneFormattedTextScreen extends AastraIPPhone {
# TimeOut
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# AllowDTMF
if($this->_allowDTMF=='yes') $out .= " allowDTMF=\"yes\"";

View File

@ -12,15 +12,19 @@ class AastraIPPhoneFormattedTextScreenEntry extends AastraIPPhone {
var $_size;
var $_align;
var $_color;
var $_wrap;
var $_blink;
var $_type;
function AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $color, $type)
function AastraIPPhoneFormattedTextScreenEntry($text, $size, $align, $color, $wrap, $blink, $type)
{
if($size=='double')$this->_text=$this->convert_high_ascii($text);
else $this->_text=$text;
$this->_size=$size;
$this->_align=$align;
$this->_color=$color;
$this->_color=$color;
$this->_wrap=$wrap;
$this->_blink=$blink;
$this->_type=$type;
}
@ -33,6 +37,8 @@ class AastraIPPhoneFormattedTextScreenEntry extends AastraIPPhone {
if($this->_size!=NULL) $xml .= " Size=\"{$this->_size}\"";
if($this->_align!=NULL) $xml .= " Align=\"{$this->_align}\"";
if($this->_color!=NULL) $xml .= " Color=\"{$this->_color}\"";
if($this->_wrap!=NULL) $xml .= " wrap=\"{$this->_wrap}\"";
if($this->_blink!=NULL) $xml .= " blink=\"{$this->_blink}\"";
$xml .= ">";
$xml .= $this->escape($this->_text)."</Line>\n";
break;

View File

@ -0,0 +1,242 @@
<?php
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneTextMenu
# Copyright Mitel Networks 2005-2015
#
# AastraIPPhoneTextMenu object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setTitle(Title) to setup the title of an object (optional)
# @title string
# setTitleWrap() to set the title to be wrapped on 2 lines (optional)
# setTopTitle(title,color,icon_index) to set the Top Title of the XML screen (6739i only)
# @title string
# @color string, "red", "blue", ... (optional)
# @icon_index integer, icon number
# setDestroyOnExit() to set DestroyonExit parameter to 'yes', 'no' by default (optional)
# setBeep() to enable a notification beep with the object (optional)
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
# @uri string
# @icon_index integer, icon number
# setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
# @timeout integer (seconds)
# @URL string
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
# addIcon(index,icon) to add custom icons to the object (optional)
# @index integer, icon index
# @icon string, icon name or definition
# generate() to return the generated XML for the object
# output(flush) to display the object
# @flush boolean optional, output buffer to be flushed out or not.
#
# Specific to the object
# setLayout(layout) to set the desired layout
# @layout 1 or 2
# setMode(mode) to set the screen mode
# @mode 'regular' or 'extended'
# setDefaultIndex(index) to set the default selection in the list (optional)
# @index index (1-24)
# setFontMono(fontMono) to decide the use of the monotype font
# @fontMono boolean ("yes"/"no")
# addEntry(url,selection,icon,iconScaled,fontMono,dial,line) to add an element in the list to be displayed
# @url string
# @selection string (optional)
# @icon string (optional)
# @iconScaled boolean (optional)
# @fontMono boolean (optional)
# @dial string, phone number to dial (optional)
# @line integer, SIP line to use (optional)
# addLine(text,align,color) to add a line in the current item
# @text string
# @align string, optional, "left", "right" or "center"
# @color string, optional, "red", "black", ...
#
# Example
# require_once('AastraIPPhoneIconMenu.class.php');
# $menu = new AastraIPPhoneIconMenu();
# $menu->setDestroyOnExit();
# $menu->setDeFaultIndex('3');
# $menu->setLayout('1');
# $menu->setMode('regular');
# $menu->setFontMono('yes');
# $menu->addEntry('http://myserver.com/script.php?choice=1','Value=1','Icon:Alarm','yes');
# $menu->addLine('Line 11','left','red');
# $menu->addLine('Line 12','right','green');
# $menu->addLine('Line 13','center','blue');
# $menu->addEntry('http://myserver.com/script.php?choice=2','Value=2','Icon:AlarmFilled','no');
# $menu->addLine('Line 21','left','red');
# $menu->addLine('Line 22','right','green');
# $menu->addLine('Line 23','center','blue');
# $menu->addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1');
# $menu->addSoftkey('6', 'Exit', 'SoftKey:Exit');
# $menu->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneIconMenuEntry.class.php');
class AastraIPPhoneIconMenu extends AastraIPPhone {
var $_layout='';
var $_mode='';
var $_defaultIndex='';
var $_style='';
var $_maxitems='24';
var $_fontMono='';
function setLayout($layout)
{
$this->_layout = $layout;
}
function setMode($mode)
{
$this->_mode = $mode;
}
function setFontMono($fontMono)
{
$this->_fontMono = $fontMono;
}
function setDefaultIndex($defaultIndex)
{
$this->_defaultIndex = $defaultIndex;
}
function setStyle($style)
{
$this->_style = $style;
}
function addEntry($url, $selection=NULL, $icon=NULL, $iconScaled=NULL, $fontMono=NULL, $dial=NULL, $line=NULL)
{
$this->_entries[] = new AastraIPPhoneIconMenuEntry( $url,
$selection,
$icon,
$iconScaled,
$fontMono,
$dial,
$line
);
}
function addLine($text, $align=NULL, $color=NULL)
{
$index=count($this->_entries);
if($index>0) {
$this->_entries[$index-1]->addLine($text, $align, $color);
}
}
function render()
{
# Beginning of root tag
$out = "<AastraIPPhoneIconMenu";
# DestroyOnExit
if ($this->_destroyOnExit=='yes') $out .= " destroyOnExit=\"yes\"";
# DefaultIndex
if ($this->_defaultIndex!="") $out .= " defaultIndex=\"{$this->_defaultIndex}\"";
# Layout
if ($this->_layout!='') $out .= " layout=\"{$this->_layout}\"";
# Mode
if ($this->_mode!='') $out .= " mode=\"{$this->_mode}\"";
# FontMono
if ($this->_fontMono!='') $out .= " fontMono=\"{$this->_fontMono}\"";
# Beep
if ($this->_beep=='yes') $out .= " Beep=\"yes\"";
# Lockin
if($this->_lockin!='') {
$out .= " LockIn=\"{$this->_lockin}\"";
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# Timeout
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# Font Monotype
if ($this->_fontMono == 'no') $out .= " fontMono=\"no\"";
# End of root tag
$out .= ">\n";
# Top Title
if ($this->_toptitle!='')
{
$toptitle = $this->escape($this->_toptitle);
$out .= "<TopTitle";
if ($this->_toptitle_icon!='') $out .= " icon=\"{$this->_toptitle_icon}\"";
if ($this->_toptitle_color!='') $out .= " Color=\"{$this->_toptitle_color}\"";
$out .= ">".$toptitle."</TopTitle>\n";
}
# Menu items
if (isset($this->_entries) && is_array($this->_entries))
{
$index=0;
$is_softkeys=Aastra_is_softkeys_supported();
foreach ($this->_entries as $entry)
{
if($index<$this->_maxitems) $out .= $entry->render();
$index++;
}
}
# Softkeys
if (isset($this->_softkeys) && is_array($this->_softkeys))
{
foreach ($this->_softkeys as $softkey) $out .= $softkey->render();
}
# Icons
if (isset($this->_icons) && is_array($this->_icons))
{
$IconList=False;
foreach ($this->_icons as $icon)
{
if(!$IconList)
{
$out .= "<IconList>\n";
$IconList=True;
}
$out .= $icon->render();
}
if($IconList) $out .= "</IconList>\n";
}
# End Tag
$out .= "</AastraIPPhoneIconMenu>\n";
# Return XML object
return($out);
}
}
?>

View File

@ -0,0 +1,87 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPPhoneTextMenuEntry
# Copyright Mitel Networks 2005-2015
#
# Internal class for AastraIPPhoneTextMenu object.
################################################################################
class AastraIPPhoneIconMenuEntry extends AastraIPPhone {
var $_url;
var $_selection;
var $_icon;
var $_iconScaled;
var $_fontMono;
var $_dial;
var $_line;
var $_lines=array();
function AastraIPPhoneIconMenuEntry($url, $selection, $icon, $iconScaled, $fontMono, $dial, $line)
{
$this->_url=$url;
$this->_selection=$selection;
$this->_icon=$icon;
$this->_iconScaled=$iconScaled;
$this->_dial=$dial;
$this->_line=$line;
$this->_fontMono=$fontMono;
}
function addLine($text, $align, $color)
{
$this->_lines[]=array('text'=>$text,'align'=>$align,'color'=>$color);
}
function render()
{
# Opening
$xml = '<MenuItem';
if($this->_fontMono!='') $xml .= " fontMono=\"{$this->_fontMono}\"";
$xml .= ">\n";
# Prompt
$icon = $this->escape($this->_icon);
$xml .= "<iconName";
if($this->_iconScaled!='') $xml .= " scaled=\"{$this->_iconScaled}\"";
$xml .= ">{$icon}</iconName>\n";
# URI
$url = $this->escape($this->_url);
$xml .= "<URI>{$url}</URI>\n";
# Selection
$selection = $this->escape($this->_selection);
if($selection!=NULL) $xml .= "<Selection>{$selection}</Selection>\n";
# Dial
if($this->_dial!=NULL)
{
if($this->_line!=NULL) $xml .= "<Dial line=\"{$this->_line}\">{$this->_dial}</Dial>\n";
else $xml .= "<Dial>{$this->_dial}</Dial>\n";
}
# Lines
foreach($this->_lines as $value) {
$xml .= '<Line';
if($value['align']!='') {
$align = $this->escape($value['align']);
$xml .= " Align=\"{$align}\"";
}
if($value['color']!='') {
$color = $this->escape($value['color']);
$xml .= " Color=\"{$color}\"";
}
$xml .= ">";
$text = $this->escape($value['text']);
if($text!='') $xml .= $text;
$xml .= '</Line>'."\n";
}
# Close
$xml .= '</MenuItem>'."\n";
# Return generated vaue
return($xml);
}
}
?>

View File

@ -19,12 +19,16 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional, only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional, only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional, only for non softkey phones)
# setAllowConf() to set the allowConf tag to 'yes' (optional, only for non softkey phones)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
@ -193,6 +197,11 @@ class AastraIPPhoneImageMenu extends AastraIPPhone {
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# AllowAnswer
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
@ -208,6 +217,9 @@ class AastraIPPhoneImageMenu extends AastraIPPhone {
# Timeout
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# ImageAction
if($this->_imageAction != '')
{

View File

@ -19,12 +19,16 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional, only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional, only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional, only for non softkey phones)
# setAllowConf() to set the allowConf tag to 'yes' (optional, only for non softkey phones)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
@ -42,8 +46,9 @@
# @flush boolean optional, output buffer to be flushed out or not.
#
# Specific to the object
# setImage(image) to define the image to be displayed
# setImage(image,scaling) to define the image to be displayed
# @image string
# @scaling scaling indicator "yes"/"no" optional
# setGDImage(GDImage) to use a GDImage for display, the size is forced to 40x144
# @GDImage GDImage
# setSPImage(SPImage) to use a SPImage for display, the size is forced to 40x144
@ -51,6 +56,7 @@
# setAlignment(vertical,horizontal) to define image alignment
# @vertical string, "top", "middle", "bottom"
# @horizontal string, "left", "middle", "right"
# setScaling() to indicate if image must be scaled
# setSize(height,width) to define image size
# @height integer (pixels)
# @width integer (pixels)
@ -118,6 +124,7 @@ class AastraIPPhoneImageScreen extends AastraIPPhone {
var $_image;
var $_verticalAlign=NULL;
var $_horizontalAlign=NULL;
var $_scaled='';
var $_height=NULL;
var $_width=NULL;
var $_allowDTMF='';
@ -140,6 +147,11 @@ class AastraIPPhoneImageScreen extends AastraIPPhone {
$this->_horizontalAlign = $horizontal;
}
function setScaling()
{
$this->_scaled = 'yes';
}
function setSize($height,$width)
{
$this->_height = $height;
@ -249,9 +261,17 @@ class AastraIPPhoneImageScreen extends AastraIPPhone {
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# Timeout
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# AllowAnswer
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
@ -315,6 +335,9 @@ class AastraIPPhoneImageScreen extends AastraIPPhone {
# Width
if($this->_width!=NULL) $out .= " width=\"{$this->_width}\"";
# Scaling
if($this->_scaled!='') $out .= " scaled=\"{$this->_scaled}\"";
# Image and end of image tag
$out .= ">{$this->_image}</Image>\n";

View File

@ -22,12 +22,16 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
@ -319,6 +323,11 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# AllowAnswer
if($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";
@ -334,6 +343,9 @@ class AastraIPPhoneInputScreen extends AastraIPPhone {
# TimeOut
if($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# End of the root tag
$out .= ">\n";

View File

@ -0,0 +1,77 @@
<?php
########################################################################################################
# Aastra XML API Classes - AastraIPPhoneConfiguration
# Copyright Mitel Networks 2005-2016
#
# AastraIPPhoneConfiguration object.
#
# Public methods
#
# Inherited from AastraIPPhone
# setBeep() to enable a notification beep with the object (optional)
# setEncodingUTF8() to change encoding from default ISO-8859-1 to UTF-8 (optional)
# generate() to return the generated XML for the object
# output(flush) to display the object
# @flush boolean optional, output buffer to be flushed out or not.
#
# Specific to the object
# addEntry(parameter,value,type) to add a configuration change
# @parameter string, parameter name
# @value string, parameter value
# @type string, conmfiguration change type (optional)
# setTriggerDestroyOnExit() to set the triggerDestroyOnExit tag to
# "yes" (optional)
#
# Example
# require_once('AastraIPPhoneConfiguration.class.php');
# $configuration = new AastraIPPhoneConfiguration();
# $configuration->addEntry('topsoftkey1 label','Test');
# $configuration->addEntry('topsoftkey1 background color','blue');
# $configuration->output();
#
########################################################################################################
require_once('AastraIPPhone.class.php');
require_once('AastraIPPhoneSoftkeyParam.class.php');
class AastraIPPhoneSoftkey extends AastraIPPhone {
var $_triggerDestroyOnExit='';
function addEntry($parameter, $value)
{
$this->_entries[] = new AastraIPPhoneSoftkeyParam($parameter, $value);
}
function setTriggerDestroyOnExit()
{
$this->_triggerDestroyOnExit="yes";
}
function render()
{
# Beginning of root tag
$out = "<AastraIPPhoneSoftkey";
# Beep
if($this->_beep=='yes') $out .= " Beep=\"yes\"";
# TriggerDestroyOnExit
if($this->_triggerDestroyOnExit=='yes') $out .= " triggerDestroyOnExit=\"yes\"";
# End of root tag
$out .= ">\n";
# Configuration Items
if (isset($this->_entries) && is_array($this->_entries))
{
foreach ($this->_entries as $entry) $out .= $entry->render();
}
# End tag
$out .= "</AastraIPPhoneSoftkey>\n";
# Return XML object
return($out);
}
}
?>

View File

@ -0,0 +1,42 @@
<?php
################################################################################
# Aastra XML API Classes - AastraIPPhoneSoftkeyParam
# Firmware 2.0 or better
# Copyright Mitel Networks 2005-2015
#
# Internal class for AastraIPPhoneConfiguration object.
################################################################################
class AastraIPPhoneSoftkeyParam extends AastraIPPhone {
var $_parameter;
var $_value;
function AastraIPPhoneSoftkeyParam($parameter, $value)
{
$this->setParameter($parameter);
$this->setValue($value);
}
function setParameter($parameter)
{
$this->_parameter = $parameter;
}
function setValue($value)
{
$this->_value = $value;
}
function render()
{
$parameter = $this->escape($this->_parameter);
$value = $this->escape($this->_value);
$xml = "<SoftkeyItem>\n";
$xml .= "<Parameter>".$parameter."</Parameter>\n";
$xml .= "<Value>".$value."</Value>\n";
$xml .= "</SoftkeyItem>\n";
return($xml);
}
}
?>

View File

@ -60,6 +60,16 @@ class AastraIPPhoneStatus extends AastraIPPhone {
$this->_entries[] = new AastraIPPhoneStatusEntry($index, $message, $type, $timeout, $uri, $icon, $color);
}
function addMessage($index, $message, $timeout=NULL, $uri='', $icon=0, $color='')
{
$this->_entries[] = new AastraIPPhoneStatusEntry($index, $message, '', $timeout, $uri, $icon, $color);
}
function addToaster($message, $uri='', $icon=0)
{
$this->_entries[] = new AastraIPPhoneStatusEntry('0', $message, 'toaster', NULL, $uri, $icon, '');
}
function render()
{
# Beginning of root tag

View File

@ -22,12 +22,16 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
@ -57,7 +61,7 @@
# setBase(base) to configure the menuItem base URI
# @base string
# resetBase() to reset the menuItem base URI
# addEntry(name,url,selection,icon,dial,line,color,split) to add an element in the list to be displayed
# addEntry(name,url,selection,icon,dial,line,color,split,iconr1,iconr2,iconr3,iconr4) to add an element in the list to be displayed
# @name string or array(0=>Line1,1=>Line2,2=>Offset,3=>Char,4=>Mode)
# @url string
# @selection string (optional)
@ -66,6 +70,10 @@
# @line integer, SIP line to use (optional)
# @color string, "red", "black", ... (optional)
# @split integer, position of the split between line 1 and line 2 (optional)
# @iconr1 integer (optional)
# @iconr2 integer (optional)
# @iconr3 integer (optional)
# @iconr4 integer (optional)
# setScrollUp(uri) to set the URI to be called when the user presses the Up arrow (optional)
# @uri string
# setScrollDown(uri) to set the URI to be called when the user presses the Down arrow (optional)
@ -131,10 +139,23 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
$this->_style = $style;
}
function addEntry($name, $url, $selection=NULL, $icon=NULL, $dial=NULL, $line=NULL, $color='', $split=NULL)
function addEntry($name, $url, $selection=NULL, $icon=NULL, $dial=NULL, $line=NULL, $color='', $split=NULL, $iconRight1=NULL, $iconRight2=NULL, $iconRight3=NULL, $iconRight4=NULL)
{
if(!Aastra_is_icons_supported()) $icon=NULL;
$this->_entries[] = new AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial, $line, $color, $split, NULL);
$this->_entries[] = new AastraIPPhoneTextMenuEntry( $name,
$url,
$selection,
$icon,
$dial,
$line,
$color,
$split,
NULL,
$iconRight1,
$iconRight2,
$iconRight3,
$iconRight4
);
}
function setBase($base)
@ -226,6 +247,11 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# WrapList
if ($this->_wraplist=='yes') $out .= " wrapList=\"yes\"";
@ -244,6 +270,9 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
# Timeout
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# Prevent list wrap
if ($this->_scrollConstrain == 'yes') $out .= " scrollConstrain=\"yes\"";
@ -263,9 +292,6 @@ class AastraIPPhoneTextMenu extends AastraIPPhone {
# Unit scroll (6739i)
if ($this->_unitScroll == 'yes') $out .= " unitScroll=\"yes\"";
# Background color(6739i)
if ($this->_bcolor != '') $out .= " Bcolor=\"{$this->_bcolor}\"";
# End of root tag
$out .= ">\n";

View File

@ -16,8 +16,12 @@ class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
var $_base;
var $_split;
var $_color;
var $_iconRight1;
var $_iconRight2;
var $_iconRight3;
var $_iconRight4;
function AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial, $line, $color, $split, $base)
function AastraIPPhoneTextMenuEntry($name, $url, $selection, $icon, $dial, $line, $color, $split, $base, $iconRight1=NULL, $iconRight2=NULL, $iconRight3=NULL, $iconRight4=NULL)
{
$this->_name=$name;
$this->_url=$url;
@ -28,6 +32,10 @@ class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
$this->_split=$split;
$this->_color=$color;
$this->_base=$base;
$this->_iconRight1=$iconRight1;
$this->_iconRight2=$iconRight2;
$this->_iconRight3=$iconRight3;
$this->_iconRight4=$iconRight4;
}
function getName()
@ -121,6 +129,10 @@ class AastraIPPhoneTextMenuEntry extends AastraIPPhone {
else $xml .= " base=\"\"";
}
if($this->_icon!=NULL) $xml .= " icon=\"{$this->_icon}\"";
if($this->_iconRight1!=NULL) $xml .= " iconr1=\"{$this->_iconRight1}\"";
if($this->_iconRight2!=NULL) $xml .= " iconr2=\"{$this->_iconRight2}\"";
if($this->_iconRight3!=NULL) $xml .= " iconr3=\"{$this->_iconRight3}\"";
if($this->_iconRight4!=NULL) $xml .= " iconr4=\"{$this->_iconRight4}\"";
$xml .= ">\n";
# Prompt

View File

@ -22,12 +22,16 @@
# setLockIn(uri) to set the Lock-in tag to 'yes' and the GoodbyeLockInURI(optional)
# @uri string, GoodByeLockInURI
# setLockInCall() to set the Lock-in tag to 'call' (optional)
# setCallProtection(notif) to protect the XML object against incoming calls
# @notif to enable/disable (false by default) the display of an incoming call notification (optional)
# setAllowAnswer() to set the allowAnswer tag to 'yes' (optional only for non softkey phones)
# setAllowDrop() to set the allowDrop tag to 'yes' (optional only for non softkey phones)
# setAllowXfer() to set the allowXfer tag to 'yes' (optional only for non softkey phones)
# setAllowConf() to set the allowConf tag to 'yes' (optional only for non softkey phones)
# setTimeout(timeout) to define a specific timeout for the XML object (optional)
# @timeout integer (seconds)
# setBackgroundColor(color) to change the XML object background color (optional)
# @color string, "red", "blue", ...
# addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
# @index integer, softkey number
# @label string
@ -167,12 +171,20 @@ class AastraIPPhoneTextScreen extends AastraIPPhone {
# TimeOut
if ($this->_timeout!=0) $out .= " Timeout=\"{$this->_timeout}\"";
# Background color
if ($this->_background_color!='') $out .= " bgColor=\"{$this->_background_color}\"";
# Lockin
if($this->_lockin!='') {
$out .= " LockIn=\"{$this->_lockin}\"";
if($this->_lockin_uri!='') $out .= " GoodbyeLockInURI=\"".$this->escape($this->_lockin_uri)."\"";
}
# Call Protection
if($this->_callprotection!='') {
$out .= " CallProtection=\"{$this->_callprotection}\"";
}
# AllowAnswer
if ($this->_allowAnswer == 'yes') $out .= " allowAnswer=\"yes\"";

View File

@ -1,4 +1,4 @@
Copyright (c) 2005-2015 Mitel Networks.
Copyright (c) 2005-2017 Mitel Networks.
All rights reserved.
Redistribution and use in source and binary forms, with or without