@webex/plugin-meetings 3.0.0-beta.337 → 3.0.0-beta.339

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.
@@ -209,7 +209,7 @@ var Breakout = _webexCore.WebexPlugin.extend({
209
209
  sessionId: this.sessionId
210
210
  });
211
211
  },
212
- version: "3.0.0-beta.337"
212
+ version: "3.0.0-beta.339"
213
213
  });
214
214
  var _default = Breakout;
215
215
  exports.default = _default;
@@ -1041,7 +1041,7 @@ var Breakouts = _webexCore.WebexPlugin.extend({
1041
1041
  this.trigger(_constants.BREAKOUTS.EVENTS.ASK_RETURN_TO_MAIN);
1042
1042
  }
1043
1043
  },
1044
- version: "3.0.0-beta.337"
1044
+ version: "3.0.0-beta.339"
1045
1045
  });
1046
1046
  var _default = Breakouts;
1047
1047
  exports.default = _default;
package/dist/config.js CHANGED
@@ -93,7 +93,8 @@ var _default = {
93
93
  experimental: {
94
94
  enableMediaNegotiatedEvent: false,
95
95
  enableUnifiedMeetings: true,
96
- enableAdhocMeetings: true
96
+ enableAdhocMeetings: true,
97
+ enableTcpReachability: false
97
98
  },
98
99
  degradationPreferences: {
99
100
  maxMacroblocksLimit: 8192
@@ -1 +1 @@
1
- {"version":3,"names":["meetings","deviceType","WEB","mediaSettings","pstn","reconnection","enabled","autoRejoin","detection","iceReconnectionTimeout","maxRejoinAttempts","stats","enableStatsAnalyzer","autoDowngradeEnabled","interval","analyzerInterval","historyMax","videoPacketLossRatioThreshold","rttThreshold","jitterThreshold","metrics","clientName","clientType","subClientType","mqaMetricsInterval","autoSendMQA","logging","enable","verboseEvents","resolution","maxWidth","maxHeight","idealWidth","idealHeight","screenResolution","bandwidth","audio","video","startBitrate","screenFrameRate","videoShareFrameRate","aspectRatio","autoUploadLogs","enableRtx","receiveTranscription","enableExtmap","enableAutomaticLLM","installedOrgID","undefined","experimental","enableMediaNegotiatedEvent","enableUnifiedMeetings","enableAdhocMeetings","degradationPreferences","maxMacroblocksLimit"],"sources":["config.ts"],"sourcesContent":["import {\n // @ts-ignore\n deviceType,\n} from '@webex/common';\n\nexport default {\n // TODO: this needs to be defaulted\n // to JS_SDK and clients set it to WEB or others\n // see https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-73167\n meetings: {\n deviceType: deviceType.WEB,\n mediaSettings: {\n pstn: false,\n },\n reconnection: {\n enabled: false,\n autoRejoin: true,\n detection: true,\n // Timeout duration to wait for ICE to reconnect if a disconnect is received.\n iceReconnectionTimeout: 10000,\n // Amount of times attempting to rejoin a meeting during reconnect\n maxRejoinAttempts: 3,\n },\n stats: {\n // Enable the webrtc stats analyzer that emits quality degradation events\n enableStatsAnalyzer: true,\n // Enable the auto downgrade video quality feature\n autoDowngradeEnabled: false,\n // 1 second intervals to collect stats data\n interval: 1000,\n // we just want to analyze data every 5 sec interval\n analyzerInterval: 5000,\n // hold the last 2 minute of a calls data\n historyMax: 120,\n // Once packet loss hits this ratio, the video will downgrade\n videoPacketLossRatioThreshold: 9, // comparison of packets lost / packets received\n rttThreshold: 500, // 500 ms noticeable quality lag begins based on bandwidth of user\n jitterThreshold: 500, // 500 ms noticeable quality lag begins based on bandwidth of user\n },\n metrics: {\n // change to your client name else data will be muddled\n // you do not need a specific format, and you do not need to register it\n clientName: 'WEBEX_JS_SDK',\n // TODO: for now this line has to be whitelisted, which is problematic for third party\n clientType: 'WEBEX_SDK',\n // Stores the sub client type used when sending metrics\n subClientType: 'WEB_APP',\n // send average values MQA in 60 second intervals\n mqaMetricsInterval: 60000,\n // send to cisco internal MQA data automatically\n // we already send CA\n autoSendMQA: true,\n },\n logging: {\n enable: true,\n verboseEvents: true,\n },\n resolution: {\n maxWidth: 1280,\n maxHeight: 720,\n idealWidth: 1280,\n idealHeight: 720,\n },\n screenResolution: {\n maxWidth: 1920,\n maxHeight: 1080,\n idealWidth: 1920,\n idealHeight: 1080,\n },\n bandwidth: {\n // please note, these are the maximum bandwidth values\n // the server supports, minimums have to be tested\n audio: 64000,\n video: 4000000,\n startBitrate: 2000,\n },\n screenFrameRate: 10,\n videoShareFrameRate: 30,\n aspectRatio: 1.7695852534562213,\n // When enabled, as calls are ended, it will upload the SDK logs and correlate them\n autoUploadLogs: true,\n enableRtx: true,\n receiveTranscription: false,\n enableExtmap: false,\n enableAutomaticLLM: false,\n installedOrgID: undefined,\n experimental: {\n enableMediaNegotiatedEvent: false,\n enableUnifiedMeetings: true,\n enableAdhocMeetings: true,\n },\n degradationPreferences: {\n maxMacroblocksLimit: 8192,\n },\n },\n};\n"],"mappings":";;;;;;;AAAA;AAGuB,eAER;EACb;EACA;EACA;EACAA,QAAQ,EAAE;IACRC,UAAU,EAAEA,kBAAU,CAACC,GAAG;IAC1BC,aAAa,EAAE;MACbC,IAAI,EAAE;IACR,CAAC;IACDC,YAAY,EAAE;MACZC,OAAO,EAAE,KAAK;MACdC,UAAU,EAAE,IAAI;MAChBC,SAAS,EAAE,IAAI;MACf;MACAC,sBAAsB,EAAE,KAAK;MAC7B;MACAC,iBAAiB,EAAE;IACrB,CAAC;IACDC,KAAK,EAAE;MACL;MACAC,mBAAmB,EAAE,IAAI;MACzB;MACAC,oBAAoB,EAAE,KAAK;MAC3B;MACAC,QAAQ,EAAE,IAAI;MACd;MACAC,gBAAgB,EAAE,IAAI;MACtB;MACAC,UAAU,EAAE,GAAG;MACf;MACAC,6BAA6B,EAAE,CAAC;MAAE;MAClCC,YAAY,EAAE,GAAG;MAAE;MACnBC,eAAe,EAAE,GAAG,CAAE;IACxB,CAAC;;IACDC,OAAO,EAAE;MACP;MACA;MACAC,UAAU,EAAE,cAAc;MAC1B;MACAC,UAAU,EAAE,WAAW;MACvB;MACAC,aAAa,EAAE,SAAS;MACxB;MACAC,kBAAkB,EAAE,KAAK;MACzB;MACA;MACAC,WAAW,EAAE;IACf,CAAC;IACDC,OAAO,EAAE;MACPC,MAAM,EAAE,IAAI;MACZC,aAAa,EAAE;IACjB,CAAC;IACDC,UAAU,EAAE;MACVC,QAAQ,EAAE,IAAI;MACdC,SAAS,EAAE,GAAG;MACdC,UAAU,EAAE,IAAI;MAChBC,WAAW,EAAE;IACf,CAAC;IACDC,gBAAgB,EAAE;MAChBJ,QAAQ,EAAE,IAAI;MACdC,SAAS,EAAE,IAAI;MACfC,UAAU,EAAE,IAAI;MAChBC,WAAW,EAAE;IACf,CAAC;IACDE,SAAS,EAAE;MACT;MACA;MACAC,KAAK,EAAE,KAAK;MACZC,KAAK,EAAE,OAAO;MACdC,YAAY,EAAE;IAChB,CAAC;IACDC,eAAe,EAAE,EAAE;IACnBC,mBAAmB,EAAE,EAAE;IACvBC,WAAW,EAAE,kBAAkB;IAC/B;IACAC,cAAc,EAAE,IAAI;IACpBC,SAAS,EAAE,IAAI;IACfC,oBAAoB,EAAE,KAAK;IAC3BC,YAAY,EAAE,KAAK;IACnBC,kBAAkB,EAAE,KAAK;IACzBC,cAAc,EAAEC,SAAS;IACzBC,YAAY,EAAE;MACZC,0BAA0B,EAAE,KAAK;MACjCC,qBAAqB,EAAE,IAAI;MAC3BC,mBAAmB,EAAE;IACvB,CAAC;IACDC,sBAAsB,EAAE;MACtBC,mBAAmB,EAAE;IACvB;EACF;AACF,CAAC;AAAA"}
1
+ {"version":3,"names":["meetings","deviceType","WEB","mediaSettings","pstn","reconnection","enabled","autoRejoin","detection","iceReconnectionTimeout","maxRejoinAttempts","stats","enableStatsAnalyzer","autoDowngradeEnabled","interval","analyzerInterval","historyMax","videoPacketLossRatioThreshold","rttThreshold","jitterThreshold","metrics","clientName","clientType","subClientType","mqaMetricsInterval","autoSendMQA","logging","enable","verboseEvents","resolution","maxWidth","maxHeight","idealWidth","idealHeight","screenResolution","bandwidth","audio","video","startBitrate","screenFrameRate","videoShareFrameRate","aspectRatio","autoUploadLogs","enableRtx","receiveTranscription","enableExtmap","enableAutomaticLLM","installedOrgID","undefined","experimental","enableMediaNegotiatedEvent","enableUnifiedMeetings","enableAdhocMeetings","enableTcpReachability","degradationPreferences","maxMacroblocksLimit"],"sources":["config.ts"],"sourcesContent":["import {\n // @ts-ignore\n deviceType,\n} from '@webex/common';\n\nexport default {\n // TODO: this needs to be defaulted\n // to JS_SDK and clients set it to WEB or others\n // see https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-73167\n meetings: {\n deviceType: deviceType.WEB,\n mediaSettings: {\n pstn: false,\n },\n reconnection: {\n enabled: false,\n autoRejoin: true,\n detection: true,\n // Timeout duration to wait for ICE to reconnect if a disconnect is received.\n iceReconnectionTimeout: 10000,\n // Amount of times attempting to rejoin a meeting during reconnect\n maxRejoinAttempts: 3,\n },\n stats: {\n // Enable the webrtc stats analyzer that emits quality degradation events\n enableStatsAnalyzer: true,\n // Enable the auto downgrade video quality feature\n autoDowngradeEnabled: false,\n // 1 second intervals to collect stats data\n interval: 1000,\n // we just want to analyze data every 5 sec interval\n analyzerInterval: 5000,\n // hold the last 2 minute of a calls data\n historyMax: 120,\n // Once packet loss hits this ratio, the video will downgrade\n videoPacketLossRatioThreshold: 9, // comparison of packets lost / packets received\n rttThreshold: 500, // 500 ms noticeable quality lag begins based on bandwidth of user\n jitterThreshold: 500, // 500 ms noticeable quality lag begins based on bandwidth of user\n },\n metrics: {\n // change to your client name else data will be muddled\n // you do not need a specific format, and you do not need to register it\n clientName: 'WEBEX_JS_SDK',\n // TODO: for now this line has to be whitelisted, which is problematic for third party\n clientType: 'WEBEX_SDK',\n // Stores the sub client type used when sending metrics\n subClientType: 'WEB_APP',\n // send average values MQA in 60 second intervals\n mqaMetricsInterval: 60000,\n // send to cisco internal MQA data automatically\n // we already send CA\n autoSendMQA: true,\n },\n logging: {\n enable: true,\n verboseEvents: true,\n },\n resolution: {\n maxWidth: 1280,\n maxHeight: 720,\n idealWidth: 1280,\n idealHeight: 720,\n },\n screenResolution: {\n maxWidth: 1920,\n maxHeight: 1080,\n idealWidth: 1920,\n idealHeight: 1080,\n },\n bandwidth: {\n // please note, these are the maximum bandwidth values\n // the server supports, minimums have to be tested\n audio: 64000,\n video: 4000000,\n startBitrate: 2000,\n },\n screenFrameRate: 10,\n videoShareFrameRate: 30,\n aspectRatio: 1.7695852534562213,\n // When enabled, as calls are ended, it will upload the SDK logs and correlate them\n autoUploadLogs: true,\n enableRtx: true,\n receiveTranscription: false,\n enableExtmap: false,\n enableAutomaticLLM: false,\n installedOrgID: undefined,\n experimental: {\n enableMediaNegotiatedEvent: false,\n enableUnifiedMeetings: true,\n enableAdhocMeetings: true,\n enableTcpReachability: false,\n },\n degradationPreferences: {\n maxMacroblocksLimit: 8192,\n },\n },\n};\n"],"mappings":";;;;;;;AAAA;AAGuB,eAER;EACb;EACA;EACA;EACAA,QAAQ,EAAE;IACRC,UAAU,EAAEA,kBAAU,CAACC,GAAG;IAC1BC,aAAa,EAAE;MACbC,IAAI,EAAE;IACR,CAAC;IACDC,YAAY,EAAE;MACZC,OAAO,EAAE,KAAK;MACdC,UAAU,EAAE,IAAI;MAChBC,SAAS,EAAE,IAAI;MACf;MACAC,sBAAsB,EAAE,KAAK;MAC7B;MACAC,iBAAiB,EAAE;IACrB,CAAC;IACDC,KAAK,EAAE;MACL;MACAC,mBAAmB,EAAE,IAAI;MACzB;MACAC,oBAAoB,EAAE,KAAK;MAC3B;MACAC,QAAQ,EAAE,IAAI;MACd;MACAC,gBAAgB,EAAE,IAAI;MACtB;MACAC,UAAU,EAAE,GAAG;MACf;MACAC,6BAA6B,EAAE,CAAC;MAAE;MAClCC,YAAY,EAAE,GAAG;MAAE;MACnBC,eAAe,EAAE,GAAG,CAAE;IACxB,CAAC;;IACDC,OAAO,EAAE;MACP;MACA;MACAC,UAAU,EAAE,cAAc;MAC1B;MACAC,UAAU,EAAE,WAAW;MACvB;MACAC,aAAa,EAAE,SAAS;MACxB;MACAC,kBAAkB,EAAE,KAAK;MACzB;MACA;MACAC,WAAW,EAAE;IACf,CAAC;IACDC,OAAO,EAAE;MACPC,MAAM,EAAE,IAAI;MACZC,aAAa,EAAE;IACjB,CAAC;IACDC,UAAU,EAAE;MACVC,QAAQ,EAAE,IAAI;MACdC,SAAS,EAAE,GAAG;MACdC,UAAU,EAAE,IAAI;MAChBC,WAAW,EAAE;IACf,CAAC;IACDC,gBAAgB,EAAE;MAChBJ,QAAQ,EAAE,IAAI;MACdC,SAAS,EAAE,IAAI;MACfC,UAAU,EAAE,IAAI;MAChBC,WAAW,EAAE;IACf,CAAC;IACDE,SAAS,EAAE;MACT;MACA;MACAC,KAAK,EAAE,KAAK;MACZC,KAAK,EAAE,OAAO;MACdC,YAAY,EAAE;IAChB,CAAC;IACDC,eAAe,EAAE,EAAE;IACnBC,mBAAmB,EAAE,EAAE;IACvBC,WAAW,EAAE,kBAAkB;IAC/B;IACAC,cAAc,EAAE,IAAI;IACpBC,SAAS,EAAE,IAAI;IACfC,oBAAoB,EAAE,KAAK;IAC3BC,YAAY,EAAE,KAAK;IACnBC,kBAAkB,EAAE,KAAK;IACzBC,cAAc,EAAEC,SAAS;IACzBC,YAAY,EAAE;MACZC,0BAA0B,EAAE,KAAK;MACjCC,qBAAqB,EAAE,IAAI;MAC3BC,mBAAmB,EAAE,IAAI;MACzBC,qBAAqB,EAAE;IACzB,CAAC;IACDC,sBAAsB,EAAE;MACtBC,mBAAmB,EAAE;IACvB;EACF;AACF,CAAC;AAAA"}
@@ -359,7 +359,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
359
359
  throw error;
360
360
  });
