diff --git a/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js b/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js index 2aaf7cf227..ade041f16e 100755 --- a/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js +++ b/bigbluebutton-html5/imports/api/audio/client/bridge/sip.js @@ -726,13 +726,18 @@ class SIPSession { } onIceGatheringStateChange(event) { - const secondsToGatherIce = (new Date() - this._sessionStartTime) / 1000; - const iceGatheringState = event.target ? event.target.iceGatheringState : null; + if ((iceGatheringState === 'gathering') && (!this._iceGatheringStartTime)) { + this._iceGatheringStartTime = new Date(); + } + if (iceGatheringState === 'complete') { + const secondsToGatherIce = (new Date() + - (this._iceGatheringStartTime || this._sessionStartTime)) / 1000; + logger.info({ logCode: 'sip_js_ice_gathering_time', extraInfo: {