module AastraXmlApi

Performs natural order sorting of an array. Natural order is the way in which a human might sort a list of files that are incremented by one. They will sort normally as long as they have leading zeros, however this doesn’t look good and is hard to read. What natural sorting does is allow the following to be sorted properly (as shown):

file1 file2 file4 file22 file30 file100

Code used is from zijab.blogspot.com/2007/05/natural-order-string-comparison-for.html

Aastra XML API Classes - Phone Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Phone is the root class for all the Aastra XML objects.

Public methods

setTitle(Title) to setup the title of an object (optional)
setTitleWrap to set the title to be wrapped on 2 lines (optional)
setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setDestroyOnExit to set DestroyonExit parameter to 'yes', 'no' by default (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setAllowAnswer to set the allowAnswer tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index,label,uri,icon_index) to add custom soktkeys to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)

Aastra XML API Classes - PhoneConfiguration Copyright Aastra Telecom 8007

Ruby adaptation by Carlton O’Riley

PhoneConfiguration object.

Public methods

Inherited from Phone

setBeep to enable a notification beep with the object (optional)

Specific to the object

addEntry(parameter,value) to add a configuration change.
setTriggerDestroyOnExit to set the triggerDestroyOnExit tag to
"yes" (optional)

Example

require 'PhoneConfiguration.rb'
configuration = PhoneConfiguration.new
configuration.addEntry('softkey1 label','Test')
configuration.addEntry('softkey1 type','xml')
configuration.setTriggerDestroyOnExit
configuration.setBeep
aastra_output configuration

Aastra XML API Classes - PhoneConfigurationEntry Firmware 2.0 or better Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneConfiguration object.

Aastra XML API Classes - PhoneDirectory Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneDirectory object.

Public methods

Inherited from Phone

setTitle(Title) to setup the title of an object (optional)
setTitleWrap to set the title to be wrapped on 2 lines (optional)
setDestroyOnExit to set DestroyonExit parameter to 'yes', 'no' by default (optional)
setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)

Specific to the object

setNext(next) to set URI of the next page (optional)
setPrevious(previous) to set URI of the previous page (optional)
addEntry(name,phone) to add an element in the list to be displayed, at least one is needed.
natsortbyname to order the list

Example

require 'PhoneDirectory.rb'
directory = PhoneDirectory.new
directory.setTitle('Title')
directory.setNext('http://myserver.com/script.php?page=2')
directory.setPrevious('http://myserver.com/script.php?page=0')
directory.setDestroyOnExit
directory.addEntry('John Doe', '200')
directory.addEntry('Jane Doe', '201')
directory.natsortByName
directory.addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1')
directory.addSoftkey('6', 'Exit', 'SoftKey:Exit')
aastra_output directory

Aastra XML API Classes - PhoneDirectoryEntry Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneDirectory object.

Aastra XML API Classes - PhoneExecute Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneExecute object.

Public methods

Inherited from Phone

setBeep to enable a notification beep with the object (optional)

Specific to the object

setTriggerDestroyOnExit to set the triggerDestroyOnExit tag to "yes" (optional)
addEntry(url,interruptCall) to add an action to be executed.

Example

require 'PhoneExecute.class.php'
execute = PhoneExecute.new
execute.addEntry('http://myserver.com/script.php?choice=2')
execute.addEntry('Command: Reset')
aastra_output execute

Aastra XML API Classes - PhoneExecuteEntry Firmware 1.4.1 or better Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneExecute object.

Aastra XML API Classes - FormattedPhoneTextScreen Copyright Aastra Telecom 2008

PhoneFormattedTextScreen object.

Public methods

Inherited from Phone

setDestroyOnExit to set DestroyonExit parameter to 'yes', 'no' by default (optional)
setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setAllowAnswer to set the allowAnswer tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index, label, uri) to add custom softkeys to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)

Specific to the object

addLine(text,size,align) to add a formatted line
setScrollStart(height) to define the beginning of the scrolling section and its height
setScrollEnd to define the end of the scrolling section
setAllowDTMF to allow DTMF passthrough on the object
setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)

Example

