Files
chatwoot/app/controllers/twilio/callback_controller.rb
Muhsin Keloth b1893c7d96 fix: Support location messages in Twilio WhatsApp integration (#11830)
Fixes location messages not appearing in conversations when sent via
Twilio. Location messages were being filtered out due to empty body
content and missing parameter handling.

![CleanShot 2025-06-27 at 20 48
12](https://github.com/user-attachments/assets/b5a75796-6937-49bc-b689-7d04f4ea5d09)
2025-06-30 11:35:32 +05:30

37 lines
726 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,
*Array.new(10) { |i| :"MediaUrl#{i}" },
*Array.new(10) { |i| :"MediaContentType#{i}" },
:MessagingServiceSid,
:NumMedia,
:Latitude,
:Longitude,
:MessageType
)
end
end