Class: SignalWire::Relay::CallReceiveEvent
- Inherits:
-
RelayEvent
- Object
- RelayEvent
- SignalWire::Relay::CallReceiveEvent
- Defined in:
- lib/signalwire/relay/relay_event.rb
Overview
calling.call.receive
Instance Attribute Summary collapse
-
#call_state ⇒ Object
readonly
Returns the value of attribute call_state.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#node_id ⇒ Object
readonly
Returns the value of attribute node_id.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#segment_id ⇒ Object
readonly
Returns the value of attribute segment_id.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Attributes inherited from RelayEvent
#call_id, #event_type, #params, #timestamp
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(call_state: '', direction: '', device: {}, node_id: '', project_id: '', context: '', segment_id: '', tag: '', **base) ⇒ CallReceiveEvent
constructor
A new instance of CallReceiveEvent.
Constructor Details
#initialize(call_state: '', direction: '', device: {}, node_id: '', project_id: '', context: '', segment_id: '', tag: '', **base) ⇒ CallReceiveEvent
Returns a new instance of CallReceiveEvent.
77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/signalwire/relay/relay_event.rb', line 77 def initialize(call_state: '', direction: '', device: {}, node_id: '', project_id: '', context: '', segment_id: '', tag: '', **base) super(**base) @call_state = call_state @direction = direction @device = device @node_id = node_id @project_id = project_id @context = context @segment_id = segment_id @tag = tag end |
Instance Attribute Details
#call_state ⇒ Object (readonly)
Returns the value of attribute call_state.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def call_state @call_state end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def context @context end |
#device ⇒ Object (readonly)
Returns the value of attribute device.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def device @device end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def direction @direction end |
#node_id ⇒ Object (readonly)
Returns the value of attribute node_id.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def node_id @node_id end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def project_id @project_id end |
#segment_id ⇒ Object (readonly)
Returns the value of attribute segment_id.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def segment_id @segment_id end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
57 58 59 |
# File 'lib/signalwire/relay/relay_event.rb', line 57 def tag @tag end |
Class Method Details
.from_payload(payload) ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/signalwire/relay/relay_event.rb', line 60 def self.from_payload(payload) base = RelayEvent.from_payload(payload) p = base.params new( event_type: base.event_type, params: base.params, call_id: base.call_id, timestamp: base., call_state: p['call_state'] || '', direction: p['direction'] || '', device: p['device'] || {}, node_id: p['node_id'] || '', project_id: p['project_id'] || '', context: p['context'] || p['protocol'] || '', segment_id: p['segment_id'] || '', tag: p['tag'] || '' ) end |