ConnectyCube / android-messenger-app

Chat and voice / video calling app using ConnectyCube
https://connectycube.com
Apache License 2.0
51 stars 23 forks source link

Call Issue when logged in a same user in multiple devices #66

Closed sapkotamadhusudan closed 4 years ago

sapkotamadhusudan commented 4 years ago

I've installed the the android-messenger-app in three device. and in two of the device i logged in with same user and with other one device i've logged in with other account and started the call.

devices: deviceA, deviceB, deviceC users: X,Y

deviceA and deviceB is logged as X deviceC is logged in as Y

when Y calls the user X, deviceA and deviceB receives the call and after i accepted the call from deviceA, no event is triggered in deviceB that same user accepted call from another device. and also when deviceB rejects the after deviceA accepted, call will disconnected from both deviceB, and deviceC

i've looked into the react-native-connectycube sdk too, there was a event callback i.e Connectycube.videochat.onStopCallListener()

Is there any alternative event callback in react-native-android sdk.

TatankaConCube commented 4 years ago

In Android SDK we have similar callbacks:

/**
 * Called in case when opponent has rejected your call
 */
override fun onCallRejectByUser(session: RTCSession, userId: Int, userInfo: MutableMap<String, String>?) {}

and

/**
 * Called in case when opponent hung up
 */
override fun onReceiveHangUpFromUser(session: RTCSession, userId: Int, userInfo: MutableMap<String, String>?) {}

More info you can found in our documentation.

sapkotamadhusudan commented 4 years ago

@TatankaConCube thanks for the info, but i've tried using these events. It works for the call initiator i.e. deviceC. But in my case deviceA and deviceB and are opponents with same user logged in, and none of the following events are invoked to the deviceB after deviceA accepted or rejected the call.

I deviceA rejects the call, onCallRejectByUser event will be invoked in deviceC but in deviceB no events are invoked. I've tried this in the sample application.

I want to dismiss the incoming call screen when same user accepts the call from another device.

/**
 * Called in case when opponent has rejected your call
 */
override fun onCallRejectByUser(session: RTCSession, userId: Int, userInfo: MutableMap<String, String>?) {}

And

/**
 * Called in case when opponent hung up
 */
override fun onReceiveHangUpFromUser(session: RTCSession, userId: Int, userInfo: MutableMap<String, String>?) {}

And

/**
 * Called in case when opponent accept the call
 */
override fun onCallAcceptByUser(session: RTCSession, userId: Int, userInfo: MutableMap<String, String>?) {}
TatankaConCube commented 4 years ago

As a variant you can organise additional signalling via System messages feature. Oriented logic will be:

sapkotamadhusudan commented 4 years ago

@TatankaConCube Thank you very much. I did implemented the purposed solution, it worked :)