Twilio Voice. Add another participant to existing call
Asked Answered
A

1

6

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.

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?

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?

Altitude answered 12/10, 2018 at 11:20 Comment(1)
I have the same problem. Did you find any solution for this?Fingering
G
4

Twilio developer evangelist here.

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).

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.

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.

Greatgranduncle answered 23/10, 2018 at 7:51 Comment(1)
I've tried this in my own app and there's simply no separate call sid created for the receiving party on an outbound call. A calls B. Filter call list. There's just a call sid for A and not a distinct one for B. The parent call sid and the call sid are the same.Pitt

© 2022 - 2024 — McMap. All rights reserved.