fix: handleMissedCalls on remote hangups before answer

This commit is contained in:
td 2022-11-18 12:13:02 +05:30
parent 6b6c44187a
commit 6da10bf233
No known key found for this signature in database
GPG Key ID: F6D9E9BF14C7D103
1 changed files with 5 additions and 0 deletions

View File

@ -339,6 +339,7 @@ class CallSession {
int toDeviceSeq = 0; int toDeviceSeq = 0;
int candidateSendTries = 0; int candidateSendTries = 0;
bool get isGroupCall => groupCallId != null; bool get isGroupCall => groupCallId != null;
bool missedCall = true;
final CachedStreamController<CallSession> onCallStreamsChanged = final CachedStreamController<CallSession> onCallStreamsChanged =
CachedStreamController(); CachedStreamController();
@ -1031,6 +1032,9 @@ class CallSession {
onCallHangup.add(this); onCallHangup.add(this);
voip.delegate.handleCallEnded(this); voip.delegate.handleCallEnded(this);
fireCallEvent(CallEvent.kHangup); fireCallEvent(CallEvent.kHangup);
if ((party == CallParty.kRemote && missedCall)) {
voip.delegate.handleMissedCall(this);
}
} }
} }
@ -1167,6 +1171,7 @@ class CallSession {
localCandidates.clear(); localCandidates.clear();
remoteCandidates.clear(); remoteCandidates.clear();
setCallState(CallState.kConnected); setCallState(CallState.kConnected);
missedCall = false;
} else if (state == RTCIceConnectionState.RTCIceConnectionStateFailed) { } else if (state == RTCIceConnectionState.RTCIceConnectionStateFailed) {
hangup(CallErrorCode.IceFailed, false); hangup(CallErrorCode.IceFailed, false);
} }