|
@@ -56,6 +56,7 @@ import {
|
56
|
56
|
ACTION_P2P_FAILED,
|
57
|
57
|
ACTION_P2P_SWITCH_TO_JVB,
|
58
|
58
|
ICE_ESTABLISHMENT_DURATION_DIFF,
|
|
59
|
+ createConferenceEvent,
|
59
|
60
|
createJingleEvent,
|
60
|
61
|
createP2PEvent
|
61
|
62
|
} from './service/statistics/AnalyticsEvents';
|
|
@@ -231,6 +232,7 @@ export default function JitsiConference(options) {
|
231
|
232
|
|
232
|
233
|
this.videoSIPGWHandler = new VideoSIPGW(this.room);
|
233
|
234
|
this.recordingManager = new RecordingManager(this.room);
|
|
235
|
+ this._conferenceJoinAnalyticsEventSent = false;
|
234
|
236
|
}
|
235
|
237
|
|
236
|
238
|
// FIXME convert JitsiConference to ES6 - ASAP !
|
|
@@ -290,12 +292,12 @@ JitsiConference.prototype._init = function(options = {}) {
|
290
|
292
|
}
|
291
|
293
|
|
292
|
294
|
const { config } = this.options;
|
293
|
|
- const statsCurrentId = config.statisticsId ? config.statisticsId : Settings.callStatsUserName;
|
294
|
295
|
|
|
296
|
+ this._statsCurrentId = config.statisticsId ? config.statisticsId : Settings.callStatsUserName;
|
295
|
297
|
this.room = this.xmpp.createRoom(
|
296
|
298
|
this.options.name, {
|
297
|
299
|
...config,
|
298
|
|
- statsId: statsCurrentId
|
|
300
|
+ statsId: this._statsCurrentId
|
299
|
301
|
},
|
300
|
302
|
JitsiConference.resourceCreator
|
301
|
303
|
);
|
|
@@ -319,6 +321,9 @@ JitsiConference.prototype._init = function(options = {}) {
|
319
|
321
|
this.room.addListener(XMPPEvents.CONFERENCE_PROPERTIES_CHANGED,
|
320
|
322
|
this._updateProperties);
|
321
|
323
|
|
|
324
|
+ this._sendConferenceJoinAnalyticsEvent = this._sendConferenceJoinAnalyticsEvent.bind(this);
|
|
325
|
+ this.room.addListener(XMPPEvents.MEETING_ID_SET, this._sendConferenceJoinAnalyticsEvent);
|
|
326
|
+
|
322
|
327
|
this.rttMonitor = new RttMonitor(config.rttMonitor || {});
|
323
|
328
|
|
324
|
329
|
this.e2eping = new E2ePing(
|
|
@@ -354,7 +359,7 @@ JitsiConference.prototype._init = function(options = {}) {
|
354
|
359
|
|
355
|
360
|
if (!this.statistics) {
|
356
|
361
|
this.statistics = new Statistics(this.xmpp, {
|
357
|
|
- aliasName: statsCurrentId,
|
|
362
|
+ aliasName: this._statsCurrentId,
|
358
|
363
|
userName: config.statisticsDisplayName ? config.statisticsDisplayName : this.myUserId(),
|
359
|
364
|
callStatsConfIDNamespace: this.connection.options.hosts.domain,
|
360
|
365
|
confID: config.confID || `${this.connection.options.hosts.domain}/${this.options.name}`,
|
|
@@ -367,7 +372,7 @@ JitsiConference.prototype._init = function(options = {}) {
|
367
|
372
|
getWiFiStatsMethod: config.getWiFiStatsMethod
|
368
|
373
|
});
|
369
|
374
|
Statistics.analytics.addPermanentProperties({
|
370
|
|
- 'callstats_name': statsCurrentId
|
|
375
|
+ 'callstats_name': this._statsCurrentId
|
371
|
376
|
});
|
372
|
377
|
}
|
373
|
378
|
|
|
@@ -571,6 +576,8 @@ JitsiConference.prototype.leave = function() {
|
571
|
576
|
XMPPEvents.CONFERENCE_PROPERTIES_CHANGED,
|
572
|
577
|
this._updateProperties);
|
573
|
578
|
|
|
579
|
+ room.removeListener(XMPPEvents.MEETING_ID_SET, this._sendConferenceJoinAnalyticsEvent);
|
|
580
|
+
|
574
|
581
|
this.eventManager.removeXMPPListeners();
|
575
|
582
|
|
576
|
583
|
this.room = null;
|
|
@@ -1833,6 +1840,7 @@ JitsiConference.prototype._acceptJvbIncomingCall = function(
|
1833
|
1840
|
// Accept incoming call
|
1834
|
1841
|
this.jvbJingleSession = jingleSession;
|
1835
|
1842
|
this.room.connectionTimes['session.initiate'] = now;
|
|
1843
|
+ this._sendConferenceJoinAnalyticsEvent();
|
1836
|
1844
|
|
1837
|
1845
|
if (this.wasStopped) {
|
1838
|
1846
|
Statistics.sendAnalyticsAndLog(
|
|
@@ -2609,6 +2617,7 @@ JitsiConference.prototype._acceptP2PIncomingCall = function(
|
2609
|
2617
|
|
2610
|
2618
|
// Accept the offer
|
2611
|
2619
|
this.p2pJingleSession = jingleSession;
|
|
2620
|
+ this._sendConferenceJoinAnalyticsEvent();
|
2612
|
2621
|
|
2613
|
2622
|
this.p2pJingleSession.initialize(this.room, this.rtc, this.options.config);
|
2614
|
2623
|
|
|
@@ -2957,6 +2966,7 @@ JitsiConference.prototype._startP2PSession = function(remoteJid) {
|
2957
|
2966
|
remoteJid);
|
2958
|
2967
|
logger.info(
|
2959
|
2968
|
'Created new P2P JingleSession', this.room.myroomjid, remoteJid);
|
|
2969
|
+ this._sendConferenceJoinAnalyticsEvent();
|
2960
|
2970
|
|
2961
|
2971
|
this.p2pJingleSession.initialize(this.room, this.rtc, this.options.config);
|
2962
|
2972
|
|
|
@@ -3266,3 +3276,22 @@ JitsiConference.prototype.createVideoSIPGWSession
|
3266
|
3276
|
return this.videoSIPGWHandler
|
3267
|
3277
|
.createVideoSIPGWSession(sipAddress, displayName);
|
3268
|
3278
|
};
|
|
3279
|
+
|
|
3280
|
+/**
|
|
3281
|
+ * Sends a conference.join analytics event.
|
|
3282
|
+ *
|
|
3283
|
+ * @returns {void}
|
|
3284
|
+ */
|
|
3285
|
+JitsiConference.prototype._sendConferenceJoinAnalyticsEvent = function() {
|
|
3286
|
+ const meetingId = this.getMeetingUniqueId();
|
|
3287
|
+
|
|
3288
|
+ if (this._conferenceJoinAnalyticsEventSent || !meetingId || this.getActivePeerConnection() === null) {
|
|
3289
|
+ return;
|
|
3290
|
+ }
|
|
3291
|
+
|
|
3292
|
+ Statistics.sendAnalytics(createConferenceEvent('joined', {
|
|
3293
|
+ meetingId,
|
|
3294
|
+ participantId: `${meetingId}.${this._statsCurrentId}`
|
|
3295
|
+ }));
|
|
3296
|
+ this._conferenceJoinAnalyticsEventSent = true;
|
|
3297
|
+};
|