Created
September 22, 2011 20:46
-
-
Save RobSpectre/1235996 to your computer and use it in GitHub Desktop.
SMS Notification to Conference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is the Voice Request URL to start the conference. | |
require_once('path/to/Services/Twilio.php'); | |
$ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxxxxxx'; | |
$AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyyyyyy'; | |
$CALLER_ID = '+1aaabbbcccc'; | |
$user_to_request_conference_attendance = '+1xxxyyyzzzz'; | |
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); | |
$msg = $client->account->sms_messages->create( | |
$CALLER_ID, | |
$user_to_request_conference_attendance, | |
'Would you like to join the conference? Reply yes or no.' | |
); | |
header('Content-type: text/xml'); | |
?> | |
<Response> | |
<Redirect>03_complete_conference.php</Redirect> | |
</Response> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is the Voice Request URL to start the conference. | |
require_once('path/to/Services/Twilio.php'); | |
$ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxxxxxx'; | |
$AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyyyyyy'; | |
$CALLER_ID = '+1aaabbbcccc'; | |
$response = $_REQUEST['Body']; | |
if ($response == 'yes') { | |
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); | |
$call = $client->account->calls->create( | |
$CALLER_ID, | |
$_REQUEST['From'], | |
"http://example.com/path/to/03_complete_conference.php" | |
); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-type: text/xml'); | |
?> | |
<Response> | |
<Dial> | |
<Conference>SMSNotificationToConference</Conference> | |
</Dial> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment