fix(audio): correct log the time needed for ice gathering

This commit is contained in:
Mario Jr 2021-07-15 10:46:49 -03:00
parent 5fcbe5f477
commit f5713869bf

View File

@ -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: {