Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an outbound conference call in Twilio, I get this error Fatal error: Call to undefined method Services_Twilio::request(). Why? #180

Closed
jtbitt opened this issue Jun 18, 2014 · 1 comment

Comments

@jtbitt
Copy link

jtbitt commented Jun 18, 2014

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 $particpant)
   {
      $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

Can you see where I'm messing up?

@ihumanable ihumanable added the 4.x label Aug 16, 2016
@codejudas
Copy link
Contributor

We've completely rewritten the library for 5.x, please upgrade and let us know if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants