Class: Adhearsion::Rayo::Component::Record
- Inherits:
-
ComponentNode
- Object
- RayoNode
- Adhearsion::Rayo::CommandNode
- ComponentNode
- Adhearsion::Rayo::Component::Record
- Defined in:
- lib/adhearsion/rayo/component/record.rb
Defined Under Namespace
Classes: Complete, Pause, Recording, Resume
Constant Summary collapse
- VALID_DIRECTIONS =
[:duplex, :send, :recv].freeze
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #connection, #original_component
Instance Method Summary collapse
-
#direction ⇒ Symbol
The direction of media to be recorded.
- #direction=(direction) ⇒ Object
-
#final_timeout ⇒ Integer
Controls the length of a period of silence after callers have spoken to conclude they finished.
-
#format ⇒ String
The codec to use for recording.
-
#initial_timeout ⇒ Integer
Controls how long the recognizer should wait after the end of the prompt for the caller to speak before sending a Recorder event.
-
#max_duration ⇒ Integer
Indicates the maximum duration for the recording.
-
#mix ⇒ true, false
Wether to mix audio down or not.
-
#pause! ⇒ Object
Sends an Rayo pause message for the current Record.
-
#pause_action ⇒ Command::Record::Pause
Pauses a running Record.
- #rayo_attributes ⇒ Object
-
#recording ⇒ Adhearsion::Rayo::Component::Record::Recording
Directly returns the recording for the component.
-
#recording_uri ⇒ String
Directly returns the recording URI for the component.
-
#resume! ⇒ Object
Sends an Rayo resume message for the current Record.
-
#resume_action ⇒ Command::Record::Resume
Create an Rayo resume message for the current Record.
-
#start_beep ⇒ true, false
Indicates whether record will be preceded with a beep.
-
#start_paused ⇒ true, false
Whether subsequent record will start in PAUSE mode.
-
#stop_beep ⇒ true, false
Indicates whether record will be followed by a beep.
Methods inherited from ComponentNode
#add_event, #complete_event, #complete_event=, #initialize, #register_event_handler, #register_internal_handlers, #response=, #stop!, #stop_action, #trigger_event_handler, #write_action
Methods inherited from Adhearsion::Rayo::CommandNode
#initialize, #response, #response=
Methods inherited from RayoNode
#==, class_from_registration, from_xml, #inherit, #inspect, #rayo_children, register, #source, #to_rayo, #to_xml
Constructor Details
This class inherits a constructor from Adhearsion::Rayo::Component::ComponentNode
Instance Method Details
#direction ⇒ Symbol
Returns the direction of media to be recorded.
33 |
# File 'lib/adhearsion/rayo/component/record.rb', line 33 attribute :direction, Symbol |
#direction=(direction) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/adhearsion/rayo/component/record.rb', line 34 def direction=(direction) if direction && !VALID_DIRECTIONS.include?(direction.to_sym) raise ArgumentError, "Invalid Direction (#{direction}), use: #{VALID_DIRECTIONS*' '}" end super end |
#final_timeout ⇒ Integer
Returns Controls the length of a period of silence after callers have spoken to conclude they finished.
18 |
# File 'lib/adhearsion/rayo/component/record.rb', line 18 attribute :final_timeout, Integer |
#format ⇒ String
Returns the codec to use for recording.
12 |
# File 'lib/adhearsion/rayo/component/record.rb', line 12 attribute :format |
#initial_timeout ⇒ Integer
Returns Controls how long the recognizer should wait after the end of the prompt for the caller to speak before sending a Recorder event.
15 |
# File 'lib/adhearsion/rayo/component/record.rb', line 15 attribute :initial_timeout, Integer |
#max_duration ⇒ Integer
Returns Indicates the maximum duration for the recording.
21 |
# File 'lib/adhearsion/rayo/component/record.rb', line 21 attribute :max_duration, Integer |
#mix ⇒ true, false
Returns wether to mix audio down or not.
42 |
# File 'lib/adhearsion/rayo/component/record.rb', line 42 attribute :mix, Boolean |
#pause! ⇒ Object
Sends an Rayo pause message for the current Record
84 85 86 87 88 89 90 |
# File 'lib/adhearsion/rayo/component/record.rb', line 84 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 ⇒ Command::Record::Pause
Pauses a running Record
77 78 79 |
# File 'lib/adhearsion/rayo/component/record.rb', line 77 def pause_action Pause.new :component_id => component_id, :target_call_id => target_call_id end |
#rayo_attributes ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/adhearsion/rayo/component/record.rb', line 44 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 ⇒ Adhearsion::Rayo::Component::Record::Recording
Directly returns the recording for the component
121 122 123 |
# File 'lib/adhearsion/rayo/component/record.rb', line 121 def recording complete_event.recording end |
#recording_uri ⇒ String
Directly returns the recording URI for the component
129 130 131 |
# File 'lib/adhearsion/rayo/component/record.rb', line 129 def recording_uri recording.uri end |
#resume! ⇒ Object
Sends an Rayo resume message for the current Record
109 110 111 112 113 114 115 |
# File 'lib/adhearsion/rayo/component/record.rb', line 109 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 ⇒ Command::Record::Resume
Create an Rayo resume message for the current Record
102 103 104 |
# File 'lib/adhearsion/rayo/component/record.rb', line 102 def resume_action Resume.new :component_id => component_id, :target_call_id => target_call_id end |
#start_beep ⇒ true, false
Returns Indicates whether record will be preceded with a beep.
24 |
# File 'lib/adhearsion/rayo/component/record.rb', line 24 attribute :start_beep, Boolean |
#start_paused ⇒ true, false
Returns Whether subsequent record will start in PAUSE mode.
30 |
# File 'lib/adhearsion/rayo/component/record.rb', line 30 attribute :start_paused, Boolean |
#stop_beep ⇒ true, false
Returns Indicates whether record will be followed by a beep.
27 |
# File 'lib/adhearsion/rayo/component/record.rb', line 27 attribute :stop_beep, Boolean |