twilioconferencetwilio-programmable-voice

How can I upgrade an existing call to a conference without losing the original participants?


I need to provide my users with the ability to add a third person to their call dynamically. I know how to find the parentSid and the childSid of the call I'd like to transfer, but as soon as I update one of these sids to a twiml that contains the conference, the other sid is marked as completed and can no longer be updated. This means I can get either the first and third or second and third users into a conference, but I also drop one of the original participants.

I have tried the solution here: Twilio - How to move an existing call to a conference, but it seems to force me into the conference as soon as I dial the first participant.

I don't have the option of starting with a conference, and can't seem to update both ends of the original call. What am I missing? Thanks!


Solution

  • Twilio developer evangelist here.

    The best plan here would be to start with a conference call, so if that is something you can try to change, that would help you here.

    Otherwise, the reason one call ends straight away when the other leg is moved to the conference is that that call has nothing left in it's TwiML to execute once that call is done.

    I am presuming that you have two call legs, one that dialled into a number was connected to another because that number returned TwiML with a <Dial> element. What I would do here is to move the call that was connected using the <Dial> first. This will cause the original call to complete its <Dial>. Once a <Dial> is completed the call will look for further TwiML in the original response or will request the URL you supply as the action attribute.

    So, if you add more TwiML after the <Dial> or an action URL, you can then drop that leg of the call into a conference too. You just have to work out how to connect what the conference will be called so that the two legs agree on which room to join.

    Let me know if that helps at all.