我正在尝试使用PHP/Symfony和JavaScript Voice SDK将排队的入站呼叫出队到会议室。
我现在要做的是将呼叫从队列中取出给单个代理。但是我想启用监督监控和指导。为此,我似乎需要一个会议室。
在服务器端,我使用默认的“分配给任何人”工作流将呼叫排队...
$voiceResponse = new VoiceResponse;
$enqueue = $voiceResponse->enqueue('',['workflowSid' => $ccmanager->getWorkflowSid()]);
$xml = $voiceResponse->asXml();
$response = new Response($xml, Response::HTTP_OK, ['context-type' => 'text/xml']);
return $response;
客户端,当其中一个代理决定接听电话时,我会取消预订...
this.dequeueReservation = function(data)
{
let contactUri = self.getContactUri();
let reservation = self.getReservation(data.phone_number);
if(reservation) {
console.log('before reservation dequeue');
reservation.dequeue(
null,
null,
'record-from-answer',
30, // seconds to answer
'https://d72d-76-18-83-142.ngrok.io/anon/voice/status', // status callback url
'initiated,ringing,answered,completed',
contactUri,
(error, newReservation) => onDequeue(data, error, newReservation)
);
}
}
其中getContactUri()是...
this.getContactUri = function() {
switch(self.agent.call_routing) {
case 'workstation':
return 'client:' + self.agent.worker_name;
case 'business_phone':
return '+1' + self.agent.business_phone;
case 'other_phone':
return '+1' + self.agent.other_phone;
default:
return null;
}
}
因此,所有这些都工作得很好,但没有办法用这种方法添加监督员功能(显然)。我需要做的(显然)是将预订出队到会议室,然后单独将代理连接到会议室。
如果我能够为会议室创建一个contactUri,这将是很容易的。然而,似乎没有"conference_room:“形式的contactUri。
或者,我可以在服务器端先将入站呼叫路由到一个会议室,然后在会议室排队。
在任何情况下,我都需要任务队列作为解决方案的一部分,这样我就可以正确地将呼叫路由到各个代理。
我该怎么做呢?
1条答案
按热度按时间rm5edbpk1#
要使会议出队,您需要使用REST API不是Twiml。在客户端中,使用REST API将成员资源出队到活动会议。根据您提供的代码,服务器将提供一种方法,用于使呼叫出队到会议。客户端将在决定接受呼叫后调用该方法。
Update a Member Resource
上面例子中的url是返回会议Twiml的url。
A Simple Conference
简单会议产生的Twiml: