From e9ae99c1c92a7ec1e6fdac6c2ff685d45c2b0f80 Mon Sep 17 00:00:00 2001 From: Marcos Mariani Date: Wed, 28 Feb 2024 21:44:39 +0100 Subject: [PATCH] fix: config iceStopWaitingOnServerReflexive is resetting the peerConnectionDelegate When enabling the `iceStopWaitingOnServerReflexive` configuration and you have a custom sessionDescriptionHandler with custom peerConnectionDelegate, it gets erased. As in the code forces the delegate to be the one set when that config is enabled... --- src/platform/web/session-manager/session-manager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/web/session-manager/session-manager.ts b/src/platform/web/session-manager/session-manager.ts index 24a21a317..b39e9f8d2 100644 --- a/src/platform/web/session-manager/session-manager.ts +++ b/src/platform/web/session-manager/session-manager.ts @@ -571,7 +571,9 @@ export class SessionManager { throw new Error("Session description handler not instance of SessionDescriptionHandler"); } sessionDescriptionHandler.peerConnectionDelegate = { + ...sessionDescriptionHandler.peerConnectionDelegate, onicecandidate: (event) => { + sessionDescriptionHandler.peerConnectionDelegate?.onicecandidate?.(event) if (event.candidate?.type === "srflx") { this.logger.log(`[${inviter.id}] Found srflx ICE candidate, stop waiting...`); // In sip.js > 0.20.1 this cast should be removed as iceGatheringComplete will be public