Class: Punchblock::Command::Dial

Inherits:
Punchblock::CommandNode show all
Includes:
HasHeaders
Defined in:
lib/punchblock/command/dial.rb

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #connection, #original_component

Instance Method Summary collapse

Methods included from HasHeaders

#headers=, included

Methods inherited from Punchblock::CommandNode

#initialize, #response

Methods inherited from RayoNode

#==, class_from_registration, from_xml, #inspect, register, #source, #to_rayo, #to_xml

Constructor Details

This class inherits a constructor from Punchblock::CommandNode

Instance Method Details

#fromString

Returns the caller ID.

Returns:

  • (String)

    the caller ID



14
# File 'lib/punchblock/command/dial.rb', line 14

attribute :from

#inherit(xml_node) ⇒ Object



25
26
27
28
29
30
# File 'lib/punchblock/command/dial.rb', line 25

def inherit(xml_node)
  if join_element = xml_node.at_xpath('ns:join', ns: Join.registered_ns)
    self.join = Join.from_xml(join_element)
  end
  super
end

#joinJoin

Returns the nested join.

Returns:

  • (Join)

    the nested join



23
# File 'lib/punchblock/command/dial.rb', line 23

attribute :join, Join

#rayo_attributesObject



32
33
34
# File 'lib/punchblock/command/dial.rb', line 32

def rayo_attributes
  {to: to, from: from, uri: uri, timeout: timeout}
end

#rayo_children(root) ⇒ Object



36
37
38
39
# File 'lib/punchblock/command/dial.rb', line 36

def rayo_children(root)
  join.to_rayo(root.parent) if join
  super
end

#response=(other) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/punchblock/command/dial.rb', line 41

def response=(other)
  if other.is_a?(Ref)
    @transport = other.scheme
    @target_call_id = other.call_id
    @domain = other.domain
  end
  super
end

#timeoutInteger

Returns timeout in milliseconds.

Returns:

  • (Integer)

    timeout in milliseconds



20
# File 'lib/punchblock/command/dial.rb', line 20

attribute :timeout, Integer

#toString

Returns destination to dial.

Returns:

  • (String)

    destination to dial



11
# File 'lib/punchblock/command/dial.rb', line 11

attribute :to

#uriString

Returns the requested URI for the resulting call.

Returns:

  • (String)

    the requested URI for the resulting call



17
# File 'lib/punchblock/command/dial.rb', line 17

attribute :uri