MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
154 stars 67 forks source link

Is there a way to determine if an outbound call is answered? #43

Closed KendallWeihe closed 3 years ago

KendallWeihe commented 3 years ago

If so, can we add documentation to the README?

Specifically, I would like some sort of event to fire when the call receiver answers/accepts the call. I assumed that's what the CallConnected was, but it seems that is fired immediately after the CallRinging event -- rendering it essentially useless. Is this a bug?

MrHertal commented 3 years ago

Hi,

good question

I did some research and found something interesting on this page: https://twilio.github.io/twilio-voice-ios/docs/5.0.0/Classes/TVOCall.html

The caller callback behavior is affected by the answerOnBridge flag provided in the Dial verb of your TwiML application associated with this client. If the answerOnBridge flag is false, which is the default, the [TVOCallDelegate callDidConnect:] callback will be emitted immediately after [TVOCallDelegate callDidStartRinging:]. If the answerOnBridge flag is true this will cause the call to emit the [TVOCallDelegate callDidConnect:] callback only until the call is answered. See Answer on Bridge documentation for more details on how to use it with the Dial TwiML verb.

You should try to set the answerOnBridge flag to true on the Dial verb when transferring call, and listen for the event CallConnected again.

KendallWeihe commented 3 years ago

Ah yes this did the trick. Thanks @MrHertal!

saurabh874 commented 2 years ago

but in this case we are not getting default ringtone,busytone if callee not accept the call or decline the call @KendallWeihe @MrHertal if set the answerOnBridge flag to true on the Dial verb then i am not getting default ringing. please help me.

MrHertal commented 2 years ago

Hi @saurabh874 ,

I think you can configure the ringtone with another attribute on the Dial verb, check Twilio documentation.

saurabh874 commented 2 years ago

@MrHertal nope I did not get any attribute to resolved ringBack tone issue , along with it we are even not able to hear any automated msgs(in case of call disconnected from callee end or call not answered from callee end ) if passing answerOnBridge as true.

is anyone have any solution for same?