class AastraXmlApi::Phone
Constants
- HIGHASCII
Public Class Methods
Create an Phone
object and set initial values. Everything sent to the phone will inherit from this class.
# File lib/aastra_xml_api/phone.rb, line 96 def initialize @entries = [] @softkeys = [] @icons = [] @refreshTimeout = 0 @timeout = 0 end
Public Instance Methods
Add an icon to be used by either a softkey of PhoneTextMenu
. Only available on the 55i, 57i, and 57iCT. The index is the same as what is referenced by addSoftkey or PhoneTextMenu.addEntry
. The icon can be either a predefined icon or the hex of an icon image.
# File lib/aastra_xml_api/phone.rb, line 180 def addIcon(index, icon) @icons += [PhoneIconEntry.new(index, icon)] end
Add a softkey to be displayed while the XML object is on the screen. Only available on the 9480i, 9480iCT, 55i, 57i, and 57iCT. Softkey will be at position index. label is what is displayed next to the softkey button. uri is what is called when the softkey is pressed. Optionally, icon is the index of the icon to display to the left of the label.
# File lib/aastra_xml_api/phone.rb, line 172 def addSoftkey(index, label, uri, icon=nil) @softkeys += [PhoneSoftkeyEntry.new(index, escape(label), escape(uri), icon)] end
Convert characters when using double sized text in PhoneFormattedTextScreen
.
# File lib/aastra_xml_api/phone.rb, line 193 def convert_high_ascii(s) ret = "" s.each do |char| if not HIGHASCII[char].nil? then ret += HIGHASCII[char] else ret += char end end return ret end
Convert any HTML characters to the proper escaped format. i.e. > becomes >
# File lib/aastra_xml_api/phone.rb, line 186 def escape(s) return nil if s.nil? CGI.escapeHTML(s) end
Returns the set refresh timeout value.
# File lib/aastra_xml_api/phone.rb, line 157 def getRefreshTimeout return @refreshTimeout end
Returns the set refresh URI.
# File lib/aastra_xml_api/phone.rb, line 162 def getRefreshURL return @refreshURL end
Applies only to the non-softkey phones (53i). When set, the phone displays ‘Ignore’ and ‘Answer’ if the XML object is displayed when the phone is ringing.
# File lib/aastra_xml_api/phone.rb, line 152 def setAllowAnswer @allowAnswer = "yes" end
Beep phone when XML is received.
# File lib/aastra_xml_api/phone.rb, line 123 def setBeep @beep = "yes" end
Defines the URI to call when the user cancels the XML object.
# File lib/aastra_xml_api/phone.rb, line 133 def setCancelAction(cancelAction) @cancelAction = cancelAction end
Do not keep the object in the phone browser after exit.
# File lib/aastra_xml_api/phone.rb, line 128 def setDestroyOnExit @destroyOnExit = "yes" end
Ignores all keys that would cause the screen to exit without using keys defined by the object.
# File lib/aastra_xml_api/phone.rb, line 139 def setLockIn @lockin = "yes" end
Set refresh timeout (seconds) and the URI to load when the timeout is reached.
# File lib/aastra_xml_api/phone.rb, line 117 def setRefresh(timeout, url) @refreshTimeout = timeout @refreshURL = url end
Override the default 45 second timeout. A value of 0 will disable timeout.
# File lib/aastra_xml_api/phone.rb, line 145 def setTimeout(timeout) @timeout = timeout end
Set the title of the Phone
object. Typically displayed on the top of the phone.
# File lib/aastra_xml_api/phone.rb, line 106 def setTitle(title) @title = title end
Allow the title to wrap over multiple lines when displayed.
# File lib/aastra_xml_api/phone.rb, line 111 def setTitleWrap @title_wrap = "yes" end