Twilio TaskRouter工作者大会

时间:2016-03-11 06:40:43

标签: java twilio

我有一个Twilio电话号码,我用于软电话和我为TaskRouter配置的电话。因此,每当有人打电话给可用工作人员呼叫路线的twilio号码时,这工作正常,但我的问题是工作人员如何在现场呼叫中呼叫其他非twilio号码。 我正在https://www.twilio.com/docs/api/taskrouter/handling-assignment-callbacks#redirecting-call阅读文档,其中提到了这一点 1.通过ReservationSid以会议名称拨打工作人员。这可以在作业回拨时完成 2.利用重定向分配指令将客户从队列转移到由ReservationSid命名的会议。

那么如何在会议中拨打工作人员以及客户如何重定向到该会议,以便座席可以在现场呼叫中拨打非twilio号码并在会议中重定向该呼叫 意味着它就像是三方沟通,
客户 - > Twilio数字--->工人--->非Twilio数字??

1 个答案:

答案 0 :(得分:1)

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' => '+18001231234'
)
        );

 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