PHP Quickstart: Preparing an Outgoing Call

Initiating a Call

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

  1. From: the Caller ID Twilio will display to the recipient of the call.
  2. To: 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 From Parameter

The 'From' parameter must be set to one of your Twilio Numbers or to a phone number that you have verified with Twilio.

If you don't have a Twilio Number yet or you want to use a different number for the caller ID, you can verify a number on the Phone Numbers page.

The To Parameter

The 'To' parameter is the phone number you wish to call. It should be formatted with a '+' and country code e.g., +16175551212. '1' is the international country code for the US and Canada, and the '+' formats the number in E.164, the phone number standard used by Twilio.

Please see the international calling FAQ for more information on formatting international phone numbers, and the international pricing page for calling rates to destinations around the world.

The Url Parameter

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

Next: Let's make the call already! »

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.