onsip / SIP.js

A simple, intuitive, and powerful JavaScript signaling library
https://sipjs.com
MIT License
1.84k stars 693 forks source link

fix: iceStopWaitingOnServerReflexive is resetting the peerConnectionDelegate #1070

Open iomariani opened 4 months ago

iomariani commented 4 months ago

When enabling the iceStopWaitingOnServerReflexive configuration and you have a custom sessionDescriptionHandler with custom peerConnectionDelegate, it gets erased.

In the code the delegate is rewritten to the one defined, without using the original delegates.

This fix simply merges the previous peerConnectionDelegate, if exists, to the new peerConnectionDelegate.

https://github.com/onsip/SIP.js/blob/e9ae99c1c92a7ec1e6fdac6c2ff685d45c2b0f80/src/platform/web/session-manager/session-manager.ts#L573-L576