我正在为Twilio API寻找一个twimlet或php脚本,它将实现一个出站呼叫列表功能,并可选择转移到录制的消息 -
类似的东西是否已经封装或编写脚本?
答案 0 :(得分:0)
自最初询问以来,我们已在代码完整教程中更新了click-to-call解决方案。
在最后一步中,在连接呼叫并且Twilio请求TwiML指令后,您可以考虑从call screening tutorial调整以处理语音邮件:
public function agentVoicemail(Request $request, $agentId)
{
$response = new Services_Twilio_Twiml;
$callStatus = $request->input('DialCallStatus');
if ($callStatus !== 'completed') {
$response->say(
'It appears that no agent is available. ' .
'Please leave a message after the beep',
['voice' => 'alice', 'language' => 'en-GB']
);
$response->record(
['maxLength' => '20',
'method' => 'GET',
'action' => route('hangup', [], false),
'transcribeCallback' => route(
'store-recording', ['agent' => $agentId], false
)
]
);
$response->say(
'No recording received. Goodbye',
['voice' => 'alice', 'language' => 'en-GB']
);
$response->hangup();
return $response;
}
return "Ok";
}