Sha256: b06f71c284f4de63f999e74370f424b07bd553af7e6ed5c3e44fc7b990043f49

Contents?: true

Size: 1.09 KB

Versions: 12

Compression:

Stored size: 1.09 KB

Contents

# encoding: utf-8

module Punchblock
  module Command
    class Dial < CommandNode
      register :dial, :core

      include HasHeaders

      # @return [String] destination to dial
      attribute :to

      # @return [String] the caller ID
      attribute :from

      # @return [String] the requested URI for the resulting call
      attribute :uri

      # @return [Integer] timeout in milliseconds
      attribute :timeout, Integer

      # @return [Join] the nested join
      attribute :join, Join

      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

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

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

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
punchblock-2.7.5 lib/punchblock/command/dial.rb
punchblock-2.7.3 lib/punchblock/command/dial.rb
punchblock-2.7.2 lib/punchblock/command/dial.rb
punchblock-2.7.1 lib/punchblock/command/dial.rb
punchblock-2.7.0 lib/punchblock/command/dial.rb
punchblock-2.6.0 lib/punchblock/command/dial.rb
punchblock-2.5.3 lib/punchblock/command/dial.rb
punchblock-2.5.2 lib/punchblock/command/dial.rb
punchblock-2.5.1 lib/punchblock/command/dial.rb
punchblock-2.5.0 lib/punchblock/command/dial.rb
punchblock-2.4.2 lib/punchblock/command/dial.rb
punchblock-2.4.0 lib/punchblock/command/dial.rb