require 'PhoneFormattedTextScreen.rb'
ftext = PhoneFormattedTextScreen.new
ftext.setDestroyOnExit
ftext.addLine('Formatted Screen', 'double', 'center')
ftext.setScrollStart('2')
ftext.addLine('Scrolled text1')
ftext.addLine('Scrolled text2')
ftext.addLine('Scrolled text3')
ftext.addLine('Scrolled text4')
ftext.addLine('Scrolled text5')
ftext.setScrollEnd
ftext.addLine('Footer',NULL,'center')
ftext.addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1','1')
ftext.addSoftkey('6', 'Exit', 'SoftKey:Exit')
ftext.addIcon('1', 'Icon:Envelope')
aastra_output ftext

Aastra XML API Classes - PhoneFormattedTextScreenEntry Firmware 2.0 or better Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneFormattedTextScreen object.

Aastra XML API Classes - Aastra XML API Classes - PhoneGDImage Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Firmware 2.2.0 or better

PhoneGDImage for PhoneImageScreen and PhoneImageScreen.

ruby needs ruby-gd gem installed


Public methods

    drawttftext(fontsize,angle,x,y,text,colorIndex,fontfile)
    Writes text to the image using TrueType fonts
    fontsize      The font size. Depending on your version of GD, this should be specified as the pixel
                    size (GD1) or point size (GD2)
    angle         The angle in degrees, with 0 degrees being left-to-right reading text. Higher values
                    represent a counter-clockwise rotation. For example, a value of 90 would result in
                    bottom-to-top reading text.
    x,y           The coordinates given by x and y will define the basepoint of the first character
                    (roughly the lower-left corner of the character).
    colorIndex    0=White    1=Black
    fontfile      Location and name of the ttf file to use

    drawtext(fontsize,x,y,text,colorIndex)
    Writes text to the image using built-in font
    fontsize      The font size. From 1 to 5
    x,y           The coordinates given by x and y will define the basepoint of the first character
                    (roughly the lower-left corner of the character).
    colorIndex    0=White    1=Black

    rectangle(x1,y1,x2,y2,colorIndex,filled)
    Creates a rectangle starting at the specified coordinates.
    x1,y1         Upper left x,y coordinate. 0,0 is the top left corner of the image.
    x2,y2         Bottom right x,y coordinate
    colorIndex    0=White    1=Black
    filled                Boolean, optional (default if False)

    ellipse(cx,cy,width,height,colorIndex,filled)
    Draws an ellipse centered at the specified coordinates.
    cx,cy         x-coordinate and y-coordinate of the center
    width         the ellipse width
    height                the ellipse height
    colorIndex    0=White    1=Black
    filled                Boolean, optional (default if False)

    line(x1,y1,x2,y2,colorIndex)
    Draws a line
    x1,y1         x,y coordinates for the first point
    x2,y2         x,y coordinates for the second point
    colorIndex    0=White    1=Black

    setGDImage(image)
    Imports an externally generated GD image
    image         GD image to import

    getGDImage()
    Exports the current GD image

    setFontPath(fontpath)
    Set directory path for the fonts to use
    fontpath      Directory for the ttf fonts
    Default value
            Windows based platform               C:\Windows\Fonts
            Linux based platform                 ../fonts
Mac OS X based platform   ../fonts
Rails based platform      RAILS_ROOT/fonts

Example 1

require 'PhoneGDImage.rb'
phoneImageGD = PhoneGDImage.new
time = Time.now.strftime("%H:%M")
phoneImageGD.drawttftext(30, 0, 10, 39, time, 1,'Ni7seg.ttf')

Example 2

require 'PhoneGDImage.rb'
phoneImageGD = PhoneGDImage.new
utf8text = "东丝丞丟丸"
phoneImageGD.drawttftext(20, 0, 5, 35, utf8text, 1, 'arialuni.ttf')

Aastra XML API Classes - IconEntry Firmware 2.0 or better Copyright Aastra Telecom 8007

Ruby adaptation by Carlton O’Riley

Internal class for Phone object.

Aastra XML API Classes - PhoneImageMenu Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneImageMenu object.

Public methods

Inherited from Phone

setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)

Specific to the object

