fix: fix glare side effects for group calls.
This commit is contained in:
parent
0eb8dc96c1
commit
0deb8d9e6e
|
|
@ -422,6 +422,7 @@ class CallSession {
|
||||||
|
|
||||||
Future<void> initWithInvite(CallType type, RTCSessionDescription offer,
|
Future<void> initWithInvite(CallType type, RTCSessionDescription offer,
|
||||||
SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) async {
|
SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) async {
|
||||||
|
if (!isGroupCall) {
|
||||||
// glare fixes
|
// glare fixes
|
||||||
final prevCallId = voip.incomingCallRoomId[room.id];
|
final prevCallId = voip.incomingCallRoomId[room.id];
|
||||||
if (prevCallId != null) {
|
if (prevCallId != null) {
|
||||||
|
|
@ -453,6 +454,7 @@ class CallSession {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await _preparePeerConnection();
|
await _preparePeerConnection();
|
||||||
if (metadata != null) {
|
if (metadata != null) {
|
||||||
|
|
@ -1082,10 +1084,11 @@ class CallSession {
|
||||||
if (!isGroupCall) {
|
if (!isGroupCall) {
|
||||||
if (callId != voip.currentCID) return;
|
if (callId != voip.currentCID) return;
|
||||||
voip.currentCID = null;
|
voip.currentCID = null;
|
||||||
|
voip.incomingCallRoomId.removeWhere((key, value) => value == callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
voip.calls.remove(callId);
|
voip.calls.remove(callId);
|
||||||
voip.incomingCallRoomId.removeWhere((key, value) => value == callId);
|
|
||||||
await cleanUp();
|
await cleanUp();
|
||||||
if (shouldEmit) {
|
if (shouldEmit) {
|
||||||
onCallHangup.add(this);
|
onCallHangup.add(this);
|
||||||
|
|
@ -1156,8 +1159,12 @@ class CallSession {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
inviteOrAnswerSent = true;
|
inviteOrAnswerSent = true;
|
||||||
|
|
||||||
|
if (!isGroupCall) {
|
||||||
Logs().d('[glare] set callid because new invite sent');
|
Logs().d('[glare] set callid because new invite sent');
|
||||||
voip.incomingCallRoomId[room.id] = callId;
|
voip.incomingCallRoomId[room.id] = callId;
|
||||||
|
}
|
||||||
|
|
||||||
setCallState(CallState.kInviteSent);
|
setCallState(CallState.kInviteSent);
|
||||||
|
|
||||||
inviteTimer = Timer(Duration(seconds: Timeouts.callTimeoutSec), () {
|
inviteTimer = Timer(Duration(seconds: Timeouts.callTimeoutSec), () {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue