2020-04-05 16:41:27 +00:00
|
|
|
class Twilio::CallbackController < ApplicationController
|
|
|
|
def create
|
|
|
|
::Twilio::IncomingMessageService.new(params: permitted_params).perform
|
|
|
|
|
|
|
|
head :no_content
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2022-07-08 12:50:07 +00:00
|
|
|
def permitted_params # rubocop:disable Metrics/MethodLength
|
2020-04-05 16:41:27 +00:00
|
|
|
params.permit(
|
|
|
|
:ApiVersion,
|
|
|
|
:SmsSid,
|
|
|
|
:From,
|
|
|
|
:ToState,
|
|
|
|
:ToZip,
|
|
|
|
:AccountSid,
|
|
|
|
:MessageSid,
|
|
|
|
:FromCountry,
|
|
|
|
:ToCity,
|
|
|
|
:FromCity,
|
|
|
|
:To,
|
|
|
|
:FromZip,
|
|
|
|
:Body,
|
|
|
|
:ToCountry,
|
2020-04-29 20:11:13 +00:00
|
|
|
:FromState,
|
|
|
|
:MediaUrl0,
|
2022-07-08 12:50:07 +00:00
|
|
|
:MediaContentType0,
|
|
|
|
:MessagingServiceSid
|
2020-04-05 16:41:27 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|