- Twilio events were being processed synchronously, leading to slow API responses. - This change moves Twilio event processing to a background job to improve performance and align with how other events (e.g., WhatsApp) are handled. --------- Co-authored-by: Pranav <pranav@chatwoot.com>
33 lines
598 B
Ruby
33 lines
598 B
Ruby
class Twilio::CallbackController < ApplicationController
|
|
def create
|
|
Webhooks::TwilioEventsJob.perform_later(permitted_params.to_unsafe_hash)
|
|
|
|
head :no_content
|
|
end
|
|
|
|
private
|
|
|
|
def permitted_params # rubocop:disable Metrics/MethodLength
|
|
params.permit(
|
|
:ApiVersion,
|
|
:SmsSid,
|
|
:From,
|
|
:ToState,
|
|
:ToZip,
|
|
:AccountSid,
|
|
:MessageSid,
|
|
:FromCountry,
|
|
:ToCity,
|
|
:FromCity,
|
|
:To,
|
|
:FromZip,
|
|
:Body,
|
|
:ToCountry,
|
|
:FromState,
|
|
:MediaUrl0,
|
|
:MediaContentType0,
|
|
:MessagingServiceSid
|
|
)
|
|
end
|
|
end
|