setImage(image)to define the image to be displayed
setGDImage(GDImage) to use a GDImage for display, the size is forced to 40x144
setAlignment(vertical,horizontal) to define image alignment
setSize(height,width) to define image size
setURIBase(uriBase) to define the base URI for the selections
addURI(key,uri) to add a selection key with its URI

Example

require 'PhoneImageMenu.rb'
imagem = PhoneImageMenu.new
imagem.setDestroyOnExit
imagem.setSize(40,144)
imagem.setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020131400020a05c91088b002b08c21c0000c200000001fe800000000000000001c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020041000004008300000ff08500000000c900000000710000000000000001401400000140140000014014000001401400000140140000000000000007c0ff00000c30880000081088000008108800000c30700000062000000000003f000001e02000000330200000021000000003301e000001e0330000000021000003f033000002001e0000020000000000001e000c03fc33003c013021007c02101201f00330ff03f001e000039000003e039001e00103f003300101f8021003007c03303f003c01e000000c00001e001c03f033007802002100f002002103e000001203c401702003cc0290ff039c02902101fc02b000007c03f01a003c020039018c0ff02d03c402102703c400001203ec01e000026402b0000264029000026c029000027c01a0000338000000033800000003100000000300000000030003f00003fc03000003fc02000003fc020000030001f0000300000000030001e000030002b000030002900003fc02900003fc01a00003f00000000310030000031c01e000031f003000033f81e00003f383000001e081e000008c003000003c01e00000fc03000001f000000003d001a0000390039000039002d00003f002700000f8012000007c000000001c0000000004000000000000000000000000000')
imagem.addURI('1','http://myserver.com?choice=1')
imagem.addURI('2','http://myserver.com?Choice=2')
imagem.addSoftkey('1', 'Label', 'http://myserver.com/script.php?action=1', '1')
imagem.addSoftkey('6', 'Exit', 'SoftKey:Exit')
imagem.addIcon('1', 'Icon:Envelope')
imagem.addIcon('2', 'FFFF0000FFFF0000')
aastra_output imagem

Aastra XML API Classes - PhoneImageMenuEntry Firmware 2.0 or better Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneImageMenu object.

Aastra XML API Classes - PhoneImageScreen Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneImageScreen object.

Public methods

Inherited from Phone

setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)

Specific to the object

setImage(image) to define the image to be displayed
setGDImage(GDImage) to use a GDImage for display, the size is forced to 40x144
setAlignment(vertical,horizontal) to define image alignment
setSize(height,width) to define image size
setAllowDTMF to allow DTMF passthrough on the object

Example

 Using a Pixel image

 require PhoneImageScreen.rb'
 images = PhoneImageScreen.new
 images.setDestroyOnExit
 images.setSize(40, 40)
 images.setImage('fffffffc02fffffffee4ffffbfffc05fffe7ff7a7ffffffffeffeebd7fffffea6bcfffffe796f3feff6fa289f0a86f4866fa20df42414595dd0134f8037ed1637f0e2522b2dd003b6eb936f05fffbd4f4107bba6eb0080e93715000010b754001281271408c640252081b1b22500013c5c66201368004e04467520dc11067152b82094d418e100247205805494780105002601530020931400020ac5c91088b0f2b08c21c07d0c2006009fdfe81f80efe0107fe0fb1c3ffff8ffc3fffef8f7febffbfcf87ffbff64')
 images.addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1', '1')
 images.addSoftkey('6', 'Exit', 'SoftKey:Exit')
 images.addIcon('1', 'Icon:Envelope')
 aastra_output images

 Using a GD image

require 'PhoneGDImage.class.php'
require 'PhoneImageScreen.class.php'
phoneImageGD = PhoneGDImage.new
object = PhoneImageScreen.new
time = Time.now.strftime("%H:%M")
phoneImageGD.drawttftext(30, 0, 10, 39, time, 1, 'Ni7seg.ttf');
object.setGDImage(phoneImageGD)
aastra_output object

Aastra XML API Classes - PhoneInputScreen Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneInputScreen object.

Public methods

Inherited from Phone

setTitle(Title) to setup the title of an object (optional)
setTitleWrap to set the title to be wrapped on 2 lines (optional)
setDestroyOnExit to set DestroyonExit parameter to 'yes', 'no' by default (optional)
setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setAllowAnswer to set the allowAnswer tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)

