Twilio

Preparing an Outgoing Call

Initiating a Call

To initiate a new outgoing phone call we need to specify three parameters:

  1. Caller: the Caller ID Twilio tells the recipient of the call.
  2. Called: the phone number you wish to call.
  3. Url: this is URL of the TwiML instructions for the call.

Lets take a look at these parameters in a little more detail.

The Caller Parameter

The Caller parameter must be set to one of your Twilio phone numbers or to a phone number you have validated with Twilio. For example, if you already have a dedicated Twilio phone number then you can specify that number as the Caller.

If you don't have Twilio phone number or want to use a different number for the Caller ID then head over to the Twilio website and load up your Twilio Account page. Click the "Phone Numbers" link at the top of your Account page. You will see a section at the bottom of the page for Outgoing Caller IDs. Click the button to add a new outgoing caller ID. Twilio will call the phone number you entered and ask you to enter a pin number. If the pin is entered successfully then that number is added to your list of validated outgoing Caller IDs and you can use it as the Caller parameter.

The Called Parameter

The Called parameter is the phone number you wish to call. When calling US or Canadian destinations, please specify the Called parameter as a ten digit number. Twilio also supports calling hundreds of destinations worldwide. Please see the international calling FAQ for information on formating international numbers.

The Url Parameter

The final parameter is Url of the TwiML file that Twilio will fetch when the call is answered.

Next: Lets make the call already!