Avoid sending stats for ended calls

This commit is contained in:
Robert Long 2021-08-03 16:07:04 -07:00
parent 793a7b7b8f
commit 656ef334eb

View file

@ -593,6 +593,11 @@ export class ConferenceCallManager extends EventEmitter {
let statsTimeout;
const sendStats = () => {
if (call.state === "ended") {
clearTimeout(statsTimeout);
return;
}
sendWebRTCInfoEvent("stats");
statsTimeout = setTimeout(sendStats, 30 * 1000);
};
@ -626,10 +631,6 @@ export class ConferenceCallManager extends EventEmitter {
);
peerConnection.addEventListener("signalingstatechange", () => {
sendWebRTCInfoEvent("signalingstatechange");
if (peerConnection.signalingState === "closed") {
clearTimeout(statsTimeout);
}
});
}