Class: SignalWire::Relay::RecordAction

Inherits:
Action
  • Object
show all
Defined in:
lib/signalwire/relay/action.rb

Overview

Handle for an active record operation.

Instance Attribute Summary

Attributes inherited from Action

#call, #completed, #control_id, #result

Instance Method Summary collapse

Methods inherited from Action

#_check_event, #_resolve, #_set_on_completed, #done?, #on_completed, #wait

Constructor Details

#initialize(call, control_id) ⇒ RecordAction

Returns a new instance of RecordAction.



122
123
124
125
# File 'lib/signalwire/relay/action.rb', line 122

def initialize(call, control_id)
  super(call, control_id, EVENT_CALL_RECORD,
        [RECORD_STATE_FINISHED, RECORD_STATE_NO_INPUT])
end

Instance Method Details

#pause(behavior: nil) ⇒ Object



131
132
133
134
135
# File 'lib/signalwire/relay/action.rb', line 131

def pause(behavior: nil)
  params = { 'control_id' => @control_id }
  params['behavior'] = behavior if behavior
  @call._execute('record.pause', params)
end

#resumeObject



137
138
139
# File 'lib/signalwire/relay/action.rb', line 137

def resume
  @call._execute('record.resume', { 'control_id' => @control_id })
end

#stopObject



127
128
129
# File 'lib/signalwire/relay/action.rb', line 127

def stop
  @call._execute('record.stop', { 'control_id' => @control_id })
end