Twilio REST 更新调用错误
Twilio REST update call error
我按照 this page 更新了对会议室的呼叫。
每次我尝试调用更新函数时,都会出现错误:
No 'To' number is specified
。
即使我进入呼叫输入的标准 Twiml,它也会这样说。文档中没有任何地方说明您需要收件人号码。
我使用的代码:
$call = $tokens['client']->account->calls->get($call_sid);
$call->update(array(
"Url" => $app["request"]->getSchemeAndHttpHost() . "/dial/api/assign_redirect?callsid=" . $call_sid,
"Method" => "POST"
));
重定向到的twiml:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Thank you for your patience. You are now connecting with an agent</Say>
<Dial record="true">
<Conference startConferenceOnEnter="false" endConferenceOnExit="true" eventCallbackUrl="{{ url('API-record') }}" record="record-from-start">{{ callsid }}</Conference>
</Dial>
接受呼叫的其他Twiml:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial record='record-from-answer' callerId='{{ callerId }}'>
{{ numberOrClient|raw }}
</Dial>
</Response>
Twilio 支持没有帮助,他们指出:https://www.twilio.com/docs/errors/21201 这毫无意义。
我已经尝试了很多关于 SO 的问题:
- Twilio - How to move an existing call to a conference
- Twilio - How to dial third party number and add him to conference?
只有最后一个对我有用。但这创造了第三条腿。我想坚持现有的。有人知道如何解决这个问题吗?
提前致谢!
编辑:我正在使用 PHP 库的 v4。
我通过获取两条腿 call_sids 并像在文档中那样创建迭代器来修复它。如果转发结果,To
错误就消失了,它比 get 更广泛并且更慢,但它有效。
我按照 this page 更新了对会议室的呼叫。
每次我尝试调用更新函数时,都会出现错误:
No 'To' number is specified
。
即使我进入呼叫输入的标准 Twiml,它也会这样说。文档中没有任何地方说明您需要收件人号码。
我使用的代码:
$call = $tokens['client']->account->calls->get($call_sid);
$call->update(array(
"Url" => $app["request"]->getSchemeAndHttpHost() . "/dial/api/assign_redirect?callsid=" . $call_sid,
"Method" => "POST"
));
重定向到的twiml:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Thank you for your patience. You are now connecting with an agent</Say>
<Dial record="true">
<Conference startConferenceOnEnter="false" endConferenceOnExit="true" eventCallbackUrl="{{ url('API-record') }}" record="record-from-start">{{ callsid }}</Conference>
</Dial>
接受呼叫的其他Twiml:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial record='record-from-answer' callerId='{{ callerId }}'>
{{ numberOrClient|raw }}
</Dial>
</Response>
Twilio 支持没有帮助,他们指出:https://www.twilio.com/docs/errors/21201 这毫无意义。
我已经尝试了很多关于 SO 的问题:
- Twilio - How to move an existing call to a conference
- Twilio - How to dial third party number and add him to conference?
只有最后一个对我有用。但这创造了第三条腿。我想坚持现有的。有人知道如何解决这个问题吗?
提前致谢!
编辑:我正在使用 PHP 库的 v4。
我通过获取两条腿 call_sids 并像在文档中那样创建迭代器来修复它。如果转发结果,To
错误就消失了,它比 get 更广泛并且更慢,但它有效。