我想创建一个拨号会话循环(在一个拨号会话结束后,创建另一个),以便一次调用多个客户端。我的拨号动词有这种方法: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.有没有办法在拨号端与当前通话异步留言?
1 回答
海绵宝宝撒
TA贡献1809条经验 获得超8个赞
如果 DialCallStatus 返回忙或无应答,则表示被叫方未接听电话。如果拨号方语音邮件或人工实际接听了电话,您只能留下语音邮件或播放自动通知。
https://www.twilio.com/docs/voice/twiml/dial#dialcallstatus
也许您最好使用 Calls REST API 资源来模拟出站呼叫并使用应答机检测 (AMD) 来促进该过程。
- 1 回答
- 0 关注
- 76 浏览
添加回答
举报
0/150
提交
取消