Class: AastraXmlApi::PhoneStatus

Inherits:
Phone
  • Object
show all
Defined in:
lib/aastra_xml_api/phone_status.rb

Constant Summary

Constants inherited from Phone

AastraXmlApi::Phone::HIGHASCII

Instance Method Summary collapse

Methods inherited from Phone

#addIcon, #addSoftkey, #convert_high_ascii, #escape, #getRefreshTimeout, #getRefreshURL, #initialize, #setAllowAnswer, #setBeep, #setCancelAction, #setDestroyOnExit, #setLockIn, #setRefresh, #setTimeout, #setTitle, #setTitleWrap

Constructor Details

This class inherits a constructor from AastraXmlApi::Phone

Instance Method Details

#addEntry(index, message, type = nil, timeout = nil) ⇒ Object

Adds a new status message to be displayed at index. The type can only be nothing (default) or alert which shows the message for 3 seconds. The timeout can override the default 3 seconds for an alert message.



52
53
54
# File 'lib/aastra_xml_api/phone_status.rb', line 52

def addEntry(index, message, type=nil, timeout=nil)
  @entries += [PhoneStatusEntry.new(index, message, type, timeout)]
end

#renderObject

Create XML text output.



57
58
59
60
61
62
63
64
65
66
# File 'lib/aastra_xml_api/phone_status.rb', line 57

def render
  xml = "<PhoneStatus"
  xml += " Beep=\"yes\"" if @beep == "yes"
  xml += " triggerDestroyOnExit=\"yes\"" if @triggerDestroyOnExit == "yes"
  xml += ">\n"
  xml += "<Session>#{@session}</Session>\n"
  @entries.each { |entry| xml += entry.render }
  xml += "</PhoneStatus>\n"
  return xml
end

#setSession(session) ⇒ Object

Sets the session associated with this status message. Only important if more than one application is sending status messages.



39
40
41
# File 'lib/aastra_xml_api/phone_status.rb', line 39

def setSession(session)
  @session = session
end

#setTriggerDestroyOnExitObject

When set, the previous user interface XML object is destroyed if its destroyOnExit tag is also set to yes.



45
46
47
# File 'lib/aastra_xml_api/phone_status.rb', line 45

def setTriggerDestroyOnExit
  @triggerDestroyOnExit = "yes"
end