Class: Voicemail::VoicemailController
- Inherits:
-
ApplicationController
- Object
- Adhearsion::CallController
- ApplicationController
- Voicemail::VoicemailController
- Defined in:
- lib/voicemail/call_controllers/voicemail_controller.rb
Instance Attribute Summary collapse
-
#recording ⇒ Object
Returns the value of attribute recording.
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Attribute Details
#recording ⇒ Object
Returns the value of attribute recording.
4 5 6 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 4 def recording @recording end |
Instance Method Details
#play_greeting ⇒ Object
18 19 20 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 18 def play_greeting play mailbox[:greeting_message] || config.default_greeting end |
#record_message ⇒ Object
22 23 24 25 26 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 22 def @recording = record config.allow_rerecording ? : save_recording end |
#recording_menu ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 28 def recording_url, config.after_record, tries: 3, timeout: 10 do match('1') { save_recording } match('2') { } invalid { } timeout { save_recording } failure { save_recording } end end |
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 6 def run answer if config.when_to_answer == :before_greeting if mailbox play_greeting answer if config.when_to_answer == :after_greeting hangup else mailbox_not_found end end |