Files
phabricator/externals/twilio-php/docs/quickstart.rst
2014-05-17 15:41:12 -07:00

812 B

Quickstart

Making a Call

$sid = "ACXXXXXX"; // Your Twilio account sid
$token = "YYYYYY"; // Your Twilio auth token

$client = new Services_Twilio($sid, $token);
$call = $client->account->calls->create(
  '9991231234', // From this number
  '8881231234', // Call this number
  'http://foo.com/call.xml'
);

Generating TwiML

To control phone calls, your application need to output TwiML. Use Services_Twilio_Twiml to easily create such responses.

$response = new Services_Twilio_Twiml();
$response->say('Hello');
print $response;
<?xml version="1.0" encoding="utf-8"?>
<Response><Play loop="5">monkey.mp3</Play><Response>