Class: ExotelApi::CallController
- Inherits:
-
StartController
- Object
- ApplicationController
- StartController
- ExotelApi::CallController
- Defined in:
- app/controllers/exotel_api/call_controller.rb
Instance Method Summary collapse
-
#after_greeting ⇒ Object
response - switch case ivr_menu, hangup.
-
#after_keypress ⇒ Object
response - audio file or list of URLs of audio files.
-
#after_keypress_greeting ⇒ Object
response - switch case ivr_menu, hangup.
-
#finish ⇒ Object
response - status 200 and plain ”.
-
#greeting ⇒ Object
response - audio file or list of URLS of audio files.
-
#ivr_menu ⇒ Object
response - audio file or list of URLS of audio files.
-
#keypress ⇒ Object
response - status 200 and plain ”.
-
#play_again ⇒ Object
response - status 200, 404 or 302 and plain ”.
Methods inherited from StartController
Instance Method Details
#after_greeting ⇒ Object
response - switch case ivr_menu, hangup
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/exotel_api/call_controller.rb', line 17 def after_greeting begin _call = direction if _call.present? applet = "{\"select\":\"#{_call.after_greeting(params)}\"}" if defined?(_call.after_greeting) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => applet, content_type: "text/html", status: 200 end |
#after_keypress ⇒ Object
response - audio file or list of URLs of audio files
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'app/controllers/exotel_api/call_controller.rb', line 56 def after_keypress begin _call = direction if _call.present? urls = _call.after_keypress(params) if defined?(_call.after_keypress) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => urls, content_type: "text/plain", status: 200 end |
#after_keypress_greeting ⇒ Object
response - switch case ivr_menu, hangup
69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'app/controllers/exotel_api/call_controller.rb', line 69 def after_keypress_greeting begin _call = direction if _call.present? applet = "{\"select\":\"#{_call.after_keypress_greeting(params)}\"}" if defined?(_call.after_keypress_greeting) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => applet, content_type: "text/html", status: 200 end |
#finish ⇒ Object
response - status 200 and plain ”
95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'app/controllers/exotel_api/call_controller.rb', line 95 def finish begin _call = direction if _call.present? _call.finish(params) if defined?(_call.finish) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => '', content_type: "text/html", :status => 200 end |
#greeting ⇒ Object
response - audio file or list of URLS of audio files
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/exotel_api/call_controller.rb', line 4 def greeting begin _call = direction if _call.present? urls = _call.greeting(params) if defined?(_call.greeting) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => urls, content_type: "text/plain", :status => 200 end |
#ivr_menu ⇒ Object
response - audio file or list of URLS of audio files
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/exotel_api/call_controller.rb', line 30 def begin _call = direction if _call.present? urls = _call.(params) if defined?(_call.) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => urls, content_type: "text/plain", :status => 200 end |
#keypress ⇒ Object
response - status 200 and plain ”
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/exotel_api/call_controller.rb', line 43 def keypress begin _call = direction if _call.present? _call.keypress(params) if defined?(_call.keypress) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => '', content_type: "text/html", :status => 200 end |
#play_again ⇒ Object
response - status 200, 404 or 302 and plain ”
82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'app/controllers/exotel_api/call_controller.rb', line 82 def play_again begin _call = direction if _call.present? applet = "{\"select\":\"#{_call.play_again(params)}\"}" if defined?(_call.play_again) end rescue => e logger.error e. logger.error e.backtrace.join("\n") end render :plain => applet, content_type: "text/html", :status => 200 end |