fix: set cid before initWithInvite to handle getUserMedia exception correctly

This commit is contained in:
Karthikeyan S 2023-12-04 17:41:16 +05:30
parent c24b329146
commit 0811b8911b
No known key found for this signature in database
GPG Key ID: 4F1848CCEEF73BCD
1 changed files with 6 additions and 2 deletions

View File

@ -258,11 +258,15 @@ class VoIP {
await delegate.playRingtone();
}
// When getUserMedia throws an exception, we handle it by terminating the call,
// and all this happens inside initWithInvite. If we set currentCID after
// initWithInvite, we might set it to callId even after it was reset to null
// by terminate.
currentCID = callId;
await newCall.initWithInvite(
callType, offer, sdpStreamMetadata, lifetime, confId != null);
currentCID = callId;
// Popup CallingPage for incoming call.
if (confId == null && !newCall.callHasEnded) {
await delegate.handleNewCall(newCall);