Class: Twilio::Rails::Phone::Twiml::InvalidPhoneNumberOperation

Inherits:
BaseOperation show all
Defined in:
app/operations/twilio/rails/phone/twiml/invalid_phone_number_operation.rb

Instance Method Summary collapse

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
19
# File 'app/operations/twilio/rails/phone/twiml/invalid_phone_number_operation.rb', line 10

def execute
  twiml = Twilio::TwiML::VoiceResponse.new
  messages = tree.config[:invalid_phone_number] || []
  response = phone_call.responses.build if phone_call_id
  add_messages(twiml, message_set: messages, response: response)
  twiml.hangup

  Twilio::Rails.config.logger.info("error_twiml: #{twiml.to_s}")
  twiml.to_s
end