Class: Signalwire::Relay::Calling::Dial
- Inherits:
-
Component
- Object
- Component
- Signalwire::Relay::Calling::Dial
show all
- Defined in:
- lib/signalwire/relay/calling/component/dial.rb
Instance Attribute Summary
Attributes inherited from Component
#blocker, #call, #completed, #event, #execute_result, #state, #successful
Instance Method Summary
collapse
Methods inherited from Component
#after_execute, #check_for_waiting_events, #create_blocker, #execute, #execute_params, #handle_execute_result, #has_blocker?, #initialize, #payload, #setup_handlers, #setup_waiting_events, #terminate, #unblock, #wait_for, #wait_on_blocker
Methods included from Logger
#level=, #logger, logger
Instance Method Details
#inner_params ⇒ Object
13
14
15
16
17
18
|
# File 'lib/signalwire/relay/calling/component/dial.rb', line 13
def inner_params
{
tag: @call.tag,
device: @call.device
}
end
|
#notification_handler(event) ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# 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
|