0

I'm building a TwiML Application (Twilio Mark Up Language App) that is set to call a user. When I make an outbound call & when the call ends, my server receives the appropriate callback from the Twilio API. But when the end user answers the phone however, my server does not receive a response from Twilio's server. Here's what's on my server:

response = Twilio::TwiML::Response.new do |r|
  r.Dial :callerId => our_number, :action => "/twilio/callback_response", :method => "POST", :statusCallbackEvent => ["answered"] do |d|
      # d.Number(CGI::escapeHTML number)
      d.Number("+1xxxxxxx")
      d.Number("+1xxxxxxx")
  end
end

It seems the :statusCallbackEvent parameter isn't working as expected.

My server is written in Rails 4.1.6 (Ruby 2.1.3). I'm using the 'twilio-ruby' gem. My Gemfile has gem 'twilio-ruby, '4.2.0' which is the most recent version of the gem.

Henry
  • 926
  • 2
  • 12
  • 27

1 Answers1

1

Twilio developer evangelist here.

You can't set status callbacks on a call using TwiML and the <Dial> verb.

If you are making the outbound call yourself, you can set the statusCallbackEvent parameter in the initial REST API call, as described in the documentation here.

philnash
  • 70,667
  • 10
  • 60
  • 88