本文介绍了特威利奥之声.将另一位参与者添加到现有通话中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个号码(Twilio 到 Twilio,或 Twilio 到任何 PTSN 号码)之间正在进行通话.这不是电话会议,只是使用 Twilio Voice 进行的普通一对一通话.

There is an ongoing call between 2 numbers (Twilio to Twilio, or Twilio to any PTSN number). It is not a conference call, just a normal 1-to-1 call using Twilio Voice.

如何将另一个人添加到该呼叫中?

How can I add another person to that call?

这是我目前的情况.我首先创建一个普通呼叫(有一个超时",然后通过动作"动词重定向到语音邮件).这是有效的,因此现在两方之间存在呼叫.

This is my current scenario.I first create a normal call (that has a ‘timeout’ and then redirects to voicemail via the ‘action’ verb).This is working, so a call now exists between 2 parties.

然后如果呼叫发起者想要添加第二个号码(即创建电话会议),我需要将呼叫发起者和第一个被叫号码移动到一个命名会议中.

Then if the call initiator wants to add a 2nd number (ie create a conference call), I need to move both the call initiator and the 1st called number into a named conference.

但是,我不知道第一个被叫号码的呼叫段的 Sid(我只知道父呼叫的 Sid),那么如何做到这一点?

However, I don’t know the Sid of the 1st called number’s leg of the call (I only know the Sid of the parent call), so how can this be done?

假设我确实设法使用 2 个初始号码创建了电话会议,我如何向会议添加更多号码,并在仅剩 1 方时自动终止会议?

Assuming I did manage to create a conference call with the 2 initial numbers, how can I add further numbers to the conference, and automatically terminate the conference when there is only 1 party left?

推荐答案

Twilio 开发人员布道者在这里.

Twilio developer evangelist here.

如果您想在通话中添加人员,那么我建议您从电话会议开始,因为这比移动两条腿要容易得多(尽管您可以通过 按ParentCallSid列出调用和过滤).

If you are looking to add people to a call, then I would recommend you start with a conference call as it's going to be much easier than moving the two legs (though you can find a call by it's parent sid by listing calls and filtering by ParentCallSid).

与呼叫者进行电话会议后,您可以通过 POST 添加新参与者向参与者端点发出请求.

Once you have a conference call with your callers in, you can add a new participant by making a POST request to the participants endpoint.

要在只剩下一名参与者时结束会议,您可以设置接收参会者离开时的会议状态回调事件.收到 webhook 后,您可以使用 会议 SID 以查看会议中有多少参与者结束,如果只剩下一个.

To end the conference when there is only one participant left, you could set up to receive conference status callback events when participants leave. When you receive the webhook you could then use the conference SID to look up how many participants are in the conference and end it if there is only one left.

让我知道这是否有帮助.

Let me know if that helps at all.

这篇关于特威利奥之声.将另一位参与者添加到现有通话中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 05:30