Fix call screen stuck with some hanging up scenarios #4026
This commit is contained in:
parent
bd9a187597
commit
226b0e6c9d
1
changelog.d/4026.bugfix
Normal file
1
changelog.d/4026.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix call screen stuck with some hanging up scenarios
|
@ -810,17 +810,19 @@ class WebRtcCall(
|
||||
}
|
||||
}
|
||||
|
||||
fun endCall(reason: EndCallReason = EndCallReason.USER_HANGUP) {
|
||||
fun endCall(reason: EndCallReason = EndCallReason.USER_HANGUP, sendSignaling: Boolean = true) {
|
||||
sessionScope?.launch(dispatcher) {
|
||||
if (mxCall.state is CallState.Ended) {
|
||||
return@launch
|
||||
}
|
||||
val reject = mxCall.state is CallState.LocalRinging
|
||||
terminate(reason, reject)
|
||||
if (reject) {
|
||||
mxCall.reject()
|
||||
} else {
|
||||
mxCall.hangUp(reason)
|
||||
if (sendSignaling) {
|
||||
if (reject) {
|
||||
mxCall.reject()
|
||||
} else {
|
||||
mxCall.hangUp(reason)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -424,7 +424,11 @@ class WebRtcCallManager @Inject constructor(
|
||||
|
||||
override fun onCallManagedByOtherSession(callId: String) {
|
||||
Timber.tag(loggerTag.value).v("onCallManagedByOtherSession: $callId")
|
||||
onCallEnded(callId, EndCallReason.ANSWERED_ELSEWHERE, false)
|
||||
val call = callsByCallId[callId]
|
||||
?: return Unit.also {
|
||||
Timber.tag(loggerTag.value).w("onCallManagedByOtherSession for non active call? $callId")
|
||||
}
|
||||
call.endCall(EndCallReason.ANSWERED_ELSEWHERE, sendSignaling = false)
|
||||
}
|
||||
|
||||
override fun onCallAssertedIdentityReceived(callAssertedIdentityContent: CallAssertedIdentityContent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user