Skip to content

Commit

Permalink
fix: config iceStopWaitingOnServerReflexive is resetting the peerConn…
Browse files Browse the repository at this point in the history
…ectionDelegate

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...
  • Loading branch information
iomariani authored Feb 28, 2024
1 parent 2e1c525 commit e9ae99c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/platform/web/session-manager/session-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9ae99c

Please sign in to comment.