I use task router enqueue and dequeue instructions to connect the caller to the worker. Everything is working perfectly fine. Now I want to add another agent in the same call. For that purpose, I need to convert that call into a conference. I am using Laravel. Here is I am enqueuing the call
$taskAttributes = [
'channel' => 'voice', // Specify that it's a voice call
'type' => $deptName,
'departmentId' => $department_id,
];
$enqueue->task(json_encode($taskAttributes),['timeout' => 60]);
return response($response)->header('Content-Type', 'text/xml');
That is how I am dequeuing it
return response()->json([
"instruction" => "dequeue",
"status_callback_events" => "initiated,ringing,answered,completed",
"record" => "record-from-answer",
"status_callback_url" => url('ivr/statuseventCallback'),
]);
What I need is to convert the in progress call to conference so I can add another person to the same call.
I managed to do that. Sharing here for information.
When the Call is attended and in progress. I trigger an API to update the task
Now every event in my webhook call will have this attribute in Task Detail. I am updating first the child leg of the call then the parent leg.
on this addconf just return the twiml conference.