Skip to content

Commit

Permalink
ref: Remove startCallStats.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Nov 20, 2023
1 parent 0e560fc commit 86bb00e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
26 changes: 0 additions & 26 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -2256,14 +2256,6 @@ JitsiConference.prototype._acceptJvbIncomingCall = function(jingleSession, jingl
this._desktopSharingFrameRate
&& jingleSession.peerconnection.setDesktopSharingFrameRate(this._desktopSharingFrameRate);

// Start callstats as soon as peerconnection is initialized,
// do not wait for XMPPEvents.PEERCONNECTION_READY, as it may never
// happen in case if user doesn't have or denied permission to
// both camera and microphone.
logger.info('Starting CallStats for JVB connection...');
this.statistics.startCallStats(
this.jvbJingleSession.peerconnection,
'jitsi' /* Remote user ID for JVB is 'jitsi' */);
this.statistics.startRemoteStats(this.jvbJingleSession.peerconnection);
} catch (e) {
GlobalOnErrorHandler.callErrorHandler(e);
Expand Down Expand Up @@ -3006,10 +2998,6 @@ JitsiConference.prototype._acceptP2PIncomingCall = function(jingleSession, jingl
remoteID = participant.getStatsID() || remoteID;
}

this.statistics.startCallStats(
this.p2pJingleSession.peerconnection,
remoteID);

const localTracks = this._getInitialLocalTracks();

this.p2pJingleSession.acceptOffer(
Expand Down Expand Up @@ -3353,20 +3341,6 @@ JitsiConference.prototype._startP2PSession = function(remoteJid) {
enableInsertableStreams: this.isE2EEEnabled() || FeatureFlags.isRunInLiteModeEnabled()
});

logger.info('Starting CallStats for P2P connection...');

let remoteID = Strophe.getResourceFromJid(this.p2pJingleSession.remoteJid);

const participant = this.participants.get(remoteID);

if (participant) {
remoteID = participant.getStatsID() || remoteID;
}

this.statistics.startCallStats(
this.p2pJingleSession.peerconnection,
remoteID);

const localTracks = this.getLocalTracks();

this.p2pJingleSession.invite(localTracks);
Expand Down
36 changes: 0 additions & 36 deletions modules/statistics/statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,42 +484,6 @@ Statistics.prototype.stopRemoteStats = function(tpc) {

// CALSTATS METHODS

/**
* Initializes the callstats.io API.
* @param {TraceablePeerConnection} tpc the {@link TraceablePeerConnection}
* instance for which CalStats will be started.
* @param {string} remoteUserID
*/
Statistics.prototype.startCallStats = function(tpc, remoteUserID) {
if (!this.callStatsIntegrationEnabled) {
return;
} else if (this.callsStatsInstances.has(tpc.id)) {
logger.error('CallStats instance for ${tpc} exists already');

return;
}
let confID = this.options.confID;

// confID - domain/tenant/roomName
// roomName - meeting name or breakout room ID
// For breakout rooms we change the conference ID used for callstats to use
// the room ID instead of the meeting name
if (!confID.endsWith(this.options.roomName)) {
confID = `${this.options.confID.slice(0, this.options.confID.lastIndexOf('/'))}/${this.options.roomName}`;
}

logger.info(`Starting CallStats for ${tpc}...`);
const newInstance
= new CallStats(
tpc,
{
confID,
remoteUserID
});

this.callsStatsInstances.set(tpc.id, newInstance);
};

/**
* Obtains the list of *all* {@link CallStats} instances collected from every
* valid {@link Statistics} instance.
Expand Down

0 comments on commit 86bb00e

Please sign in to comment.