versatica / JsSIP

JsSIP, the JavaScript SIP library
https://jssip.net
Other
2.4k stars 740 forks source link

Prevent repeated ICE finish #800

Closed pschichtel closed 10 months ago

pschichtel commented 1 year ago

This is something I noticed while implementing a rudimentary ICE gathering timeout (see #432). As you can see here, I defer the call to IceCandidateEvent.ready by a configurable timeout. If that timeout is elapses after the iceGatheringState changed to completed, then ready will be called twice.

All other calls to the ready function in RTCSession.js are already conditional on the finished variable, I simply pushed that condition into the function.

jmillan commented 10 months ago

thanks @pschichtel 👍