Question

I am joining two callers together by calling the first and then in the URL Response TwiML I am dialing the second number. How can I Say a message to both parties after the second phone has picked up?

Was it helpful?

Solution

Twilio evangelist here.

I think this depends on the specific experience you want to give. For clarity, lets define the two callers as Caller A (the initial caller) and Caller B (the person dialed after Caller A dials in).

Option A

So one option could be to Say the message to Caller A before dialing Caller B. Then when you <Dial> Caller B, set the url attribute of the <Number> noun which lets you give Twilio some TwiML to execute to Caller B before Callers A and B are connected.

The downside to this is the parties will hear the message at different times, and you might not want Caller A to hear the message unless they actually get connected to Caller B.

Option B

Another option would be to leverage a <Conference>. With this option when Caller A dials in you drop them into a Conference instead of Dialing Caller B. Then use the API to make an outbound call to Caller B. When Caller B answers, you drop them into the same Conference as Caller A.

Once Caller B is added to the conference you can have Twilio itself call into that Conference and Say something into it. This SO post shows how to Say something into a Conference:

Use Say verb to all Conference participants

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top