Class: Punchblock::Command::Accept

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

Constant Summary

Constants inherited from RayoNode

RayoNode::InvalidNodeError

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name

Class Method Summary collapse

Methods included from HasHeaders

#headers, #headers=, #headers_hash, #inspect_attributes

Methods inherited from Punchblock::CommandNode

#initialize, #inspect_attributes, #response, #response=, #write_attr

Methods inherited from RayoNode

class_from_registration, #eql?, import, #inspect, #inspect_attributes, register, #source

Constructor Details

This class inherits a constructor from Punchblock::CommandNode

Class Method Details

.new(options = {}) ⇒ Command::Accept

Create a Rayo accept command. This is equivalent to a SIP “180 Trying”

Examples:

Accept.new.to_xml

returns:
    <accept xmlns="urn:xmpp:rayo:1"/>

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :headers (Array[Header], Hash, Optional)

    SIP headers to attach to the call. Can be either a hash of key-value pairs, or an array of Header objects.

Returns:



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

def self.new(options = {})
  super().tap do |new_node|
    new_node.headers = options[:headers]
  end
end