class Signalwire::Relay::Calling::Dial

Public Instance Methods

event_type() click to toggle source
# File lib/signalwire/relay/calling/component/dial.rb, line 9
def event_type
  Relay::CallNotification::STATE
end
inner_params() click to toggle source
# File lib/signalwire/relay/calling/component/dial.rb, line 13
def inner_params
  {
    tag: @call.tag,
    device: @call.device
  }
end
method() click to toggle source
# File lib/signalwire/relay/calling/component/dial.rb, line 5
def method
  Relay::ComponentMethod::DIAL
end
notification_handler(event) click to toggle source
# File lib/signalwire/relay/calling/component/dial.rb, line 20
def notification_handler(event)
  @state = event.call_params[:call_state]

  ended_events = [Relay::CallState::ANSWERED, Relay::CallState::ENDING, Relay::CallState::ENDED]

  if ended_events.include?(@state)
    @completed = true
    @successful = true if @state == Relay::CallState::ANSWERED
    @event = event
  end

  check_for_waiting_events
end