class Punchblock::Component::Record
Constants
- VALID_DIRECTIONS
Public Instance Methods
direction=(direction)
click to toggle source
Calls superclass method
# File lib/punchblock/component/record.rb, line 33 def direction=(direction) if direction && !VALID_DIRECTIONS.include?(direction.to_sym) raise ArgumentError, "Invalid Direction (#{direction}), use: #{VALID_DIRECTIONS*' '}" end super end
pause!()
click to toggle source
Sends an Rayo pause message for the current Record
# File lib/punchblock/component/record.rb, line 83 def pause! raise InvalidActionError, "Cannot pause a Record that is not executing" unless executing? pause_action.tap do |action| result = write_action action paused! if result end end
pause_action()
click to toggle source
Pauses a running Record
@return [Command::Record::Pause] an Rayo pause message for the current Record
@example
record_obj.pause_action.to_xml returns: <pause xmlns="urn:xmpp:rayo:record:1"/>
# File lib/punchblock/component/record.rb, line 76 def pause_action Pause.new :component_id => component_id, :target_call_id => target_call_id end
rayo_attributes()
click to toggle source
# File lib/punchblock/component/record.rb, line 43 def rayo_attributes { 'format' => format, 'initial-timeout' => initial_timeout, 'final-timeout' => final_timeout, 'max-duration' => max_duration, 'start-beep' => start_beep, 'stop-beep' => stop_beep, 'start-paused' => start_paused, 'direction' => direction, 'mix' => mix } end
recording()
click to toggle source
Directly returns the recording for the component @return [Punchblock::Component::Record::Recording] The recording object
# File lib/punchblock/component/record.rb, line 120 def recording complete_event.recording end
recording_uri()
click to toggle source
Directly returns the recording URI for the component @return [String] The recording URI
# File lib/punchblock/component/record.rb, line 128 def recording_uri recording.uri end
resume!()
click to toggle source
Sends an Rayo resume message for the current Record
# File lib/punchblock/component/record.rb, line 108 def resume! raise InvalidActionError, "Cannot resume a Record that is not paused." unless paused? resume_action.tap do |action| result = write_action action resumed! if result end end
resume_action()
click to toggle source
Create an Rayo resume message for the current Record
@return [Command::Record::Resume] an Rayo resume message
@example
record_obj.resume_action.to_xml returns: <resume xmlns="urn:xmpp:rayo:record:1"/>
# File lib/punchblock/component/record.rb, line 101 def resume_action Resume.new :component_id => component_id, :target_call_id => target_call_id end