Specific to the object - Single Input

setURL(url) to set the URL to called after the input
setType(type) to set type of input ('IP', 'string', 'number', 'dateUS'...), 'string' by default
setDefault(default) to set default value for the input (optional)
setParameter(param) to set the parameter name to be parsed after the input
setInputLanguage(language) to set the language of the input (optional)
setPassword to set the Password parameter to 'yes', 'no' by default (optional)
setNotEditable to set the editable parameter to 'no', 'yes' by default (optional)
setEditable is now replaced by setNotEditable but kept for compatibility reasons (optional)
setPrompt(prompt) to set the prompt to be displayed for the input.

Specific to the object - Multiple Inputs

setURL(url) to set the URL to called after the input
setType(type) to set the default type of input ('IP', 'string', 'number', 'dateUS'...), 'string' by default
setDefault(default) to set default default value for the input (optional)
setParameter(param) to set the default parameter name to be parsed after the input
setPassword to set the default Password parameter to 'yes', 'no' by default (optional)
setNotEditable to set the default editable parameter to 'no', 'yes' by default (optional)
setEditable is now replaced by setNotEditable but kept for compatibility reasons (optional)
setPrompt(prompt) to set the default prompt to be displayed for the input.
setDefaultIndex(index) to define the field index the object will use to start (optional) default is 1
setDisplayMode(display) to define the aspect of the display, normal/condensed (optional) default is normal.
setInputLanguage(language) to set the language of the input (optional)
addField(type) to add an input field and setting its type (IP, string, number, dateUS, timeUS,dateInt, timeInt or empty) if the type is an empty string then the type is inherited from the main object.
setFieldPassword(password) to set the password mode for the input field ('yes', no'), overrides the value set by setPassword for the field
setFieldEditable(editable) to set the input field editable mode ('yes', no'), overrides the value set by setEditable or setNotEditable for the field
setFieldParameter(parameter) to set the parameter name to be parsed after the global input, overrides the value set by setParameter for the field
setFieldPrompt(prompt)to set the prompt to be displayed for the input field, overrides the value set by setPrompt for the field
setFieldSelection(selection) to set the Selection tag for the field
setFieldDefault(default) to set default value for the input field, overrides the value set by setDefault for the field
addFieldSoftkey(index,label,uri,icon) to add custom softkeys to the input field, overrides the softkeys set by addSoftkey.

Example 1 - Single Input

require 'PhoneInputScreen.rb'
input = PhoneInputScreen.new
input.setTitle('Title')
input.setPrompt('Enter your password')
input.setParameter('param')
input.setType('string')
input.setURL('http://myserver.com/script.php')
input.setPassword
input.setDestroyOnExit
input.setDefault('Default')
aastra_output input

Example 2 - Multiple Inputs

require 'PhoneInputScreen.rb'
input = PhoneInputScreen.new
input.setTitle('Example 2')
input.setDisplayMode('condensed')
input.setURL('http://myserver.com/script.php')
input.setDestroyOnExit
input.addSoftkey('5', 'Done', 'SoftKey:Submit')
input.addField('string')
input.setFieldPrompt('Username:')
input.setFieldParameter('user')
input.addFieldSoftkey('3', 'ABC', 'SoftKey:ChangeMode')
input.addField('number')
input.setFieldPassword('yes')
input.setFieldPrompt('Pass:')
input.setFieldParameter('passwd')
aastra_output input

Aastra XML API Classes - PhoneInputScreenEntry Firmware 2.2.0 or better Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneInputScreen object.

Aastra XML API Classes - PhoneSoftkeyEntry Firmware 2.2.0 or better Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for Phone object.

Aastra XML API Classes - PhoneStatus Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneStatus object.

Public methods

Inherited from Phone

setBeep to enable a notification beep with the object (optional)

Specific to the object

setSession(session) to setup the session ID
setTriggerDestroyOnExit to set the triggerDestroyOnExit tag to
"yes" (optional)
addEntry(index,message,type,timeout) to add a message to be displayed
on the idle screen.

Example

require 'PhoneStatus.rb'
status = PhoneStatus.new
status.setSession('Session');
status.setBeep
status.addEntry('1', 'Message 1', '', 0)
status.addEntry('2', 'Message 2', 'alert', 5)
aastra_output status

Aastra XML API Classes - PhoneStatusEntry Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneStatus object.

Aastra XML API Classes - PhoneTextMenu Copyright Aastra Telecom 2008

PhoneTextMenu object.

Public methods

Inherited from Phone

setTitle(Title) to setup the title of an object (optional)
setTitleWrap to set the title to be wrapped on 2 lines (optional)
setDestroyOnExit to set DestroyOnExit parameter to "yes" (optional)
setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setAllowAnswer to set the allowAnswer tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index,label,uri,icon_index) to add custom softkeys to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)

