|
@@ -1,54 +1,55 @@
|
1
|
1
|
/* global __filename, $, Promise */
|
2
|
2
|
import { Strophe } from 'strophe.js';
|
3
|
3
|
|
4
|
|
-import {
|
5
|
|
- ACTION_JINGLE_RESTART,
|
6
|
|
- ACTION_JINGLE_SI_RECEIVED,
|
7
|
|
- ACTION_JINGLE_SI_TIMEOUT,
|
8
|
|
- ACTION_JINGLE_TERMINATE,
|
9
|
|
- ACTION_P2P_ESTABLISHED,
|
10
|
|
- ACTION_P2P_FAILED,
|
11
|
|
- ACTION_P2P_SWITCH_TO_JVB,
|
12
|
|
- ICE_ESTABLISHMENT_DURATION_DIFF,
|
13
|
|
- createJingleEvent,
|
14
|
|
- createP2PEvent
|
15
|
|
-} from './service/statistics/AnalyticsEvents';
|
16
|
|
-import AvgRTPStatsReporter from './modules/statistics/AvgRTPStatsReporter';
|
17
|
|
-import ComponentsVersions from './modules/version/ComponentsVersions';
|
18
|
|
-import ConnectionQuality from './modules/connectivity/ConnectionQuality';
|
19
|
|
-import E2ePing from './modules/e2eping/e2eping';
|
20
|
|
-import { getLogger } from 'jitsi-meet-logger';
|
21
|
|
-import GlobalOnErrorHandler from './modules/util/GlobalOnErrorHandler';
|
22
|
4
|
import EventEmitter from 'events';
|
23
|
|
-import authenticateAndUpgradeRole from './authenticateAndUpgradeRole';
|
|
5
|
+import { getLogger } from 'jitsi-meet-logger';
|
|
6
|
+import isEqual from 'lodash.isequal';
|
|
7
|
+
|
24
|
8
|
import * as JitsiConferenceErrors from './JitsiConferenceErrors';
|
25
|
9
|
import JitsiConferenceEventManager from './JitsiConferenceEventManager';
|
26
|
10
|
import * as JitsiConferenceEvents from './JitsiConferenceEvents';
|
27
|
|
-import JitsiDTMFManager from './modules/DTMF/JitsiDTMFManager';
|
28
|
11
|
import JitsiParticipant from './JitsiParticipant';
|
29
|
12
|
import JitsiTrackError from './JitsiTrackError';
|
30
|
13
|
import * as JitsiTrackErrors from './JitsiTrackErrors';
|
31
|
14
|
import * as JitsiTrackEvents from './JitsiTrackEvents';
|
32
|
|
-import Jvb121EventGenerator from './modules/event/Jvb121EventGenerator';
|
33
|
|
-import * as MediaType from './service/RTC/MediaType';
|
34
|
|
-import ParticipantConnectionStatusHandler
|
35
|
|
- from './modules/connectivity/ParticipantConnectionStatus';
|
|
15
|
+import authenticateAndUpgradeRole from './authenticateAndUpgradeRole';
|
|
16
|
+import JitsiDTMFManager from './modules/DTMF/JitsiDTMFManager';
|
36
|
17
|
import P2PDominantSpeakerDetection from './modules/P2PDominantSpeakerDetection';
|
37
|
18
|
import RTC from './modules/RTC/RTC';
|
|
19
|
+import TalkMutedDetection from './modules/TalkMutedDetection';
|
38
|
20
|
import browser from './modules/browser';
|
39
|
|
-import * as RTCEvents from './service/RTC/RTCEvents';
|
|
21
|
+import ConnectionQuality from './modules/connectivity/ConnectionQuality';
|
|
22
|
+import ParticipantConnectionStatusHandler
|
|
23
|
+ from './modules/connectivity/ParticipantConnectionStatus';
|
|
24
|
+import E2ePing from './modules/e2eping/e2eping';
|
|
25
|
+import Jvb121EventGenerator from './modules/event/Jvb121EventGenerator';
|
|
26
|
+import RecordingManager from './modules/recording/RecordingManager';
|
|
27
|
+import RttMonitor from './modules/rttmonitor/rttmonitor';
|
|
28
|
+import AvgRTPStatsReporter from './modules/statistics/AvgRTPStatsReporter';
|
|
29
|
+import SpeakerStatsCollector from './modules/statistics/SpeakerStatsCollector';
|
40
|
30
|
import Statistics from './modules/statistics/statistics';
|
41
|
|
-import TalkMutedDetection from './modules/TalkMutedDetection';
|
42
|
31
|
import Transcriber from './modules/transcription/transcriber';
|
43
|
|
-import VideoType from './service/RTC/VideoType';
|
44
|
|
-import RecordingManager from './modules/recording/RecordingManager';
|
|
32
|
+import GlobalOnErrorHandler from './modules/util/GlobalOnErrorHandler';
|
|
33
|
+import ComponentsVersions from './modules/version/ComponentsVersions';
|
45
|
34
|
import VideoSIPGW from './modules/videosipgw/VideoSIPGW';
|
46
|
35
|
import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
|
47
|
|
-import * as XMPPEvents from './service/xmpp/XMPPEvents';
|
48
|
36
|
import { JITSI_MEET_MUC_TYPE } from './modules/xmpp/ChatRoom';
|
49
|
|
-import RttMonitor from './modules/rttmonitor/rttmonitor';
|
50
|
|
-
|
51
|
|
-import SpeakerStatsCollector from './modules/statistics/SpeakerStatsCollector';
|
|
37
|
+import * as MediaType from './service/RTC/MediaType';
|
|
38
|
+import * as RTCEvents from './service/RTC/RTCEvents';
|
|
39
|
+import VideoType from './service/RTC/VideoType';
|
|
40
|
+import {
|
|
41
|
+ ACTION_JINGLE_RESTART,
|
|
42
|
+ ACTION_JINGLE_SI_RECEIVED,
|
|
43
|
+ ACTION_JINGLE_SI_TIMEOUT,
|
|
44
|
+ ACTION_JINGLE_TERMINATE,
|
|
45
|
+ ACTION_P2P_ESTABLISHED,
|
|
46
|
+ ACTION_P2P_FAILED,
|
|
47
|
+ ACTION_P2P_SWITCH_TO_JVB,
|
|
48
|
+ ICE_ESTABLISHMENT_DURATION_DIFF,
|
|
49
|
+ createJingleEvent,
|
|
50
|
+ createP2PEvent
|
|
51
|
+} from './service/statistics/AnalyticsEvents';
|
|
52
|
+import * as XMPPEvents from './service/xmpp/XMPPEvents';
|
52
|
53
|
|
53
|
54
|
const logger = getLogger(__filename);
|
54
|
55
|
|
|
@@ -142,6 +143,9 @@ export default function JitsiConference(options) {
|
142
|
143
|
// the restart.
|
143
|
144
|
this.wasStopped = false;
|
144
|
145
|
|
|
146
|
+ // Conference properties, maintained by jicofo.
|
|
147
|
+ this.properties = {};
|
|
148
|
+
|
145
|
149
|
/**
|
146
|
150
|
* The object which monitors local and remote connection statistics (e.g.
|
147
|
151
|
* sending bitrate) and calculates a number which represents the connection
|
|
@@ -254,6 +258,10 @@ JitsiConference.prototype._init = function(options = {}) {
|
254
|
258
|
|
255
|
259
|
this.room.updateDeviceAvailability(RTC.getDeviceAvailability());
|
256
|
260
|
|
|
261
|
+ this._updateProperties = this._updateProperties.bind(this);
|
|
262
|
+ this.room.addListener(XMPPEvents.CONFERENCE_PROPERTIES_CHANGED,
|
|
263
|
+ this._updateProperties);
|
|
264
|
+
|
257
|
265
|
this.rttMonitor = new RttMonitor(config.rttMonitor || {});
|
258
|
266
|
|
259
|
267
|
this.e2eping = new E2ePing(
|
|
@@ -457,6 +465,10 @@ JitsiConference.prototype.leave = function() {
|
457
|
465
|
XMPPEvents.CONNECTION_ESTABLISHED,
|
458
|
466
|
this._onIceConnectionEstablished);
|
459
|
467
|
|
|
468
|
+ room.removeListener(
|
|
469
|
+ XMPPEvents.CONFERENCE_PROPERTIES_CHANGED,
|
|
470
|
+ this._updateProperties);
|
|
471
|
+
|
460
|
472
|
this.room = null;
|
461
|
473
|
|
462
|
474
|
return room.leave().catch(error => {
|
|
@@ -1623,6 +1635,15 @@ JitsiConference.prototype._acceptJvbIncomingCall = function(
|
1623
|
1635
|
createJingleEvent(ACTION_JINGLE_RESTART, { p2p: false }));
|
1624
|
1636
|
}
|
1625
|
1637
|
|
|
1638
|
+ const serverRegion
|
|
1639
|
+ = $(jingleOffer)
|
|
1640
|
+ .find('>server-region[xmlns="http://jitsi.org/protocol/focus"]')
|
|
1641
|
+ .attr('region');
|
|
1642
|
+
|
|
1643
|
+ this.eventEmitter.emit(
|
|
1644
|
+ JitsiConferenceEvents.SERVER_REGION_CHANGED,
|
|
1645
|
+ serverRegion);
|
|
1646
|
+
|
1626
|
1647
|
this._maybeClearSITimeout();
|
1627
|
1648
|
Statistics.sendAnalytics(createJingleEvent(
|
1628
|
1649
|
ACTION_JINGLE_SI_RECEIVED,
|
|
@@ -2530,6 +2551,56 @@ JitsiConference.prototype._onIceConnectionEstablished = function(
|
2530
|
2551
|
|
2531
|
2552
|
};
|
2532
|
2553
|
|
|
2554
|
+/**
|
|
2555
|
+ * Called when the chat room reads a new list of properties from jicofo's
|
|
2556
|
+ * presence. The properties may have changed, but they don't have to.
|
|
2557
|
+ *
|
|
2558
|
+ * @param {Object} properties - The properties keyed by the property name
|
|
2559
|
+ * ('key').
|
|
2560
|
+ * @private
|
|
2561
|
+ */
|
|
2562
|
+JitsiConference.prototype._updateProperties = function(properties = {}) {
|
|
2563
|
+ const changed = isEqual(properties, this.properties);
|
|
2564
|
+
|
|
2565
|
+ this.properties = properties;
|
|
2566
|
+ if (changed) {
|
|
2567
|
+ this.eventEmitter.emit(
|
|
2568
|
+ JitsiConferenceEvents.PROPERTIES_CHANGED,
|
|
2569
|
+ this.properties);
|
|
2570
|
+
|
|
2571
|
+ // Some of the properties need to be added to analytics events.
|
|
2572
|
+ const analyticsKeys = [
|
|
2573
|
+
|
|
2574
|
+ // The number of jitsi-videobridge instances currently used for the
|
|
2575
|
+ // conference.
|
|
2576
|
+ 'bridge-count',
|
|
2577
|
+
|
|
2578
|
+ // The conference creation time (set by jicofo).
|
|
2579
|
+ 'created-ms',
|
|
2580
|
+ 'octo-enabled'
|
|
2581
|
+ ];
|
|
2582
|
+
|
|
2583
|
+ analyticsKeys.forEach(key => {
|
|
2584
|
+ if (this.properties[key]
|
|
2585
|
+ && this.properties[key].value !== undefined) {
|
|
2586
|
+ Statistics.analytics.addPermanentProperties({
|
|
2587
|
+ [key.replace('-', '_')]: properties[key].value
|
|
2588
|
+ });
|
|
2589
|
+ }
|
|
2590
|
+ });
|
|
2591
|
+ }
|
|
2592
|
+};
|
|
2593
|
+
|
|
2594
|
+/**
|
|
2595
|
+ * Gets a conference property with a given key.
|
|
2596
|
+ *
|
|
2597
|
+ * @param {string} key - The key.
|
|
2598
|
+ * @returns {*} The value
|
|
2599
|
+ */
|
|
2600
|
+JitsiConference.prototype.getProperty = function(key) {
|
|
2601
|
+ return this.properties[key];
|
|
2602
|
+};
|
|
2603
|
+
|
2533
|
2604
|
/**
|
2534
|
2605
|
* Clears the deferred start P2P task if it has been scheduled.
|
2535
|
2606
|
* @private
|