Merge pull request #1630 from famedly/karthi/handle-getusermedia-exception
fix: set cid before initWithInvite to properly end call on getUserMedia exception
This commit is contained in:
commit
03ade5583f
|
|
@ -258,11 +258,15 @@ class VoIP {
|
||||||
await delegate.playRingtone();
|
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(
|
await newCall.initWithInvite(
|
||||||
callType, offer, sdpStreamMetadata, lifetime, confId != null);
|
callType, offer, sdpStreamMetadata, lifetime, confId != null);
|
||||||
|
|
||||||
currentCID = callId;
|
|
||||||
|
|
||||||
// Popup CallingPage for incoming call.
|
// Popup CallingPage for incoming call.
|
||||||
if (confId == null && !newCall.callHasEnded) {
|
if (confId == null && !newCall.callHasEnded) {
|
||||||
await delegate.handleNewCall(newCall);
|
await delegate.handleNewCall(newCall);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue