@webex/plugin-meetings 3.12.0-task-refactor.1 → 3.12.0-webex-services-ready.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +197 -0
- package/dist/aiEnableRequest/index.js.map +1 -0
- package/dist/aiEnableRequest/utils.js +36 -0
- package/dist/aiEnableRequest/utils.js.map +1 -0
- package/dist/annotation/index.js +14 -5
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/index.js +26 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +9 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +59 -10
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +34 -0
- package/dist/hashTree/constants.js.map +1 -0
- package/dist/hashTree/hashTree.js +533 -0
- package/dist/hashTree/hashTree.js.map +1 -0
- package/dist/hashTree/hashTreeParser.js +2068 -36
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +13 -3
- package/dist/hashTree/types.js.map +1 -1
- package/dist/hashTree/utils.js +111 -0
- package/dist/hashTree/utils.js.map +1 -0
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/constant.js +12 -0
- package/dist/interceptors/constant.js.map +1 -0
- package/dist/interceptors/dataChannelAuthToken.js +350 -0
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
- package/dist/interceptors/index.js +7 -0
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/locusRouteToken.js +27 -5
- package/dist/interceptors/locusRouteToken.js.map +1 -1
- package/dist/interceptors/utils.js +27 -0
- package/dist/interceptors/utils.js.map +1 -0
- package/dist/interpretation/index.js +11 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +11 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +896 -277
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +1 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +72 -3
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +5 -2
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +11 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2075 -1096
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +168 -5
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +369 -173
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +127 -25
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +20 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +40 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +11 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +64 -68
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +11 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +171 -18
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +142 -94
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/reachabilityPeerConnection.js +1 -1
- package/dist/reachability/reachabilityPeerConnection.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +0 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/types/aiEnableRequest/index.d.ts +5 -0
- package/dist/types/aiEnableRequest/utils.d.ts +2 -0
- package/dist/types/common/browser-detection.d.ts +1 -0
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/common/events/events-scope.d.ts +1 -0
- package/dist/types/common/events/events.d.ts +1 -0
- package/dist/types/config.d.ts +7 -2
- package/dist/types/constants.d.ts +35 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +11 -0
- package/dist/types/hashTree/hashTree.d.ts +136 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +392 -14
- package/dist/types/hashTree/types.d.ts +20 -0
- package/dist/types/hashTree/utils.d.ts +40 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/constant.d.ts +5 -0
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
- package/dist/types/interceptors/index.d.ts +2 -1
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interceptors/locusRouteToken.d.ts +2 -0
- package/dist/types/interceptors/utils.d.ts +1 -0
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +116 -51
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +48 -12
- package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
- package/dist/types/media/properties.d.ts +3 -1
- package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
- package/dist/types/meeting/index.d.ts +196 -15
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +17 -1
- package/dist/types/meeting/request.type.d.ts +5 -0
- package/dist/types/meeting/util.d.ts +40 -0
- package/dist/types/meeting-info/util.d.ts +1 -0
- package/dist/types/meeting-info/utilv2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +34 -20
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +2 -0
- package/dist/types/member/types.d.ts +5 -4
- package/dist/types/member/util.d.ts +14 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +10 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- package/dist/types/reachability/clusterReachability.d.ts +33 -6
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +4 -0
- package/dist/types/recording-controller/util.d.ts +5 -5
- package/dist/types/roap/index.d.ts +1 -1
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/index.js +585 -164
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +26 -24
- package/src/aiEnableRequest/README.md +84 -0
- package/src/aiEnableRequest/index.ts +186 -0
- package/src/aiEnableRequest/utils.ts +25 -0
- package/src/annotation/index.ts +27 -7
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/index.ts +31 -0
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +7 -2
- package/src/constants.ts +49 -3
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +26 -0
- package/src/hashTree/hashTree.ts +480 -0
- package/src/hashTree/hashTreeParser.ts +1911 -29
- package/src/hashTree/types.ts +24 -1
- package/src/hashTree/utils.ts +98 -0
- package/src/index.ts +14 -1
- package/src/interceptors/constant.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +246 -0
- package/src/interceptors/index.ts +2 -1
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interceptors/locusRouteToken.ts +22 -5
- package/src/interceptors/utils.ts +16 -0
- package/src/interpretation/index.ts +29 -11
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +20 -1
- package/src/locus-info/index.ts +958 -250
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/selfUtils.ts +1 -0
- package/src/locus-info/types.ts +51 -12
- package/src/media/MediaConnectionAwaiter.ts +62 -5
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +4 -1
- package/src/meeting/in-meeting-actions.ts +20 -0
- package/src/meeting/index.ts +1025 -146
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +53 -0
- package/src/meeting/request.type.ts +6 -0
- package/src/meeting/util.ts +207 -7
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +307 -132
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +127 -13
- package/src/member/index.ts +20 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +41 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +11 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +117 -76
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +13 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- package/src/reachability/clusterReachability.ts +156 -29
- package/src/reachability/index.ts +62 -17
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/reachabilityPeerConnection.ts +3 -1
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +4 -0
- package/src/reconnection-manager/index.ts +0 -1
- package/src/recording-controller/index.ts +1 -2
- package/src/webinar/index.ts +448 -11
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
- package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
- package/test/unit/spec/annotation/index.ts +69 -7
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/index.ts +49 -0
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTree.ts +721 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +5328 -0
- package/test/unit/spec/hashTree/utils.ts +264 -0
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interceptors/locusRouteToken.ts +44 -0
- package/test/unit/spec/interceptors/utils.ts +75 -0
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +222 -52
- package/test/unit/spec/locus-info/index.js +2000 -171
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +12 -3
- package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
- package/test/unit/spec/meeting/index.js +2925 -209
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +82 -0
- package/test/unit/spec/meeting/utils.js +595 -27
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +1214 -75
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +453 -52
- package/test/unit/spec/member/index.js +35 -4
- package/test/unit/spec/member/util.js +154 -27
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
- package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/clusterReachability.ts +125 -1
- package/test/unit/spec/reachability/index.ts +154 -49
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -8
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/webinar/index.ts +837 -39
- package/test/unit/spec/webinar/utils.ts +39 -0
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {ClusterNode} from './request';
|
|
2
2
|
import EventsScope from '../common/events/events-scope';
|
|
3
|
+
import LoggerProxy from '../common/logs/logger-proxy';
|
|
3
4
|
|
|
4
5
|
import {Enum} from '../constants';
|
|
5
6
|
import {
|
|
6
7
|
ClusterReachabilityResult,
|
|
7
8
|
NatType,
|
|
9
|
+
Protocol,
|
|
8
10
|
ReachabilityPeerConnectionEvents,
|
|
9
11
|
} from './reachability.types';
|
|
10
12
|
import {ReachabilityPeerConnection} from './reachabilityPeerConnection';
|
|
11
13
|
|
|
12
14
|
// data for the Events.resultReady event
|
|
13
15
|
export type ResultEventData = {
|
|
14
|
-
protocol:
|
|
16
|
+
protocol: Protocol;
|
|
15
17
|
result: 'reachable' | 'unreachable' | 'untested';
|
|
16
18
|
latencyInMilliseconds: number; // amount of time it took to get the ICE candidate
|
|
17
19
|
clientMediaIPs?: string[];
|
|
@@ -19,7 +21,7 @@ export type ResultEventData = {
|
|
|
19
21
|
|
|
20
22
|
// data for the Events.clientMediaIpsUpdated event
|
|
21
23
|
export type ClientMediaIpsUpdatedEventData = {
|
|
22
|
-
protocol:
|
|
24
|
+
protocol: Protocol;
|
|
23
25
|
clientMediaIPs: string[];
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -37,36 +39,117 @@ export type Events = Enum<typeof Events>;
|
|
|
37
39
|
|
|
38
40
|
/**
|
|
39
41
|
* A class that handles reachability checks for a single cluster.
|
|
40
|
-
* Creates and orchestrates
|
|
42
|
+
* Creates and orchestrates ReachabilityPeerConnection instance(s).
|
|
41
43
|
* Listens to events and emits them to consumers.
|
|
44
|
+
*
|
|
45
|
+
* When enablePerUdpUrlReachability is true:
|
|
46
|
+
* - Creates one ReachabilityPeerConnection for each UDP URL
|
|
47
|
+
* - Creates one ReachabilityPeerConnection for all TCP and TLS URLs together
|
|
48
|
+
* Otherwise:
|
|
49
|
+
* - Creates a single ReachabilityPeerConnection for all URLs
|
|
42
50
|
*/
|
|
43
51
|
export class ClusterReachability extends EventsScope {
|
|
44
|
-
private reachabilityPeerConnection: ReachabilityPeerConnection;
|
|
52
|
+
private reachabilityPeerConnection: ReachabilityPeerConnection | null = null;
|
|
53
|
+
private reachabilityPeerConnectionsForUdp: ReachabilityPeerConnection[] = [];
|
|
54
|
+
|
|
45
55
|
public readonly isVideoMesh: boolean;
|
|
46
56
|
public readonly name;
|
|
47
57
|
public readonly reachedSubnets: Set<string> = new Set();
|
|
48
58
|
|
|
59
|
+
private enablePerUdpUrlReachability: boolean;
|
|
60
|
+
private udpResultEmitted = false;
|
|
61
|
+
|
|
49
62
|
/**
|
|
50
63
|
* Constructor for ClusterReachability
|
|
51
64
|
* @param {string} name cluster name
|
|
52
65
|
* @param {ClusterNode} clusterInfo information about the media cluster
|
|
66
|
+
* @param {boolean} enablePerUdpUrlReachability whether to create separate peer connections per UDP URL
|
|
53
67
|
*/
|
|
54
|
-
constructor(name: string, clusterInfo: ClusterNode) {
|
|
68
|
+
constructor(name: string, clusterInfo: ClusterNode, enablePerUdpUrlReachability = false) {
|
|
55
69
|
super();
|
|
56
70
|
this.name = name;
|
|
57
71
|
this.isVideoMesh = clusterInfo.isVideoMesh;
|
|
72
|
+
this.enablePerUdpUrlReachability = enablePerUdpUrlReachability;
|
|
58
73
|
|
|
59
|
-
this.
|
|
74
|
+
if (this.enablePerUdpUrlReachability) {
|
|
75
|
+
this.initializePerUdpUrlReachabilityCheck(clusterInfo);
|
|
76
|
+
} else {
|
|
77
|
+
this.initializeSingleReachabilityPeerConnection(clusterInfo);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
60
80
|
|
|
61
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Initializes a single ReachabilityPeerConnection for all protocols
|
|
83
|
+
* @param {ClusterNode} clusterInfo information about the media cluster
|
|
84
|
+
* @returns {void}
|
|
85
|
+
*/
|
|
86
|
+
private initializeSingleReachabilityPeerConnection(clusterInfo: ClusterNode) {
|
|
87
|
+
this.reachabilityPeerConnection = new ReachabilityPeerConnection(this.name, clusterInfo);
|
|
88
|
+
this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);
|
|
62
89
|
}
|
|
63
90
|
|
|
64
91
|
/**
|
|
65
|
-
*
|
|
92
|
+
* Initializes per-URL UDP reachability checks:
|
|
93
|
+
* - One ReachabilityPeerConnection per UDP URL
|
|
94
|
+
* - One ReachabilityPeerConnection for all TCP and TLS URLs together
|
|
95
|
+
* @param {ClusterNode} clusterInfo information about the media cluster
|
|
66
96
|
* @returns {void}
|
|
67
97
|
*/
|
|
68
|
-
private
|
|
69
|
-
|
|
98
|
+
private initializePerUdpUrlReachabilityCheck(clusterInfo: ClusterNode) {
|
|
99
|
+
LoggerProxy.logger.log(
|
|
100
|
+
`ClusterReachability#initializePerUdpUrlReachabilityCheck --> cluster: ${this.name}, performing per-URL UDP reachability for ${clusterInfo.udp.length} URLs`
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// Create one ReachabilityPeerConnection for each UDP URL
|
|
104
|
+
clusterInfo.udp.forEach((udpUrl) => {
|
|
105
|
+
const singleUdpClusterInfo: ClusterNode = {
|
|
106
|
+
isVideoMesh: clusterInfo.isVideoMesh,
|
|
107
|
+
udp: [udpUrl],
|
|
108
|
+
tcp: [],
|
|
109
|
+
xtls: [],
|
|
110
|
+
};
|
|
111
|
+
const rpc = new ReachabilityPeerConnection(this.name, singleUdpClusterInfo);
|
|
112
|
+
this.setupReachabilityPeerConnectionEventListeners(rpc, true);
|
|
113
|
+
this.reachabilityPeerConnectionsForUdp.push(rpc);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Create one ReachabilityPeerConnection for all TCP and TLS URLs together
|
|
117
|
+
if (clusterInfo.tcp.length > 0 || clusterInfo.xtls.length > 0) {
|
|
118
|
+
const tcpTlsClusterInfo: ClusterNode = {
|
|
119
|
+
isVideoMesh: clusterInfo.isVideoMesh,
|
|
120
|
+
udp: [],
|
|
121
|
+
tcp: clusterInfo.tcp,
|
|
122
|
+
xtls: clusterInfo.xtls,
|
|
123
|
+
};
|
|
124
|
+
this.reachabilityPeerConnection = new ReachabilityPeerConnection(
|
|
125
|
+
this.name,
|
|
126
|
+
tcpTlsClusterInfo
|
|
127
|
+
);
|
|
128
|
+
this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Sets up event listeners for a ReachabilityPeerConnection instance
|
|
134
|
+
* @param {ReachabilityPeerConnection} rpc the ReachabilityPeerConnection instance
|
|
135
|
+
* @param {boolean} isUdpPerUrl whether this is a per-URL UDP instance
|
|
136
|
+
* @returns {void}
|
|
137
|
+
*/
|
|
138
|
+
private setupReachabilityPeerConnectionEventListeners(
|
|
139
|
+
rpc: ReachabilityPeerConnection,
|
|
140
|
+
isUdpPerUrl = false
|
|
141
|
+
) {
|
|
142
|
+
rpc.on(ReachabilityPeerConnectionEvents.resultReady, (data) => {
|
|
143
|
+
// For per-URL UDP checks, only emit the first successful UDP result
|
|
144
|
+
if (isUdpPerUrl && data.protocol === 'udp') {
|
|
145
|
+
if (this.udpResultEmitted) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (data.result === 'reachable') {
|
|
149
|
+
this.udpResultEmitted = true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
70
153
|
this.emit(
|
|
71
154
|
{
|
|
72
155
|
file: 'clusterReachability',
|
|
@@ -77,21 +160,18 @@ export class ClusterReachability extends EventsScope {
|
|
|
77
160
|
);
|
|
78
161
|
});
|
|
79
162
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
);
|
|
163
|
+
rpc.on(ReachabilityPeerConnectionEvents.clientMediaIpsUpdated, (data) => {
|
|
164
|
+
this.emit(
|
|
165
|
+
{
|
|
166
|
+
file: 'clusterReachability',
|
|
167
|
+
function: 'setupReachabilityPeerConnectionEventListeners',
|
|
168
|
+
},
|
|
169
|
+
Events.clientMediaIpsUpdated,
|
|
170
|
+
data
|
|
171
|
+
);
|
|
172
|
+
});
|
|
93
173
|
|
|
94
|
-
|
|
174
|
+
rpc.on(ReachabilityPeerConnectionEvents.natTypeUpdated, (data) => {
|
|
95
175
|
this.emit(
|
|
96
176
|
{
|
|
97
177
|
file: 'clusterReachability',
|
|
@@ -102,18 +182,54 @@ export class ClusterReachability extends EventsScope {
|
|
|
102
182
|
);
|
|
103
183
|
});
|
|
104
184
|
|
|
105
|
-
|
|
106
|
-
data.subnets.forEach((subnet) => {
|
|
185
|
+
rpc.on(ReachabilityPeerConnectionEvents.reachedSubnets, (data) => {
|
|
186
|
+
data.subnets.forEach((subnet: string) => {
|
|
107
187
|
this.reachedSubnets.add(subnet);
|
|
108
188
|
});
|
|
109
189
|
});
|
|
110
190
|
}
|
|
111
191
|
|
|
112
192
|
/**
|
|
193
|
+
* Gets the aggregated reachability result for this cluster.
|
|
113
194
|
* @returns {ClusterReachabilityResult} reachability result for this cluster
|
|
114
195
|
*/
|
|
115
196
|
getResult(): ClusterReachabilityResult {
|
|
116
|
-
|
|
197
|
+
if (!this.enablePerUdpUrlReachability) {
|
|
198
|
+
return (
|
|
199
|
+
this.reachabilityPeerConnection?.getResult() ?? {
|
|
200
|
+
udp: {result: 'untested'},
|
|
201
|
+
tcp: {result: 'untested'},
|
|
202
|
+
xtls: {result: 'untested'},
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const result: ClusterReachabilityResult = {
|
|
208
|
+
udp: {result: 'untested'},
|
|
209
|
+
tcp: {result: 'untested'},
|
|
210
|
+
xtls: {result: 'untested'},
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Get the first reachable UDP result from per-URL instances
|
|
214
|
+
for (const rpc of this.reachabilityPeerConnectionsForUdp) {
|
|
215
|
+
const rpcResult = rpc.getResult();
|
|
216
|
+
if (rpcResult.udp.result === 'reachable') {
|
|
217
|
+
result.udp = rpcResult.udp;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
if (rpcResult.udp.result === 'unreachable' && result.udp.result === 'untested') {
|
|
221
|
+
result.udp = rpcResult.udp;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Get TCP and TLS results from the main peer connection
|
|
226
|
+
if (this.reachabilityPeerConnection) {
|
|
227
|
+
const mainResult = this.reachabilityPeerConnection.getResult();
|
|
228
|
+
result.tcp = mainResult.tcp;
|
|
229
|
+
result.xtls = mainResult.xtls;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return result;
|
|
117
233
|
}
|
|
118
234
|
|
|
119
235
|
/**
|
|
@@ -121,7 +237,17 @@ export class ClusterReachability extends EventsScope {
|
|
|
121
237
|
* @returns {Promise<ClusterReachabilityResult>}
|
|
122
238
|
*/
|
|
123
239
|
async start(): Promise<ClusterReachabilityResult> {
|
|
124
|
-
|
|
240
|
+
const startPromises: Promise<ClusterReachabilityResult>[] = [];
|
|
241
|
+
|
|
242
|
+
this.reachabilityPeerConnectionsForUdp.forEach((rpc) => {
|
|
243
|
+
startPromises.push(rpc.start());
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
if (this.reachabilityPeerConnection) {
|
|
247
|
+
startPromises.push(this.reachabilityPeerConnection.start());
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
await Promise.all(startPromises);
|
|
125
251
|
|
|
126
252
|
return this.getResult();
|
|
127
253
|
}
|
|
@@ -131,6 +257,7 @@ export class ClusterReachability extends EventsScope {
|
|
|
131
257
|
* @returns {void}
|
|
132
258
|
*/
|
|
133
259
|
public abort() {
|
|
134
|
-
this.
|
|
260
|
+
this.reachabilityPeerConnectionsForUdp.forEach((rpc) => rpc.abort());
|
|
261
|
+
this.reachabilityPeerConnection?.abort();
|
|
135
262
|
}
|
|
136
263
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import {isEqual, mapValues, mean} from 'lodash';
|
|
7
7
|
|
|
8
8
|
import {Defer} from '@webex/common';
|
|
9
|
+
import {CapabilityState, WebCapabilities} from '@webex/web-capabilities';
|
|
9
10
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
10
11
|
import MeetingUtil from '../meeting/util';
|
|
11
12
|
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
TransportResultForBackend,
|
|
25
26
|
GetClustersTrigger,
|
|
26
27
|
NatType,
|
|
28
|
+
Protocol,
|
|
27
29
|
} from './reachability.types';
|
|
28
30
|
import {
|
|
29
31
|
ClientMediaIpsUpdatedEventData,
|
|
@@ -32,6 +34,7 @@ import {
|
|
|
32
34
|
NatTypeUpdatedEventData,
|
|
33
35
|
ResultEventData,
|
|
34
36
|
} from './clusterReachability';
|
|
37
|
+
import {isReachabilityEnabled, resolveReachabilityProtocols} from './util';
|
|
35
38
|
import EventsScope from '../common/events/events-scope';
|
|
36
39
|
import BEHAVIORAL_METRICS from '../metrics/constants';
|
|
37
40
|
import Metrics from '../metrics';
|
|
@@ -193,9 +196,17 @@ export default class Reachability extends EventsScope {
|
|
|
193
196
|
*/
|
|
194
197
|
public async gatherReachability(trigger: string): Promise<ReachabilityResults> {
|
|
195
198
|
// @ts-ignore
|
|
196
|
-
if (!this.webex.config.meetings.enableReachabilityChecks) {
|
|
199
|
+
if (!isReachabilityEnabled(this.webex.config.meetings.enableReachabilityChecks)) {
|
|
197
200
|
throw new Error('enableReachabilityChecks is disabled in config');
|
|
198
201
|
}
|
|
202
|
+
|
|
203
|
+
if (WebCapabilities.supportsRTCPeerConnection() !== CapabilityState.CAPABLE) {
|
|
204
|
+
LoggerProxy.logger.warn(
|
|
205
|
+
'Reachability:index#gatherReachability --> WebRTC API is not available, skipping reachability checks'
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
return {};
|
|
209
|
+
}
|
|
199
210
|
// Fetch clusters and measure latency
|
|
200
211
|
try {
|
|
201
212
|
this.lastTrigger = trigger;
|
|
@@ -506,7 +517,7 @@ export default class Reachability extends EventsScope {
|
|
|
506
517
|
* Returns true only if ALL protocols (UDP, TCP and TLS) have been tested and none
|
|
507
518
|
* of the media clusters where reachable with any of the protocols. This is done
|
|
508
519
|
* irrespective of the config, so for example:
|
|
509
|
-
* if config.meetings.
|
|
520
|
+
* if config.meetings.enableReachabilityChecks disables TLS,
|
|
510
521
|
* it will return false, because TLS reachability won't be tested,
|
|
511
522
|
* so we can't say for sure that media backend is unreachable over TLS.
|
|
512
523
|
*
|
|
@@ -559,6 +570,32 @@ export default class Reachability extends EventsScope {
|
|
|
559
570
|
return unreachable;
|
|
560
571
|
}
|
|
561
572
|
|
|
573
|
+
/**
|
|
574
|
+
* Checks if any cluster is reachable via the given protocol based on stored reachability results.
|
|
575
|
+
*
|
|
576
|
+
* @param {string} protocol - the protocol to check ('udp', 'tcp', or 'xtls')
|
|
577
|
+
* @returns {Promise<boolean>} true if at least one cluster has a 'reachable' result for the given protocol
|
|
578
|
+
*/
|
|
579
|
+
async isAnyClusterReachableViaProtocol(protocol: Protocol): Promise<boolean> {
|
|
580
|
+
try {
|
|
581
|
+
// @ts-ignore
|
|
582
|
+
const resultsJson = await this.webex.boundedStorage.get(
|
|
583
|
+
this.namespace,
|
|
584
|
+
REACHABILITY.localStorageResult
|
|
585
|
+
);
|
|
586
|
+
|
|
587
|
+
const results: ReachabilityResults = JSON.parse(resultsJson);
|
|
588
|
+
|
|
589
|
+
return Object.values(results).some((result) => result[protocol]?.result === 'reachable');
|
|
590
|
+
} catch (e) {
|
|
591
|
+
LoggerProxy.logger.warn(
|
|
592
|
+
`Reachability:index#isAnyClusterReachableViaProtocol --> Error reading reachability data: ${e}`
|
|
593
|
+
);
|
|
594
|
+
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
562
599
|
/**
|
|
563
600
|
* Get list of all unreachable clusters
|
|
564
601
|
* @returns {array} Unreachable clusters
|
|
@@ -691,7 +728,7 @@ export default class Reachability extends EventsScope {
|
|
|
691
728
|
*/
|
|
692
729
|
protected getStatistics(
|
|
693
730
|
results: Array<ClusterReachabilityResult & {isVideoMesh: boolean}>,
|
|
694
|
-
protocol:
|
|
731
|
+
protocol: Protocol,
|
|
695
732
|
isVideoMesh: boolean
|
|
696
733
|
) {
|
|
697
734
|
const values = results
|
|
@@ -879,14 +916,21 @@ export default class Reachability extends EventsScope {
|
|
|
879
916
|
|
|
880
917
|
this.startTime = performance.now();
|
|
881
918
|
|
|
919
|
+
const protocols = resolveReachabilityProtocols(
|
|
920
|
+
// @ts-ignore
|
|
921
|
+
this.webex.config.meetings.enableReachabilityChecks
|
|
922
|
+
);
|
|
923
|
+
|
|
924
|
+
const enabledProtocols = [
|
|
925
|
+
protocols.udp && 'UDP',
|
|
926
|
+
protocols.tcp && 'TCP',
|
|
927
|
+
protocols.tls && 'TLS',
|
|
928
|
+
].filter(Boolean);
|
|
929
|
+
|
|
882
930
|
LoggerProxy.logger.log(
|
|
883
|
-
`Reachability:index#performReachabilityChecks --> doing
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}${
|
|
887
|
-
// @ts-ignore
|
|
888
|
-
this.webex.config.meetings.experimental.enableTlsReachability ? ',TLS' : ''
|
|
889
|
-
} reachability checks`
|
|
931
|
+
`Reachability:index#performReachabilityChecks --> doing ${enabledProtocols.join(
|
|
932
|
+
','
|
|
933
|
+
)} reachability checks`
|
|
890
934
|
);
|
|
891
935
|
|
|
892
936
|
this.resetResultCounters();
|
|
@@ -896,18 +940,14 @@ export default class Reachability extends EventsScope {
|
|
|
896
940
|
const cluster = clusterList[key];
|
|
897
941
|
|
|
898
942
|
// Linus doesn't support TCP reachability checks on video mesh nodes
|
|
899
|
-
const includeTcpReachability =
|
|
900
|
-
// @ts-ignore
|
|
901
|
-
this.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
|
|
943
|
+
const includeTcpReachability = protocols.tcp && !cluster.isVideoMesh;
|
|
902
944
|
|
|
903
945
|
if (!includeTcpReachability) {
|
|
904
946
|
cluster.tcp = [];
|
|
905
947
|
}
|
|
906
948
|
|
|
907
949
|
// Linus doesn't support xTLS reachability checks on video mesh nodes
|
|
908
|
-
const includeTlsReachability =
|
|
909
|
-
// @ts-ignore
|
|
910
|
-
this.webex.config.meetings.experimental.enableTlsReachability && !cluster.isVideoMesh;
|
|
950
|
+
const includeTlsReachability = protocols.tls && !cluster.isVideoMesh;
|
|
911
951
|
|
|
912
952
|
if (!includeTlsReachability) {
|
|
913
953
|
cluster.xtls = [];
|
|
@@ -961,7 +1001,12 @@ export default class Reachability extends EventsScope {
|
|
|
961
1001
|
Object.keys(clusterList).forEach((key) => {
|
|
962
1002
|
const cluster = clusterList[key];
|
|
963
1003
|
|
|
964
|
-
this.clusterReachability[key] = new ClusterReachability(
|
|
1004
|
+
this.clusterReachability[key] = new ClusterReachability(
|
|
1005
|
+
key,
|
|
1006
|
+
cluster,
|
|
1007
|
+
// @ts-ignore
|
|
1008
|
+
this.webex.config.meetings.enablePerUdpUrlReachability
|
|
1009
|
+
);
|
|
965
1010
|
this.clusterReachability[key].on(Events.resultReady, async (data: ResultEventData) => {
|
|
966
1011
|
const {protocol, result, clientMediaIPs, latencyInMilliseconds} = data;
|
|
967
1012
|
|
|
@@ -2,6 +2,17 @@ import {IP_VERSION, Enum} from '../constants';
|
|
|
2
2
|
|
|
3
3
|
export type Protocol = 'udp' | 'tcp' | 'xtls';
|
|
4
4
|
|
|
5
|
+
// Per-protocol reachability flags, fully resolved.
|
|
6
|
+
export type ResolvedReachabilityProtocols = {
|
|
7
|
+
udp: boolean;
|
|
8
|
+
tcp: boolean;
|
|
9
|
+
tls: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ReachabilityProtocolConfig = Partial<Omit<ResolvedReachabilityProtocols, 'udp'>>;
|
|
13
|
+
|
|
14
|
+
export type EnableReachabilityChecksConfig = boolean | ReachabilityProtocolConfig;
|
|
15
|
+
|
|
5
16
|
/**
|
|
6
17
|
* Events emitted by ReachabilityPeerConnection
|
|
7
18
|
*/
|
|
@@ -243,7 +243,9 @@ export class ReachabilityPeerConnection extends EventsScope {
|
|
|
243
243
|
if (result.latencyInMilliseconds === undefined) {
|
|
244
244
|
LoggerProxy.logger.log(
|
|
245
245
|
// @ts-ignore
|
|
246
|
-
`Reachability:ReachabilityPeerConnection#saveResult --> Successfully reached ${
|
|
246
|
+
`Reachability:ReachabilityPeerConnection#saveResult --> Successfully reached ${
|
|
247
|
+
this.clusterName
|
|
248
|
+
} over ${protocol}: ${latency}ms, serverIp=${serverIp || 'unknown'}`
|
|
247
249
|
);
|
|
248
250
|
result.latencyInMilliseconds = latency;
|
|
249
251
|
result.result = 'reachable';
|
package/src/reachability/util.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
/* eslint-disable import/prefer-default-export */
|
|
2
|
+
import {EnableReachabilityChecksConfig, ResolvedReachabilityProtocols} from './reachability.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolves `enableReachabilityChecks` into explicit per-protocol flags.
|
|
6
|
+
* Defaults to all protocols enabled when not configured.
|
|
7
|
+
* UDP is always tested unless reachability is disabled entirely (`false`).
|
|
8
|
+
*
|
|
9
|
+
* @param {EnableReachabilityChecksConfig} enabled value of config.meetings.enableReachabilityChecks
|
|
10
|
+
* @returns {ResolvedReachabilityProtocols} resolved per-protocol flags
|
|
11
|
+
*/
|
|
12
|
+
export function resolveReachabilityProtocols(
|
|
13
|
+
enabled: EnableReachabilityChecksConfig = true
|
|
14
|
+
): ResolvedReachabilityProtocols {
|
|
15
|
+
if (typeof enabled === 'object') {
|
|
16
|
+
return {
|
|
17
|
+
udp: true,
|
|
18
|
+
tcp: enabled.tcp ?? true,
|
|
19
|
+
tls: enabled.tls ?? true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {udp: enabled, tcp: enabled, tls: enabled};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether any reachability protocol is enabled.
|
|
28
|
+
*
|
|
29
|
+
* @param {EnableReachabilityChecksConfig} config value of config.meetings.enableReachabilityChecks
|
|
30
|
+
* @returns {boolean} true if any protocol is enabled
|
|
31
|
+
*/
|
|
32
|
+
export function isReachabilityEnabled(config: EnableReachabilityChecksConfig = true): boolean {
|
|
33
|
+
const {udp, tcp, tls} = resolveReachabilityProtocols(config);
|
|
34
|
+
|
|
35
|
+
return udp || tcp || tls;
|
|
36
|
+
}
|
|
37
|
+
|
|
2
38
|
/**
|
|
3
39
|
* Converts a stun url to a turn url
|
|
4
40
|
*
|
|
@@ -40,6 +40,7 @@ export enum SkinToneType {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export type Sender = {
|
|
43
|
+
displayName: string;
|
|
43
44
|
participantId: string;
|
|
44
45
|
};
|
|
45
46
|
|
|
@@ -59,4 +60,7 @@ type RelayEventData = {
|
|
|
59
60
|
|
|
60
61
|
export type RelayEvent = {
|
|
61
62
|
data: RelayEventData;
|
|
63
|
+
headers?: {
|
|
64
|
+
route?: string;
|
|
65
|
+
};
|
|
62
66
|
};
|
|
@@ -609,7 +609,6 @@ export default class ReconnectionManager {
|
|
|
609
609
|
if (this.meeting.isMultistream) {
|
|
610
610
|
Object.values(this.meeting.mediaRequestManagers).forEach(
|
|
611
611
|
(mediaRequestManager: MediaRequestManager) => {
|
|
612
|
-
mediaRequestManager.clearPreviousRequests();
|
|
613
612
|
mediaRequestManager.commit();
|
|
614
613
|
}
|
|
615
614
|
);
|
|
@@ -261,8 +261,7 @@ export default class RecordingController {
|
|
|
261
261
|
|
|
262
262
|
LoggerProxy.logger.log(`RecordingController:index#recordingControls --> ${record}`);
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
return this.request.request({
|
|
264
|
+
return this.request.locusDeltaRequest({
|
|
266
265
|
uri: `${this.locusUrl}/${CONTROLS}`,
|
|
267
266
|
body: {
|
|
268
267
|
record,
|