使用 Twilio 函数转发到多个目的地
Forwarding to multiple destinations with Twilio functions
我是 twilio 的新手。我正在尝试设置一个 phone 号码,它可以在多个目的地响铃。
我关注 this 博客并像这样设置了一个 twiML 脚本。
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Number>+1-777-777-7777</Number>
<Sip>sip:1777xxxxxxxxxx@in.callcentric.com;region=us2</Sip>
<Sip>sip:1777xxxxxxxxxx@in.callcentric.com;region=us2</Sip>
</Dial>
</Response>
然而,正如其他用户在评论中所报告的那样,这似乎不适用于目标是 sip 和数字混合的场景。在我的例子中,只有 phone 号码响铃。 sip 目的地根本不接电话。
有没有办法让它工作?使用垃圾箱或新的 twilio 功能?
这里是 Twilio 开发人员布道者。
无法使用多个<Sip>
nouns in a <Dial>
. From the documentation:
Currently, only one <Sip>
noun may be specified per <Dial>
, and the INVITE message may be sent to only one SIP endpoint. Also, you cannot add any other nouns (eg <Number>
, <Client>
) in the same <Dial>
as the SIP. If you want to use another noun, set up a callback on the <Dial>
to use alternate methods.
相反,您可以使用 <Enqueue>
and dial each of the numbers/SIP addresses using the REST API. Then, when one connects, connect it to the call in the queue and disconnect the other calls. You'd need to keep a reference to the original call SID so that could connect directly to it and to each of the generated call SIDs so that you can terminate them with the REST API too.
将来电者添加到队列中
如果有帮助请告诉我。
我是 twilio 的新手。我正在尝试设置一个 phone 号码,它可以在多个目的地响铃。 我关注 this 博客并像这样设置了一个 twiML 脚本。
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Number>+1-777-777-7777</Number>
<Sip>sip:1777xxxxxxxxxx@in.callcentric.com;region=us2</Sip>
<Sip>sip:1777xxxxxxxxxx@in.callcentric.com;region=us2</Sip>
</Dial>
</Response>
然而,正如其他用户在评论中所报告的那样,这似乎不适用于目标是 sip 和数字混合的场景。在我的例子中,只有 phone 号码响铃。 sip 目的地根本不接电话。
有没有办法让它工作?使用垃圾箱或新的 twilio 功能?
这里是 Twilio 开发人员布道者。
无法使用多个<Sip>
nouns in a <Dial>
. From the documentation:
Currently, only one
<Sip>
noun may be specified per<Dial>
, and the INVITE message may be sent to only one SIP endpoint. Also, you cannot add any other nouns (eg<Number>
,<Client>
) in the same<Dial>
as the SIP. If you want to use another noun, set up a callback on the<Dial>
to use alternate methods.
相反,您可以使用 <Enqueue>
and dial each of the numbers/SIP addresses using the REST API. Then, when one connects, connect it to the call in the queue and disconnect the other calls. You'd need to keep a reference to the original call SID so that could connect directly to it and to each of the generated call SIDs so that you can terminate them with the REST API too.
如果有帮助请告诉我。