我想创建一个拨号会话循环(在一个拨号会话结束后,创建另一个),以便一次调用多个客户端。
我的拨号动词有这种方法:
public function afterCall(Call $call, DialSession $ds, TwilioClient $client): VoiceResponse
{
$voiceResponse = new VoiceResponse();
$voiceResponse->pause(['length' => 1]);
if ($_REQUEST['DialCallStatus'] === 'completed') {
$call->status = Call::COMPLETED;
$call->connected = true;
$call->recording_link = $_REQUEST['RecordingUrl'];
}
if ($_REQUEST['DialCallStatus'] === 'busy' || $_REQUEST['DialCallStatus'] === 'no-answer') {
$call->status = Call::BUSY;
$client->leaveVoiceMail($_REQUEST['DialCallSid']);
}
if ($_REQUEST['DialCallStatus'] !== 'completed' &&
$_REQUEST['DialCallStatus'] !== 'busy' &&
$_REQUEST['DialCallStatus'] !== 'no-answer'
) {
$call->status = Call::ERROR;
}
return $voiceResponse;
}
当我或我想留下已保存的 mp3 消息(语音邮件)DialCallStatus时busyno-answer
但是当我更新 call /w dialCallSid (in $client->leaveVoiceMail($_REQUEST['DialCallSid']);) 时,我收到了这个错误:
Twilio\Exceptions\RestException: [HTTP 400] Unable to update record: Call is not in-progress. Cannot redirect.
有没有办法在拨号端与当前通话异步留言?
海绵宝宝撒