I am trying to code some PHP for an outbound call conference room. The point of the conference room is to make a temporary solution for our customers calling one of our call centers, who need to be transferred, and automatically placed in a call with the other call center. This is exactly what we need, but having this error.
I already tried SMS and standard calls and those work fine. When I run the code below for conference calls, I get this error.
Fatal error: Call to undefined method Services_Twilio::request()
I have my conference.xml file already, like so.
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Dial>
<Conference>i2c</Conference>
</Dial>
</Response>
And my conference.php file looks like this:
<?php
// The PHP Twilio helper library. Get it here http://www.twilio.com/docs/libraries/
require('twilio-php/Services/Twilio.php');
$API_VERSION = '2010-04-01';
$ACCOUNT_SID = 'my sid #';
$AUTH_TOKEN = 'my auth_token';
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN);
// The phone numbers of the people to be called
$participants = array('customer#', 'call-center#');
// Go through the participants array and call each person.
foreach ($participants as $participant)
{
$vars = array(
'From' => 'my #',
'To' => $participant,
'Url' => 'conference.xml');
$response = $client->request("/$API_VERSION/Accounts/$ACCOUNT_SID/Calls", "POST", $vars);
}
?>
It's getting an error on line 23, which is the line with the $response on it. Can you tell what's going wrong? I'm working off this code that Twilio provided. The part that says "Reach Out and Call Somebody". I changed TwilioRestClient to Services_Twilio because that is the newer version.
https://www.twilio.com/blog/2011/07/easy-conference-calling-twilio.html
Anyone see where I'm messing up?