361
361
  },
362
- version: "3.0.0-beta.337"
362
+ version: "3.0.0-beta.339"
363
363
  });
364
364
  var _default = SimultaneousInterpretation;
365
365
  exports.default = _default;
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.0.0-beta.337"
21
+ version: "3.0.0-beta.339"
22
22
  });
23
23
  var _default = SILanguage;
24
24
  exports.default = _default;
@@ -0,0 +1,356 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
5
+ _Object$defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.ClusterReachability = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
13
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
15
+ var _common = require("@webex/common");
16
+ var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
17
+ var _util = require("./util");
18
+ var _constants = require("../constants");
19
+ var DEFAULT_TIMEOUT = 3000;
20
+ var VIDEO_MESH_TIMEOUT = 1000;
21
+
22
+ // result for a specific transport protocol (like udp or tcp)
23
+ /**
24
+ * A class that handles reachability checks for a single cluster.
25
+ */
26
+ var ClusterReachability = /*#__PURE__*/function () {
27
+ // this defer is resolved once reachability checks for this cluster are completed
28
+
29
+ /**
30
+ * Constructor for ClusterReachability
31
+ * @param {string} name cluster name
32
+ * @param {ClusterNode} clusterInfo information about the media cluster
33
+ */
34
+ function ClusterReachability(name, clusterInfo) {
35
+ (0, _classCallCheck2.default)(this, ClusterReachability);
36
+ (0, _defineProperty2.default)(this, "numUdpUrls", void 0);
37
+ (0, _defineProperty2.default)(this, "numTcpUrls", void 0);
38
+ (0, _defineProperty2.default)(this, "result", void 0);
39
+ (0, _defineProperty2.default)(this, "pc", void 0);
40
+ (0, _defineProperty2.default)(this, "defer", void 0);
41
+ (0, _defineProperty2.default)(this, "startTimestamp", void 0);
42
+ (0, _defineProperty2.default)(this, "isVideoMesh", void 0);
43
+ (0, _defineProperty2.default)(this, "name", void 0);
44
+ this.name = name;
45
+ this.isVideoMesh = clusterInfo.isVideoMesh;
46
+ this.numUdpUrls = clusterInfo.udp.length;
47
+ this.numTcpUrls = clusterInfo.tcp.length;
48
+ this.pc = this.createPeerConnection(clusterInfo);
49
+ this.defer = new _common.Defer();
50
+ this.result = {
51
+ udp: {
52
+ result: 'untested'
53
+ },
54
+ tcp: {
55
+ result: 'untested'
56
+ },
57
+ xtls: {
58
+ result: 'untested'
59
+ }
60
+ };
61
+ }
62
+
63
+ /**
64
+ * Gets total elapsed time, can be called only after start() is called
65
+ * @returns {Number} Milliseconds
66
+ */
67
+ (0, _createClass2.default)(ClusterReachability, [{
68
+ key: "getElapsedTime",
69
+ value: function getElapsedTime() {
70
+ return Math.round(performance.now() - this.startTimestamp);
71
+ }
72
+
73
+ /**
74
+ * Generate peerConnection config settings
75
+ * @param {ClusterNode} cluster
76
+ * @returns {RTCConfiguration} peerConnectionConfig
77
+ */
78
+ }, {
79
+ key: "buildPeerConnectionConfig",
80
+ value: function buildPeerConnectionConfig(cluster) {
81
+ var udpIceServers = cluster.udp.map(function (url) {
82
+ return {
83
+ username: '',
84
+ credential: '',
85
+ urls: [url]
86
+ };
87
+ });
88
+
89
+ // STUN servers are contacted only using UDP, so in order to test TCP reachability
90
+ // we pretend that Linus is a TURN server, because we can explicitly say "transport=tcp" in TURN urls.
91
+ // We then check for relay candidates to know if TURN-TCP worked (see registerIceCandidateListener()).
92
+ var tcpIceServers = cluster.tcp.map(function (urlString) {
93
+ return {
94
+ username: 'webexturnreachuser',
95
+ credential: 'webexturnreachpwd',
96
+ urls: [(0, _util.convertStunUrlToTurn)(urlString, 'tcp')]
97
+ };
98
+ });
99
+ return {
100
+ iceServers: [].concat((0, _toConsumableArray2.default)(udpIceServers), (0, _toConsumableArray2.default)(tcpIceServers)),
101
+ iceCandidatePoolSize: 0,
102
+ iceTransportPolicy: 'all'
103
+ };
104
+ }
105
+
106
+ /**
107
+ * Creates an RTCPeerConnection
108
+ * @param {ClusterNode} clusterInfo information about the media cluster
109
+ * @returns {RTCPeerConnection} peerConnection
110
+ */
111
+ }, {
112
+ key: "createPeerConnection",
113
+ value: function createPeerConnection(clusterInfo) {
114
+ try {
115
+ var config = this.buildPeerConnectionConfig(clusterInfo);
116
+ var peerConnection = new RTCPeerConnection(config);
117
+ return peerConnection;
118
+ } catch (peerConnectionError) {
119
+ _loggerProxy.default.logger.warn("Reachability:index#createPeerConnection --> Error creating peerConnection:", peerConnectionError);
120
+ return undefined;
121
+ }
122
+ }
123
+
124
+ /**
125
+ * @returns {ClusterReachabilityResult} reachability result for this cluster
126
+ */
127
+ }, {
128
+ key: "getResult",
129
+ value: function getResult() {
130
+ return this.result;
131
+ }
132
+
133
+ /**
134
+ * Closes the peerConnection
135
+ *
136
+ * @returns {void}
137
+ */
138
+ }, {
139
+ key: "closePeerConnection",
140
+ value: function closePeerConnection() {
141
+ if (this.pc) {
142
+ this.pc.onicecandidate = null;
143
+ this.pc.onicegatheringstatechange = null;
144
+ this.pc.close();
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Resolves the defer, indicating that reachability checks for this cluster are completed
150
+ *
151
+ * @returns {void}
152
+ */
153
+ }, {
154
+ key: "finishReachabilityCheck",
155
+ value: function finishReachabilityCheck() {
156
+ this.defer.resolve();
157
+ }
158
+
159
+ /**
160
+ * Adds public IP (client media IPs)
161
+ * @param {string} protocol
162
+ * @param {string} publicIP
163
+ * @returns {void}
164
+ */
165
+ }, {
166
+ key: "addPublicIP",
167
+ value: function addPublicIP(protocol, publicIP) {
168
+ var result = this.result[protocol];
169
+ if (publicIP) {
170
+ if (result.clientMediaIPs) {
171
+ if (!result.clientMediaIPs.includes(publicIP)) {
172
+ result.clientMediaIPs.push(publicIP);
173
+ }
174
+ } else {
175
+ result.clientMediaIPs = [publicIP];
176
+ }
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Registers a listener for the iceGatheringStateChange event
182
+ *
183
+ * @returns {void}
184
+ */
185
+ }, {
186
+ key: "registerIceGatheringStateChangeListener",
187
+ value: function registerIceGatheringStateChangeListener() {
188
+ var _this = this;
189
+ this.pc.onicegatheringstatechange = function () {
190
+ var COMPLETE = _constants.ICE_GATHERING_STATE.COMPLETE;
191
+ if (_this.pc.iceConnectionState === COMPLETE) {
192
+ _this.closePeerConnection();
193
+ _this.finishReachabilityCheck();
194
+ }
195
+ };
196
+ }
197
+
198
+ /**
199
+ * Checks if we have the results for all the protocols (UDP and TCP)
200
+ *
201
+ * @returns {boolean} true if we have all results, false otherwise
202
+ */
203
+ }, {
204
+ key: "haveWeGotAllResults",
205
+ value: function haveWeGotAllResults() {
206
+ var _this2 = this;
207
+ return ['udp', 'tcp'].every(function (protocol) {
208
+ return _this2.result[protocol].result === 'reachable' || _this2.result[protocol].result === 'untested';
209
+ });
210
+ }
211
+
212
+ /**
213
+ * Stores the latency in the result for the given protocol and marks it as reachable
214
+ *
215
+ * @param {string} protocol
216
+ * @param {number} latency
217
+ * @returns {void}
218
+ */
219
+ }, {
220
+ key: "storeLatencyResult",
221
+ value: function storeLatencyResult(protocol, latency) {
222
+ var result = this.result[protocol];
223
+ if (result.latencyInMilliseconds === undefined) {
224
+ _loggerProxy.default.logger.log( // @ts-ignore
225
+ "Reachability:index#storeLatencyResult --> Successfully reached ".concat(this.name, " over ").concat(protocol, ": ").concat(latency, "ms"));
226
+ result.latencyInMilliseconds = latency;
227
+ result.result = 'reachable';
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Registers a listener for the icecandidate event
233
+ *
234
+ * @returns {void}
235
+ */
236
+ }, {
237
+ key: "registerIceCandidateListener",
238
+ value: function registerIceCandidateListener() {
239
+ var _this3 = this;
240
+ this.pc.onicecandidate = function (e) {
241
+ var CANDIDATE_TYPES = {
242
+ SERVER_REFLEXIVE: 'srflx',
243
+ RELAY: 'relay'
244
+ };
245
+ if (e.candidate) {
246
+ if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {
247
+ _this3.storeLatencyResult('udp', _this3.getElapsedTime());
248
+ _this3.addPublicIP('udp', e.candidate.address);
249
+ }
250
+ if (e.candidate.type === CANDIDATE_TYPES.RELAY) {
251
+ _this3.storeLatencyResult('tcp', _this3.getElapsedTime());
252
+ // we don't add public IP for TCP, because in the case of relay candidates
253
+ // e.candidate.address is the TURN server address, not the client's public IP
254
+ }
255
+
256
+ if (_this3.haveWeGotAllResults()) {
257
+ _this3.closePeerConnection();
258
+ _this3.finishReachabilityCheck();
259
+ }
260
+ }
261
+ };
262
+ }
263
+
264
+ /**
265
+ * Starts the process of doing UDP and TCP reachability checks on the media cluster.
266
+ * XTLS reachability checking is not supported.
267
+ *
268
+ * @returns {Promise}
269
+ */
270
+ }, {
271
+ key: "start",
272
+ value: function () {
273
+ var _start = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
274
+ var offer;
275
+ return _regenerator.default.wrap(function _callee$(_context) {
276
+ while (1) switch (_context.prev = _context.next) {
277
+ case 0:
278
+ if (this.pc) {
279
+ _context.next = 3;
280
+ break;
281
+ }
282
+ _loggerProxy.default.logger.warn("Reachability:ClusterReachability#start --> Error: peerConnection is undefined");
283
+ return _context.abrupt("return", this.result);
284
+ case 3:
285
+ // Initialize this.result as saying that nothing is reachable.
286
+ // It will get updated as we go along and successfully gather ICE candidates.
287
+ this.result.udp = {
288
+ result: this.numUdpUrls > 0 ? 'unreachable' : 'untested'
289
+ };
290
+ this.result.tcp = {
291
+ result: this.numTcpUrls > 0 ? 'unreachable' : 'untested'
292
+ };
293
+ _context.prev = 5;
294
+ _context.next = 8;
295
+ return this.pc.createOffer({
296
+ offerToReceiveAudio: true
297
+ });
298
+ case 8:
299
+ offer = _context.sent;
300
+ this.startTimestamp = performance.now();
301
+
302
+ // not awaiting the next call on purpose, because we're not sending the offer anywhere and there won't be any answer
303
+ // we just need to make this call to trigger the ICE gathering process
304
+ this.pc.setLocalDescription(offer);
305
+ _context.next = 13;
306
+ return this.gatherIceCandidates();
307
+ case 13:
308
+ _context.next = 18;
309
+ break;
310
+ case 15:
311
+ _context.prev = 15;
312
+ _context.t0 = _context["catch"](5);
313
+ _loggerProxy.default.logger.warn("Reachability:ClusterReachability#start --> Error: ", _context.t0);
314
+ case 18:
315
+ return _context.abrupt("return", this.result);
316
+ case 19:
317
+ case "end":
318
+ return _context.stop();
319
+ }
320
+ }, _callee, this, [[5, 15]]);
321
+ }));
322
+ function start() {
323
+ return _start.apply(this, arguments);
324
+ }
325
+ return start;
326
+ }()
327
+ /**
328
+ * Starts the process of gathering ICE candidates
329
+ *
330
+ * @returns {Promise} promise that's resolved once reachability checks for this cluster are completed or timeout is reached
331
+ */
332
+ }, {
333
+ key: "gatherIceCandidates",
334
+ value: function gatherIceCandidates() {
335
+ var _this4 = this;
336
+ var timeout = this.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT;
337
+ this.registerIceGatheringStateChangeListener();
338
+ this.registerIceCandidateListener();
339
+
340
+ // Set maximum timeout
341
+ setTimeout(function () {
342
+ var CLOSED = _constants.CONNECTION_STATE.CLOSED;
343
+
344
+ // Close any open peerConnections
345
+ if (_this4.pc.connectionState !== CLOSED) {
346
+ _this4.closePeerConnection();
347
+ _this4.finishReachabilityCheck();
348
+ }
349
+ }, timeout);
350
+ return this.defer.promise;
351
+ }
352
+ }]);
353
+ return ClusterReachability;
354
+ }();
355
+ exports.ClusterReachability = ClusterReachability;
356
+ //# sourceMappingURL=clusterReachability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DEFAULT_TIMEOUT","VIDEO_MESH_TIMEOUT","ClusterReachability","name","clusterInfo","isVideoMesh","numUdpUrls","udp","length","numTcpUrls","tcp","pc","createPeerConnection","defer","Defer","result","xtls","Math","round","performance","now","startTimestamp","cluster","udpIceServers","map","url","username","credential","urls","tcpIceServers","urlString","convertStunUrlToTurn","iceServers","iceCandidatePoolSize","iceTransportPolicy","config","buildPeerConnectionConfig","peerConnection","RTCPeerConnection","peerConnectionError","LoggerProxy","logger","warn","undefined","onicecandidate","onicegatheringstatechange","close","resolve","protocol","publicIP","clientMediaIPs","includes","push","COMPLETE","ICE_GATHERING_STATE","iceConnectionState","closePeerConnection","finishReachabilityCheck","every","latency","latencyInMilliseconds","log","e","CANDIDATE_TYPES","SERVER_REFLEXIVE","RELAY","candidate","type","storeLatencyResult","getElapsedTime","addPublicIP","address","haveWeGotAllResults","createOffer","offerToReceiveAudio","offer","setLocalDescription","gatherIceCandidates","timeout","registerIceGatheringStateChangeListener","registerIceCandidateListener","setTimeout","CLOSED","CONNECTION_STATE","connectionState","promise"],"sources":["clusterReachability.ts"],"sourcesContent":["import {Defer} from '@webex/common';\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClusterNode} from './request';\nimport {convertStunUrlToTurn} from './util';\n\nimport {ICE_GATHERING_STATE, CONNECTION_STATE} from '../constants';\n\nconst DEFAULT_TIMEOUT = 3000;\nconst VIDEO_MESH_TIMEOUT = 1000;\n\n// result for a specific transport protocol (like udp or tcp)\nexport type TransportResult = {\n result: 'reachable' | 'unreachable' | 'untested';\n latencyInMilliseconds?: number; // amount of time it took to get the first ICE candidate\n clientMediaIPs?: string[];\n};\n\n// reachability result for a specific media cluster\nexport type ClusterReachabilityResult = {\n udp: TransportResult;\n tcp: TransportResult;\n xtls: TransportResult;\n};\n\n/**\n * A class that handles reachability checks for a single cluster.\n */\nexport class ClusterReachability {\n private numUdpUrls: number;\n private numTcpUrls: number;\n private result: ClusterReachabilityResult;\n private pc?: RTCPeerConnection;\n private defer: Defer; // this defer is resolved once reachability checks for this cluster are completed\n private startTimestamp: number;\n public readonly isVideoMesh: boolean;\n public readonly name;\n\n /**\n * Constructor for ClusterReachability\n * @param {string} name cluster name\n * @param {ClusterNode} clusterInfo information about the media cluster\n */\n constructor(name: string, clusterInfo: ClusterNode) {\n this.name = name;\n this.isVideoMesh = clusterInfo.isVideoMesh;\n this.numUdpUrls = clusterInfo.udp.length;\n this.numTcpUrls = clusterInfo.tcp.length;\n\n this.pc = this.createPeerConnection(clusterInfo);\n\n this.defer = new Defer();\n this.result = {\n udp: {\n result: 'untested',\n },\n tcp: {\n result: 'untested',\n },\n xtls: {\n result: 'untested',\n },\n };\n }\n\n /**\n * Gets total elapsed time, can be called only after start() is called\n * @returns {Number} Milliseconds\n */\n private getElapsedTime() {\n return Math.round(performance.now() - this.startTimestamp);\n }\n\n /**\n * Generate peerConnection config settings\n * @param {ClusterNode} cluster\n * @returns {RTCConfiguration} peerConnectionConfig\n */\n private buildPeerConnectionConfig(cluster: ClusterNode): RTCConfiguration {\n const udpIceServers = cluster.udp.map((url) => ({\n username: '',\n credential: '',\n urls: [url],\n }));\n\n // STUN servers are contacted only using UDP, so in order to test TCP reachability\n // we pretend that Linus is a TURN server, because we can explicitly say \"transport=tcp\" in TURN urls.\n // We then check for relay candidates to know if TURN-TCP worked (see registerIceCandidateListener()).\n const tcpIceServers = cluster.tcp.map((urlString: string) => {\n return {\n username: 'webexturnreachuser',\n credential: 'webexturnreachpwd',\n urls: [convertStunUrlToTurn(urlString, 'tcp')],\n };\n });\n\n return {\n iceServers: [...udpIceServers, ...tcpIceServers],\n iceCandidatePoolSize: 0,\n iceTransportPolicy: 'all',\n };\n }\n\n /**\n * Creates an RTCPeerConnection\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {RTCPeerConnection} peerConnection\n */\n private createPeerConnection(clusterInfo: ClusterNode) {\n try {\n const config = this.buildPeerConnectionConfig(clusterInfo);\n\n const peerConnection = new RTCPeerConnection(config);\n\n return peerConnection;\n } catch (peerConnectionError) {\n LoggerProxy.logger.warn(\n `Reachability:index#createPeerConnection --> Error creating peerConnection:`,\n peerConnectionError\n );\n\n return undefined;\n }\n }\n\n /**\n * @returns {ClusterReachabilityResult} reachability result for this cluster\n */\n getResult() {\n return this.result;\n }\n\n /**\n * Closes the peerConnection\n *\n * @returns {void}\n */\n private closePeerConnection() {\n if (this.pc) {\n this.pc.onicecandidate = null;\n this.pc.onicegatheringstatechange = null;\n this.pc.close();\n }\n }\n\n /**\n * Resolves the defer, indicating that reachability checks for this cluster are completed\n *\n * @returns {void}\n */\n private finishReachabilityCheck() {\n this.defer.resolve();\n }\n\n /**\n * Adds public IP (client media IPs)\n * @param {string} protocol\n * @param {string} publicIP\n * @returns {void}\n */\n private addPublicIP(protocol: 'udp' | 'tcp', publicIP?: string | null) {\n const result = this.result[protocol];\n\n if (publicIP) {\n if (result.clientMediaIPs) {\n if (!result.clientMediaIPs.includes(publicIP)) {\n result.clientMediaIPs.push(publicIP);\n }\n } else {\n result.clientMediaIPs = [publicIP];\n }\n }\n }\n\n /**\n * Registers a listener for the iceGatheringStateChange event\n *\n * @returns {void}\n */\n private registerIceGatheringStateChangeListener() {\n this.pc.onicegatheringstatechange = () => {\n const {COMPLETE} = ICE_GATHERING_STATE;\n\n if (this.pc.iceConnectionState === COMPLETE) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n };\n }\n\n /**\n * Checks if we have the results for all the protocols (UDP and TCP)\n *\n * @returns {boolean} true if we have all results, false otherwise\n */\n private haveWeGotAllResults(): boolean {\n return ['udp', 'tcp'].every(\n (protocol) =>\n this.result[protocol].result === 'reachable' || this.result[protocol].result === 'untested'\n );\n }\n\n /**\n * Stores the latency in the result for the given protocol and marks it as reachable\n *\n * @param {string} protocol\n * @param {number} latency\n * @returns {void}\n */\n private storeLatencyResult(protocol: 'udp' | 'tcp', latency: number) {\n const result = this.result[protocol];\n\n if (result.latencyInMilliseconds === undefined) {\n LoggerProxy.logger.log(\n // @ts-ignore\n `Reachability:index#storeLatencyResult --> Successfully reached ${this.name} over ${protocol}: ${latency}ms`\n );\n result.latencyInMilliseconds = latency;\n result.result = 'reachable';\n }\n }\n\n /**\n * Registers a listener for the icecandidate event\n *\n * @returns {void}\n */\n private registerIceCandidateListener() {\n this.pc.onicecandidate = (e) => {\n const CANDIDATE_TYPES = {\n SERVER_REFLEXIVE: 'srflx',\n RELAY: 'relay',\n };\n\n if (e.candidate) {\n if (e.candidate.type === CANDIDATE_TYPES.SERVER_REFLEXIVE) {\n this.storeLatencyResult('udp', this.getElapsedTime());\n this.addPublicIP('udp', e.candidate.address);\n }\n\n if (e.candidate.type === CANDIDATE_TYPES.RELAY) {\n this.storeLatencyResult('tcp', this.getElapsedTime());\n // we don't add public IP for TCP, because in the case of relay candidates\n // e.candidate.address is the TURN server address, not the client's public IP\n }\n\n if (this.haveWeGotAllResults()) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n }\n };\n }\n\n /**\n * Starts the process of doing UDP and TCP reachability checks on the media cluster.\n * XTLS reachability checking is not supported.\n *\n * @returns {Promise}\n */\n async start(): Promise<ClusterReachabilityResult> {\n if (!this.pc) {\n LoggerProxy.logger.warn(\n `Reachability:ClusterReachability#start --> Error: peerConnection is undefined`\n );\n\n return this.result;\n }\n\n // Initialize this.result as saying that nothing is reachable.\n // It will get updated as we go along and successfully gather ICE candidates.\n this.result.udp = {\n result: this.numUdpUrls > 0 ? 'unreachable' : 'untested',\n };\n this.result.tcp = {\n result: this.numTcpUrls > 0 ? 'unreachable' : 'untested',\n };\n\n try {\n const offer = await this.pc.createOffer({offerToReceiveAudio: true});\n\n this.startTimestamp = performance.now();\n\n // not awaiting the next call on purpose, because we're not sending the offer anywhere and there won't be any answer\n // we just need to make this call to trigger the ICE gathering process\n this.pc.setLocalDescription(offer);\n\n await this.gatherIceCandidates();\n } catch (error) {\n LoggerProxy.logger.warn(`Reachability:ClusterReachability#start --> Error: `, error);\n }\n\n return this.result;\n }\n\n /**\n * Starts the process of gathering ICE candidates\n *\n * @returns {Promise} promise that's resolved once reachability checks for this cluster are completed or timeout is reached\n */\n private gatherIceCandidates() {\n const timeout = this.isVideoMesh ? VIDEO_MESH_TIMEOUT : DEFAULT_TIMEOUT;\n\n this.registerIceGatheringStateChangeListener();\n this.registerIceCandidateListener();\n\n // Set maximum timeout\n setTimeout(() => {\n const {CLOSED} = CONNECTION_STATE;\n\n // Close any open peerConnections\n if (this.pc.connectionState !== CLOSED) {\n this.closePeerConnection();\n this.finishReachabilityCheck();\n }\n }, timeout);\n\n return this.defer.promise;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAEA;AAEA;AAEA;AAEA,IAAMA,eAAe,GAAG,IAAI;AAC5B,IAAMC,kBAAkB,GAAG,IAAI;;AAE/B;AAcA;AACA;AACA;AAFA,IAGaC,mBAAmB;EAKR;;EAKtB;AACF;AACA;AACA;AACA;EACE,6BAAYC,IAAY,EAAEC,WAAwB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAClD,IAAI,CAACD,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACE,WAAW,GAAGD,WAAW,CAACC,WAAW;IAC1C,IAAI,CAACC,UAAU,GAAGF,WAAW,CAACG,GAAG,CAACC,MAAM;IACxC,IAAI,CAACC,UAAU,GAAGL,WAAW,CAACM,GAAG,CAACF,MAAM;IAExC,IAAI,CAACG,EAAE,GAAG,IAAI,CAACC,oBAAoB,CAACR,WAAW,CAAC;IAEhD,IAAI,CAACS,KAAK,GAAG,IAAIC,aAAK,EAAE;IACxB,IAAI,CAACC,MAAM,GAAG;MACZR,GAAG,EAAE;QACHQ,MAAM,EAAE;MACV,CAAC;MACDL,GAAG,EAAE;QACHK,MAAM,EAAE;MACV,CAAC;MACDC,IAAI,EAAE;QACJD,MAAM,EAAE;MACV;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,0BAAyB;MACvB,OAAOE,IAAI,CAACC,KAAK,CAACC,WAAW,CAACC,GAAG,EAAE,GAAG,IAAI,CAACC,cAAc,CAAC;IAC5D;;IAEA;AACF;AACA;AACA;AACA;EAJE;IAAA;IAAA,OAKA,mCAAkCC,OAAoB,EAAoB;MACxE,IAAMC,aAAa,GAAGD,OAAO,CAACf,GAAG,CAACiB,GAAG,CAAC,UAACC,GAAG;QAAA,OAAM;UAC9CC,QAAQ,EAAE,EAAE;UACZC,UAAU,EAA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