using twilio account how to create a dynamic conference call for voiceurl in php


I am trying to upload using client on twilio and trying buy a twilio number.

Also, I need to get a dynamic voice URL in order to record a conference call dynamically.


require_once 'vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from
$sid = "*********************";
$token = "*******************";
$client = new Client($sid, $token);

$numbers = $client->availablePhoneNumbers('US')->local->read(
    array("areaCode" => "424")

$twilioNumber = $numbers[0]->phoneNumber;

$newNumber = $client->incomingPhoneNumbers->create(
            "voiceUrl" => "host url",
            "voiceMethod" => "GET"

if ($newNumber) {
            return $twilioNumber;
        } else {
            return 0;

// In the voiceUrl parameter i am passing a conference call connect code hosted link but its not getting updated to twilio account dynamically.




 You can use like     

 require 'Services/Twilio.php';

 $account_id = ACCOUNT_SID;
 $auth_token = AUTH_TOKEN;

 $number = $_REQUEST['id'];

 $client = new Services_Twilio($account_id, $auth_token);


 $number= $client->account->incoming_phone_numbers->create(array('PhoneNumber' =>'+'.$number));
$number1 = $client->account->incoming_phone_numbers->get($number_sid);
$number1->update(array("VoiceUrl" => "","SmsUrl"=>"","VoiceFallbackUrl"=>""));

}catch(Exception $e){

 echo $err = "Error purchasing number: {$e->getMessage()}";

echo $phone_number;

People are also looking for solutions to the problem: Triangle of asterisks in php


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.