Skip to content

Instantly share code, notes, and snippets.

@jaboutboul
Created November 21, 2011 23:28
Show Gist options
  • Save jaboutboul/1384331 to your computer and use it in GitHub Desktop.
Save jaboutboul/1384331 to your computer and use it in GitHub Desktop.
Initiating a Call - (718) 701-8658
<?php
require 'Services/Twilio.php';
require 'credentials.php';
$version = "2010-04-01";
$phonenumber = "+17187018658";
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN, $version);
try {
$call = $client->account->calls->create(
$phonenumber, //From
'+17182493243', //To
'http://demo.twilio.com/welcome/voice' //TwiML
);
echo 'Started Call: '.$call->sid;
} catch(Exception $e){
echo 'Error: '.$e.getMessage();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment