class Signalwire::Relay::Calling::Connect
Public Class Methods
new(call:, devices:, ringback: nil)
click to toggle source
Calls superclass method
Signalwire::Relay::Calling::Component::new
# File lib/signalwire/relay/calling/component/connect.rb, line 5 def initialize(call:, devices:, ringback: nil) super(call: call) @devices = devices @ringback = ringback end
Public Instance Methods
broadcast_event(event)
click to toggle source
# File lib/signalwire/relay/calling/component/connect.rb, line 44 def broadcast_event(event) @call.broadcast "connect_#{@state}".to_sym, event @call.broadcast :connect_state_change, event end
event_type()
click to toggle source
# File lib/signalwire/relay/calling/component/connect.rb, line 15 def event_type Relay::CallNotification::CONNECT end
inner_params()
click to toggle source
# File lib/signalwire/relay/calling/component/connect.rb, line 19 def inner_params params = { node_id: @call.node_id, call_id: @call.id, devices: @devices } params[:ringback] = @ringback unless @ringback.nil? params end
method()
click to toggle source
# File lib/signalwire/relay/calling/component/connect.rb, line 11 def method Relay::ComponentMethod::CONNECT end
notification_handler(event)
click to toggle source
# File lib/signalwire/relay/calling/component/connect.rb, line 30 def notification_handler(event) @state = event.call_params[:connect_state] @completed = @state != Relay::CallConnectState::CONNECTING if @completed @successful = @state == Relay::CallConnectState::CONNECTED @event = event end broadcast_event(event) check_for_waiting_events end