react-native-incall-manager icon indicating copy to clipboard operation
react-native-incall-manager copied to clipboard

Ringback plays briefly and then stops

Open danjenkins opened this issue 6 years ago • 12 comments

I need to double check with the current release of react-native-webrtc but with the M69 work thats now in master branch, ringback works on outgoing calls very briefly and then stops (before I call InCallManager.stop()) - I presume the webrtc audio session gets started and then that stops the ringback using the shared app audio instance

Have you come across this before?

danjenkins avatar Dec 04 '18 09:12 danjenkins

@danjenkins any progress on that?

ckrodrigues avatar May 31 '19 20:05 ckrodrigues

Yes, webrtc will change audio mode internally, and it's global audio session instance. To avoid this:

  • actions related to modifying audio setup should be run on the main thread ( This lib should add run on the main thread )
  • listen on audio mode change in call session and overrides it back to our desired mode. ( since webrtc changes audio preference internally )

I wonder if we can use react native's NativeModule to have more info of react-native-webrtc and cooperate more tightly as an config option.

zxcpoiu avatar Jul 03 '19 06:07 zxcpoiu

The auto mode of this library should have handled this issue. Take a glance on the source code if you are using this lib manually.

zxcpoiu avatar Jul 03 '19 06:07 zxcpoiu

Hi ! We've also upgraded to react-native-webrtc 1.69.2 and having this issue too. @danjenkins have you found a way the solve this ?

manuquentin avatar Aug 05 '19 15:08 manuquentin

hey all - sorry I havent come back to this recently! Let me test some things out this week :)

danjenkins avatar Aug 05 '19 15:08 danjenkins

I don't see this issue. :thinking:

I'm using: InCallManager.start({media: (shouldUseVideo ? 'video' : 'audio'), ringback: '_DTMF_'}); on android, and using callKit on ios

zxcpoiu avatar Aug 14 '19 09:08 zxcpoiu

Btw, both M69 and M75 works fine

zxcpoiu avatar Aug 14 '19 09:08 zxcpoiu

react-native-webrtc 1.69.2 on ios device has this issue. It is fine to call InCallManager.start when there is no webrtc connection (e.g, calling the start function after launch the app) but the ringback plays less than 1 second when there is webrtc connection.

nick76567 avatar Aug 20 '19 06:08 nick76567

But does't webrtc connection established means "Answer" in terms of telecommunication?

When the remote party send "early media" or "answered" ( which means webrtc connection established and the rtp stream is starting to send), the "ringback" should stop and play the remote rtp.

What is your scenario?

If you really need to play local ringback when rtp has established, have you tried to mute/enable=falseon all webrtc tracks first?

zxcpoiu avatar Aug 23 '19 07:08 zxcpoiu

I had this problem too. For me, the source of the problem was the moment of calling InCallManager.start(...) - if you will call this before RNCallKeep didActivateAudioSession event, it will cut the sound in the moment of activating the audio session.

Originally I placed the InCallManager.start(...) in the didActivateAudioSession listener but I had other problems with unlocking the screen described in this issue: https://github.com/react-native-webrtc/react-native-callkeep/issues/231.

As a final solution, I just wait until the didActivateAudioSession event occurs and then call InCallManager.start(...). Now it works like a charm. :)

Hope that it helps somebody.

PS. Thx for the great library!

swiety85 avatar Sep 09 '20 09:09 swiety85

Thanks this solved my problem!

jikseyres16 avatar Jul 21 '22 09:07 jikseyres16

@swiety85 , hi, did u call InCallManager.start(...) in outgoing case? In this case i dont have any method to trigger 'configAudioSession' method

fukemy avatar Oct 24 '22 09:10 fukemy