From 6da10bf2338f7a2f1be270c5fc43dff8cdf52e9b Mon Sep 17 00:00:00 2001 From: td Date: Fri, 18 Nov 2022 12:13:02 +0530 Subject: [PATCH] fix: handleMissedCalls on remote hangups before answer --- lib/src/voip/call.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/voip/call.dart b/lib/src/voip/call.dart index 5382ce9f..8ed6c19a 100644 --- a/lib/src/voip/call.dart +++ b/lib/src/voip/call.dart @@ -339,6 +339,7 @@ class CallSession { int toDeviceSeq = 0; int candidateSendTries = 0; bool get isGroupCall => groupCallId != null; + bool missedCall = true; final CachedStreamController onCallStreamsChanged = CachedStreamController(); @@ -1031,6 +1032,9 @@ class CallSession { onCallHangup.add(this); voip.delegate.handleCallEnded(this); fireCallEvent(CallEvent.kHangup); + if ((party == CallParty.kRemote && missedCall)) { + voip.delegate.handleMissedCall(this); + } } } @@ -1167,6 +1171,7 @@ class CallSession { localCandidates.clear(); remoteCandidates.clear(); setCallState(CallState.kConnected); + missedCall = false; } else if (state == RTCIceConnectionState.RTCIceConnectionStateFailed) { hangup(CallErrorCode.IceFailed, false); }