Sha256: 4b758a483922e6ff10d80472b7d3a3b8f92a25762c18bd8d98682d7f7993fa5d

Contents?: true

Size: 1014 Bytes

Versions: 12

Compression:

Stored size: 1014 Bytes

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 [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, 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.3.1 lib/punchblock/command/dial.rb
punchblock-2.3.0 lib/punchblock/command/dial.rb
punchblock-2.2.2 lib/punchblock/command/dial.rb
punchblock-2.2.1 lib/punchblock/command/dial.rb
punchblock-2.2.0 lib/punchblock/command/dial.rb
punchblock-2.1.1 lib/punchblock/command/dial.rb
punchblock-2.1.0 lib/punchblock/command/dial.rb
punchblock-2.0.2 lib/punchblock/command/dial.rb
punchblock-2.0.1 lib/punchblock/command/dial.rb
punchblock-2.0.0 lib/punchblock/command/dial.rb
punchblock-2.0.0.beta2 lib/punchblock/command/dial.rb
punchblock-2.0.0.beta1 lib/punchblock/command/dial.rb