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
- #play_greeting ⇒ Object
- #play_recording_confirmation ⇒ Object
- #record_message ⇒ Object
- #recording_menu ⇒ Object
- #run ⇒ Object
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
19 20 21 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 19 def play_greeting play mailbox[:greeting_message] || config.default_greeting end |
#play_recording_confirmation ⇒ Object
23 24 25 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 23 def play_recording_confirmation play config.recording_confirmation end |
#record_message ⇒ Object
27 28 29 30 31 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 27 def @recording = record config.allow_rerecording ? : save_recording end |
#recording_menu ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/voicemail/call_controllers/voicemail_controller.rb', line 33 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 17 |
# 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 play_recording_confirmation hangup else mailbox_not_found end end |