diff --git a/modules/statistics/statistics.js b/modules/statistics/statistics.js index b84fd0d30..adbf840f7 100644 --- a/modules/statistics/statistics.js +++ b/modules/statistics/statistics.js @@ -113,5 +113,25 @@ export default { CallStats.sendAddIceCandidateFailed(e, pc); } ); + }, + /** + * FIXME: + * Currently used by torture. If we are removing this, torture needs to + * be fixed also. + * + * Obtains audio level reported in the stats for specified peer. + * @param peerJid full MUC jid of the user for whom we want to obtain last + * audio level. + * @param ssrc the SSRC of audio stream for which we want to obtain audio + * level. + * @returns {*} a float form 0 to 1 that represents current audio level or + * null if for any reason the value is not available + * at this time. + */ + getPeerSSRCAudioLevel: function (peerJid, ssrc) { + + var peerStats = rtpStats.jid2stats[peerJid]; + + return peerStats ? peerStats.ssrc2AudioLevel[ssrc] : null; } };