|
@@ -254,8 +254,14 @@ JitsiConference.prototype._init = function(options = {}) {
|
254
|
254
|
// bellow).
|
255
|
255
|
const windowLocation = window.location;
|
256
|
256
|
|
|
257
|
+ let callStatsAliasName = this.myUserId();
|
|
258
|
+
|
|
259
|
+ if (config.enableDisplayNameInStats && config.displayName) {
|
|
260
|
+ callStatsAliasName = config.displayName;
|
|
261
|
+ }
|
|
262
|
+
|
257
|
263
|
this.statistics = new Statistics(this.xmpp, {
|
258
|
|
- callStatsAliasName: this.myUserId(),
|
|
264
|
+ callStatsAliasName,
|
259
|
265
|
callStatsConfIDNamespace:
|
260
|
266
|
config.callStatsConfIDNamespace
|
261
|
267
|
|| (windowLocation && windowLocation.hostname)
|
|
@@ -263,7 +269,8 @@ JitsiConference.prototype._init = function(options = {}) {
|
263
|
269
|
callStatsCustomScriptUrl: config.callStatsCustomScriptUrl,
|
264
|
270
|
callStatsID: config.callStatsID,
|
265
|
271
|
callStatsSecret: config.callStatsSecret,
|
266
|
|
- roomName: this.options.name
|
|
272
|
+ roomName: this.options.name,
|
|
273
|
+ swapUserNameAndAlias: config.enableStatsID
|
267
|
274
|
});
|
268
|
275
|
}
|
269
|
276
|
|
|
@@ -1138,14 +1145,17 @@ JitsiConference.prototype.muteParticipant = function(id) {
|
1138
|
1145
|
* @param role the role of the participant in the MUC
|
1139
|
1146
|
* @param isHidden indicates if this is a hidden participant (system
|
1140
|
1147
|
* participant for example a recorder).
|
|
1148
|
+ * @param statsID the participant statsID (optional)
|
1141
|
1149
|
*/
|
1142
|
|
-JitsiConference.prototype.onMemberJoined = function(jid, nick, role, isHidden) {
|
|
1150
|
+JitsiConference.prototype.onMemberJoined = function(
|
|
1151
|
+ jid, nick, role, isHidden, statsID) {
|
1143
|
1152
|
const id = Strophe.getResourceFromJid(jid);
|
1144
|
1153
|
|
1145
|
1154
|
if (id === 'focus' || this.myUserId() === id) {
|
1146
|
1155
|
return;
|
1147
|
1156
|
}
|
1148
|
|
- const participant = new JitsiParticipant(jid, this, nick, isHidden);
|
|
1157
|
+ const participant
|
|
1158
|
+ = new JitsiParticipant(jid, this, nick, isHidden, statsID);
|
1149
|
1159
|
|
1150
|
1160
|
participant._role = role;
|
1151
|
1161
|
this.participants[id] = participant;
|
|
@@ -2107,9 +2117,20 @@ JitsiConference.prototype._acceptP2PIncomingCall = function(
|
2107
|
2117
|
false /* initiator */, this.room, this.rtc);
|
2108
|
2118
|
|
2109
|
2119
|
logger.info('Starting CallStats for P2P connection...');
|
|
2120
|
+
|
|
2121
|
+ let remoteID = Strophe.getResourceFromJid(this.p2pJingleSession.peerjid);
|
|
2122
|
+
|
|
2123
|
+ if (this.options.config.enableStatsID) {
|
|
2124
|
+ const participant = this.participants[remoteID];
|
|
2125
|
+
|
|
2126
|
+ if (participant) {
|
|
2127
|
+ remoteID = participant.getStatsID() || remoteID;
|
|
2128
|
+ }
|
|
2129
|
+ }
|
|
2130
|
+
|
2110
|
2131
|
this.statistics.startCallStats(
|
2111
|
2132
|
this.p2pJingleSession.peerconnection,
|
2112
|
|
- Strophe.getResourceFromJid(this.p2pJingleSession.peerjid));
|
|
2133
|
+ remoteID);
|
2113
|
2134
|
|
2114
|
2135
|
const localTracks = this.getLocalTracks();
|
2115
|
2136
|
|
|
@@ -2392,9 +2413,20 @@ JitsiConference.prototype._startP2PSession = function(peerJid) {
|
2392
|
2413
|
this.p2pJingleSession.initialize(true /* initiator */, this.room, this.rtc);
|
2393
|
2414
|
|
2394
|
2415
|
logger.info('Starting CallStats for P2P connection...');
|
|
2416
|
+
|
|
2417
|
+ let remoteID = Strophe.getResourceFromJid(this.p2pJingleSession.peerjid);
|
|
2418
|
+
|
|
2419
|
+ if (this.options.config.enableStatsID) {
|
|
2420
|
+ const participant = this.participants[remoteID];
|
|
2421
|
+
|
|
2422
|
+ if (participant) {
|
|
2423
|
+ remoteID = participant.getStatsID() || remoteID;
|
|
2424
|
+ }
|
|
2425
|
+ }
|
|
2426
|
+
|
2395
|
2427
|
this.statistics.startCallStats(
|
2396
|
2428
|
this.p2pJingleSession.peerconnection,
|
2397
|
|
- Strophe.getResourceFromJid(this.p2pJingleSession.peerjid));
|
|
2429
|
+ remoteID);
|
2398
|
2430
|
|
2399
|
2431
|
// NOTE one may consider to start P2P with the local tracks detached,
|
2400
|
2432
|
// but no data will be sent until ICE succeeds anyway. And we switch
|