in PHP I have manage like this
first set one URL assignment in taskrouter
HERE : TaskRouter->Settings->Event Callbacks
like www.site.com/test/event_status_callback.php
You can use twilio conferece task router :-
https://www.twilio.com/docs/api/taskrouter/reservations
Conference Instruction like this
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/user/account
$accountSid = "AC1afdf65d5c4e434dc58792456bda940f";
$authToken = "your_auth_token";
$workspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$taskSid = "WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$reservationSid = "WRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$client = new Client($accountSid, $authToken);
// Update a Reservation with a Conference instruction
$reservation = $client->taskrouter
->workspaces($workspaceSid)
->tasks($taskSid)
->reservations($reservationSid)
->fetch();
$reservation->update(
array(
'instruction' => 'conference',
'dequeueFrom' => '+180'
)
);
1) call come on twilio number and goes to taskrouter
<Response>
<Enqueue workflowSid="WWXXXXXXXXXXXXXXXXXXXXXXXX">
<Task>{"selected_language": "<?= $language ?>"}</Task>
</Enqueue>
</Response>
2)now call goes to perticuler language wise and dail to avelable workers and here you can redirect your call to other Non Twilio number get call sid
also you can Use Db for manage worker side and call sid
In this event_status_callback.php page you get call_sid
$call = $client
->calls($call_sidss)
->update(
array(
"url" => $url . "test/callredirectonsupport.php",
"method" => "POST"
)
);
echo $call->to;
3) callredirectonsupport.php
now you call redirect to callredirectonsupport.php
here you can write youe dial code