Specific to the object

setDefaultIndex(index) to set the default selection in the list (optional)
setStyle(style) to set the style of the list numbered/none/radio (optional)
setWrapList to allow 2 lines items (optional)
addEntry(name,url,selection,icon,dial) to add an element in the list to be displayed
natsortbyname to order the list

Example 1

require 'PhoneTextMenu.rb'
menu = PhoneTextMenu.new
menu.setTitle('Title')
menu.setDestroyOnExit
menu.setDeFaultIndex('3')
menu.addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2')
menu.addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1')
menu.addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3')
menu.natsortByName
menu.addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1')
menu.addSoftkey('6', 'Exit', 'SoftKey:Exit')
aastra_output menu

Example 2

require 'PhoneTextMenu.rb'
menu = PhoneTextMenu.new
menu.setTitle('Title')
menu.setDestroyOnExit
menu.setDeFaultIndex('2')
menu.addEntry('Choice 2', 'http://myserver.com/script.php?choice=2', 'Value=2','1')
menu.addEntry('Choice 1', 'http://myserver.com/script.php?choice=1', 'Value=1','2')
menu.addEntry('Choice 3', 'http://myserver.com/script.php?choice=3', 'Value=3','3')
menu.natsortByName
menu.addSoftkey('1', 'My Select', 'http://myserver.com/script.php?action=1')
menu.addSoftkey('6', 'Exit', 'SoftKey:Exit')
menu.addIcon('1', 'Icon:PhoneOnHook')
menu.addIcon('2', 'Icon:PhoneOffHook')
menu.addIcon('3', 'Icon:PhoneRinging')
aastra_output menu

Aastra XML API Classes - PhoneTextMenuEntry Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

Internal class for PhoneTextMenu object.

Aastra XML API Classes - PhoneTextScreen Copyright Aastra Telecom 2008

Ruby adaptation by Carlton O’Riley

PhoneTextScreen object.

Public methods

Inherited from Phone

setTitle(Title) to setup the title of an object (optional)
setTitleWrap to set the title to be wrapped on 2 lines (optional)
setDestroyOnExit to set DestroyonExit parameter to 'yes', 'no' by default (optional)
setCancelAction(uri) to set the cancel parameter with the URI to be called on Cancel (optional)
setBeep to enable a notification beep with the object (optional)
setLockIn to set the Lock-in tag to 'yes' (optional)
setAllowAnswer to set the allowAnswer tag to 'yes' (optional)
setTimeout(timeout) to define a specific timeout for the XML object (optional)
addSoftkey(index,label,uri,iconindex) to add custom softkeys to the object (optional)
addIcon(index,icon) to add custom icons to the object (optional)
setRefresh(timeout,URL) to add Refresh parameters to the object (optional)

Specific to the object

setText(text) to set the text to be displayed.
setDoneAction(uri) to set the URI to be called when the user selects the default "Done" key (optional)
setAllowDTMF to allow DTMF passthrough on the object

Example

require 'PhoneTextScreen.rb'
text = PhoneTextScreen.new
text.setTitle('Title')
text.setText('Text to be displayed.')
text.setDestroyOnExit
text.addSoftkey('1', 'Mail', 'http://myserver.com/script.php?action=1', '1')
text.addSoftkey('6', 'Exit', 'SoftKey:Exit')
text.addIcon('1', 'Icon:Envelope')
aastra_output text

Constants

VERSION