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
#check_for_waiting_events, #create_blocker, #execute, #execute_params, #handle_execute_result, #initialize, #payload, #setup_handlers, #setup_waiting_events, #terminate, #unblock, #wait_for, #wait_on_blocker
Instance Method Details
#event_type ⇒ Object
9
10
11
|
# File 'lib/signalwire/relay/calling/component/dial.rb', line 9
def event_type
Relay::CallNotification::STATE
end
|
#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
|
#method ⇒ Object
5
6
7
|
# File 'lib/signalwire/relay/calling/component/dial.rb', line 5
def method
Relay::ComponentMethod::DIAL
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
|