Skip to content

Instantly share code, notes, and snippets.

@TMcManus
Created December 3, 2012 08:48
Show Gist options
  • Save TMcManus/4193709 to your computer and use it in GitHub Desktop.
Save TMcManus/4193709 to your computer and use it in GitHub Desktop.
Unique Conference
<?php
/*
* Download the twilio-php helper library from:
* https://github.com/twilio/twilio-php
* Copy the "Services" folder into the directory containing this file.
*/
require('Services/Twilio.php');
$response = new Services_Twilio_Twiml;
$dial = $response->dial();
$dial->conference($_GET['conference_name'], array(
"waitUrl" => "http://twimlets.com/holdmusic?Bucket=com.twilio.music.guitars",
));
print $response;
<?php
/*
* Download the twilio-php helper library from:
* https://github.com/twilio/twilio-php
* Copy the "Services" folder into the directory containing this file.
*/
require('Services/Twilio.php');
$site_path = "http://example.com";
$account_sid = "ACXXXXXX"; // Your Twilio account sid
$auth_token = "YYYYYY"; // Your Twilio auth token
$caller_id = "+18085558901"; // The phone number you want the call to come from
$user_1 = "+17075559876";
$user_2 = "+15305551234";
$conference_name = urlencode(base64_encode(time().$user_1.$user_2));
$url = $site_path."/conference.php?conference_name=".$conference_name;
$client = new Services_Twilio($account_sid, $auth_token);
$call_1 = $client->account->calls->create(
$caller_id, $user_1, $url
);
$call_2 = $client->account->calls->create(
$caller_id, $user_2, $url
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment