0
votes

I'm new to Twilio and I'm trying to figure out how to build something like this:

  • my application places a phone call using my Twilio number to a user's mobile phone.
  • the application uses Twilio.Init then CallResource.Create to initate the call and provide Twiml
  • I use a URL to return Twiml by passing in a url to CallResource.Create
  • the Twiml should say the choices to the user, then collect information from the them (using Say then Gather) for two possible responses, and return that collected information back to my application.

What I'm REALLY confused about is whether or not I need to specify a webhook that is the same path as the url I'm passing to CallResource.Create() to retrieve the Twiml.

Looking at the Twilio dashboard, under the Voice and Fax section, it looks like you only would need to specify a webhook when a call comes in (aka, a user calls your Twilio number) enter image description here

But, for what I need to build, a user is not calling my Twilio number, my application is using my Twilio number to call a user on their mobile phone.

In the docs, it says:

If you specify a URL parameter in your request, Twilio will make its HTTP request to this URL to retrieve TwiML to handle the call. This request from Twilio is identical to the request Twilio sends when receiving an inbound call.

If it's identical to an incoming call, then do I need a webhook configured or not?