Twllio : Play Sound during call

2019-09-12 06:45发布

问题:

I want play sound during call, so receiver will able to listen that sound.

Suppose, I am in office, And I want play sound of traffic during Twilio Call. Is this possible using Twilio in iOS ?

If I select button to play traffic sound, then only receiver can able to listen the same. If receiver select to play sound of Party, then only caller can listen that sound, not both the parties.

If yes, What are the possible ways to implement the same.

回答1:

Twilio developer evangelist here.

You could use <Conference> in this scenario. You would then dial both of your callers into a conference. Then have Twilio dial a third call into that conference and have that call <Play> the audio into the conference.

That however will play to all the parties on the call (i.e. both caller and receiver will be able to hear the third party call). You could then add logic to your application using the <Gather> verb to check whether a button has been pressed and then drop that third party call and add another one.

I know this doesn't do everything you want as it will play on both sides, but is very close to what you're trying to do.

Hope this helps you