From e789ab904f102628e6208fb2d753d859c9c47468 Mon Sep 17 00:00:00 2001 From: "duanweiwei1982@gmail.com" Date: Fri, 15 Jul 2022 22:34:19 +0800 Subject: [PATCH] fix: Fix currentCID is null when handleNewCall is triggered, which will cause family-app. --- lib/src/voip/voip.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/src/voip/voip.dart b/lib/src/voip/voip.dart index fc836e23..dc26ef3d 100644 --- a/lib/src/voip/voip.dart +++ b/lib/src/voip/voip.dart @@ -197,18 +197,18 @@ class VoIP { content['offer']['sdp'], content['offer']['type'], ); - await newCall - .initWithInvite( - callType, offer, sdpStreamMetadata, lifetime, confId != null) - .then((_) { - // Popup CallingPage for incoming call. - if (!delegate.isBackgroud && confId == null) { - delegate.handleNewCall(newCall); - } - onIncomingCall.add(newCall); - }); + await newCall.initWithInvite( + callType, offer, sdpStreamMetadata, lifetime, confId != null); + currentCID = callId; + // Popup CallingPage for incoming call. + if (!delegate.isBackgroud && confId == null) { + delegate.handleNewCall(newCall); + } + + onIncomingCall.add(newCall); + if (delegate.isBackgroud) { /// Forced to enable signaling synchronization until the end of the call. client.backgroundSync = true;