Class: SignalWire::Relay::ReferEvent

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

Overview

calling.call.refer

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(state: '', sip_refer_to: '', sip_refer_response_code: '', sip_notify_response_code: '', **base) ⇒ ReferEvent

Returns a new instance of ReferEvent.



352
353
354
355
356
357
358
359
# File 'lib/signalwire/relay/relay_event.rb', line 352

def initialize(state: '', sip_refer_to: '', sip_refer_response_code: '',
               sip_notify_response_code: '', **base)
  super(**base)
  @state                      = state
  @sip_refer_to               = sip_refer_to
  @sip_refer_response_code    = sip_refer_response_code
  @sip_notify_response_code   = sip_notify_response_code
end

Instance Attribute Details

#sip_notify_response_codeObject (readonly)

Returns the value of attribute sip_notify_response_code.



336
337
338
# File 'lib/signalwire/relay/relay_event.rb', line 336

def sip_notify_response_code
  @sip_notify_response_code
end

#sip_refer_response_codeObject (readonly)

Returns the value of attribute sip_refer_response_code.



336
337
338
# File 'lib/signalwire/relay/relay_event.rb', line 336

def sip_refer_response_code
  @sip_refer_response_code
end

#sip_refer_toObject (readonly)

Returns the value of attribute sip_refer_to.



336
337
338
# File 'lib/signalwire/relay/relay_event.rb', line 336

def sip_refer_to
  @sip_refer_to
end

#stateObject (readonly)

Returns the value of attribute state.



336
337
338
# File 'lib/signalwire/relay/relay_event.rb', line 336

def state
  @state
end

Class Method Details

.from_payload(payload) ⇒ Object



339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/signalwire/relay/relay_event.rb', line 339

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,
    state:                      p['state'] || '',
    sip_refer_to:               p['sip_refer_to'] || '',
    sip_refer_response_code:    p['sip_refer_response_code'] || '',
    sip_notify_response_code:   p['sip_notify_response_code'] || ''
  )
end