2
votes

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.

2

2 Answers

3
votes

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.

1
votes

I've recently been using their API and if you add a pause after your initial dial command to connect to a call, then when you issue a command to move the child call and the parent right after, the call will be active for the move to register in their system. I use a 2 second pause for this.