Move Twilio call to a conference room

时光怂恿深爱的人放手 提交于 2019-12-14 03:55:09

问题


How do I move the two parties involved on the call to a conference room at the same time?

I started the call through the Web SDK, thus the call started from a <Dial> element.

Now I have the ParentCallSid and ChildCallSid to identify each party.

But using the Twilio's PHP library, I can't seem to find how I can move both parties to a new URL (which would start the conference) at the same time.

And if I try to move only one at a time, the moment I move one party Twilio hangs up the other party, probably because it was left alone on the call. And the party I moved is successfully transferred to the conference.

On Twilio's docs there's no example of doing it. I've tried passing an array, passing a string separated with spaces, chaining the calls() method, but no luck. Couldn't find the docs of that method as well.


回答1:


Twilio evangelist here.

Think the best option would be to just put them in a <Conference> at the start of the call if you can. Doing that is pretty simple. You drop the incoming call in the the conference, then using the REST API, you initiate the outgoing call to the second party. When they answer you drop them into the same conference.

If that's not an option, what you'll need to do is use the REST API to redirect each call leg into the conference. Redirect lets you tell Twilio to go get a new set of TwiML to execute for a specific call SID. In your case you want that TwiML to be something like:

<Response>
    <Dial>
        <Conference>BrayansBestConferenceEvar</Conference>
    </Dial>
</Response>

Check out Modifying Live Calls in our docs for more info.

Hope that helps.



来源:https://stackoverflow.com/questions/39168447/move-twilio-call-to-a-conference-room

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!