Class: SignalWire::Relay::DialEvent

Inherits:
RelayEvent show all
Defined in:
lib/signalwire/relay/relay_event.rb

Overview

calling.call.dial

Instance Attribute Summary collapse

Attributes inherited from RelayEvent

#call_id, #event_type, #params, #timestamp

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag: '', dial_state: '', call_data: {}, **base) ⇒ DialEvent

Returns a new instance of DialEvent.



326
327
328
329
330
331
# File 'lib/signalwire/relay/relay_event.rb', line 326

def initialize(tag: '', dial_state: '', call_data: {}, **base)
  super(**base)
  @tag        = tag
  @dial_state = dial_state
  @call_data  = call_data
end

Instance Attribute Details

#call_dataObject (readonly)

Returns the value of attribute call_data.



312
313
314
# File 'lib/signalwire/relay/relay_event.rb', line 312

def call_data
  @call_data
end

#dial_stateObject (readonly)

Returns the value of attribute dial_state.



312
313
314
# File 'lib/signalwire/relay/relay_event.rb', line 312

def dial_state
  @dial_state
end

#tagObject (readonly)

Returns the value of attribute tag.



312
313
314
# File 'lib/signalwire/relay/relay_event.rb', line 312

def tag
  @tag
end

Class Method Details

.from_payload(payload) ⇒ Object



314
315
316
317
318
319
320
321
322
323
324
# File 'lib/signalwire/relay/relay_event.rb', line 314

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.timestamp,
    tag:        p['tag'] || '',
    dial_state: p['dial_state'] || '',
    call_data:  p['call'] || {}
  )
end