HTML Toolkit Programmer Reference - R2.0
HTML Toolkit Programmer Reference - R2.0
eqji=q==
=
m~=o=d=
o~=OKM=
=
NOTICE
The information contained in this document is believed to be accurate in all respects but is not
warranted by Mitel Networks Corporation (MITEL). The information is subject to change without
notice and should not be construed in any way as a commitment by Mitel or any of its affiliates or
subsidiaries. Mitel and its affiliates and subsidiaries assume no responsibility for any errors or
omissions in this document. Revisions of this document or new editions of it may be issued to
incorporate such changes.
No part of this document can be reproduced or transmitted in any form or by any means - electronic
or mechanical - for any purpose without written permission from Mitel Networks Corporation.
TRADEMARKS
Mitel is a registered trademark of Mitel Networks Corporation.
Other product names mentioned in this document may be trademarks of their respective companies
and are hereby acknowledged.
ii
Table of Contents
INTRODUCTION ....................................................................................................... 1
What Has Changed in Release 2.0 ..................................................................................... 1
PROGRAMMERS API.............................................................................................. 2
Browser Request API .......................................................................................................... 3
Debugging API Tools........................................................................................................... 3
HTML App Programmers API .............................................................................................. 3
TelML Collections, Objects and Functions Overview .......................................................... 4
TelML Definition - Common Elements ................................................................................. 4
Objects ............................................................................................................................................ 4
Collections....................................................................................................................................... 5
Item.................................................................................................................................................. 5
Count()............................................................................................................................................. 5
BuildTable() ..................................................................................................................................... 5
BuildTable Variables ....................................................................................................................... 5
Example........................................................................................................................................... 6
IsSupported()................................................................................................................................... 6
iii
Button Collection................................................................................................................ 39
Classification of Buttons and Keys................................................................................................ 39
Button Attributes............................................................................................................................ 39
Button Attribute: Name .................................................................................................................. 39
Button Attribute: Telephony Name ................................................................................................ 40
Button Attribute: Label................................................................................................................... 40
Button Attribute: Function.............................................................................................................. 40
Button Attribute: Function Associated Data ................................................................................. 43
Button Attribute: Programmability on the PBX .............................................................................. 43
Button Attribute: Index................................................................................................................... 43
Button Attribute: Hardware ID Code.............................................................................................. 44
Button Attribute: Associated LED Hardware ID Code................................................................... 44
Button Attribute: AutoEvent Type.................................................................................................. 44
Button Attribute: AutoEvent Associated Data ............................................................................... 44
Button Attribute: Relative Position................................................................................................. 44
iv
vi
List of Tables
Table 1. Button Collection Function" Attribute Values.......................................................................... 41
Table 2. 5330/5340 Hard Key Button Attributes.................................................................................. 45
Table 3. Softkey Attributes 5330 Set.................................................................................................... 46
Table 4. Lamp State Values ................................................................................................................ 93
Table 5. Telephony State Values ........................................................................................................ 94
Table 6. TelML Event List.................................................................................................................. 171
List of Figures
Figure 1. 5330 Key Names Locations ................................................................................................. 48
Figure 2. 5330 Telephony Key Name Locations ................................................................................. 49
Figure 3. 5340 Key Name Locations .................................................................................................... 54
Figure 4. 5340 Telephony Key Name Locations ................................................................................. 55
vii
viii
Introduction
This document provides application developers with detailed information about the APIs
available for developing HTML Applications that run on the phones.
For general information about the HTML Toolkit, please refer to the HTML Toolkit
Developers Guide.
RequestFullScreenBrowser( )
RequestGraphicalKeyBrowser( )
SpawnFullScreenInstance( )
TelML.Buttons.Item().GetRelative( )
TelML.Buttons.Item().RegisterKey( )
TelML.Buttons.Item().DeregisterKey( )
TelML.Buttons.GetPressReporting()
TelML.Buttons.GetReleaseReporting()
TelML.Display.GetTextSize( )
TelML.LowLevel.GetAvailableLanguageList( )
TelML.LowLevel.GetPhoneIPAddress( )
TelML.LowLevel.GetTimeDateFormat( )
TelML.LowLevel.GetTimeDate( )
TelML.Phone.GetCallNotification( )
TelML.Phone.GetCallInfoEnable( )
TelML.ICP.GetIPAddress( )
TelML.ICP.GetSWVersion( )
TelMLEvent.OnCallInfoEnableChanged
TelMLEvent.OnTimeDateChanged
TelMLEvent.OnTimeDateFormatChanged
TelMLEvent.OnTextSizeChanged
TelMLEvent.OnCallNotifyChanged
TelML.Browser.GetUseBuiltInControls(NUMBER number)
TelML.Browser.SetUseBuiltInControls( )
window.open()
Programmers API
The programmer writes applications using HTML 4.01, cascading style sheets (CSS) level 1,
and JavaScript 1.5. There are many public domain descriptions for HTML and JavaScript and
the reader is encouraged to use those as references.
HTML Applications access phone functionality using a provided JavaScript API.
Notes
RequestFullScreenBrowser()
RequestFullScreenBrowser()
RequestFullScreenBrowser()
RequestNewPageBrowser(title)
RequestGraphicalKeyBrowser()
SpawnFullScreenInstance(url)
Branding Application
NONE
Notification Application
RequestFullScreenBrowser()
Please see the Sample Applications directory from the installed tool chain for examples of
these API calls.
ApplicationData
PermanentApplicationData
Buttons
Lines
Lamps
TextDisplay
and 5 objects :
Browser
Display
LowLevel
Phone
ICP
The collections and objects above are accessed by referencing the TelML object as follows:
TelML.ApplicationData
TelML.PermanentApplicationData
TelML.Buttons
TelML.Lines
TelML.Lamps
TelML.TextDisplay
TelML.Browser
TelML.Display
TelML.LowLevel
TelML.Phone
TelML.ICP
Collections
Collections are used to hold multiple items such as lines, buttons, etc.
Collections have a number of common elements:
Count()
IsSupported(STRING itemtotest)
Item
Item returns an item in the collection. Item may have either a NUMBER or STRING as the
parameter. In the case of NUMBER, the item can be retrieved by passing the 0-based item
number in.
Passing in a STRING retrieves an item via an alpha-numeric key. This key is not case
sensitive.
Count()
Count returns the number of items in a collection. If there are 5 items in a collection, this
function will return 5, and the individual items will be accessed using Item( 0 ), Item( 1 ), Item(
2 ), Item( 3 ), Item( 4 ).
BuildTable()
A BuildTable function is provided for each collection. This is a mechanism whereby the user
can easily populate an HTML table or an HTML structure with all the elements in the
collection.
Build Table will first process the "HeaderTemplate" parameter. It will build a string consisting
of the text in the Header parameter, and will substitute any variables found in the string.
Next BuildTable automatically iterates through all the items in the collection, in the default
access order for that collection. For example, if there are 5 items in the collection, it will
iterate through items 0, 1, 2, 3, and 4 in that order. It will automatically substitute any
variables found in the BodyTemplate as it processes each row.
Finally, it will process the FooterTemplate, doing any variable substitution required, and will
concatenate this to the string.
BuildTable Variables
Variables are defined as strings of text surrounded by "%" characters.
Variables names will vary for each collection type.
Variable names are not case sensitive. "%Number%" is the same as %number%"
If a variable is used that is not defined, then "" is returned for that variable.
Example
A user may want to call this function as follows:
var MyTable = TelML.Buttons.BuildTable(
"<table><tr><td>Function</td><td>AssociatedNumber</td></tr>",
"<tr><td>%Function%</td><td>%AssociatedNumber%</td></tr>",
"</table>");
IsSupported()
Each object in TelML includes an IsSupported() function. This function can be called by
passing "" as a parameter, or by passing a specific function or variable name as a parameter.
If "" is passed into this function, then it will return a comma delimited string which is
comprised of all the individual functions and variables that are supported by this
implementation of TelML. In this way, a programmer can determine which objects, functions,
and variables are supported in this implementation.
If a developer wishes to determine if a specific function, variable or object is supported then
they can pass in the objects name, and the IsSupported() function will either return the
objects name if the object is supported, or "" if the object is not supported.
The function names are compared without case sensitivity.
Pseudocode for the TelML object is shown below:
TelML
{
STRING IsSupported( STRING item )
// Collections
ApplicationDataCollection ApplicationData
PermanentApplicationDataCollection PermanentApplicationData
ButtonCollection Buttons
LineCollection Lines
LampCollection Lamps
TextDisplayCollection TextDisplay
// Objects
BrowserObject Browser
DisplayObject Display
LowLevelSettingsObject LowLevel
PhoneObject Phone
ICPObject ICP
}
Pseudocode for the collections and objects in TelML are shown below:
ApplicationDataCollection
{
STRING IsSupported( STRING item )
ApplicationDataItem Item( STRING key )
ApplicationDataItem Item( NUMBER index )
NUMBER Count()
NUMBER Delete( STRING key )
LineCollection
{
STRING IsSupported( STRING item )
LineItem Item( NUMBER index )
NUMBER Count()
STRING BuildTable( STRING HeaderTemplate, STRING BodyTemplate, STRING
FooterTemplate )
}
LineItem
{
STRING IsSupported( STRING item )
NUMBER GetIndex ()
STRING GetDirectoryNumber()
STRING GetDirectoryNumberURI()
BOOLEAN GetIsPrime()
STRING IsLineStateSupported( STRING state)
STRING IsLineEventSupported( STRING event)
NUMBER AnswerCall()
NUMBER ClearCall()
NUMBER DialDigits( STRING digits )
ICPObject
{
STRING GetIPAddress()
10
OnButtonInformation
OnButtonPress
OnDisplayChanged
OnErrorCode
OnHookswitch
OnLampMode
OnLanguageChanged
OnTelephononyIdle
OnTelephonyNotIdle
OnConnectionCleared
OnDelivered
OnEstablished
OnOriginated
OnCallInfoEnableChanged
OnTimeDateChanged
OnTimeDateFormatChanged
OnTextSizeChanged
OnCallNotifyChanged
IsSupported()
Definition
STRING IsSupported( STRING item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.ApplicationData.IsSupported("Item");
// returns "Item"
11
Item()
Definition #1
ApplicationDataItem Item( STRING key )
Description
Retrieve an item from the Collection by searching for a key.
Arguments
Type
STRING
Name
key
Description
Key to search for in the collection.
Returns
A reference to an ApplicationDataItem is returned from the collection should a match be
found.
Undefined is returned if a match cannot be found.
Key is not case sensitive.
Notes
None
Example
// Assume: Empty Application Data Collection, Add new item
TelML.ApplicationData.AddItem("user_name","Company C.E.O.");
// userItem will contain a reference to
// ApplicationDataItem that was added with the AddItem command.
var userItem=TelML.ApplicationData.Item("user_name");
12
Definition #2
ApplicationDataItem Item( NUMBER index )
Description
Retrieve an item from the Collection by index.
Arguments
Type
NUMBER
Name
index
Description
Index in the collection to retrieve.
Returns
A reference to an ApplicationDataItem is returned from the ApplicationDataCollection at
the specified index.
Undefined is returned if the index is not present.
Notes
The order in which items are retrieved is undetermined.
Example
// Assume: Empty Application Data Collection, Add new item
TelML.ApplicationData.AddItem("user_name","Company C.E.O.");
// userItem will contain reference to ApplicationDataItem that was
added with the AddItem command.
var userItem=TelML.ApplicationData.Item(0);
13
Count( )
Definition
NUMBER Count()
Description
Return the number of items in the collection.
Arguments
None
Returns
The number of items.
Notes
None
Example
// Assume: Empty Application Data Collection
TelML.ApplicationData.Count();
// will return 0, as there are no items in collection
14
Delete()
Definition #1
NUMBER Delete( STRING key)
Description
Delete this item from the Collection.
Arguments
Type
STRING
Name
key
Description
The key value
Returns
0 always
Notes
If an item that does not exist is deleted, no error is returned.
Example
// Assume: Empty Application Data Collection, Add new item
TelML.ApplicationData.AddItem("user_name","Company C.E.O.");
// Remove added item from collection
TelML.ApplicationData.Delete("user_name");
15
Definition #2
NUMBER Delete( NUMBER index)
Description
Delete this item from the Collection.
Arguments
Type
NUMBER
Name
index
Description
The index
Returns
0 always
Notes
If an item that does not exist is deleted, no error is returned.
Example
// Assume: Empty Application Data Collection, Add new item
TelML.ApplicationData.AddItem("user_name","Company C.E.O.");
// Remove First Item in List
TelML.ApplicationData.Delete(0);
16
AddItem()
Definition
NUMBER AddItem( STRING key, STRING value)
Description
Add the item to the collection.
Arguments
Type
Name
Description
STRING
key
STRING
value
The value
Returns
-1 if the key already exists
-2 if no room
0 if ok
Notes
If the item exists with the supplied key, this function returns 1, and does not update the
value.
Example
// Assume: Empty Application Data Collection, Add new item
TelML.ApplicationData.AddItem("user_name","Company C.E.O.");
17
QueryMemory()
Definition
NUMBER QueryMemory()
Description
Returns the amount of memory, in bytes, available in the Collection.
If nothing is allocated, this will return 10240. This number will drop as resources are used.
Arguments
None
Returns
The amount of memory in bytes available in the Collection.
Notes
None
Example
// Assume: Empty Application Data Collection
TelML.ApplicationData.QueryMemory();
// Returns 10240
18
QueryKey()
Definition #1
NUMBER QueryKey( STRING key )
Description
Returns 1 if the key is defined.
Arguments
Type
STRING
Name
key
Description
The key of the item
Returns
0 if the key is undefined,
non-zero (1) if the key is defined.
Notes
None
Example
// Assume: Empty Application Data Collection
TelML.ApplicationData.QueryKey("user_name");
// Returns 0, since the key "user_name" does not exist in the
collection
19
Definition #2
NUMBER QueryKey( NUMBER index )
Description
Returns 1 if the index is defined.
Arguments
Type
NUMBER
Name
index
Description
The index of the item
Returns
0 if the index is undefined,
non-zero (1) if the index is defined.
Notes
None
Example
// Assume: Empty Application Data Collection
TelML.ApplicationData.QueryKey(0);
// Returns 0, since the index does not exist.
20
BuildTable( )
Definition
See TelML Definition Common Elements
Description
Valid variables for the header/footer section are:
%Count%
%Value%
%Key%
%Index%
%Size%
Arguments
See TelML Definition Common Elements
Returns
See TelML Definition Common Elements
Notes
See TelML Definition Common Elements
Example
var HTMLText =TelML.ApplicationData.BuildTable( "%Count% items to
follow<br>","<br> Key = %Key%; value = %value%; index = %iNdEx%
size = %siZE%","<br>%Count% items displayed");
// HTMLText will contain HTML code of all data stored in the
// ApplicationData collection.
21
IsSupported()
Definition
STRING IsSupported( STRING item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.PermanentApplicationData.IsSupported("Item");
// returns "Item"
22
Item()
Definition #1
ApplicationDataItem Item( STRING key )
Description
Retrieve an item from the Collection by searching for a key.
Arguments
Type
STRING
Name
key
Description
Key to search for in the collection.
Returns
A reference to an ApplicationDataItem is returned from the collection should a match be
found.
Undefined is returned if a match cannot be found.
Key is not case sensitive.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// userItem will contain a reference to
// ApplicationDataItem that was added with the AddItem command.
var userItem=TelML.PermanentApplicationData.Item("user_name");
23
Definition #2
ApplicationDataItem Item( NUMBER index )
Description
Retrieve an item from the Collection by index.
Arguments
Type
NUMBER
Name
index
Description
Index in the collection to retrieve.
Returns
A reference to an ApplicationDataItem is returned from the Permanent
ApplicationDataCollection at the specified index.
Undefined is returned if the index is not present.
Notes
The order in which items are retrieved is undetermined.
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// userItem will contain reference to ApplicationDataItem
// that was added with the AddItem command.
var userItem=TelML.PermanentApplicationData.Item(0);
24
Count( )
Definition
NUMBER Count()
Description
Return the number of items in the collection.
Arguments
None
Returns
The number of items.
Notes
None
Example
// Assume: Empty Application Data Collection
TelML.PermanentApplicationData.Count();
// will return 0, as there are no items in collection
25
Delete()
Definition #1
NUMBER Delete( STRING key)
Description
Delete this item from the Collection.
Arguments
Type
STRING
Name
key
Description
The key value
Returns
0 always
Notes
If an item that does not exist is deleted, no error is returned.
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// Remove added item from collection
TelML.PermanentApplicationData.Delete("user_name");
26
Definition #2
NUMBER Delete( NUMBER index)
Description
Delete this item from the Collection.
Arguments
Type
NUMBER
Name
index
Description
The index
Returns
0 always
Notes
If an item that does not exist is deleted, no error is returned.
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// Remove First Item in List
TelML.PermanentApplicationData.Delete(0);
27
AddItem()
Definition
NUMBER AddItem( STRING key, STRING value)
Description
Add the item to the collection.
Arguments
Type
Name
Description
STRING
key
STRING
value
The value
Returns
-1 if the key already exists
-2 if no room
0 if ok.
Notes
If an item exists with the supplied key, this function returns 1, and does not update the
value.
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
28
QueryMemory()
Definition
NUMBER QueryMemory()
Description
Returns the amount of memory, in bytes, available in the Collection.
If nothing is allocated, this will return 10240. This number will drop as resources are used.
Arguments
None
Returns
The amount of memory in bytes available in the Collection.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection
TelML.PermanentApplicationData.QueryMemory();
// Returns 10240
29
QueryKey()
Definition #1
NUMBER QueryKey( STRING key )
Description
Returns 1 if the key is defined.
Arguments
Type
STRING
Name
key
Description
The key of the item
Returns
0 if the key is undefined,
non-zero (1) if the key is defined.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection
TelML.PermanentApplicationData.QueryKey("user_name");
// Returns 0, since the key "user_name" does not exist in the
collection
30
Definition #2
NUMBER QueryKey( NUMBER index )
Description
Returns 1 if the index is defined.
Arguments
Type
NUMBER
Name
index
Description
The index of the item
Returns
0 if the index is undefined,
non-zero (1) if the index is defined.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection
TelML.PermanentApplicationData.QueryKey(0);
// Returns 0, since the index does not exist.
31
BuildTable( )
Definition
See TelML Definition Common Elements
Description
Valid variables for the header/footer section are:
%Count%
%Value%
%Key%
%Index%
%Size%
Arguments
See TelML Definition Common Elements
Returns
See TelML Definition Common Elements
Notes
See TelML Definition Common Elements
Example
var HTMLText =TelML.PermanentApplicationData.BuildTable( "%Count%
items to follow<br>","<br> Key = %Key%; value = %value%; index =
%iNdEx% size = %siZE%","<br>%Count% items displayed");
// HTMLText will contain HTML code of all data stored in the
//PermanentApplicationData collection.
32
IsSupported()
Definition
STRING IsSupported( STRING item )
Description
Defined in TelML Definition Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
// Add new item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
TelML.PermanentApplicationData.Item(0).IsSupported("GetKey");
// returns "GetKey"
33
GetValue()
Definition
STRING GetValue()
Description
Return the string value of this item in the collection.
Arguments
None
Returns
The string value of this item in the collection
Notes
None
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
TelML.PermanentApplicationData.Item("user_name").GetValue();
// Returns "Company C.E.O."
34
SetValue()
Definition
NUMBER SetValue( STRING value )
Description
Set the value of this item.
Arguments
Type
STRING
Name
Description
value
Returns
-1 if cant set this value (out of memory),
0 if success.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
TelML.PermanentApplicationData.Item("user_name").SetValue("Company
C.F.O.");
// Changes the value associated with the key "user_name" to
"Company C.F.O."
35
GetKey()
Definition
STRING GetKey()
Description
Returns the key used to access this item in the collection.
Arguments
None
Returns
Returns the key used to access this item in the collection.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// Find out the key of the first item in the list
TelML.PermanentApplicationData.Item(0).GetKey();
// Returns "user_name"
36
GetIndex()
Definition
NUMBER GetIndex()
Description
Return the numeric index of this item in the collection.
Arguments
None
Returns
Return the numeric index of this item in the collection.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// Find out the key of the first item in the list
TelML.PermanentApplicationData.Item("user_name").GetIndex();
// Returns 0 (first item in list)
37
GetSize()
Definition
NUMBER GetSize()
Description
Returns the size of the string value.
Arguments
None
Returns
Returns the size of the string value.
Notes
None
Example
// Assume: Empty Permanent Application Data Collection, Add new
item
TelML.PermanentApplicationData.AddItem("user_name","Company
C.E.O.");
// Find out the key of the first item in the list
TelML.PermanentApplicationData.Item("user_name").GetSize();
// Returns 14 (string length of "Company C.E.O.")
38
Button Collection
The button collection enumerates all buttons and keys on the phone. There are many
methods that can be used to:
In order to explain the operation of the Button Collection, the available information about keys
will be presented. Subsequently, the TelML methods to access this data will be presented.
Button Attributes
Each key has the following attributes:
Name
Telephony Name
Label
Function
Index
Hardware ID Code
Relative Position
39
40
Listed below are the possible PBX features and phone applications that can be programmed
on buttons:
Table 1. Button Collection Function" Attribute Values
Function
SpeedCall
AutoAnswer
Yes
Paging
Yes
Music
Yes
CallPickup
Yes
CallBack
Yes
Headset
Yes
Swap
Yes
NightAnswer
Yes
MakeBusy
Yes
Campon
Yes
Override
Yes
DoNotDisturb
Yes
Release
Yes
DirectPage
Yes
SingleFlash
Yes
DoubleFlash
Yes
MeetMeAnswer
Yes
MessageWaitingIndicator
DN to monitor
Yes
EmergencyCall
Yes
AccountCodeVerified
Yes
AccountCodeNonVerified
Yes
TagCall
Yes
Speaker
Yes
Message
Yes
Hold
Yes
TransferConference
Yes
Cancel
Yes
Redial
Yes
Superkey
Yes
PrivacyRelease
Yes
AnalogLine
Yes
Speak@Ease
Yes
41
Function
ACD
Yes
HotDesking
Yes
PhoneBook
Yes
CallLog
Yes
CallPark
Yes
CallParkRetrieve
Yes
GroupListen
Yes
Function
Line0
DN of Line
No
Line1
DN of Line
No
Line2
DN of Line
No
Line3
DN of Line
No
Line4
DN of Line
No
PCApplication
Yes
PhoneApplication
"CallAnnounce"
No
PhoneApplication
"ThresholdAlert"
No
PhoneApplication
"CdeSpeedCall"
No
PhoneApplication
"CallForwardBusyExternal"
No
PhoneApplication
"CallForwardNoAnswerExternal"
No
PhoneApplication
"CallForwardBusyInternal"
No
PhoneApplication
"CallForwardBusyNoAnswerInterna
l"
No
PhoneApplication
"CallForwardBusy"
No
PhoneApplication
"CallForwardNoAnswer"
No
PhoneApplication
"CallForwardAlways"
No
PhoneApplication
"SpecificGroupAlert"
No
PhoneApplication
"GenericGroupAlert"
No
PhoneApplication
"DssBlf"
No
PhoneApplication
"Secretarial"
No
PhoneApplication
"UrlLine"
No
PhoneApplication
"RecordACall"
No
PhoneApplication
"MicFeature"
No
PhoneApplication
"PhoneApplicationFeature"
No
PhoneApplication
"Forwarding"
No
Overview
Yes
People
Yes
42
Function
Settings
Yes
ConferenceCtrl
Yes
CallForward
Yes
PhoneHelp
Yes
CLIDDetail
Yes
Phone
Yes
Message
Yes
History
Yes
AppShutter
Yes
WebBrowser
Yes
PcHelp
Yes
PcCompanion
Yes
PhoneHtmlApplication
UnprogrammedEmbeddedApp
Yes
Yes
43
0, no action (default).
1, activate the HTML element with the ID specified in the Auto Event Associated Data by
sending the focus, select, and click methods on that HTML element.
2, send the code or ASCII character to the browser specified in the Auto Event
Associated Data attribute. See the definition of SetAutoEvent()-Type 2 Browser
Keystroke Auto Event for valid keystroke codes to send.
3, simulate as if a key (with key name or index specified in Auto Event Associated Data)
was pressed.
These attributes are not shown in any of the attribute tables because the programmer
defines them.
44
Telephony
Name
Label
Function
Associated LED
Hardware ID Code
Present?
Programmabilit
y on the PBX?
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Volup
Volup
Volup
Volup
No
No
Voldn
Voldn
Voldn
Voldn
No
No
Hookswitch
Hookswitch
Hookswitch
Hookswitch
No
No
Hold
Hold
Hold
Hold
No
No
Cancel
Cancel
Cancel
Cancel
No
No
Trans/Conf
Trans/Conf
Trans/Conf
Trans/Conf
No
No
Message
Message
Message
Message
Yes
No
Speaker
Speaker
Speaker
Speaker
No
No
Redial
Redial
Redial
Redial
No
No
Mute
Mute
Mute
Mute
Yes
No
Settings
Settings
Settings
Settings
No
No
Previous
Previous
Previous
Previous
No
No
Home
Home
Home
Home
No
No
Next
Next
Next
Next
No
No
45
Telephony
Name
SCREE
NKEY1
SK1
SCREE
NKEY2
SK2
SCREE
NKEY3
SK3
Label
(description)
Function
PBX Prompt
Displayed
beside SK1
Relative
Position
(Full
Screen)
Row: 0
Relative
Position
(New Page
App)
Assoc. LED
Hardware ID
Code
Present ?
Program on
the PBX?
Undefined
Yes
No
Undefined
Yes
No
Undefined
Yes
No
Column: 0
PBX Prompt
Displayed
beside SK2
Row: 1
Column: 0
PBX Prompt
Displayed
beside SK3
Row: 2
Column: 0
Telephony
Name
SCREE
NKEY4
PK8
SCREE
NKEY5
PK7
SCREE
NKEY6
PK6
SCREE
NKEY7
PK5
SCREE
NKEY8
PK4
SCREE
NKEY9
PK3
SCREE
NKEY10
PK2
SCREE
NKEY11
PK1
46
Label
(description)
Function
(Assoc.
Data)
Relative
Position
(Full
Screen)
Relative
Position
(New Page
App)
Associated
LED
Hardware
ID Code
Present?
Program
on the
PBX?
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
PBX Label
Displayed
beside PK8
As config on
PBX.
Row: 3
Row: 0
Column: 0
Column: 0
PBX Label
Displayed
beside PK7
As config on
PBX.
Row: 4
Row: 1
Column: 0
Column: 0
PBX Label
Displayed
beside PK6
As config on
PBX.
Row: 5
Row: 2
Column: 0
Column: 0
PBX Label
Displayed
beside PK5
As config on
PBX.
Row: 6
Row: 3
Column: 0
Column: 0
PBX Label
Displayed
beside PK4
As config on
PBX.
Row: 7
Row: 4
Column: 0
Column: 0
PBX Label
Displayed
beside PK3
As config on
PBX.
Row: 8
Row: 5
Column: 0
Column: 0
PBX Label
Displayed
beside PK2
As config on
PBX.
Row: 9
Row: 6
Column: 0
Column: 0
PBX Label
Displayed
beside PK1
Line0
(Phone
Extension)
Row: 10
Row: 7
Column: 0
Column: 0
Name
Telephony
Name
Label
(description)
Function
(Assoc.
Data)
Relative
Position
(Full
Screen)
Relative
Position
(New Page
App)
Associated
LED
Hardware
ID Code
Present?
Program
on the
PBX?
PK9
PBX Label
Displayed
beside PK9
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK10
PBX Label
Displayed
beside PK10
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK11
PBX Label
Displayed
beside PK11
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK12
PBX Label
Displayed
beside PK12
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK13
PBX Label
Displayed
beside PK13
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK14
PBX Label
Displayed
beside PK14
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK15
PBX Label
Displayed
beside PK15
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK16
PBX Label
Displayed
beside PK16
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK17
PBX Label
Displayed
beside PK17
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK18
PBX Label
Displayed
beside PK18
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK19
PBX Label
Displayed
beside PK19
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK20
PBX Label
Displayed
beside PK20
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK21
PBX Label
Displayed
beside PK21
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK22
PBX Label
Displayed
beside PK22
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK23
PBX Label
Displayed
beside PK23
As config
on PBX.
Undefined
Undefined
Yes
Yes
PK24
PBX Label
Displayed
beside PK24
As config
on PBX.
Undefined
Undefined
Yes
Yes
47
48
49
Telephony
Name
Label
(description)
SCREE
NKEY1
SK1
PBX Prompt
Displayed
beside SK1
SCREE
NKEY2
SK2
SCREE
NKEY3
SK3
SCREE
NKEY12
SK4
SCREE
NKEY13
SK5
SCREE
NKEY14
SK6
Function
Relative
Position (Full
Screen)
Relative
Position (New
Page App)
Associated
LED
Hardware
ID Code
Present?
Progra
m on
the
PBX?
Row: 0
Undefined
Yes
No
Undefined
Yes
No
Undefined
Yes
No
Undefined
Yes
No
Undefined
Yes
No
Undefined
Yes
No
Column: 0
PBX Prompt
Displayed
beside SK2
Row: 1
Column: 0
PBX Prompt
Displayed
beside SK3
Row: 2
Column: 0
PBX Prompt
Displayed
beside SK4
Row: 0
Column: 1
PBX Prompt
Displayed
beside SK5
Row: 1
Column: 1
PBX Prompt
Displayed
beside SK6
Row: 2
Column: 1
Telephon
y Name
SCREE
NKEY4
PK16
SCREE
NKEY5
PK14
SCREE
NKEY6
PK12
SCREE
NKEY7
PK10
SCREE
NKEY8
PK8
50
Label
(description)
Function
(Assoc.
Data)
LED ID
Code
Present?
PBX Label
Displayed
beside PK16
As config on
PBX.
Yes
PBX Label
Displayed
beside PK14
As config on
PBX.
Yes
PBX Label
Displayed
beside PK12
As config on
PBX.
Yes
PBX Label
Displayed
beside PK10
As config on
PBX.
Yes
PBX Label
Displayed
beside PK8
As config on
PBX.
Yes
Relative
Position
(Full
Screen)
Relative
Position
(New Page
App)
Row: 3
Row: 0
Column: 0
Column: 0
Row: 4
Row: 1
Column: 0
Column: 0
Row: 5
Row: 2
Column: 0
Column: 0
Row: 6
Row: 3
Column: 0
Column: 0
Row: 7
Row: 4
Column: 0
Column: 0
Program
on the
PBX?
Yes
Yes
Yes
Yes
Yes
Name
Telephon
y Name
SCREE
NKEY9
PK6
SCREE
NKEY10
PK4
SCREE
NKEY11
PK2
SCREE
NKEY15
PK15
SCREE
NKEY16
PK13
SCREE
NKEY17
PK11
SCREE
NKEY18
PK9
SCREE
NKEY19
PK7
SCREE
NKEY20
PK5
SCREE
NKEY21
PK3
SCREE
NKEY22
PK1
Label
(description)
Function
(Assoc.
Data)
LED ID
Code
Present?
PBX Label
Displayed
beside PK6
As config on
PBX.
Yes
PBX Label
Displayed
beside PK4
As config on
PBX.
Yes
PBX Label
Displayed
beside PK2
As config on
PBX.
Yes
PBX Label
Displayed
beside PK15
As config on
PBX.
Yes
PBX Label
Displayed
beside PK13
As config on
PBX.
Yes
PBX Label
Displayed
beside PK11
As config on
PBX.
Yes
PBX Label
Displayed
beside PK9
As config on
PBX.
Yes
PBX Label
Displayed
beside PK7
As config on
PBX.
Yes
PBX Label
Displayed
beside PK5
As config on
PBX.
Yes
PBX Label
Displayed
beside PK3
As config on
PBX.
Yes
PBX Label
Displayed
beside PK1
Line0
(Phone
Extension)
Yes
PK17
PBX Label
Displayed
beside PK17
As config on
PBX.
PK18
PBX Label
Displayed
beside PK18
PK19
PK20
Relative
Position
(Full
Screen)
Relative
Position
(New Page
App)
Program
on the
PBX?
Row: 8
Row: 5
Yes
Column: 0
Column: 0
Row: 9
Row: 6
Column: 0
Column: 0
Row: 10
Row: 7
Column: 0
Column: 0
Row: 3
Row: 0
Column: 1
Column: 1
Row: 4
Row: 2
Column: 1
Column: 1
Row: 5
Row: 3
Column: 1
Column: 1
Row: 6
Row: 4
Column: 1
Column: 1
Row: 7
Row: 5
Column: 1
Column: 1
Row: 8
Row: 6
Column: 1
Column: 1
Row: 9
Row: 7
Column: 1
Column: 1
Row: 10
Row: 8
Column: 1
Column: 1
Yes
Undefined
Undefined
Yes
As config on
PBX.
Yes
Undefined
Undefined
Yes
PBX Label
Displayed
beside PK19
As config on
PBX.
Yes
Undefined
Undefined
Yes
PBX Label
Displayed
beside PK20
As config on
PBX.
Yes
Undefined
Undefined
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
51
Name
52
Telephon
y Name
Label
(description)
Function
(Assoc.
Data)
LED ID
Code
Present?
Relative
Position
(Full
Screen)
Relative
Position
(New Page
App)
Program
on the
PBX?
PK21
PBX Label
Displayed
beside PK21
As config on
PBX.
Yes
Undefined
Undefined
Yes
PK22
PBX Label
Displayed
beside PK22
As config on
PBX.
Yes
Undefined
Undefined
Yes
PK23
PBX Label
Displayed
beside PK23
As config on
PBX.
Yes
Undefined
Undefined
Yes
PK24
PBX Label
Displayed
beside PK24
As config on
PBX.
Yes
Undefined
Undefined
Yes
PK25
PBX Label
Displayed
beside PK25
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK26
PBX Label
Displayed
beside PK26
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK27
PBX Label
Displayed
beside PK27
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK28
PBX Label
Displayed
beside PK28
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK29
PBX Label
Displayed
beside PK29
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK30
PBX Label
Displayed
beside PK30
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK31
PBX Label
Displayed
beside PK31
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK32
PBX Label
Displayed
beside PK32
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK33
PBX Label
Displayed
beside PK34
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK35
PBX Label
Displayed
beside PK35
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK36
PBX Label
Displayed
beside PK36
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK37
PBX Label
Displayed
beside PK37
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK38
PBX Label
Displayed
beside PK38
As config
on PBX.
Yes
Undefined
Undefined
Yes
Name
Telephon
y Name
Label
(description)
Function
(Assoc.
Data)
LED ID
Code
Present?
PK39
PBX Label
Displayed
beside PK39
As config
on PBX.
Yes
PK40
PBX Label
Displayed
beside PK40
As config
on PBX.
PK41
PBX Label
Displayed
beside PK41
PK42
Relative
Position
(Full
Screen)
Relative
Position
(New Page
App)
Program
on the
PBX?
Undefined
Undefined
Yes
Yes
Undefined
Undefined
Yes
As config
on PBX.
Yes
Undefined
Undefined
Yes
PBX Label
Displayed
beside
PK42
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK43
PBX Label
Displayed
beside PK43
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK44
PBX Label
Displayed
beside PK44
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK45
PBX Label
Displayed
beside PK45
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK46
PBX Label
Displayed
beside PK46
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK47
PBX Label
Displayed
beside PK47
As config
on PBX.
Yes
Undefined
Undefined
Yes
PK48
PBX Label
Displayed
beside PK48
As config
on PBX.
Yes
Undefined
Undefined
Yes
53
54
55
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.Buttons.IsSupported("Item");
// returns "Item"
56
Item()
Definition #1
ButtonItem Item(STRING Name)
Description
Retrieve an item from the Collection using the keys Name or Telephony Name.
Arguments
Type
STRING
Name
Name
Description
Name to search for in Name and Telephony Name Attributes
Returns
undefined if a match cannot be found in the Name or Telephony Name attributes of the
items in the Button Collection.
If a match is found, then a reference to a ButtonItem object is returned.
Notes
Case insensitive search is performed.
Example
var PrimeLineKey = TelML.Buttons.Item("PK1");
var BottomLeftProgrammableKey = TelML.Buttons.Item("SCREENKEY11");
// On a 5330 PrimeLineKey is the same as
BottomLeftProgrammableKey.
// On a 5340 PrimeLineKey.GetKeyName()
is "SCREENKEY22" and
// BottomLeftProgrammableKey.GetTelephonyKeyName() is "PK2".
57
Definition #2
ButtonItem Item(NUMBER Index)
Description
Retrieve an item from the Collection using the Index.
Arguments
Type
NUMBER
Name
Index
Description
index of the item in the collection to be retrieved.
Returns
undefined if a button with the supplied index cannot be found in the ButtonCollection.
If a Button can be found with the supplied index, then a reference to a ButtonItem object
is returned.
Notes
The index number for a particular key should not be hardcoded into HTML apps because
it could change in future versions. This method is very useful when used in an event
hander in conjunction with TelMLEventTelMLEvent.ButtonIndex. See example below.
Example
// Establish Key Event Handler
TelMLEvent.OnButtonPress = myButtonHandler;
function myButtonHandler()
{
// pressedKeyIndex contains the index of the key pressed
var pressedKeyIndex = TelMLEvent.ButtonIndex;
// pressedKeyItem is a reference to the pressed button Item
var pressedKeyItem = TelML.Buttons.Item(pressedKeyIndex);
// pressedKeyName is the string name of the pressed button.
var pressedKeyName = pressedKeyItem.GetKeyName();
}
58
Count( )
Definition
NUMBER Count()
Description
Return the number of buttons in the collection.
Arguments
None
Returns
The number of buttons.
Notes
None
Example
// returns the number of buttons in the collection
TelML.Buttons.Count();
59
ClearAutoEvents( )
Definition
NUMBER ClearAutoEvents()
Description
Sets all the Auto Event Type for all keys in the collection to type 0 which results in no
action on key press.
Arguments
None
Returns
0
Notes
Each running application has its own set of AutoEvents.
Example
// Clear all the autoevents.
TelML.Buttons.ClearAutoEvents();
60
BuildTable( )
Definition
See TelML Definition Common Elements
Description
Valid variables for the header/footer section are:
%Count%
%PressReporting%
%ReleaseReporting%
%KeyName%
%TelephonyKeyName%
%Label%
%Function%
%IsProgrammable%
%Index%
%Number%
%AssociatedLamp%
%AssociatatedNumber%
%AutoEventType%
%AutoEventIDKeyCode%
Arguments
See TelML Definition Common Elements
Returns
See TelML Definition Common Elements
Notes
See TelML Definition Common Elements
61
Example
var HTMLText = TelML.Buttons.BuildTable("%Count% items to
follow<br>",
"<br> Keyname = %KeyName%; Label = %LABEL%; index = %iNdEx%",
"%Count% items displayed");
// HTMLText will contain HTML code to display selected information
about all of the keys.
RelativePosition( )
Definition
ButtonItem RelativePosition(NUMBER column, NUMBER row)
Description
This collection accessor is similar to the Item method. This method requires a column,
and row offset from the top left "SCREENKEY" that is available to the application. This
method is particularly useful for developing applications to run as Graphical Key
Applications and New Page Applications so that they can be location independent.
For all application types other than Graphical Key Applications and New Page
Applications, the origin position is "SCREENKEY1" the top left key.
Arguments
Column For 5330 sets, this value can only be 0 because there is only one column of
keys. For a 5340 set with the same Graphical Key application programmed against the
programmable key on the left and the right side the value 0 refers to the key on the left,
and the value 1 would refer to the key on the right. For a 5340 set with a graphical key
application programmed to a key on the right side, this value can only be 0 because there
are no more columns beyond this. All non Graphical Key applications on the 5340 can be
0 or 1.
Row The key row offset increases towards the bottom of the screen based on the top
left "SCREENKEY" available to the application. This value can be between 0 and 10.
Returns
The ButtonItem object if the specified relative position is available to the application.
Otherwise, it returns undefined.
62
Notes
This method is useful to determine the amount of screen space programmed for a
graphical key application. An application can start testing from 0,0 and explore until
undefined is returned.
Example
//
// Graphical Key Application Programmed against four 5340 keys
// starting at SCREENKEY5.
//
var topLeft = TelML.Buttons.RelativePosition(0,0).GetKeyName();
// topLeft = "SCREENKEY5"
var bottomLeft = TelML.Buttons.RelativePosition(0,1).GetKeyName();
// bottomLeft = "SCREENKEY6";
var topRight = TelML.Buttons. RelativePosition (1,0).GetKeyName();
// topRight = "SCREENKEY16";
var bottomRight = TelML.Buttons.RelativePosition(1,1).GetKeyName();
// bottomRight = "SCREENKEY17";
var outOfRange = TelML.Buttons.RelativePosition(2,1);
// outOfRange = undefined.
//
// Full Screen Application
//
var topLeft = TelML.Buttons.RelativePosition(0,0).GetKeyName();
// topLeft = "SCREENKEY1";
//
// New Page Application
//
var topLeft = TelML.Buttons.RelativePosition(0,0).GetKeyName();
// topLeft = "SCREENKEY4";
63
RegisterKeyGroup( )
Definition
BOOLEAN RegisterKeyGroup(STRING keyGroupName)
Description
This method registers for a group of keys such that the HTML Application will receive
TelMLEvent.OnButtonPress events when keys from the requested key group are pressed
and/or released.
Arguments
KeyGroupName can be one of:
"NoKeys" - no effect
"VolumeKeys" the up and down arrow keys / volume keys on the right side of the phone
"ControlKeys" all keys above the dialpad keys except for the volume keys
"DialPadKeys" the digit keys 0..9 and * and #
"NavigationKeys" the navigation buttons below the screen
"ScreenKeys" the keys located around the screen
Returns
True if successful in registering the keys, False otherwise.
Notes
Each application type has different rules for which keys can be registered. Please see the
appropriate section in the HTML Toolkit Developer Guide describing all of the application
types.
Example
//
// Register all of the control keys
var result = TelML.Buttons.RegisterKeyGroup("ControlKeys");
// result = true;
64
DeregisterKeyGroup( )
Definition
BOOLEAN DeregisterKeyGroup(STRING keyGroupName)
Description
This method de-registers a group of keys such that HTML Application will no longer
receive TelMLEvent.OnButtonPress events when keys from the requested key group are
pressed and/or released.
Arguments
KeyGroupName can be one of :
"NoKeys" - no effect
"VolumeKeys" the up and down arrow keys / volume keys on the right side of the phone
"ControlKeys" the six keys immediately above the dialpad keys
"DialPadKeys" the digit keys 0..9 and * and #
"NavigationKeys" the three buttons below the screen
"ScreenKeys" the keys located around the screen
Returns
True if successful in de-registering the keys, False otherwise.
Notes
Each application type has different rules for which keys can be de-registered. Please see
the appropriate section in the HTML Toolkit Developer Guide describing all of the
application types. Please note that the hookswitch, the speaker key, and mic mute key
are not part of any group and need to be individually registered.
Example
//
// De-register all of the control keys
var result = TelML.Buttons.DeregisterKeyGroup("ControlKeys");
// result = true;
65
SetPressReporting( )
Definition
BOOLEAN SetPressReporting(BOOLEAN control)
Description
By default, reporting of downstrokes is disabled. By default, applications will only receive
TelMLEvent.OnButtonPressed events on upstrokes. This method will control whether
downstrokes of buttons will be reported to the application. Downstrokes are reported in
the TelMLEvent.OnButtonPressed event handler by reading the member
TelMLEvent.ButtonPressed and if it is true then it will be a downstroke, otherwise it is an
upstroke.
Arguments
control
BOOLEAN
Returns
The new value of the SetPressReporting.
Notes
This method can be used to create interesting visual effects when buttons are depressed.
Example
// Turn on press and release reporting so we get both downstrokes and
upstrokes
TelML.Buttons.SetPressReporting(true);
TelML.Buttons.SetReleaseReporting(true);
// Install a simple handler
TelMLEvent.OnButtonPress = function ()
{
alert("You just "+(TelMLEvent.ButtonPressed === true ?
"pressed" : "released")+ "a button");
};
66
SetReleaseReporting( )
Definition
BOOLEAN SetReleaseReporting(BOOLEAN control)
Description
By default, reporting of upstrokes is enabled. By default, applications will receive
TelMLEvent.OnButtonPressed events on upstrokes. This method will control whether
upstrokes of buttons will be reported to the application. Downstrokes are reported in the
TelMLEvent.OnButtonPressed event handler by reading the member
TelMLEvent.ButtonPressed and if it is true then it will be a downstroke, otherwise it is an
upstroke.
Arguments
control
BOOLEAN
Returns
The new value of the SetReleaseReporting.
Notes
This method can be used to create interesting visual effects when keys are released.
Example
// Turn on press and release reporting so we get both downstrokes and
upstrokes
TelML.Buttons.SetPressReporting(true);
TelML.Buttons.SetReleaseReporting(true);
// Install a simple handler
TelMLEvent.OnButtonPress = function ()
{
alert("You just "+TelMLEvent.ButtonPressed === true ? "pressed"
: "released" + "a button");
};
67
GetPressReporting( )
Definition
BOOLEAN GetPressReporting( )
Description
Returns true if press reporting is enabled, false otherwise. Press reporting is false by
default.
Returns
The current button press reporting setting.
Notes
None
Example
// Turn on press reporting only if it isn't set
if (TelML.Buttons.GetPressReporting() === false)
{
TelML.Buttons.SetPressReporting(true);
}
68
GetReleaseReporting( )
Definition
BOOLEAN GetReleaseReporting( )
Description
Returns true if release reporting is enabled, false otherwise. Release reporting is true by
default.
Returns
The current button release reporting setting.
Notes
None
Example
// Turn on release reporting only if it isn't set
if (TelML.Buttons.GetReleaseReporting() === false)
{
TelML.Buttons.SetReleaseReporting(true);
}
69
Button Item
This object contains all of the attributes for one button. These attributes were introduced in
the section on Button Attributes and will be referred to from this section.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.Buttons.Item("MESSAGE").IsSupported("GetKeyName");
// returns "GetKeyName"
70
GetKeyName( )
Definition
STRING GetKeyName()
Description
Returns the Key Name for this key. See Tables 2 through 6 in the Button Attribute section
to see how the keys are named. Please note that for programmable keys on pages 2 and
3 of the phone application do not have key names because they are not physical keys.
They do have Telephony Key Names as seen by the PBX.
Arguments
None
Returns
The string containing the Key Name.
Notes
None
Example
TelML.Buttons.Item("MESSAGE").GetKeyName();
// returns "Message"
71
GetTelephonyKeyName( )
Definition
STRING GetTelephonyKeyName()
Description
Returns the Telephony Key Name for this key. See Tables 2 through 6 in the Button
Attribute section to see how the keys are named.
Arguments
None
Returns
The string containing the Telephony Key Name.
Notes
None
Example
TelML.Buttons.Item("SCREENKEY1").GetTelephonyKeyName();
// returns "SK1" (for both 5330/40).
72
GetLabel( )
Definition
STRING GetLabel()
Description
Returns the Label associated with this key. See Tables 2 through 6 in the Button Attribute
section to see how the keys are named.
Arguments
None
Returns
The label associated with this key.
Notes
None
Example
TelML.Buttons.Item("PK1").GetLabel();
// returns the label associated with the prime line
// usually the directory number of the phone.
73
GetFunction( )
Definition
STRING GetFunction()
Description
Returns the Function associated with this key. See Tables 1 through 6 in the Button
Attribute section to see the possible return values.
Arguments
None
Returns
The function assigned to this key.
Notes
None
Example
TelML.Buttons.Item("PK1").GetFunction();
// returns "Line0".
74
GetAssociatedNumber( )
Definition
STRING GetAssociatedNumber()
Description
Returns the Function Associated Data. The name of this method is a misnomer, as it
returns numbers as well as text descriptions of the functions assigned to keys. See
Tables 1 through 6 in the Button Attribute section to see the possible return values.
Arguments
None
Returns
The function associated data assigned to this key.
Notes
None
Example
TelML.Buttons.Item("PK1").GetAssociatedNumber();
// returns the directory number of the prime line.
75
GetIsProgrammable( )
Definition
BOOLEAN GetIsProgrammable()
Description
Returns PBX programmability of this key from HTML applications. See Tables 2 through
6 in the Button Attribute section to see which keys are programmable.
Arguments
None
Returns
true if programmable, false if not programmable.
Notes
Just because this function returns true, doesnt mean that it can be reprogrammed by
using the SetButtonFunction method as some programming functions can only be set by
the administrator on the PBX. See table 1 for details to see HTML application
programmable functions.
Example
TelML.Buttons.Item("SK1").GetIsProgrammable();
// Returns false
76
GetIndex( )
Definition
NUMBER Index()
Description
Returns the location of this ButtonItem in the collection. See Button Attribute: Index for
more information regarding this attribute.
Arguments
None
Returns
Location of ButtonItem in this collection.
Notes
None
Example
var sk1_index = TelML.Buttons.Item("SK1").GetIndex();
var screenkey1_index = TelML.Buttons.Item("screenkey1").GetIndex();
// sk1_index is equal to screenkey1_index since they refer to the
// same ButtonItem in the button collection.
77
GetNumber( )
Definition
NUMBER GetNumber ()
Description
Returns the Hardware ID Code for this button. See Button Attribute: Hardware ID Code
for more details.
Arguments
None
Returns
The Hardware ID Code for the button.
Notes
These numbers are used internally and are not really of any use to an HTML Apps
programmer.
Example
TelML.Buttons.Item("SK1").GetNumber();
// return value depends on set type.
78
GetAssociatedLamp( )
Definition
NUMBER GetAssociatedLamp()
Description
Returns the Hardware ID Code for the associated LED if present. If not present, it returns
1. See Button Attribute: Associated LED Hardware ID Code for more details.
Arguments
None
Returns
-1 if no associated LED, otherwise Hardware ID Code for associated LED.
Notes
This function is useful for determining if there is an LED associated with a particular key.
The Hardware ID numbers are used internally and are not of any use to an HTML Apps
programmer.
Example
TelML.Buttons.Item("Volup").GetAssociatedLamp();
// returns 1 since there is no associated lamp
79
GetAutoEventType( )
Definition
NUMBER GetAutoEventType ()
Description
Returns the current action to occur when this key is pressed. See Button Attribute:
AutoEvent Type for a description of the action types.
Arguments
None
Returns
0, 1, 2 or 3.
Notes
None
Example
// Setup an autoevent on a key.
TelML.Buttons.Item("SK1").SetAutoEventType(1,"editbox");
// Verify that it was set correctly.
TelML.Buttons.Item("SK1").GetAutoEventType();
// returns "1"
80
GetAutoEventIDKeyCode( )
Definition
STRING GetAutoEventIDKeyCode () for GetAutoEventType ()==1,2,3
NUMBER GetAutoEventIDKeyCode () for GetAutoEventType ()==2,3
Description
Returns the current setting of the Auto Event Associated Data. See Button Attribute:
AutoEvent Type for description of the action types.
Arguments
None
Returns
The associated data for the Auto Event.
Notes
Types 2 or 3 may return either a number or a string.
Example
// Setup an autoevent on a key.
TelML.Buttons.Item("SK1").SetAutoEventType(1,"editbox");
// Verify that it was set correctly.
TelML.Buttons.Item("SK1").GetAutoEventIDKeyCode();
// returns "editbox"
81
Press( )
Definition
VOID Press()
Description
Sends this key to the phone, as if the user pressed the key. Some keys will be sent to an
internal application in the phone, and all the rest of the keys will be sent to the PBX.
Arguments
None
Returns
No value
Notes
None
Example
// Simulate pressing the Message Key
TelML.Buttons.Item("Message").Press();
82
SetButtonFunction()
Definition
NUMBER SetButtonFunction(STRING Label, STRING Function, STRING
FunctionAssociatedData)
Description
Programs a key using the information provided. Please see Button Attribute: Function for
details as to which functions are programmable via this method. Some keys cannot be
reprogrammed by using this command as some features programmed on key can only be
added or removed by the Administrator of the ICP.
Arguments
Type
Name
Description
STRING
label
STRING
function
STRING
functionAssociatedData
Returns
-1 error setting function
0 no error occurred
Notes
This command can load down the performance of the ICP, so use this sparingly.
Example
// Program a speed dial on PK2 for 1234 labeled as Boss
TelML.Buttons.Item("PK2").SetButtonFunction("Boss","SpeedCall","12
34");
// Returns 0, if PK2 is previously unprogrammed.
83
Description
Sets an AutoEvent on an HTML element with the ID name provided when this key is
pressed. See Button Attribute: AutoEvent Type for further details.
Arguments
Type
Name
Description
NUMBER
autoEventType
STRING
idCode
Returns
-1 Invalid autoEventType
0 otherwise
Notes
The IdCode provided is not verified at assignment time. Should the IdCode not be found
in the loaded HTML document at keypress time, no action will occur.
Example
TelML.Buttons.Item("SCREENKEY5").SetAutoEvent(1,"idcheckbox");
// When SCREENKEY5 is pressed, it will cause an HTML element
// with an ID name of idcheckbox to be selected, focused, and clicked.
84
Description
Directs specified asciiChar or code to the web browser when this key is pressed. To be
used when the TelML.Browser.SetUseBuiltInControls(0) method is invoked to turned off
the built in keyboard to allow use of an app designer defined keyboard for using HTML
forms. See the table in the Notes section below for valid values of code.
See Button Attribute: Auto EventType for further details.
Arguments
Type
Name
Description
NUMBER
AutoEventType
STRING
AsciiChar
NUMBER
Code
Returns
-1 invalid autoEventType
0 no error
Notes
The code or asciiChar provided is not verified at assignment time. Should an invalid code
or asciiChar be sent, undesirable behaviours may occur.
To determine the hexadecimal code value, refer to left column to determine the first hex
digit and then refer to top row to determine the second hex digit.
85
BS
A
LF
TAB
CR
ESC
2 SPACE !
"
&
'
<
>
(18688)
(0x4900)
PgDn
(20736)
(0x5100)
Home
(18176)
(0x4700)
End
(20224)
(0x4f00)
UpArrw
(18432)
(0x4800)
DnArrw
(20480)
(0x5000)
LftArrw
(19200)
(0x4b00)
RtArrw
(19712)
(0x4d00)
Shift-Tab ( 3840)
(0x0f00)
*Ctl-Bksp(
127)
(0x007f)
Example
TelML.Buttons.Item("SCREENKEY5").SetAutoEvent(2,"a");
// Will send the key "a" to the browser when SCREENKEY5 key is pressed.
86
Description
When this key is pressed, the auto event handler will access the key collection using the
Item method (using the supplied keyName or keyIndex) and invoke the Press() method
on that key. See Button Attribute: AutoEventType for further details.
Arguments
Type
Name
Description
NUMBER
AutoEventType
STRING
KeyName
NUMBER
KeyIndex
Returns
-1 invalid autoEventType
0 no error
Notes
The supplied keyName or keyIndex values not validated when calling this function.
Should the keyName or keyIndex not exist when the event occurs, a runtime error will
occur.
Example
TelML.Buttons.Item("PK1").SetAutoEvent(3,"PK1");
// Whenever the PK1 key is pressed, it will forward it to the PBX.
87
ClearAutoEvent( )
Definition
NUMBER ClearAutoEvent ()
Description
Sets the Auto Event Type to type 0 which results in no action on key press. See Button
Attribute: AutoEvent Type for further details.
Arguments
None
Returns
0
Notes
None
Example
TelML.Buttons.Item("PK1").ClearAutoEvent();
// Removes any auto events that may have been on PK1.
88
GetRelativePosition( )
Definition
OBJECT GetRelativePosition()
Description
This function will return an object with the relative key offsets from the top left
"SCREENKEY" in which the application is running.
Arguments
None
Returns
Undefined, if this method is called on one of the SCREENKEYS that is not available to
the running application.
An object with two properties: row and column. The row offset increases towards the
bottom, and the column offset increases towards the right.
Notes
None
Example
//
// Graphical Key Application Programmed against four 5340 keys
// starting at SCREENKEY5.
//
var topLeft = TelML.Buttons.Item("SCREENKEY5").GetRelative();
// topLeft = {row: 0, column: 0);
var bottomLeft = TelML.Buttons.Item("SCREENKEY6").GetRelative();
// bottomLeft = { column: 0, row: 1);
var topRight = TelML.Buttons.Item("SCREENKEY16").GetRelative();
// topRight = { column: 1, row: 0);
var bottomRight = TelML.Buttons.Item("SCREENKEY17").GetRelative();
// bottomRight = { column: 1, row: 1);
var outOfRange = TelML.Buttons. Item("SCREENKEY7").GetRelative();
// outOfRange = undefined.
//
// Full Screen Application
//
89
RegisterKey( )
Definition
BOOLEAN RegisterKey()
Description
This method registers a key such that HTML Application will receive
TelMLEvent.OnButtonPress events when it is pressed and/or released.
By registering the key, it will also be possible to control the corresponding lamp (if
applicable) by using the TelML.Lamps object.
Arguments
None
Returns
True if successful, False otherwise.
Notes
Each application type has different rules for which keys can be registered. Please see the
appropriate section describing all of the application types.
Example
var result = TelML.Buttons.Item("Message").RegisterKey();
// result = true (sample)
Message key presses will now be reported
to applications that are allowed to register this key.
90
DeregisterKey( )
Definition
BOOLEAN DeregisterKey()
Description
This method de-registers a key such that HTML Application will no longer receive
TelMLEvent.OnButtonPress events when it is pressed and/or released.
By deregistering a key, it will not be possible to control the corresponding lamp (if
applicable) using the TelML.Lamps object.
Arguments
None
Returns
True if successful, False otherwise.
Notes
Each application type has different rules for which keys can be de-registered. Please see
the appropriate section describing all of the application types.
Example
var result = TelML.Buttons.Item("Message").DeregisterKey();
// result = true (sample)
Message key presses will now be reported
to applications that are allowed to register this key.
91
Lamp Collection
The lamp collection enumerates all the lamps, physically present on the phone as well as
additional lamps that are located on pages 2 and 3 of the phone application. By using the
lamp collection interfaces the programmer can:
Control visible lamps while in the HTML app, by turning them on or off, or flashing at
different speeds
In order to control a lamp associated with a key, the key must be registered implicitly because
of the type of application OR must be explictly registered by using the
TelML.Buttons.RegisterKeyGroup or TelML.Buttons.Item().RegisterKey API commands.
The ringer lamp is not controllable by TelML since it is used exclusively by the PBX.
In order to explain the operation of the Lamp Collection, the available information about
Lamps will be presented. Subsequently, the TelML methods to access this data will be
presented.
Lamp Attributes
Each Lamp has the following attributes:
Name
Telephony Name
State
Telephony State
Color
Index
Hardware ID Code
Relative Position
92
Description
off
on
10
11
..
21
93
State
Description
31
41
51
61
62
63
64
Description
Off
On
flashing
94
95
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.Lamps.IsSupported("Item");
// returns "Item"
96
Item()
Definition #1
LampItem Item(STRING Name)
Description
Retrieve an item from the Collection using the lamps Name or Telephony Name.
Arguments
Type
STRING
Name
Name
Description
Name to search in Name and Telephony Name
Returns
undefined if a match cannot be found in the Name or Telephony Name attributes of the
items of the LampCollection.
If a match is found, then a reference to a LampItem object is returned.
Notes
Case insensitive search is performed.
Example
var PrimeLineLamp = TelML.Lamps.Item("PK1");
var BottomLeftLamp = TelML.Lamps.Item("SCREENKEY11");
// On a 5330 PrimeLineLamp is the same as BottomLeftLamp.
// On a 5340 PrimeLineLamp.GetLampName()
is "SCREENKEY22"
Definition #2
LampItem Item(NUMBER Index)
Description
Retrieve an item from the Collection using the Index.
97
Arguments
Type
NUMBER
Name
index
Description
Name to search in Name and Telephony Name attributes
Returns
undefined if a button of the supplied index cannot be found in the LampCollection. If a
Lamp can be found with the supplied index is found, then a reference to a ButtonItem
object is returned.
Notes
The index number for a particular key should not be hardcoded into HTML apps because
it could change in future versions.
Example
// Establish Key Event Handler
TelMLEvent.OnLampMode = myLampHandler;
function myLampHandler()
{
// changedLampIndex contains the index of the changed lamp
var changedLampIndex = TelMLEvent.LampIndex;
// changedLampItem is a reference to the changed lamp item .
var changedLampItem = TelML.Lamps.Item(changedLampIndex);
// changedLampName is the string name of the changed lamp.
var changedLampName = changedLampItem.GetKeyName();
}
98
RelativePosition( )
Definition
LampItem RelativePosition(column, row)
Description
This collection accessor is similar to the Item method. This method requires a column,
and row offset from the top left "SCREENKEY" that is available to the application. This
method is particularly useful for developing applications to run as Graphical Key
Applications and New Page Applications so that they can be location independent.
For all application types other than Graphical Key Applications and New Page
Applications, the origin position is "SCREENKEY1" the top left lamp.
Arguments
Column For 5330 sets, this value can only be 0 because there is only one column of
lamps. For a 5340 set with the same Graphical Key application programmed against the
programmable key on the left and the right side the value 0 refers to the lamp on the left,
and the value 1 would refer to the lamp on the right. For a 5340 set with a graphical key
application programmed to a key on the right side this value can only be 0 because there
are no more columns beyond this. All non Graphical Key applications on the 5340 can be
0 or 1.
Row The lamp row offset increases towards the bottom of the screen based on the top
left "SCREENKEY" available to the application.
Returns
The LampItem object if the specified relative position is available to the application.
Otherwise, it returns undefined.
Notes
This method is useful to determine the amount of screen space programmed for a
Graphical Key application. An application can start testing from 0,0 and explore until
undefined is returned.
Example
//
// Graphical Key Application Programmed against four 5340 keys
// starting at SCREENKEY5.
//
var topLeft = TelML.Lamps.RelativePosition(0,0).GetLampName();
// topLeft = "SCREENKEY5"
var bottomLeft = TelML.Lamps.RelativePosition(0,1).GetLampName();
// bottomLeft = "SCREENKEY6";
99
Count( )
Definition
NUMBER Count()
Description
Return the number of lamps in the collection.
Arguments
None
Returns
The number of lamps.
Notes
None
Example
// returns the number of lamps in the collection
TelML.Lamps.Count();
100
BuildTable( )
Definition
See TelML Definition Common Elements
Description
Valid variables for the header/footer section are:
%Count%
%LampName%
%TelephonyLampName%
%TelephonyState%
%TelephonyColor%
%State%
%Color%
%Index%
%Number%
Arguments
See TelML Definition Common Elements
Returns
See TelML Definition Common Elements
Notes
See TelML Definition Common Elements
Example
var HTMLText = TelML.Lamps.BuildTable("%Count% items to
follow<br>",
"<br> LampName = %LampName%; Color = %COLOR%; index = %iNdEx%",
"%Count% items displayed");
// HTMLText will contain HTML code to display selected information
about all of the lamps.
101
Lamp Item
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.Lamps.Item("Message").IsSupported("GetLampName");
// returns "GetLampName"
102
GetLampName( )
Definition
STRING GetLampName()
Description
Returns the Lamp Name for this lamp. See Lamp Attribute: Name to see how the keys
and associated lamps are named. Please note that for programmable keys beyond the
first page as shown in the Phone Application do not have key names because they are
not physical lamps. They do have Telephony Lamp Names as seen by the PBX.
Arguments
None
Returns
The string containing the Lamp Name.
Notes
None
Example
TelML.Lamps.Item("MESSAGE").GetLampName();
// returns "Message"
103
GetTelephonyLampName( )
Definition
STRING GetTelephonyLampName()
Description
Returns the Telephony Name for this lamp. See Lamp Attribute: Telephony Name to see
how the keys and associated lamps are named.
Arguments
None
Returns
The string containing the Telephony Lamp Name.
Notes
None
Example
TelML.Lamps.Item("SCREENKEY1").GetTelephonyLampName();
// returns "SK1" for both 5330 and 5340
104
GetColor()
Definition
NUMBER GetColor()
Description
Returns the locally controlled color for this lamp. See Lamp Attribute: Color for details.
Arguments
None
Returns
The current color set for this lamp. 0 is green, 1 is red.
Notes
Green is the default color. The hardkey indicators and ringer can be red only. If set to
green they will not be visible.
PK1 through PK8 are the only visible PK keys on a 5330, and PK1 through PK16 are the
only visible PK keys on a 5340.
The ringer lamp is not controllable by TelML since it is used exclusively by the PBX.
In order to control a lamp associated with a key, the key must be registered implicitly
because of the type of application OR must be explicitly registered by using the
RegisterKeyGroup or RegisterKey API commands.
Example
TelML.Lamps.Item("SCREENKEY1").GetColor();
// Returns 0, green which is the default color
105
SetColor()
Definition
NUMBER SetColor(NUMBER color)
Description
Locally control the color for this lamp. See Lamp Attribute: Telephony Color for more
details.
Arguments
Type
NUMBER
Name
color
Description
New lamp color: 0-green; 1-red
Returns
If a change is required to make it the specified color, it is returned. 0 is green, 1 is red.
Otherwise:
-1 for bad color specified,
-2 for no change needed
Notes
Green is the default color. The hardkey indicators and ringer can be red only. If set to
green they will not be visible.
PK1 through PK8 are the only visible PK keys on a 5330, and PK1 through PK16 are the
only visible PK keys on a 5340.
The ringer lamp is not controllable by TelML since it is used exclusively by the PBX.
In order to control a lamp associated with a key, the key must be registered implicitly
because of the type of application OR must be explicitly registered by using the
RegisterKeyGroup or RegisterKey API commands.
Example
TelML.Lamps.Item("SCREENKEY1").SetState(2);
// Top left key is now flashing 50ms on/off in default color
(green)
TelML.Lamps.Item("SCREENKEY1").SetColor(1);
// Will return "0", and Top left key is now flashing red
106
GetState()
Definition
NUMBER GetState()
Description
Returns locally controlled state of this lamp. See Lamp Attribute: State for definition of the
state value.
Arguments
None
Returns
0-64 (see Lamp Attribute: State for details)
Notes
0 is the default state.
PK1 through PK8 are the only visible PK keys on a 5330, and PK1 through PK16 are the
only visible PK keys on a 5340.
The ringer lamp is not controllable by TelML since it is used exclusively by the PBX.
In order to control a lamp associated with a key, the key must be registered implicitly
because of the type of application OR must be explicitly registered by using the
RegisterKeyGroup or RegisterKey API commands.
Example
// Assume lamp is off.
TelML.Lamps.Item("SCREENKEY1").GetState();
// Returns 0
107
SetState()
Definition
NUMBER SetState(NUMBER state)
Description
Locally controls the state of this lamp. See Lamp Attribute: State for definition of the state
value.
Arguments
Type
NUMBER
Name
state
Description
New lamp state
Returns
If a change is required to make it the specified state, it is returned
Otherwise:
-1 for bad state specified,
-2 for no change needed
Notes
0 is the default state.
PK1 through PK8 are the only visible PK keys on a 5330, and PK1 through PK16 are the
only visible PK keys on a 5340.
The ringer lamp is not controllable by TelML since it is used exclusively by the PBX.
In order to control a lamp associated with a key, the key must be registered implicitly
because of the type of application OR must be explicitly registered by using the
RegisterKeyGroup or RegisterKey API commands.
Example
// Assume lamp is off.
TelML.Lamps.Item("SCREENKEY1").SetState(1);
// Returns 1, The lamp associated with SCREENKEY1 will
// turn on with the default color (green)
108
GetTelephonyState()
Definition
NUMBER GetTelephonyState()
Description
Returns the PBXs view of the state of this lamp. See Lamp Attribute: Telephony State for
definition of the telephony state value.
Arguments
None
Returns
Returns the PBXs view of the state of this lamp.
Notes
None
Example
TelML.Lamps.Item("PK1").GetTelephonyState();
// Returns current lamp telephony state of the prime line key.
109
GetTelephonyColor()
Definition
NUMBER GetTelephonyColor()
Description
Returns the PBXs view of the color of this lamp. See Lamp Attribute: Telephony Color for
definition of the telephony color value.
Arguments
None
Returns
Returns the PBXs view of the state of this lamp.
Notes
None
Example
TelML.Lamps.Item("PK1").GetTelephonyColor();
// Returns the current color the PBX has set for PK1.
110
GetIndex( )
Definition
NUMBER Index()
Description
Returns the location of this LampItem in the collection. See Lamp Attribute: Index for
more information regarding this attribute.
Arguments
None
Returns
Location of this LampItem in the collection.
Notes
None
Example
var sk1_index = TelML.Lamps.Item("SK1").GetIndex();
var screenkey1_index = TelML.Lamps.Item("screenkey1").GetIndex();
// sk1_index is equal to screenkey1_index since they refer to
// the same LampItem in the lamp collection.
111
GetNumber( )
Definition
NUMBER GetNumber ()
Description
Returns the Hardware ID Code for this Lamp. See Lamp Attribute: Hardware ID Code for
more details.
Arguments
None
Returns
The Hardware ID Code for the lamp.
Notes
These numbers are used internally and are not really of any use to an HTML Apps
programmer.
Example
TelML.Lamps.Item("SK1").GetNumber();
// Returns The Hardware ID Code for the top left lamp.
112
GetRelativePosition( )
Definition
OBJECT GetRelativePosition()
Description
This function will return an object with the relative lamp offsets from the top left
"SCREENKEY" in which the application is running.
Arguments
None
Returns
Undefined, if this method is called on one of the SCREENKEYS that is not available to
the running application.
An object with two properties: row and column. The row increases towards the bottom,
and the column increases towards the right.
Notes
None
Example
//
// Graphical Key Application Programmed against four 5340 keys
// starting at SCREENKEY5.
//
var topLeft = TelML.Lamps.Item("SCREENKEY5").GetRelative();
// topLeft = {row: 0, column: 0);
var bottomLeft = TelML.Lamps.Item("SCREENKEY6").GetRelative();
// bottomLeft = { column: 0, row: 1);
var topRight = TelML.Lamps.Item("SCREENKEY16").GetRelative();
// topRight = { column: 1, row: 0);
var bottomRight = TelML.Lamps.Item("SCREENKEY17").GetRelative();
// bottomRight = { column: 1, row: 1);
var outOfRange = TelML.Lamps.Item("SCREENKEY7").GetRelative();
// outOfRange = undefined.
//
// Full Screen Application
//
113
114
Lines Collection
The Line collection is used to discover the number of lines in the phone and iterate through
the lines. Lines are returned in order. Lines are numbered from 0 to 3 for phones operating in
MiNet mode. Lines are numbered 1 to 4 for phones operating in SIP mode. The set only
enumerates the first 4 lines into the Lines collection.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition Common Elements
Notes
None
Example
TelML.Lines.IsSupported("Item");
// returns "Item"
115
Item()
Definition
LineItem Item( NUMBER index )
Description
Returns the LineItem for the corresponding index.
Arguments
Type
NUMBER
Name
index
Description
The index of the LineItem to return
Returns
A reference to a LineItem if successful,
Undefined if the index does not exist.
Notes
None
Example
var myLine = TelML.Lines.Item(1);
// myLine is a reference to a LineItem for the line on index 1
116
Count()
Definition
NUMBER Count( )
Description
Returns the number of lines.
Arguments
None.
Returns
The number of lines.
Notes
Only the first 4 lines are enumerated.
Example
var numberOfLines = TelML.Lines.Count();
// numberOfLines contains the number of lines enumerated
117
BuildTable()
Definition
STRING BuildTable( STRING header, STRING body, STRING footer )
Description
The BuildTable function has been described in TelML Definition Common Elements.
Supported variables in each section are:
header: %count%
body: %Index%, %DirectoryNumber%, %DirectoryNumberURI%, %IsPrime%
footer: %count%
Arguments
Type
Name
Description
STRING
header
STRING
body
STRING
footer
Returns
The string as defined in the corresponding TelML Definition Common Elements section.
Notes
None
Example
var HTMLText = TelML.Lines.BuildTable("%Count% items to
follow<br>",
"<br> DN = %DirectoryNUMBER%; Prime = %ISPRIME%;",
"%Count% items displayed");
// HTMLText will contain HTML code to display selected information
about all of the lines in the collection.
118
LineItem
The LineItem is used to make and answer calls on the line. It is also used to get information
about the line such as its index, its DN, if its the prime line and the states and events
supported on the line.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition Common Elements.
Arguments
Type
STRING
Name
item
Description
The item to be queried, or blank to query all items
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelML.Lines.Item(2).IsSupported("");
// Returns a comma separated list of all the LineItem methods
TelML.Lines.Item(2).IsSupported("GetIndex");
// Returns "GetIndex"
119
GetIndex()
Definition
NUMBER GetIndex()
Description
Returns the index number of this LineItem in the collection.
Arguments
None
Returns
Notes
None
Example
var myLineItem = TelML.Lines.Item(2);
// Store a reference to the line on index 2 for easy referencing.
myLineItem.GetIndex();
// returns 2;
120
GetDirectoryNumber()
Definition
STRING GetDirectoryNumber()
Description
This function returns the directory number (i.e. the extension) of the line in a format that
can be used by MakeCall and DialDigits.
Arguments
None
Returns
The dn in a format that can be used by MakeCall and DialDigits, e.g. 1234
If the value is unknown, it will return "".
Notes
None
Example
TelML.Lines.Item(2).GetDirectoryNumber();
// returns the directory number of the line on index 2.
121
GetDirectoryNumberURI()
Definition
STRING GetDirectoryNumberURI()
Description
This function returns the directory number of the line in a standard TelURI format.
Examples:
If the telephone has extension 1234 and PSTN number is 222-333-4444, the format is
Tel:+222-333-4444;ext=1234
If the telephone has extension 1234 and the PSTN number is unknown, the format is
Tel:;ext=1234
This format cannot be used by MakeCall and DialDigits.
Arguments
None
Returns
The dn in a standard TelURI format.
Notes
None
Example
TelML.Lines.Item(2).GetDirectoryNumberURI();
// returns the directory number URI of the line on index 2.
122
GetIsPrime()
Definition
BOOLEAN GetIsPrime()
Description
This function returns true if this line is the prime line, and false otherwise. The prime line
is the line that is selected when the user goes off hook or presses the speaker key.
Arguments
None
Returns
true if the line is the prime line
false if the line is not the prime line
Notes
None
Example
TelML.Lines.Item(3).GetIsPrime();
// return false
123
IsLineStateSupported()
Definition
STRING IsLineStateSupported( STRING lineEvent)
Description
This function returns the line states that are supported by the phone.
Arguments
Type
STRING
Name
lineState
Description
The line state to be queried, or blank to query all states
Returns
The line states supported.
Notes
For 5330 and 5340 phones, "" is returned, i.e. line states are not supported.
Example
TelML.Lines.Item(3).IsLineStateSupported("");
// returns ""
TelML.Lines.Item(3).IsLineStateSupported("Idle");
// returns ""
124
IsLineEventSupported()
Definition
STRING IsLineEventSupported( STRING event )
Description
This function returns the line events that are supported by the phone. If the parameter is
blank, all line events supported by the phone are returned. If the parameter is non-blank,
the event is returned if the parameter is supported, or blank is returned.
Arguments
Type
STRING
Name
Event
Description
The line event to be queried, or blank to query all events
Returns
The line events supported by the phone:
OnConnectionCleared, OnDelivered, OnEstablished, OnOriginated.
See TelML Events section for more details about these events..
Notes
None
Example
var myEvents = TelML.Lines.Item(2).IsLineEventSupported();
// returns
"OnConnectionCleared,OnDelivered,OnEstablished,OnOriginated"
125
AnswerCall()
Definition
NUMBER AnswerCall()
Description
This function attempts to answer a call on this line by sending a key press for the
corresponding line (i.e. the PK key) to the 3300 ICP.
If the phone is not in the correct state (e.g. a superkey session, or a MiXML session) the
call will not be answered, and the function will not return with an error code. It is up to the
programmer to keep track of the state of the line and the phone to ensure both are in the
correct state for this function to operate correctly.
Arguments
None
Returns
0
Notes
None
Example
TelML.Lines.Item(3).AnswerCall();
// Will answer the call on the line on index 3
126
ClearCall()
Definition
NUMBER ClearCall()
Description
This function attempts to disconnect a call on this line. It sends two key press messages
to the 3300 ICP: the first to select the line (i.e. the PK key corresponding to the line), and
the second to cancel the call via the cancel key.
If the phone is not in the correct state (e.g. a superkey session, or a MiXML session) the
call will not be cleared, and the function will not return with an error code. It is up to the
programmer to keep track of the state of the line and the phone to ensure both are in the
correct state for this function to operate correctly.
Arguments
None
Returns
0
Notes
None
Example
TelML.Lines.Item(3).ClearCall();
// Will clear the call on the line on index 3.
127
DialDigits()
Definition
NUMBER DialDigits( STRING digits )
Description
This function sends keypress messages to the 3300 ICP to dial the digits in the
parameter string on this line. This function assumes the line is in the correct state to dial
the digits.
This function is similar to MakeCall(), but this function does not select the line before
dialling the digits. It assumes the line has already been selected.
Arguments
Type
STRING
Name
digits
Description
The digits to dial on the line
Returns
0
Notes
None
Example
TelML.Lines.Item(2).DialDigits("1234");
// Will dial digits 1234 on the line on index 3.
128
MakeCall()
Definition
NUMBER MakeCall( STRING digits )
Description
This function sends keypress messages to the 3300 ICP to select this line and dial the
digits in the parameter string. The line and phone must be in the correct state for the
function to make the call. For example, if the phone is in a superkey session, the key
press messages will be interpreted by the 3300 ICP in the context of that superkey
session and a call will not be made. Also, if the line is already on a call, this function will
just reselect the line and then send digits (DTMF tones) on that line. It is up to the
programmer to keep track of the state of the line and the phone to ensure both are in the
correct state for a call to be made.
Arguments
Type
STRING
Name
digits
Description
The digits of the party to call
Returns
0
Notes
None
Example
TelML.Lines.Item(2).MakeCall("1234");
// Makes a call on the line on index 2 by dialing 1234
129
TextDisplay Collection
The TextDisplay collection gives information about the display area on the phone that is
written by the 3300 ICP.
There is a TelML event that occurs whenever this display is changed. A TelML program may
hook into this event, read the values from this object, and then show this information on the
GUI of the custom application.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements.
Arguments
Type
STRING
Name
item
Description
Verify support for supplied item, or "" for a comma separated list of
supported items.
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelML.Phone.IsSupported("Item");
// returns "Item"
130
Item()
Definition
STRING Item( NUMBER index )
Description
The 3300 ICP writes two lines of information on the phones display. This function returns
a string containing that line of text.
Arguments
Type
NUMBER
Name
Index
Description
The index of the 3300 display line. Index can be 0 or 1.
Returns
The 3300 ICP string at the line index provided or undefined for an invalid index.
Notes
The TelMLEvent.OnDisplayChanged event is triggered whenever the contents of the
display changes.
Example
// Code snippet to put a phone display into an HTML page
131
Count()
Definition
NUMBER Count()
Description
This method returns the number of display lines on the phone written to by the 3300 ICP.
This is also the number of lines that can be accessed by the item method.
Arguments
None
Returns
The number of display lines on the phone written to by the 3300 ICP.
Notes
The count is the maximum number that can be used as the index in the item method
above.
Example
numberOfLines = TelML.TextDisplay.Count();
// will be 2 for 5330/5340
132
GetWidth()
Definition
NUMBER GetWidth()
Description
This method returns the width of the 3300 ICP display line on the phone in characters.
Arguments
None
Returns
The width of the 3300 ICP display line on the phone in characters.
Notes
For 5330/5340, the width is 20.
Notes
The count is the maximum number that can be used as the index in the item method
above.
Example
TelML.TextDisplay.GetWidth();
// returns 20 for 5330/5340
133
Browser Object
The browser object contains information about the phone browser operational characteristics.
There are methods to inject events, control the use of built in user controls, and to close
down the browser.
IsSupported()
Definition
STRING IsSupported( STRING item )
Description
Defined in TelML Definition - Common Elements.
Arguments
Type
STRING
Name
item
Description
Verify support for supplied item, or "" for a list of all supported
items.
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelML.Browser.IsSupported("InjectEvent");
// Returns "InjectEvent"
134
InjectEvent()
This method sends an event to the browser. The browser will handle the event as though the
physical event had occurred.
The event types and parameters are exactly the same that are used for the SetAutoEvent
method of the ButtonItem objects. Refer to ButtonItem object, SetAutoEvent Types 1 through
3 for all the details.
Event Type can be:
1 = Browser Click
2 = Browser Keypress
3 = Phone Keypress
The event types and parameters are exactly the same that are used for the SetAutoEvent
method of the ButtonItem objects. Refer to ButtonItem object, Method: SetAutoEvent Types
1 through 3 for details.
Definitions
NUMBER InjectEvent(NUMBER eventType, NUMBER idKeycode)
NUMBER InjectEvent(NUMBER eventType, STRING idKeycode)
Description
See above and ButtonItem Method: SetAutoEvent types 1 through 3.
Arguments
See ButtonItem Method: SetAutoEvent types 1 through 3.
Returns
-1 bad eventType
0 otherwise
Notes
None
Comprehensive Example
// This example will create an HTML form with two text elements.
// Using InjectEvent, it will select the ZIP form element and
// then enter in 90210. This is only to demonstrate how to use
135
136
GetUseBuiltInControls()
Definition
NUMBER GetUseBuiltInControls()
Description
This method has been deprecated.
Arguments
None
Returns
0
Notes
None
Example
None.
SetUseBuiltInControls()
Definition
NUMBER SetUseBuiltInControls(NUMBER value)
Description
This method has been deprecated.
Arguments
None
Returns
0
Notes
None.
Example
None.
137
Hide()
Definition
NUMBER Hide()
Description
This method is the same as the Close() method. It closes the browser and returns the
GUI of the phone back to its state before the HTML app was executed. This method
should not be used in Full Screen GUI Replacement Mode apps or New Page
Applications.
The application will no longer be running after this method is called.
Arguments
None
Returns
0
Notes
None
Example
TelML.Browser.Hide();
138
Close()
Definition
NUMBER Close()
Description
This method closes the browser and returns the GUI of the phone back to its state before
the HTML app was executed. This method should not be used in Full Screen GUI
Replacement Mode apps or New Page Applications.
The application will no longer be running after this method is called.
Arguments
None
Returns
0
Notes
None
Example
TelML.Browser.Close();
139
Display Object
The display object contains information about the phones display such as height, width,
depth, contrast and brightness. It also allows setting the contrast and the brightness. For
setting (and getting) brightness there are two different settings in the phone: the normal
brightness and the brightness when the phone is in screen saver/dimmer mode. This second
brightness setting is referred to as the idle brightness. The programmer does not control
when the phone is in normal or idle brightness mode (that is controlled by user activity), but
the programmer may set different levels for each of the modes so when the modes are active
the appropriate brightness is used.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements.
Arguments
Type
STRING
Name
item
Description
Verify support for supplied item, or "" for a list of all supported items.
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelML.Display.IsSupported("GetWidth");
// Returns "GetWidth"
140
GetWidth()
Definition
NUMBER GetWidth()
Description
This method returns the width of the phone display in pixels.
Arguments
None
Returns
160: for the 5330 and 5340 phones.
Notes
None
Example
TelML.Display.GetWidth();
// returns 160 for 5330 and 5340
141
GetHeight()
Definition
NUMBER GetHeight()
Description
This method returns the height of the phone display in pixels.
Arguments
None
Returns
320: for the 5330 and 5340 phones.
Notes
None
Example
TelML.Display.GetHeight();
// Returns 320 on 5330 and 5340 sets
142
GetDepth()
Definition
NUMBER GetDepth()
Description
This method returns the screen colour depth of the phone display.
Some sample depths:
16 = grayscale
Arguments
None
Returns
16
Notes
None
Example
TelML.Display.GetDepth();
// Returns 16 on 5330 and 5340 sets
143
GetContrast()
Definition
NUMBER GetContrast()
Description
This method returns the contrast of the phone display. The contrast level ranges from 0 to
the value returned by GetContrastMax().
Arguments
None
Returns
The contrast level from 0 to the value returned by GetContrastMax().
Notes
None
Example
TelML.Display.GetContrast();
// Returns current contrast setting
144
SetContrast()
Definition
NUMBER SetContrast(NUMBER value)
Description
This method sets the contrast of the phone display. The contrast level ranges from 0 to
the value returned by GetContrastMax. If an illegal value is used in the parameter then
the contrast is not changed.
Arguments
Type
NUMBER
Name
value
Description
The new contrast level
Returns
New value equal to the input value if input value is in allowable range
Max value if the input value is out of range
Notes
None
Example
var contrast = TelML.Display.GetContrast();
// decrease the contrast
if (contrast > 0)
{
var newContrast=TelML.Display.SetContrast(contrast-1);
}
145
GetContrastMax()
Definition
NUMBER GetContrast()
Description
This method returns the maximum contrast value of the phone display.
Arguments
None
Returns
The max allowable contrast setting (19).
Notes
None
Example
var maxContrast = TelML.Display.GetContrastMax();
var contrast = TelML.Display.GetContrast();
146
GetBrightness()
Definition
NUMBER GetBrightness()
Description
This method returns the brightness setting of the phone display. The brightness level
ranges from 0 to the value returned by GetBrightnessMax().
Arguments
None
Returns
The current brightness setting.
Notes
None
Example
var brightness = TelML.Display.GetBrightness();
147
SetBrightness()
Definition
NUMBER SetBrightness(NUMBER value)
Description
This method sets the brightness of the phone display. The brightness level ranges from 0
to the value returned by GetBrightnessMax().
Arguments
Type
NUMBER
Name
value
Description
The new brightness level
Returns
New value equal to the input value if input value is in allowable range
Max value if the input value is out of range
Notes
None
Example
var brightness = TelML.Display.GetBrightness();
// decrease the brightness
if (brightness > 0)
{
var newbrightness=TelML.Display.SetBrightness(brightness-1);
}
148
GetBrightnessMax()
Definition
NUMBER GetBrightnessMax()
Description
This method returns the maximum brightness value of the phone display.
Arguments
None
Returns
The max allowable brightness setting (10).
Notes
None
Example
var maxBrightness = TelML.Display.GetBrightnessMax();
var brightness = TelML.Display.GetBrightness();
// increase the brightness
if (brightness < maxBrightness)
{
var newBrightness=TelML.Display.SetBrightness(brightness+1);
}
149
GetIdleBrightness()
Definition
NUMBER GetIdleBrightness()
Description
This method returns the current idle brightness setting of the phone display.
Arguments
None
Returns
The current idle brightness.
Notes
None
Example
var idlebrightness = TelML.Display.GetIdleBrightness();
150
SetIdleBrightness()
Definition
NUMBER SetIdleBrightness(NUMBER value)
Description
This method sets the idle brightness of the phone display. When the phone goes into
screen dimmer (idle) mode, this value of brightness will be used for the phones
brightness setting.
Arguments
Type
NUMBER
Name
value
Description
The new idle brightness level
Returns
New value equal to the input value if input value is in allowable range
Max value if the input value is out of range
Notes
None
Example
var idleBright = TelML.Display.GetIdleBrightness();
if (idleBright > 0)
{
var newIdleBrightness=TelML.Display.SetIdleBrightness(idleBright1);
}
151
GetTextSize()
Definition
STRING GetTextSize()
Description
This method retrieves the current setting of Text size that is controlled by the user in the
Settings Application, option Text Size.
Arguments
None.
Returns
"small" if the Settings Application Text Size option is set to Small Text
"large" if the Settings Application Text Size option is set to Large Text
Notes
Small Text has the following CSS style designation: font-family:Mitel_53xx_Small_V2
Large Text has the following CSS style designation: font-family:Mitel_53xx_Large_V2
This function is usually called during the handling of a TelMLEvent.OnTextSizeChanged
event.
Example
var textSize = TelML.Display.GetTextSize();
// textSize is "large" or "small" depending on the setting
// of the Text Size option in the Settings Application.
152
LowLevel Object
The LowLevel object contains information about miscellaneous settings in the phone such as
the phone model number, MAC, mode (Minet/SIP), firmware version and current language.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements.
Arguments
Type
STRING
Name
item
Description
Verify support for supplied item, or "" for a comma separated list of
supported items.
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelML.LowLevel.IsSupported("GetModelNumber");
// returns "GetModelNumber"
153
GetModelNumber()
Definition
STRING GetModelNumber()
Description
This method returns the model number of the phone.
Arguments
None
Returns
5330 for phone model 5330.
5340 for phone model 5340.
Notes
None
Example
TelML.LowLevel.GetModelNumber();
// returns the model number of the phone
154
GetPhoneMAC()
Definition
STRING GetPhoneMAC()
Description
This method returns the MAC address of the phone.
Arguments
None
Returns
The MAC address of the phone.
Notes
None
Example
TelML.LowLevel.GetPhoneMAC();
// returns "AA-AB-AC-AD-12-34" (sample)
155
GetFirmwareVersion()
Definition
STRING GetFirmwareVersion()
Description
This method returns the firmware version of the phone.
Arguments
None
Returns
The firmware version of the phone.
Notes
None
Example
TelML.LowLevel.GetFirmwareVersion();
// returns "1.5.0.31" (sample)
156
GetPhoneMode()
Definition
STRING GetPhoneMode()
Description
This method returns the mode (actually protocol) of the phone, either Minet or SIP.
Arguments
None
Returns
Minet or SIP
Notes
None
Example
TelML.LowLevel.GetPhoneMode();
// returns the protocol of the phone
157
GetPhoneLanguage()
Definition
NUMBER GetPhoneLanguage()
Description
This method returns the current language of the phone.
Arguments
None
Returns
1 English
2 French
3 German
4 Spanish (Latin American)
5 Portuguese (Brazil)
6 Dutch
7 Italian
8 Romanian
9 Portugese (Portugal)
10 Spanish (EU)
11 Russian
Notes
None
Example
TelML.LowLevel.GetPhoneLanguage();
// returns the current language setting on the phone
158
GetAvailableLanguageList()
Definition
STRING GetAvailableLanguageList()
Description
This method returns a comma separated list of language numbers corresponding to the
values in TelML.LowLevel.GetPhoneLanguage()
Arguments
None
Returns
Comma separated list of language numbers.
1 English
2 French
3 German
4 Spanish (Latin American)
5 Portuguese (Brazil)
6 Dutch
7 Italian
8 Romanian
9 Portugese (Portugal)
10 Spanish (EU)
11 Russian
Notes
None
Example
var languageList = TelML.LowLevel.GetAvailableLanguageList();
// languageList is assigned "1, 2, 4" (sample)
159
GetPhoneIPAddress()
Definition
STRING GetPhoneIPAddress()
Description
This method returns the numerical IP address of the phone.
Arguments
None
Returns
"xxx.xxx.xxx.xxx" where xxx is a number between 0 and 255 which represents the
numerical IP address of the phone.
Notes
None
Example
var myIpAddress = TelML.LowLevel.GetPhoneIPAddress();
// myIpAddress = "192.168.0.1" (sample)
160
GetTimeDateFormat()
Definition
STRING GetTimeDateFormat ()
Description
This method returns the current format being used for the date and time on the phone so
that HTML applications can be consistent with the setting on the phone.
Arguments
None
Returns
"Hh::MM dd-MN-yy" if the phone is operating on a 12 hour clock format.
"HH::MM dd-MN-yy" if the phone is operating on a 24 hour clock format.
Notes
None
Example
var myTimeFormat = TelML.LowLevel.GetTimeDateFormat();
// myIpAddress = " HH::MM dd-MN-yy " (sample 24 hour clock
format)
161
GetTimeDate()
Definition
STRING GetTimeDate()
Description
This method returns the current date and time using the format currently specified for the
phone.
Arguments
None
Returns
A string containing the time and date in the format currently specified for the phone.
Notes
None
Example
var myTimeDate = TelML.LowLevel.GetTimeDate();
// myTimeDate = "11:23a 15-Jan-2011" (sample time)
162
Phone Object
The Phone object gives information about the hookswitch state of the phone.
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements.
Arguments
Type
STRING
Name
item
Description
Verify support for supplied item, or "" for a comma separated list of
supported items.
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelML.Phone.IsSupported("");
// returns "IsSupported,GetHookswitch"
163
GetHookswitch()
Definition
NUMBER GetHookswitch()
Description
This method returns the state of the hookswitch.
Arguments
None
Returns
0 if offhook.
1 if onhook.
Notes
The hookswitch state does not indicate if the user is on a call. There are instances where
the hookswitch is onhook, but there is an active call, and conversely, there are instances
where the hookswitch is offhook, but there is no active call.
Example
hookSwitchState = TelML.Phone.GetHookswitch();
// returns the current hookswitch status
164
GetCallInfoEnable()
Definition
BOOLEAN GetCallInfoEnabled()
Description
Inside the settings application, under the option Call Notification, there is an option called
"Display Call Info". This function returns the current setting of this option.
Arguments
None
Returns
false if not selected
true if selected
Notes
This function is meant to be used in conjunction with the
TelMLEvent.OnCallInfoEnableChanged. See example below.
Example
// Setup a handler to output a log whenever the option is changed
TelMLEvent.OnCallInfoEnableChanged = function () {
alert("Call Info now" + (TelML.Phone.GetCallInfoEnabled() ?
"enabled" : "disabled" ));
};
165
GetCallNotification()
Definition
OBJECT GetCallNotification()
Description
Inside the settings application, under the option "Call Notification" there are a series of
options that allow the user to choose the call notification settings. This method is used to
determine the current settings inside this application.
Arguments
None
Returns
This method returns an OBJECT with the following properties and values
LaunchOnMakeCall
LaunchOnInPrimeLine
LaunchOnInOtherLine
LaunchOnInAppearance
Notes
This function is used in conjunction with the TelMLEvent.OnCallNotifiyChanged. See
example below.
Example
// Setup a handler to output a log whenever the option is changed
TelMLEvent.OnCallNotifyChanged = function () {
var settings = TelML.Phone.GetCallNotification();
alert("Launch on Make Call is" + settings.LaunchOnMakeCall);
alert("Prime Line Call is" + settings.LaunchOnInPrimeLine);
alert("Other Line Call is" + settings.LaunchOnInOtherLine);
alert("Appearance Call is" + settings.LaunchOnInAppearance);
};
166
ICP Object
The ICP object gives information about the connected ICP.
GetIPAddress()
Definition
STRING GetIPAddress( )
Description
This function returns the numerical IP address of the connected ICP.
Arguments
None
Returns
"xxx.xxx.xxx.xxx" where xxx is a number between 0 and 255 which represents the
numerical IP address of the connected ICP.
Notes
None
Example
var switchIpAddress = TelML.ICP.GetIPAddress();
// switchIpAddress = "192.168.1.1" (sample)
167
GetSWVersion()
Definition
STRING GetSWVersion()
Description
This function returns the version number of the software running on the connected ICP.
Arguments
None
Returns
The string representing the version of ICP software that is running.
Notes
None
Example
var switchSoftwareVersion = TelML.ICP.GetSWVersion();
// switchSoftwareVersion = "9.1.1.17" (sample)
168
TelML Events
Overview
TelML events are accessed via the TelMLEvent object. When an event occurs the TelML
programmer can specify the JavaScript code to run or a function to call. The JavaScript code
can be a function call or a series of JavaScript statements that actually handle and process
the event. Parameters for each event are accessed through a set of variables defined in the
object.
The three usages are as follows:
1) specifying a function to call
TelMLEvent.OnDisplayChanged = HandleDisplayChange;
2) specifying an anonymous function
TelMLEvent.OnDisplayChanged =
function () {
do_stuff();
};
3) specifying a series of Javascript statements enclosed in a string.
TelMLEvent.OnDisplayChanged =
"displayChange=1;HandleDisplayChange();";
169
IsSupported()
Definition
STRING IsSupported( STRING Item )
Description
Defined in TelML Definition - Common Elements.
Arguments
Type
STRING
Name
item
Description
Verify support for supplied event, or "" for a comma separated list
of supported events.
Returns
Defined in TelML Definition - Common Elements.
Notes
None
Example
TelMLEvent.IsSupported("OnButtonInformation");
// returns "OnButtonInformation"
170
Parameter(s)
Description
OnButtonInformation
NUMBER
ButtonIndex
OnButtonPress
NUMBER
ButtonIndex
BOOLEAN
ButtonPressed
OnDisplayChanged
OnErrorCode
NUMBER ErrorID
STRING ErrorString
OnHookswitch
OnLampMode
OnLanguageChanged
NUMBER Language
OnTelephonyIdle
OnTelephonyNotIdle
OnConnectionCleared
NUMBER LineIndex
OnDelivered
NUMBER LineIndex
STRING
CLIDNumber
STRING CLIDName
STRING CLIDRaw
OnEstablished
NUMBER LineIndex
OnOriginated
NUMBER LineIndex
171
Event
Parameter(s)
Description
OnCallInfoEnableChanged
None
OnTimeDateChanged
None
OnTimeDateFormatChanged None
OnTextSizeChanged
None
OnCallNotifyChanged
None
LAUNCH INFORMATION
POPULATED AT STARTUP
NUMBER
StartUpPageIndex
172
173