Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@freekrai
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freekrai/22286564e98a19b76ebc to your computer and use it in GitHub Desktop.
Save freekrai/22286564e98a19b76ebc to your computer and use it in GitHub Desktop.
Rollcall.php - for use in tutorial published @ http://rogerstringer.com/2014/09/05/get-roll-call-twilio-conference-call/
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXX";
$token = "YYYYY";
$client = new Services_Twilio($sid, $token);
$response = new Services_Twilio_Twiml();
if( isset($_REQUEST['ConferenceSid']) ){
$participants = $client->account->conferences->get( $_REQUEST['ConferenceSid'] )->participants;
$cnt = count( $participants );
$response->Say( "There are ".$cnt." callers in this conference" );
foreach ($participants as $participant) {
$call = $client->account->calls->get( $participant->callsid );
$response->Say( $call->from );
}
}
$response->Redirect("conferencemod.xml");
print $response;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment