@webex/plugin-meetings 3.0.0-stream-classes.4 → 3.0.0-test.1
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/README.md +12 -0
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/common/errors/no-meeting-info.js +51 -0
- package/dist/common/errors/no-meeting-info.js.map +1 -0
- package/dist/common/errors/reclaim-host-role-errors.js +158 -0
- package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
- package/dist/common/errors/webex-errors.js +23 -3
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/logs/request.js +5 -1
- package/dist/common/logs/request.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +69 -9
- package/dist/constants.js.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/interceptors/index.js +15 -0
- package/dist/interceptors/index.js.map +1 -0
- package/dist/interceptors/locusRetry.js +93 -0
- package/dist/interceptors/locusRetry.js.map +1 -0
- package/dist/interpretation/index.js +16 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +40 -11
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +15 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +42 -21
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/media/index.js +10 -6
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +13 -3
- package/dist/media/properties.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +135 -330
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +4 -0
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2187 -1074
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +37 -25
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +34 -19
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +71 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/index.js +48 -23
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +25 -4
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +17 -0
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +142 -57
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +2 -6
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +9 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +11 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +17 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/types.js.map +1 -1
- package/dist/members/util.js +15 -4
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +15 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +1 -1
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +16 -2
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +222 -73
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +22 -0
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +356 -0
- package/dist/reachability/clusterReachability.js.map +1 -0
- package/dist/reachability/index.js +262 -432
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -1
- package/dist/reachability/request.js.map +1 -1
- package/dist/reachability/util.js +29 -0
- package/dist/reachability/util.js.map +1 -0
- package/dist/reconnection-manager/index.js +113 -96
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +57 -25
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +5 -13
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +173 -81
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/rtcMetrics/index.js +68 -6
- package/dist/rtcMetrics/index.js.map +1 -1
- package/dist/statsAnalyzer/index.js +338 -289
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +296 -156
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/types/common/errors/no-meeting-info.d.ts +14 -0
- package/dist/types/common/errors/reclaim-host-role-errors.d.ts +60 -0
- package/dist/types/common/errors/webex-errors.d.ts +13 -1
- package/dist/types/common/logs/request.d.ts +2 -0
- package/dist/types/config.d.ts +1 -1
- package/dist/types/constants.d.ts +66 -13
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interceptors/index.d.ts +2 -0
- package/dist/types/interceptors/locusRetry.d.ts +27 -0
- package/dist/types/locus-info/index.d.ts +1 -1
- package/dist/types/locus-info/parser.d.ts +3 -2
- package/dist/types/mediaQualityMetrics/config.d.ts +99 -223
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +285 -34
- package/dist/types/meeting/locusMediaRequest.d.ts +1 -2
- package/dist/types/meeting/muteState.d.ts +2 -8
- package/dist/types/meeting/request.d.ts +4 -1
- package/dist/types/meeting/util.d.ts +25 -1
- package/dist/types/meeting-info/index.d.ts +7 -0
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/collection.d.ts +9 -0
- package/dist/types/meetings/index.d.ts +42 -14
- package/dist/types/member/index.d.ts +1 -0
- package/dist/types/members/types.d.ts +1 -0
- package/dist/types/members/util.d.ts +5 -0
- package/dist/types/metrics/constants.d.ts +15 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +2 -0
- package/dist/types/multistream/remoteMediaGroup.d.ts +2 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +25 -1
- package/dist/types/multistream/sendSlotManager.d.ts +9 -0
- package/dist/types/reachability/clusterReachability.d.ts +109 -0
- package/dist/types/reachability/index.d.ts +59 -112
- package/dist/types/reachability/request.d.ts +1 -1
- package/dist/types/reachability/util.d.ts +8 -0
- package/dist/types/reconnection-manager/index.d.ts +10 -0
- package/dist/types/roap/index.d.ts +2 -1
- package/dist/types/roap/request.d.ts +2 -1
- package/dist/types/roap/turnDiscovery.d.ts +21 -4
- package/dist/types/rtcMetrics/index.d.ts +15 -1
- package/dist/types/statsAnalyzer/index.d.ts +28 -11
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +28 -4
- package/dist/types/webinar/collection.d.ts +16 -0
- package/dist/types/webinar/index.d.ts +5 -0
- package/dist/webinar/collection.js +44 -0
- package/dist/webinar/collection.js.map +1 -0
- package/dist/webinar/index.js +69 -0
- package/dist/webinar/index.js.map +1 -0
- package/package.json +3 -2
- package/src/common/errors/no-meeting-info.ts +24 -0
- package/src/common/errors/reclaim-host-role-errors.ts +134 -0
- package/src/common/errors/webex-errors.ts +19 -2
- package/src/common/logs/request.ts +5 -1
- package/src/config.ts +1 -1
- package/src/constants.ts +71 -6
- package/src/index.ts +5 -0
- package/src/interceptors/index.ts +3 -0
- package/src/interceptors/locusRetry.ts +67 -0
- package/src/interpretation/index.ts +18 -1
- package/src/locus-info/index.ts +52 -16
- package/src/locus-info/mediaSharesUtils.ts +16 -0
- package/src/locus-info/parser.ts +47 -21
- package/src/media/index.ts +8 -6
- package/src/media/properties.ts +17 -2
- package/src/mediaQualityMetrics/config.ts +103 -238
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +1510 -529
- package/src/meeting/muteState.ts +34 -20
- package/src/meeting/request.ts +19 -1
- package/src/meeting/util.ts +97 -0
- package/src/meeting-info/index.ts +47 -20
- package/src/meeting-info/meeting-info-v2.ts +27 -5
- package/src/meeting-info/utilv2.ts +1 -1
- package/src/meetings/collection.ts +13 -0
- package/src/meetings/index.ts +112 -31
- package/src/meetings/util.ts +2 -8
- package/src/member/index.ts +9 -0
- package/src/member/util.ts +14 -0
- package/src/members/index.ts +29 -2
- package/src/members/types.ts +1 -0
- package/src/members/util.ts +15 -1
- package/src/metrics/constants.ts +14 -0
- package/src/multistream/mediaRequestManager.ts +4 -1
- package/src/multistream/remoteMediaGroup.ts +19 -0
- package/src/multistream/remoteMediaManager.ts +141 -18
- package/src/multistream/sendSlotManager.ts +29 -0
- package/src/reachability/clusterReachability.ts +320 -0
- package/src/reachability/index.ts +221 -382
- package/src/reachability/request.ts +1 -1
- package/src/reachability/util.ts +24 -0
- package/src/reconnection-manager/index.ts +87 -83
- package/src/roap/index.ts +60 -24
- package/src/roap/request.ts +3 -16
- package/src/roap/turnDiscovery.ts +112 -39
- package/src/rtcMetrics/index.ts +71 -5
- package/src/statsAnalyzer/index.ts +430 -427
- package/src/statsAnalyzer/mqaUtil.ts +317 -168
- package/src/webinar/collection.ts +31 -0
- package/src/webinar/index.ts +62 -0
- package/test/integration/spec/converged-space-meetings.js +7 -7
- package/test/integration/spec/journey.js +86 -104
- package/test/integration/spec/space-meeting.js +9 -9
- package/test/unit/spec/interceptors/locusRetry.ts +131 -0
- package/test/unit/spec/interpretation/index.ts +36 -3
- package/test/unit/spec/locus-info/index.js +205 -12
- package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
- package/test/unit/spec/locus-info/mediaSharesUtils.ts +10 -0
- package/test/unit/spec/locus-info/parser.js +54 -13
- package/test/unit/spec/media/index.ts +20 -4
- package/test/unit/spec/media/properties.ts +2 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +4027 -1075
- package/test/unit/spec/meeting/muteState.js +219 -67
- package/test/unit/spec/meeting/request.js +63 -12
- package/test/unit/spec/meeting/utils.js +93 -0
- package/test/unit/spec/meeting-info/index.js +180 -61
- package/test/unit/spec/meeting-info/meetinginfov2.js +196 -53
- package/test/unit/spec/meetings/collection.js +12 -0
- package/test/unit/spec/meetings/index.js +619 -206
- package/test/unit/spec/meetings/utils.js +35 -12
- package/test/unit/spec/member/index.js +8 -7
- package/test/unit/spec/member/util.js +32 -0
- package/test/unit/spec/members/index.js +130 -17
- package/test/unit/spec/members/utils.js +26 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +20 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +80 -1
- package/test/unit/spec/multistream/remoteMediaManager.ts +210 -3
- package/test/unit/spec/multistream/sendSlotManager.ts +50 -18
- package/test/unit/spec/reachability/clusterReachability.ts +279 -0
- package/test/unit/spec/reachability/index.ts +505 -135
- package/test/unit/spec/reachability/util.ts +40 -0
- package/test/unit/spec/reconnection-manager/index.js +74 -17
- package/test/unit/spec/roap/index.ts +181 -61
- package/test/unit/spec/roap/request.ts +27 -3
- package/test/unit/spec/roap/turnDiscovery.ts +362 -101
- package/test/unit/spec/rtcMetrics/index.ts +57 -3
- package/test/unit/spec/stats-analyzer/index.js +1225 -12
- package/test/unit/spec/webinar/collection.ts +13 -0
- package/test/unit/spec/webinar/index.ts +60 -0
- package/test/utils/integrationTestUtils.js +4 -4
- package/test/utils/webex-test-users.js +12 -4
|
@@ -9,22 +9,20 @@ exports.default = void 0;
|
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
10
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
11
11
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
|
|
12
|
-
var
|
|
12
|
+
var _entries = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/entries"));
|
|
13
13
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
14
14
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
15
|
-
var
|
|
16
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
|
|
17
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
18
17
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
19
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
20
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
21
|
-
var
|
|
20
|
+
var _mapValues2 = _interopRequireDefault(require("lodash/mapValues"));
|
|
22
21
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
23
22
|
var _util = _interopRequireDefault(require("../meeting/util"));
|
|
24
23
|
var _constants = require("../constants");
|
|
25
24
|
var _request = _interopRequireDefault(require("./request"));
|
|
26
|
-
var
|
|
27
|
-
var VIDEO_MESH_TIMEOUT = 1000;
|
|
25
|
+
var _clusterReachability = require("./clusterReachability");
|
|
28
26
|
/**
|
|
29
27
|
* @class Reachability
|
|
30
28
|
* @export
|
|
@@ -40,7 +38,7 @@ var Reachability = /*#__PURE__*/function () {
|
|
|
40
38
|
(0, _defineProperty2.default)(this, "namespace", _constants.REACHABILITY.namespace);
|
|
41
39
|
(0, _defineProperty2.default)(this, "webex", void 0);
|
|
42
40
|
(0, _defineProperty2.default)(this, "reachabilityRequest", void 0);
|
|
43
|
-
(0, _defineProperty2.default)(this, "
|
|
41
|
+
(0, _defineProperty2.default)(this, "clusterReachability", void 0);
|
|
44
42
|
this.webex = webex;
|
|
45
43
|
|
|
46
44
|
/**
|
|
@@ -51,22 +49,13 @@ var Reachability = /*#__PURE__*/function () {
|
|
|
51
49
|
* @memberof Reachability
|
|
52
50
|
*/
|
|
53
51
|
this.reachabilityRequest = new _request.default(this.webex);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* internal object of clusters latency results
|
|
57
|
-
* @instance
|
|
58
|
-
* @type {object}
|
|
59
|
-
* @private
|
|
60
|
-
* @memberof Reachability
|
|
61
|
-
*/
|
|
62
|
-
this.clusterLatencyResults = {};
|
|
52
|
+
this.clusterReachability = {};
|
|
63
53
|
}
|
|
64
54
|
|
|
65
55
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @returns {
|
|
56
|
+
* Gets a list of media clusters from the backend and performs reachability checks on all the clusters
|
|
57
|
+
* @returns {Promise<ReachabilityResults>} reachability results
|
|
68
58
|
* @public
|
|
69
|
-
* @async
|
|
70
59
|
* @memberof Reachability
|
|
71
60
|
*/
|
|
72
61
|
(0, _createClass2.default)(Reachability, [{
|
|
@@ -77,51 +66,194 @@ var Reachability = /*#__PURE__*/function () {
|
|
|
77
66
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
78
67
|
while (1) switch (_context.prev = _context.next) {
|
|
79
68
|
case 0:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// Remove stored reachability results to ensure no stale data
|
|
83
|
-
// @ts-ignore
|
|
69
|
+
_context.prev = 0;
|
|
84
70
|
_context.next = 3;
|
|
85
|
-
return this.webex.boundedStorage.del(this.namespace, _constants.REACHABILITY.localStorageResult);
|
|
86
|
-
case 3:
|
|
87
|
-
_context.next = 5;
|
|
88
|
-
return this.webex.boundedStorage.del(this.namespace, _constants.REACHABILITY.localStorageJoinCookie);
|
|
89
|
-
case 5:
|
|
90
|
-
_context.prev = 5;
|
|
91
|
-
_context.next = 8;
|
|
92
71
|
return this.reachabilityRequest.getClusters(_util.default.getIpVersion(this.webex));
|
|
93
|
-
case
|
|
72
|
+
case 3:
|
|
94
73
|
_yield$this$reachabil = _context.sent;
|
|
95
74
|
clusters = _yield$this$reachabil.clusters;
|
|
96
75
|
joinCookie = _yield$this$reachabil.joinCookie;
|
|
97
|
-
_context.next =
|
|
98
|
-
return this.
|
|
99
|
-
case
|
|
76
|
+
_context.next = 8;
|
|
77
|
+
return this.performReachabilityChecks(clusters);
|
|
78
|
+
case 8:
|
|
100
79
|
results = _context.sent;
|
|
101
|
-
_context.next =
|
|
80
|
+
_context.next = 11;
|
|
102
81
|
return this.webex.boundedStorage.put(this.namespace, _constants.REACHABILITY.localStorageResult, (0, _stringify.default)(results));
|
|
103
|
-
case
|
|
104
|
-
_context.next =
|
|
82
|
+
case 11:
|
|
83
|
+
_context.next = 13;
|
|
105
84
|
return this.webex.boundedStorage.put(this.namespace, _constants.REACHABILITY.localStorageJoinCookie, (0, _stringify.default)(joinCookie));
|
|
106
|
-
case
|
|
85
|
+
case 13:
|
|
107
86
|
_loggerProxy.default.logger.log('Reachability:index#gatherReachability --> Reachability checks completed');
|
|
108
87
|
return _context.abrupt("return", results);
|
|
109
|
-
case
|
|
110
|
-
_context.prev =
|
|
111
|
-
_context.t0 = _context["catch"](
|
|
112
|
-
_loggerProxy.default.logger.error("Reachability:index#gatherReachability --> Error
|
|
88
|
+
case 17:
|
|
89
|
+
_context.prev = 17;
|
|
90
|
+
_context.t0 = _context["catch"](0);
|
|
91
|
+
_loggerProxy.default.logger.error("Reachability:index#gatherReachability --> Error:", _context.t0);
|
|
113
92
|
return _context.abrupt("return", {});
|
|
114
|
-
case
|
|
93
|
+
case 21:
|
|
115
94
|
case "end":
|
|
116
95
|
return _context.stop();
|
|
117
96
|
}
|
|
118
|
-
}, _callee, this, [[
|
|
97
|
+
}, _callee, this, [[0, 17]]);
|
|
119
98
|
}));
|
|
120
99
|
function gatherReachability() {
|
|
121
100
|
return _gatherReachability.apply(this, arguments);
|
|
122
101
|
}
|
|
123
102
|
return gatherReachability;
|
|
124
103
|
}()
|
|
104
|
+
/**
|
|
105
|
+
* Returns statistics about last reachability results. The returned value is an object
|
|
106
|
+
* with a flat list of properties so that it can be easily sent with metrics
|
|
107
|
+
*
|
|
108
|
+
* @returns {Promise} Promise with metrics values, it never rejects/throws.
|
|
109
|
+
*/
|
|
110
|
+
}, {
|
|
111
|
+
key: "getReachabilityMetrics",
|
|
112
|
+
value: function () {
|
|
113
|
+
var _getReachabilityMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
114
|
+
var stats, updateStats, resultsJson, results;
|
|
115
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
116
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
117
|
+
case 0:
|
|
118
|
+
stats = {
|
|
119
|
+
reachability_public_udp_success: 0,
|
|
120
|
+
reachability_public_udp_failed: 0,
|
|
121
|
+
reachability_public_tcp_success: 0,
|
|
122
|
+
reachability_public_tcp_failed: 0,
|
|
123
|
+
reachability_vmn_udp_success: 0,
|
|
124
|
+
reachability_vmn_udp_failed: 0,
|
|
125
|
+
reachability_vmn_tcp_success: 0,
|
|
126
|
+
reachability_vmn_tcp_failed: 0
|
|
127
|
+
};
|
|
128
|
+
updateStats = function updateStats(clusterType, result) {
|
|
129
|
+
if (result.udp && result.udp.result !== 'untested') {
|
|
130
|
+
var outcome = result.udp.result === 'reachable' ? 'success' : 'failed';
|
|
131
|
+
stats["reachability_".concat(clusterType, "_udp_").concat(outcome)] += 1;
|
|
132
|
+
}
|
|
133
|
+
if (result.tcp && result.tcp.result !== 'untested') {
|
|
134
|
+
var _outcome = result.tcp.result === 'reachable' ? 'success' : 'failed';
|
|
135
|
+
stats["reachability_".concat(clusterType, "_tcp_").concat(_outcome)] += 1;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
_context2.prev = 2;
|
|
139
|
+
_context2.next = 5;
|
|
140
|
+
return this.webex.boundedStorage.get(_constants.REACHABILITY.namespace, _constants.REACHABILITY.localStorageResult);
|
|
141
|
+
case 5:
|
|
142
|
+
resultsJson = _context2.sent;
|
|
143
|
+
results = JSON.parse(resultsJson);
|
|
144
|
+
(0, _values.default)(results).forEach(function (result) {
|
|
145
|
+
updateStats(result.isVideoMesh ? 'vmn' : 'public', result);
|
|
146
|
+
});
|
|
147
|
+
_context2.next = 13;
|
|
148
|
+
break;
|
|
149
|
+
case 10:
|
|
150
|
+
_context2.prev = 10;
|
|
151
|
+
_context2.t0 = _context2["catch"](2);
|
|
152
|
+
// empty storage, that's ok
|
|
153
|
+
_loggerProxy.default.logger.warn('Roap:request#getReachabilityMetrics --> Error parsing reachability data: ', _context2.t0);
|
|
154
|
+
case 13:
|
|
155
|
+
return _context2.abrupt("return", stats);
|
|
156
|
+
case 14:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context2.stop();
|
|
159
|
+
}
|
|
160
|
+
}, _callee2, this, [[2, 10]]);
|
|
161
|
+
}));
|
|
162
|
+
function getReachabilityMetrics() {
|
|
163
|
+
return _getReachabilityMetrics.apply(this, arguments);
|
|
164
|
+
}
|
|
165
|
+
return getReachabilityMetrics;
|
|
166
|
+
}()
|
|
167
|
+
/**
|
|
168
|
+
* Maps our internal transport result to the format that backend expects
|
|
169
|
+
* @param {TransportResult} transportResult
|
|
170
|
+
* @returns {TransportResultForBackend}
|
|
171
|
+
*/
|
|
172
|
+
}, {
|
|
173
|
+
key: "mapTransportResultToBackendDataFormat",
|
|
174
|
+
value: function mapTransportResultToBackendDataFormat(transportResult) {
|
|
175
|
+
var output = {};
|
|
176
|
+
for (var _i = 0, _Object$entries = (0, _entries.default)(transportResult); _i < _Object$entries.length; _i++) {
|
|
177
|
+
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
178
|
+
_key = _Object$entries$_i[0],
|
|
179
|
+
value = _Object$entries$_i[1];
|
|
180
|
+
switch (_key) {
|
|
181
|
+
case 'result':
|
|
182
|
+
switch (value) {
|
|
183
|
+
case 'reachable':
|
|
184
|
+
output.reachable = 'true';
|
|
185
|
+
break;
|
|
186
|
+
case 'unreachable':
|
|
187
|
+
output.reachable = 'false';
|
|
188
|
+
break;
|
|
189
|
+
case 'untested':
|
|
190
|
+
output.untested = 'true';
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
break;
|
|
194
|
+
case 'latencyInMilliseconds':
|
|
195
|
+
output.latencyInMilliseconds = value.toString();
|
|
196
|
+
break;
|
|
197
|
+
default:
|
|
198
|
+
output[_key] = value;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return output;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Reachability results as an object in the format that backend expects
|
|
206
|
+
*
|
|
207
|
+
* @returns {any} reachability results that need to be sent to the backend
|
|
208
|
+
*/
|
|
209
|
+
}, {
|
|
210
|
+
key: "getReachabilityResults",
|
|
211
|
+
value: function () {
|
|
212
|
+
var _getReachabilityResults = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
213
|
+
var _this = this;
|
|
214
|
+
var results, resultsJson, allClusterResults;
|
|
215
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
216
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
217
|
+
case 0:
|
|
218
|
+
_context3.prev = 0;
|
|
219
|
+
_context3.next = 3;
|
|
220
|
+
return this.webex.boundedStorage.get(_constants.REACHABILITY.namespace, _constants.REACHABILITY.localStorageResult);
|
|
221
|
+
case 3:
|
|
222
|
+
resultsJson = _context3.sent;
|
|
223
|
+
allClusterResults = JSON.parse(resultsJson);
|
|
224
|
+
results = (0, _mapValues2.default)(allClusterResults, function (clusterResult) {
|
|
225
|
+
return {
|
|
226
|
+
udp: _this.mapTransportResultToBackendDataFormat(clusterResult.udp || {
|
|
227
|
+
result: 'untested'
|
|
228
|
+
}),
|
|
229
|
+
tcp: _this.mapTransportResultToBackendDataFormat(clusterResult.tcp || {
|
|
230
|
+
result: 'untested'
|
|
231
|
+
}),
|
|
232
|
+
xtls: _this.mapTransportResultToBackendDataFormat(clusterResult.xtls || {
|
|
233
|
+
result: 'untested'
|
|
234
|
+
})
|
|
235
|
+
};
|
|
236
|
+
});
|
|
237
|
+
_context3.next = 11;
|
|
238
|
+
break;
|
|
239
|
+
case 8:
|
|
240
|
+
_context3.prev = 8;
|
|
241
|
+
_context3.t0 = _context3["catch"](0);
|
|
242
|
+
// empty storage, that's ok
|
|
243
|
+
_loggerProxy.default.logger.warn('Roap:request#attachReachabilityData --> Error parsing reachability data: ', _context3.t0);
|
|
244
|
+
case 11:
|
|
245
|
+
return _context3.abrupt("return", results);
|
|
246
|
+
case 12:
|
|
247
|
+
case "end":
|
|
248
|
+
return _context3.stop();
|
|
249
|
+
}
|
|
250
|
+
}, _callee3, this, [[0, 8]]);
|
|
251
|
+
}));
|
|
252
|
+
function getReachabilityResults() {
|
|
253
|
+
return _getReachabilityResults.apply(this, arguments);
|
|
254
|
+
}
|
|
255
|
+
return getReachabilityResults;
|
|
256
|
+
}()
|
|
125
257
|
/**
|
|
126
258
|
* fetches reachability data and checks for cluster reachability
|
|
127
259
|
* @returns {boolean}
|
|
@@ -129,158 +261,41 @@ var Reachability = /*#__PURE__*/function () {
|
|
|
129
261
|
* @memberof Reachability
|
|
130
262
|
*/
|
|
131
263
|
}, {
|
|
132
|
-
key: "
|
|
264
|
+
key: "isAnyPublicClusterReachable",
|
|
133
265
|
value: function () {
|
|
134
|
-
var
|
|
266
|
+
var _isAnyPublicClusterReachable = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
135
267
|
var reachable, reachabilityData, reachabilityResults;
|
|
136
|
-
return _regenerator.default.wrap(function
|
|
137
|
-
while (1) switch (
|
|
268
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
269
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
138
270
|
case 0:
|
|
139
271
|
reachable = false; // @ts-ignore
|
|
140
|
-
|
|
272
|
+
_context4.next = 3;
|
|
141
273
|
return this.webex.boundedStorage.get(this.namespace, _constants.REACHABILITY.localStorageResult).catch(function () {});
|
|
142
274
|
case 3:
|
|
143
|
-
reachabilityData =
|
|
275
|
+
reachabilityData = _context4.sent;
|
|
144
276
|
if (reachabilityData) {
|
|
145
277
|
try {
|
|
146
278
|
reachabilityResults = JSON.parse(reachabilityData);
|
|
147
279
|
reachable = (0, _values.default)(reachabilityResults).some(function (result) {
|
|
148
280
|
var _result$udp, _result$tcp;
|
|
149
|
-
return ((_result$udp = result.udp) === null || _result$udp === void 0 ? void 0 : _result$udp.
|
|
281
|
+
return !result.isVideoMesh && (((_result$udp = result.udp) === null || _result$udp === void 0 ? void 0 : _result$udp.result) === 'reachable' || ((_result$tcp = result.tcp) === null || _result$tcp === void 0 ? void 0 : _result$tcp.result) === 'reachable');
|
|
150
282
|
});
|
|
151
283
|
} catch (e) {
|
|
152
284
|
_loggerProxy.default.logger.error("Roap:request#attachReachabilityData --> Error in parsing reachability data: ".concat(e));
|
|
153
285
|
}
|
|
154
286
|
}
|
|
155
|
-
return
|
|
287
|
+
return _context4.abrupt("return", reachable);
|
|
156
288
|
case 6:
|
|
157
289
|
case "end":
|
|
158
|
-
return
|
|
290
|
+
return _context4.stop();
|
|
159
291
|
}
|
|
160
|
-
},
|
|
292
|
+
}, _callee4, this);
|
|
161
293
|
}));
|
|
162
|
-
function
|
|
163
|
-
return
|
|
294
|
+
function isAnyPublicClusterReachable() {
|
|
295
|
+
return _isAnyPublicClusterReachable.apply(this, arguments);
|
|
164
296
|
}
|
|
165
|
-
return
|
|
297
|
+
return isAnyPublicClusterReachable;
|
|
166
298
|
}()
|
|
167
|
-
/**
|
|
168
|
-
* Generate peerConnection config settings
|
|
169
|
-
* @param {object} cluster
|
|
170
|
-
* @returns {object} peerConnectionConfig
|
|
171
|
-
* @private
|
|
172
|
-
* @memberof Reachability
|
|
173
|
-
*/
|
|
174
|
-
}, {
|
|
175
|
-
key: "buildPeerConnectionConfig",
|
|
176
|
-
value: function buildPeerConnectionConfig(cluster) {
|
|
177
|
-
var iceServers = (0, _uniq2.default)(cluster.udp).map(function (url) {
|
|
178
|
-
return {
|
|
179
|
-
username: '',
|
|
180
|
-
credential: '',
|
|
181
|
-
urls: [url]
|
|
182
|
-
};
|
|
183
|
-
});
|
|
184
|
-
return {
|
|
185
|
-
iceServers: (0, _toConsumableArray2.default)(iceServers),
|
|
186
|
-
iceCandidatePoolSize: '0',
|
|
187
|
-
iceTransportPolicy: 'all'
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Creates an RTCPeerConnection
|
|
193
|
-
* @param {object} cluster
|
|
194
|
-
* @returns {RTCPeerConnection} peerConnection
|
|
195
|
-
* @private
|
|
196
|
-
* @memberof Reachability
|
|
197
|
-
*/
|
|
198
|
-
}, {
|
|
199
|
-
key: "createPeerConnection",
|
|
200
|
-
value: function createPeerConnection(cluster) {
|
|
201
|
-
var key = cluster.key,
|
|
202
|
-
config = cluster.config;
|
|
203
|
-
try {
|
|
204
|
-
var peerConnection = new window.RTCPeerConnection(config);
|
|
205
|
-
|
|
206
|
-
// @ts-ignore
|
|
207
|
-
peerConnection.key = key;
|
|
208
|
-
return peerConnection;
|
|
209
|
-
} catch (peerConnectionError) {
|
|
210
|
-
_loggerProxy.default.logger.log("Reachability:index#createPeerConnection --> Error creating peerConnection: ".concat(peerConnectionError));
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Gets total elapsed time
|
|
217
|
-
* @param {RTCPeerConnection} peerConnection
|
|
218
|
-
* @returns {Number} Milliseconds
|
|
219
|
-
* @private
|
|
220
|
-
* @memberof Reachability
|
|
221
|
-
*/
|
|
222
|
-
}, {
|
|
223
|
-
key: "getElapsedTime",
|
|
224
|
-
value: function getElapsedTime(peerConnection) {
|
|
225
|
-
var startTime = peerConnection.begin;
|
|
226
|
-
delete peerConnection.begin;
|
|
227
|
-
return (0, _now.default)() - startTime;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* creates offer and generates localSDP
|
|
232
|
-
* @param {object} clusterList cluster List
|
|
233
|
-
* @returns {Promise} Reachability latency results
|
|
234
|
-
* @private
|
|
235
|
-
* @memberof Reachability
|
|
236
|
-
*/
|
|
237
|
-
}, {
|
|
238
|
-
key: "getLocalSDPForClusters",
|
|
239
|
-
value: function getLocalSDPForClusters(clusterList) {
|
|
240
|
-
var _this = this;
|
|
241
|
-
var clusters = (0, _toConsumableArray2.default)((0, _keys.default)(clusterList));
|
|
242
|
-
clusters = clusters.map( /*#__PURE__*/function () {
|
|
243
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(key) {
|
|
244
|
-
var cluster, config, peerConnection, description;
|
|
245
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
246
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
247
|
-
case 0:
|
|
248
|
-
cluster = clusterList[key];
|
|
249
|
-
config = _this.buildPeerConnectionConfig(cluster);
|
|
250
|
-
peerConnection = _this.createPeerConnection({
|
|
251
|
-
key: key,
|
|
252
|
-
config: config
|
|
253
|
-
});
|
|
254
|
-
_context3.next = 5;
|
|
255
|
-
return peerConnection.createOffer({
|
|
256
|
-
offerToReceiveAudio: true
|
|
257
|
-
});
|
|
258
|
-
case 5:
|
|
259
|
-
description = _context3.sent;
|
|
260
|
-
// @ts-ignore
|
|
261
|
-
peerConnection.begin = (0, _now.default)();
|
|
262
|
-
peerConnection.setLocalDescription(description);
|
|
263
|
-
return _context3.abrupt("return", _this.iceGatheringState(peerConnection, cluster.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT).catch(function (iceGatheringStateError) {
|
|
264
|
-
_loggerProxy.default.logger.log("Reachability:index#getLocalSDPForClusters --> Error in getLocalSDP : ".concat(iceGatheringStateError));
|
|
265
|
-
}));
|
|
266
|
-
case 9:
|
|
267
|
-
case "end":
|
|
268
|
-
return _context3.stop();
|
|
269
|
-
}
|
|
270
|
-
}, _callee3);
|
|
271
|
-
}));
|
|
272
|
-
return function (_x) {
|
|
273
|
-
return _ref.apply(this, arguments);
|
|
274
|
-
};
|
|
275
|
-
}());
|
|
276
|
-
return _promise.default.all(clusters).then(this.parseIceResultsToReachabilityResults).then(function (reachabilityLatencyResults) {
|
|
277
|
-
_this.logUnreachableClusters();
|
|
278
|
-
|
|
279
|
-
// return results
|
|
280
|
-
return reachabilityLatencyResults;
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
|
|
284
299
|
/**
|
|
285
300
|
* Get list of all unreachable clusters
|
|
286
301
|
* @returns {array} Unreachable clusters
|
|
@@ -288,127 +303,28 @@ var Reachability = /*#__PURE__*/function () {
|
|
|
288
303
|
* @memberof Reachability
|
|
289
304
|
*/
|
|
290
305
|
}, {
|
|
291
|
-
key: "
|
|
292
|
-
value: function
|
|
306
|
+
key: "getUnreachableClusters",
|
|
307
|
+
value: function getUnreachableClusters() {
|
|
293
308
|
var unreachableList = [];
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Attach an event handler for the icegatheringstatechange
|
|
306
|
-
* event and measure latency.
|
|
307
|
-
* @param {RTCPeerConnection} peerConnection
|
|
308
|
-
* @returns {undefined}
|
|
309
|
-
* @private
|
|
310
|
-
* @memberof Reachability
|
|
311
|
-
*/
|
|
312
|
-
}, {
|
|
313
|
-
key: "handleIceGatheringStateChange",
|
|
314
|
-
value: function handleIceGatheringStateChange(peerConnection) {
|
|
315
|
-
var _this2 = this;
|
|
316
|
-
peerConnection.onicegatheringstatechange = function () {
|
|
317
|
-
var COMPLETE = _constants.ICE_GATHERING_STATE.COMPLETE;
|
|
318
|
-
if (peerConnection.iceConnectionState === COMPLETE) {
|
|
319
|
-
var elapsed = _this2.getElapsedTime(peerConnection);
|
|
320
|
-
|
|
321
|
-
// @ts-ignore
|
|
322
|
-
_loggerProxy.default.logger.log( // @ts-ignore
|
|
323
|
-
"Reachability:index#onIceGatheringStateChange --> Successfully pinged ".concat(peerConnection.key, ":"), elapsed);
|
|
324
|
-
_this2.setLatencyAndClose(peerConnection, elapsed);
|
|
309
|
+
(0, _entries.default)(this.clusterReachability).forEach(function (_ref) {
|
|
310
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
311
|
+
key = _ref2[0],
|
|
312
|
+
clusterReachability = _ref2[1];
|
|
313
|
+
var result = clusterReachability.getResult();
|
|
314
|
+
if (result.udp.result === 'unreachable') {
|
|
315
|
+
unreachableList.push({
|
|
316
|
+
name: key,
|
|
317
|
+
protocol: 'udp'
|
|
318
|
+
});
|
|
325
319
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
* event and measure latency.
|
|
332
|
-
* @param {RTCPeerConnection} peerConnection
|
|
333
|
-
* @returns {undefined}
|
|
334
|
-
* @private
|
|
335
|
-
* @memberof Reachability
|
|
336
|
-
*/
|
|
337
|
-
}, {
|
|
338
|
-
key: "handleOnIceCandidate",
|
|
339
|
-
value: function handleOnIceCandidate(peerConnection) {
|
|
340
|
-
var _this3 = this;
|
|
341
|
-
peerConnection.onicecandidate = function (e) {
|
|
342
|
-
var SERVER_REFLEXIVE = 'srflx';
|
|
343
|
-
if (e.candidate && String(e.candidate.type).toLowerCase() === SERVER_REFLEXIVE) {
|
|
344
|
-
var elapsed = _this3.getElapsedTime(peerConnection);
|
|
345
|
-
_loggerProxy.default.logger.log( // @ts-ignore
|
|
346
|
-
"Reachability:index#onIceCandidate --> Successfully pinged ".concat(peerConnection.key, ":"), elapsed);
|
|
347
|
-
// order is important
|
|
348
|
-
_this3.addPublicIP(peerConnection, e.candidate.address);
|
|
349
|
-
_this3.setLatencyAndClose(peerConnection, elapsed);
|
|
320
|
+
if (result.tcp.result === 'unreachable') {
|
|
321
|
+
unreachableList.push({
|
|
322
|
+
name: key,
|
|
323
|
+
protocol: 'tcp'
|
|
324
|
+
});
|
|
350
325
|
}
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* An event handler on an RTCPeerConnection when the state of the ICE
|
|
356
|
-
* candidate gathering process changes. Used to measure connection
|
|
357
|
-
* speed.
|
|
358
|
-
* @private
|
|
359
|
-
* @param {RTCPeerConnection} peerConnection
|
|
360
|
-
* @param {number} timeout
|
|
361
|
-
* @returns {Promise}
|
|
362
|
-
*/
|
|
363
|
-
}, {
|
|
364
|
-
key: "iceGatheringState",
|
|
365
|
-
value: function iceGatheringState(peerConnection, timeout) {
|
|
366
|
-
var _this4 = this;
|
|
367
|
-
var ELAPSED = 'elapsed';
|
|
368
|
-
return new _promise.default(function (resolve) {
|
|
369
|
-
var peerConnectionProxy = new window.Proxy(peerConnection, {
|
|
370
|
-
// eslint-disable-next-line require-jsdoc
|
|
371
|
-
get: function get(target, property) {
|
|
372
|
-
var targetMember = target[property];
|
|
373
|
-
if (typeof targetMember === 'function') {
|
|
374
|
-
return targetMember.bind(target);
|
|
375
|
-
}
|
|
376
|
-
return targetMember;
|
|
377
|
-
},
|
|
378
|
-
set: function set(target, property, value) {
|
|
379
|
-
// only intercept elapsed property
|
|
380
|
-
if (property === ELAPSED) {
|
|
381
|
-
// @ts-ignore
|
|
382
|
-
resolve({
|
|
383
|
-
clusterId: peerConnection.key,
|
|
384
|
-
publicIPs: target.publicIPs,
|
|
385
|
-
elapsed: value
|
|
386
|
-
});
|
|
387
|
-
return true;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
// pass thru
|
|
391
|
-
return window.Reflect.set(target, property, value);
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
// Using peerConnection proxy so handle functions below
|
|
396
|
-
// won't be coupled to our promise implementation
|
|
397
|
-
_this4.handleIceGatheringStateChange(peerConnectionProxy);
|
|
398
|
-
_this4.handleOnIceCandidate(peerConnectionProxy);
|
|
399
|
-
|
|
400
|
-
// Set maximum timeout
|
|
401
|
-
window.setTimeout(function () {
|
|
402
|
-
var CLOSED = _constants.CONNECTION_STATE.CLOSED;
|
|
403
|
-
|
|
404
|
-
// Close any open peerConnections
|
|
405
|
-
if (peerConnectionProxy.connectionState !== CLOSED) {
|
|
406
|
-
// order is important
|
|
407
|
-
_this4.addPublicIP(peerConnectionProxy, null);
|
|
408
|
-
_this4.setLatencyAndClose(peerConnectionProxy, null);
|
|
409
|
-
}
|
|
410
|
-
}, timeout);
|
|
411
326
|
});
|
|
327
|
+
return unreachableList;
|
|
412
328
|
}
|
|
413
329
|
|
|
414
330
|
/**
|
|
@@ -420,156 +336,70 @@ var Reachability = /*#__PURE__*/function () {
|
|
|
420
336
|
}, {
|
|
421
337
|
key: "logUnreachableClusters",
|
|
422
338
|
value: function logUnreachableClusters() {
|
|
423
|
-
var list = this.
|
|
424
|
-
list.forEach(function (
|
|
425
|
-
|
|
339
|
+
var list = this.getUnreachableClusters();
|
|
340
|
+
list.forEach(function (_ref3) {
|
|
341
|
+
var name = _ref3.name,
|
|
342
|
+
protocol = _ref3.protocol;
|
|
343
|
+
_loggerProxy.default.logger.log("Reachability:index#logUnreachableClusters --> failed to reach ".concat(name, " over ").concat(protocol));
|
|
426
344
|
});
|
|
427
345
|
}
|
|
428
346
|
|
|
429
347
|
/**
|
|
430
|
-
*
|
|
431
|
-
* @param {
|
|
432
|
-
* @returns {
|
|
433
|
-
* @protected
|
|
434
|
-
* @memberof Reachability
|
|
348
|
+
* Performs reachability checks for all clusters
|
|
349
|
+
* @param {ClusterList} clusterList
|
|
350
|
+
* @returns {Promise<ReachabilityResults>} reachability check results
|
|
435
351
|
*/
|
|
436
352
|
}, {
|
|
437
|
-
key: "
|
|
438
|
-
value: function
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
var
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
clientMediaIPs: publicIPs
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
reachabilityMap[clusterId] = {
|
|
461
|
-
udp: latencyResult,
|
|
462
|
-
tcp: {
|
|
463
|
-
untested: 'true'
|
|
464
|
-
},
|
|
465
|
-
xtls: {
|
|
466
|
-
untested: 'true'
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
});
|
|
470
|
-
return reachabilityMap;
|
|
471
|
-
}
|
|
353
|
+
key: "performReachabilityChecks",
|
|
354
|
+
value: function () {
|
|
355
|
+
var _performReachabilityChecks = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(clusterList) {
|
|
356
|
+
var _this2 = this;
|
|
357
|
+
var results, clusterReachabilityChecks;
|
|
358
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
359
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
360
|
+
case 0:
|
|
361
|
+
results = {};
|
|
362
|
+
if (!(!clusterList || !(0, _keys.default)(clusterList).length)) {
|
|
363
|
+
_context5.next = 3;
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
return _context5.abrupt("return", _promise.default.resolve(results));
|
|
367
|
+
case 3:
|
|
368
|
+
_loggerProxy.default.logger.log("Reachability:index#performReachabilityChecks --> doing UDP".concat(
|
|
369
|
+
// @ts-ignore
|
|
370
|
+
this.webex.config.meetings.experimental.enableTcpReachability ? ' and TCP' : '', " reachability checks"));
|
|
371
|
+
clusterReachabilityChecks = (0, _keys.default)(clusterList).map(function (key) {
|
|
372
|
+
var cluster = clusterList[key];
|
|
472
373
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
resolve(localSDPData);
|
|
374
|
+
// Linus doesn't support TCP reachability checks on video mesh nodes
|
|
375
|
+
var includeTcpReachability =
|
|
376
|
+
// @ts-ignore
|
|
377
|
+
_this2.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
|
|
378
|
+
if (!includeTcpReachability) {
|
|
379
|
+
cluster.tcp = [];
|
|
380
|
+
}
|
|
381
|
+
_this2.clusterReachability[key] = new _clusterReachability.ClusterReachability(key, cluster);
|
|
382
|
+
return _this2.clusterReachability[key].start().then(function (result) {
|
|
383
|
+
results[key] = result;
|
|
384
|
+
results[key].isVideoMesh = cluster.isVideoMesh;
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
_context5.next = 7;
|
|
388
|
+
return _promise.default.all(clusterReachabilityChecks);
|
|
389
|
+
case 7:
|
|
390
|
+
this.logUnreachableClusters();
|
|
391
|
+
return _context5.abrupt("return", results);
|
|
392
|
+
case 9:
|
|
393
|
+
case "end":
|
|
394
|
+
return _context5.stop();
|
|
495
395
|
}
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Adds public IP (client media IPs)
|
|
505
|
-
* @param {RTCPeerConnection} peerConnection
|
|
506
|
-
* @param {string} publicIP
|
|
507
|
-
* @returns {void}
|
|
508
|
-
*/
|
|
509
|
-
}, {
|
|
510
|
-
key: "addPublicIP",
|
|
511
|
-
value: function addPublicIP(peerConnection, publicIP) {
|
|
512
|
-
var modifiedPeerConnection = peerConnection;
|
|
513
|
-
var CLOSED = _constants.CONNECTION_STATE.CLOSED;
|
|
514
|
-
if (modifiedPeerConnection.connectionState === CLOSED) {
|
|
515
|
-
_loggerProxy.default.logger.log("Reachability:index#addPublicIP --> Attempting to set publicIP of ".concat(publicIP, " on closed peerConnection."));
|
|
516
|
-
}
|
|
517
|
-
if (publicIP) {
|
|
518
|
-
if (modifiedPeerConnection.publicIPs) {
|
|
519
|
-
modifiedPeerConnection.publicIPs.push(publicIP);
|
|
520
|
-
} else {
|
|
521
|
-
modifiedPeerConnection.publicIPs = [publicIP];
|
|
522
|
-
}
|
|
523
|
-
} else {
|
|
524
|
-
modifiedPeerConnection.publicIPs = null;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Records latency and closes the peerConnection
|
|
530
|
-
* @param {RTCPeerConnection} peerConnection
|
|
531
|
-
* @param {number} elapsed Latency in milliseconds
|
|
532
|
-
* @returns {undefined}
|
|
533
|
-
* @private
|
|
534
|
-
* @memberof Reachability
|
|
535
|
-
*/
|
|
536
|
-
}, {
|
|
537
|
-
key: "setLatencyAndClose",
|
|
538
|
-
value: function setLatencyAndClose(peerConnection, elapsed) {
|
|
539
|
-
var _intialState;
|
|
540
|
-
var REACHABLE = 'reachable';
|
|
541
|
-
var UNREACHABLE = 'unreachable';
|
|
542
|
-
var CLOSED = _constants.CONNECTION_STATE.CLOSED;
|
|
543
|
-
// @ts-ignore
|
|
544
|
-
var key = peerConnection.key;
|
|
545
|
-
var resultKey = elapsed === null ? UNREACHABLE : REACHABLE;
|
|
546
|
-
var intialState = (_intialState = {}, (0, _defineProperty2.default)(_intialState, REACHABLE, 0), (0, _defineProperty2.default)(_intialState, UNREACHABLE, 0), _intialState);
|
|
547
|
-
if (peerConnection.connectionState === CLOSED) {
|
|
548
|
-
_loggerProxy.default.logger.log("Reachability:index#setLatencyAndClose --> Attempting to set latency of ".concat(elapsed, " on closed peerConnection."));
|
|
549
|
-
return;
|
|
396
|
+
}, _callee5, this);
|
|
397
|
+
}));
|
|
398
|
+
function performReachabilityChecks(_x) {
|
|
399
|
+
return _performReachabilityChecks.apply(this, arguments);
|
|
550
400
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
// Set to null in case this fired from
|
|
555
|
-
// an event other than onIceCandidate
|
|
556
|
-
peerConnection.onicecandidate = null;
|
|
557
|
-
peerConnection.close();
|
|
558
|
-
// @ts-ignore
|
|
559
|
-
peerConnection.elapsed = elapsed;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* utility function
|
|
564
|
-
* @returns {undefined}
|
|
565
|
-
* @private
|
|
566
|
-
* @memberof Reachability
|
|
567
|
-
*/
|
|
568
|
-
}, {
|
|
569
|
-
key: "setup",
|
|
570
|
-
value: function setup() {
|
|
571
|
-
this.clusterLatencyResults = {};
|
|
572
|
-
}
|
|
401
|
+
return performReachabilityChecks;
|
|
402
|
+
}()
|
|
573
403
|
}]);
|
|
574
404
|
return Reachability;
|
|
575
405
|
}();
|