Class: Voicemail::MailboxController
- Inherits:
-
ApplicationController
- Object
- Adhearsion::CallController
- ApplicationController
- Voicemail::MailboxController
- Defined in:
- lib/voicemail/mailbox_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#authenticate ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/voicemail/mailbox_controller.rb', line 14 def authenticate current_tries = 0 auth_ok = false while current_tries < config.mailbox.pin_tries input = ask config.mailbox.please_enter_pin, terminator: "#", timeout: config.prompt_timeout logger.info input.to_s logger.info mailbox[:pin].to_s auth_ok = true if input.to_s == mailbox[:pin].to_s break if auth_ok play config.mailbox.pin_wrong current_tries += 1 end auth_ok end |
#play_number_of_messages ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/voicemail/mailbox_controller.rb', line 29 def number = storage.(mailbox[:id]) if number > 0 play config.mailbox.number_before play_numeric number play config.mailbox.number_after else play config.. end end |
#run ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/voicemail/mailbox_controller.rb', line 3 def run if mailbox play_greeting fail_auth unless authenticate else mailbox_not_found end end |