From 96099a06a809d8dafcd4a2ef662bf3ee881e4b00 Mon Sep 17 00:00:00 2001 From: Nils Ohlmeier Date: Fri, 26 Aug 2022 11:03:08 -0700 Subject: [PATCH] feature(rtcstats): expose sendSdp as config option (#12072) * feature(rtcstats): expose sendSdp as config option * fixed linting error --- config.js | 4 ++++ react/features/rtcstats/RTCStats.js | 6 ++++-- react/features/rtcstats/middleware.js | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index 9f01e9848..f7467ee50 100644 --- a/config.js +++ b/config.js @@ -969,6 +969,10 @@ var config = { // will only send data related to RTCPeerConnection events. // rtcstatsPollInterval: 10000, + // This determines if rtcstats sends the SDP to the rtcstats server or replaces + // all SDPs with an emtpy string instead. + // rtcstatsSendSdp: false, + // Array of script URLs to load as lib-jitsi-meet "analytics handlers". // scriptURLs: [ // "libs/analytics-ga.min.js", // google-analytics diff --git a/react/features/rtcstats/RTCStats.js b/react/features/rtcstats/RTCStats.js index 4d158dd42..ca5d6f21f 100644 --- a/react/features/rtcstats/RTCStats.js +++ b/react/features/rtcstats/RTCStats.js @@ -41,11 +41,12 @@ class RTCStats { * @param {string} options.useLegacy - Switch to legacy chrome webrtc statistics. Parameter will only have * an effect on chrome based applications. * @param {number} options.pollInterval - The getstats poll interval in ms. + * @param {boolean} options.sendSdp - Determines if the client sends SDP to the rtcstats server. * @returns {void} */ init(options) { - const { endpoint, useLegacy, pollInterval } = options; + const { endpoint, useLegacy, pollInterval, sendSdp } = options; const traceOptions = { endpoint, @@ -56,7 +57,8 @@ class RTCStats { const rtcstatsOptions = { connectionFilter, pollInterval, - useLegacy + useLegacy, + sendSdp }; this.trace = traceInit(traceOptions); diff --git a/react/features/rtcstats/middleware.js b/react/features/rtcstats/middleware.js index 113500e86..dbafdbb5f 100644 --- a/react/features/rtcstats/middleware.js +++ b/react/features/rtcstats/middleware.js @@ -44,6 +44,7 @@ MiddlewareRegistry.register(store => next => action => { // Default poll interval is 10000ms and standard stats will be used, if not provided in the config. const pollInterval = analytics.rtcstatsPollInterval || 10000; const useLegacy = analytics.rtcstatsUseLegacy || false; + const sendSdp = analytics.rtcstatsSendSdp || false; // Initialize but don't connect to the rtcstats server wss, as it will start sending data for all @@ -51,7 +52,8 @@ MiddlewareRegistry.register(store => next => action => { RTCStats.init({ endpoint: analytics.rtcstatsEndpoint, useLegacy, - pollInterval + pollInterval, + sendSdp }); } catch (error) { logger.error('Failed to initialize RTCStats: ', error);