Class: LiveCallRouting::Twilio::V3Controller
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- LiveCallRouting::Twilio::V3Controller
- Defined in:
- app/controllers/pager_tree/integrations/live_call_routing/twilio/v3_controller.rb
Instance Method Summary collapse
- #dropped ⇒ Object
- #music ⇒ Object
- #queue_status ⇒ Object
- #queue_status_deferred(deferred_request) ⇒ Object
Instance Method Details
#dropped ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/pager_tree/integrations/live_call_routing/twilio/v3_controller.rb', line 14 def dropped set_integration @integration.adapter_source_log = @integration.logs.create!(level: :info, format: :json, message: params.to_unsafe_h) if @integration.try(:log_incoming_requests?) @integration.adapter_controller = self @integration.adapter_alert = @integration.alerts.find_by(thirdparty_id: params[:CallSid]) @integration.adapter_incoming_request_params = params @integration.adapter_response_dropped end |
#music ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/pager_tree/integrations/live_call_routing/twilio/v3_controller.rb', line 5 def music set_integration @integration.adapter_source_log = @integration.logs.create!(level: :info, format: :json, message: params.to_unsafe_h) if @integration.try(:log_incoming_requests?) @integration.adapter_controller = self @integration.adapter_incoming_request_params = params @integration.adapter_response_music end |
#queue_status ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/pager_tree/integrations/live_call_routing/twilio/v3_controller.rb', line 24 def queue_status ::PagerTree::Integrations.deferred_request_class.constantize.perform_later_from_request!(request) head :ok end |
#queue_status_deferred(deferred_request) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/pager_tree/integrations/live_call_routing/twilio/v3_controller.rb', line 30 def queue_status_deferred(deferred_request) params = deferred_request.params id = params.dig("id") @integration = find_integration(id) deferred_request.account_id = @integration.account_id @integration.adapter_source_log = @integration.logs.create!(level: :info, format: :json, message: deferred_request.request) if @integration.log_incoming_requests? @integration.adapter_incoming_request_params = params @integration.adapter_incoming_deferred_request = deferred_request @integration.adapter_process_queue_status_deferred end |