Closed mwaked closed 4 years ago
In current realisation it is expected behaviour, we manage one session at the same time. But ConnectyCube SDK provides possibility to work with few sessions at the same time. For example you can automatically reject new session only in case if current session’s state is BaseSession.RTCSessionState.RTC_SESSION_CONNECTED
, but in this case you should manage call screens for few calls at the same time (outgoing and new incoming). To listen changes of session state you can use:
currentCall.addSessionCallbacksListener(object : RTCSessionStateCallback<RTCSession>{
override fun onDisconnectedFromUser(rtcSession: RTCSession, userId: Int) {}
override fun onConnectedToUser(rtcSession: RTCSession, userId: Int) {}
override fun onConnectionClosedForUser(rtcSession: RTCSession, userId: Int) {}
override fun onStateChanged(rtcSession: RTCSession, state: BaseSession.RTCSessionState) {
// state was changed here
}
})
To get current session state use:
val currentState = currentCall.state
@TatankaConCube Okay thanks i will try this.
Users call each other at the same time and each one created different session at the same time!, and each one receive new session then their call close, What i can do in this case?, I want to direct connect together without closing the call if they call each other at the same time