-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsendCall.php
More file actions
31 lines (26 loc) · 1.01 KB
/
sendCall.php
File metadata and controls
31 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
// Include the Twilio PHP library
require('twilio-php/Services/Twilio.php');
// Twilio REST API version
$version = "2010-04-01";
// Set our Account SID and AuthToken
$sid = "AC76de558201b9927e3bdb03f209f15a81";
$token = "4ba4e3995a2e1fd5de33d8af2676a84f";
// A phone number you have previously validated with Twilio
$phonenumber = '6465028711';
// Instantiate a new Twilio Rest Client
$client = new Services_Twilio($sid, $token, $version);
// $response = new Services_Twilio_Twiml;
// $response->say("Hello Tushar, how are you doing today?");
try {
// Initiate a new outbound call
$call = $client->account->calls->create(
$phonenumber, // The number of the phone initiating the call
'+16072167043', // The number of the phone receiving call
'http://demo.twilio.com/welcome/voice/'
);
echo 'Started call: ' . $call->sid;
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
?>