@webex/plugin-meetings 3.0.0-test.1 → 3.1.0-next.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.
Files changed (331) hide show
  1. package/.eslintrc.js +6 -0
  2. package/babel.config.js +3 -0
  3. package/dist/annotation/constants.js +12 -20
  4. package/dist/annotation/constants.js.map +1 -1
  5. package/dist/annotation/index.js +25 -10
  6. package/dist/annotation/index.js.map +1 -1
  7. package/dist/breakouts/breakout.js +2 -3
  8. package/dist/breakouts/breakout.js.map +1 -1
  9. package/dist/breakouts/collection.js +1 -2
  10. package/dist/breakouts/collection.js.map +1 -1
  11. package/dist/breakouts/edit-lock-error.js +1 -2
  12. package/dist/breakouts/edit-lock-error.js.map +1 -1
  13. package/dist/breakouts/events.js +1 -2
  14. package/dist/breakouts/events.js.map +1 -1
  15. package/dist/breakouts/index.js +13 -14
  16. package/dist/breakouts/index.js.map +1 -1
  17. package/dist/breakouts/request.js +1 -2
  18. package/dist/breakouts/request.js.map +1 -1
  19. package/dist/breakouts/utils.js +3 -6
  20. package/dist/breakouts/utils.js.map +1 -1
  21. package/dist/common/browser-detection.js +2 -3
  22. package/dist/common/browser-detection.js.map +1 -1
  23. package/dist/common/collection.js +3 -4
  24. package/dist/common/collection.js.map +1 -1
  25. package/dist/common/config.js +1 -2
  26. package/dist/common/config.js.map +1 -1
  27. package/dist/common/errors/captcha-error.js +1 -2
  28. package/dist/common/errors/captcha-error.js.map +1 -1
  29. package/dist/common/errors/intent-to-join.js +1 -2
  30. package/dist/common/errors/intent-to-join.js.map +1 -1
  31. package/dist/common/errors/join-meeting.js +1 -2
  32. package/dist/common/errors/join-meeting.js.map +1 -1
  33. package/dist/common/errors/media.js +1 -2
  34. package/dist/common/errors/media.js.map +1 -1
  35. package/dist/common/errors/no-meeting-info.js +1 -2
  36. package/dist/common/errors/no-meeting-info.js.map +1 -1
  37. package/dist/common/errors/parameter.js +3 -4
  38. package/dist/common/errors/parameter.js.map +1 -1
  39. package/dist/common/errors/password-error.js +1 -2
  40. package/dist/common/errors/password-error.js.map +1 -1
  41. package/dist/common/errors/permission.js +1 -2
  42. package/dist/common/errors/permission.js.map +1 -1
  43. package/dist/common/errors/reclaim-host-role-errors.js +6 -10
  44. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -1
  45. package/dist/common/errors/reconnection-in-progress.js +1 -2
  46. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  47. package/dist/common/errors/reconnection.js +1 -2
  48. package/dist/common/errors/reconnection.js.map +1 -1
  49. package/dist/common/errors/stats.js +1 -2
  50. package/dist/common/errors/stats.js.map +1 -1
  51. package/dist/common/errors/webex-errors.js +14 -15
  52. package/dist/common/errors/webex-errors.js.map +1 -1
  53. package/dist/common/errors/webex-meetings-error.js +1 -2
  54. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  55. package/dist/common/events/events-scope.js +1 -2
  56. package/dist/common/events/events-scope.js.map +1 -1
  57. package/dist/common/events/events.js +1 -2
  58. package/dist/common/events/events.js.map +1 -1
  59. package/dist/common/events/trigger-proxy.js +1 -2
  60. package/dist/common/events/trigger-proxy.js.map +1 -1
  61. package/dist/common/events/util.js +1 -2
  62. package/dist/common/events/util.js.map +1 -1
  63. package/dist/common/logs/logger-config.js +1 -2
  64. package/dist/common/logs/logger-config.js.map +1 -1
  65. package/dist/common/logs/logger-proxy.js +1 -2
  66. package/dist/common/logs/logger-proxy.js.map +1 -1
  67. package/dist/common/logs/request.js +3 -4
  68. package/dist/common/logs/request.js.map +1 -1
  69. package/dist/common/queue.js +2 -4
  70. package/dist/common/queue.js.map +1 -1
  71. package/dist/config.js +4 -3
  72. package/dist/config.js.map +1 -1
  73. package/dist/constants.js +207 -380
  74. package/dist/constants.js.map +1 -1
  75. package/dist/controls-options-manager/constants.js +3 -6
  76. package/dist/controls-options-manager/constants.js.map +1 -1
  77. package/dist/controls-options-manager/enums.js +7 -10
  78. package/dist/controls-options-manager/enums.js.map +1 -1
  79. package/dist/controls-options-manager/index.js +27 -32
  80. package/dist/controls-options-manager/index.js.map +1 -1
  81. package/dist/controls-options-manager/util.js +1 -2
  82. package/dist/controls-options-manager/util.js.map +1 -1
  83. package/dist/index.js +71 -4
  84. package/dist/index.js.map +1 -1
  85. package/dist/interceptors/index.js.map +1 -1
  86. package/dist/interceptors/locusRetry.js +4 -3
  87. package/dist/interceptors/locusRetry.js.map +1 -1
  88. package/dist/interpretation/collection.js +1 -2
  89. package/dist/interpretation/collection.js.map +1 -1
  90. package/dist/interpretation/index.js +4 -5
  91. package/dist/interpretation/index.js.map +1 -1
  92. package/dist/interpretation/siLanguage.js +2 -3
  93. package/dist/interpretation/siLanguage.js.map +1 -1
  94. package/dist/locus-info/controlsUtils.js +12 -13
  95. package/dist/locus-info/controlsUtils.js.map +1 -1
  96. package/dist/locus-info/embeddedAppsUtils.js +3 -4
  97. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  98. package/dist/locus-info/fullState.js +1 -2
  99. package/dist/locus-info/fullState.js.map +1 -1
  100. package/dist/locus-info/hostUtils.js +1 -2
  101. package/dist/locus-info/hostUtils.js.map +1 -1
  102. package/dist/locus-info/index.js +23 -27
  103. package/dist/locus-info/index.js.map +1 -1
  104. package/dist/locus-info/infoUtils.js +3 -4
  105. package/dist/locus-info/infoUtils.js.map +1 -1
  106. package/dist/locus-info/mediaSharesUtils.js +16 -3
  107. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  108. package/dist/locus-info/parser.js +6 -10
  109. package/dist/locus-info/parser.js.map +1 -1
  110. package/dist/locus-info/selfUtils.js +12 -6
  111. package/dist/locus-info/selfUtils.js.map +1 -1
  112. package/dist/media/MediaConnectionAwaiter.js +163 -0
  113. package/dist/media/MediaConnectionAwaiter.js.map +1 -0
  114. package/dist/media/index.js +9 -5
  115. package/dist/media/index.js.map +1 -1
  116. package/dist/media/properties.js +7 -28
  117. package/dist/media/properties.js.map +1 -1
  118. package/dist/media/util.js +1 -2
  119. package/dist/media/util.js.map +1 -1
  120. package/dist/mediaQualityMetrics/config.js +9 -18
  121. package/dist/mediaQualityMetrics/config.js.map +1 -1
  122. package/dist/meeting/in-meeting-actions.js +14 -2
  123. package/dist/meeting/in-meeting-actions.js.map +1 -1
  124. package/dist/meeting/index.js +1411 -1036
  125. package/dist/meeting/index.js.map +1 -1
  126. package/dist/meeting/locusMediaRequest.js +4 -5
  127. package/dist/meeting/locusMediaRequest.js.map +1 -1
  128. package/dist/meeting/muteState.js +2 -4
  129. package/dist/meeting/muteState.js.map +1 -1
  130. package/dist/meeting/request.js +45 -36
  131. package/dist/meeting/request.js.map +1 -1
  132. package/dist/meeting/state.js +1 -2
  133. package/dist/meeting/state.js.map +1 -1
  134. package/dist/meeting/util.js +13 -10
  135. package/dist/meeting/util.js.map +1 -1
  136. package/dist/meeting/voicea-meeting.js +169 -0
  137. package/dist/meeting/voicea-meeting.js.map +1 -0
  138. package/dist/meeting-info/collection.js +3 -4
  139. package/dist/meeting-info/collection.js.map +1 -1
  140. package/dist/meeting-info/index.js +5 -4
  141. package/dist/meeting-info/index.js.map +1 -1
  142. package/dist/meeting-info/meeting-info-v2.js +27 -29
  143. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  144. package/dist/meeting-info/request.js +1 -2
  145. package/dist/meeting-info/request.js.map +1 -1
  146. package/dist/meeting-info/util.js +306 -269
  147. package/dist/meeting-info/util.js.map +1 -1
  148. package/dist/meeting-info/utilv2.js +336 -294
  149. package/dist/meeting-info/utilv2.js.map +1 -1
  150. package/dist/meetings/collection.js +5 -6
  151. package/dist/meetings/collection.js.map +1 -1
  152. package/dist/meetings/index.js +44 -17
  153. package/dist/meetings/index.js.map +1 -1
  154. package/dist/meetings/request.js +2 -3
  155. package/dist/meetings/request.js.map +1 -1
  156. package/dist/meetings/util.js +1 -4
  157. package/dist/meetings/util.js.map +1 -1
  158. package/dist/member/index.js +1 -3
  159. package/dist/member/index.js.map +1 -1
  160. package/dist/member/types.js +6 -8
  161. package/dist/member/types.js.map +1 -1
  162. package/dist/member/util.js +1 -2
  163. package/dist/member/util.js.map +1 -1
  164. package/dist/members/collection.js +1 -2
  165. package/dist/members/collection.js.map +1 -1
  166. package/dist/members/index.js +8 -7
  167. package/dist/members/index.js.map +1 -1
  168. package/dist/members/request.js +2 -3
  169. package/dist/members/request.js.map +1 -1
  170. package/dist/members/types.js +3 -4
  171. package/dist/members/types.js.map +1 -1
  172. package/dist/members/util.js +3 -4
  173. package/dist/members/util.js.map +1 -1
  174. package/dist/metrics/constants.js +1 -2
  175. package/dist/metrics/constants.js.map +1 -1
  176. package/dist/metrics/index.js +3 -2
  177. package/dist/metrics/index.js.map +1 -1
  178. package/dist/multistream/mediaRequestManager.js +9 -11
  179. package/dist/multistream/mediaRequestManager.js.map +1 -1
  180. package/dist/multistream/receiveSlot.js +3 -5
  181. package/dist/multistream/receiveSlot.js.map +1 -1
  182. package/dist/multistream/receiveSlotManager.js +7 -9
  183. package/dist/multistream/receiveSlotManager.js.map +1 -1
  184. package/dist/multistream/remoteMedia.js +3 -5
  185. package/dist/multistream/remoteMedia.js.map +1 -1
  186. package/dist/multistream/remoteMediaGroup.js +7 -6
  187. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  188. package/dist/multistream/remoteMediaManager.js +32 -29
  189. package/dist/multistream/remoteMediaManager.js.map +1 -1
  190. package/dist/multistream/sendSlotManager.js +9 -6
  191. package/dist/multistream/sendSlotManager.js.map +1 -1
  192. package/dist/networkQualityMonitor/index.js +1 -2
  193. package/dist/networkQualityMonitor/index.js.map +1 -1
  194. package/dist/personal-meeting-room/index.js +2 -3
  195. package/dist/personal-meeting-room/index.js.map +1 -1
  196. package/dist/personal-meeting-room/request.js +2 -3
  197. package/dist/personal-meeting-room/request.js.map +1 -1
  198. package/dist/personal-meeting-room/util.js +1 -2
  199. package/dist/personal-meeting-room/util.js.map +1 -1
  200. package/dist/reachability/clusterReachability.js +35 -20
  201. package/dist/reachability/clusterReachability.js.map +1 -1
  202. package/dist/reachability/index.js +41 -12
  203. package/dist/reachability/index.js.map +1 -1
  204. package/dist/reachability/request.js +25 -20
  205. package/dist/reachability/request.js.map +1 -1
  206. package/dist/reachability/util.js +19 -0
  207. package/dist/reachability/util.js.map +1 -1
  208. package/dist/reactions/constants.js +1 -2
  209. package/dist/reactions/constants.js.map +1 -1
  210. package/dist/reactions/reactions.js +2 -4
  211. package/dist/reactions/reactions.js.map +1 -1
  212. package/dist/reactions/reactions.type.js +6 -8
  213. package/dist/reactions/reactions.type.js.map +1 -1
  214. package/dist/reconnection-manager/index.js +18 -11
  215. package/dist/reconnection-manager/index.js.map +1 -1
  216. package/dist/recording-controller/enums.js +4 -5
  217. package/dist/recording-controller/enums.js.map +1 -1
  218. package/dist/recording-controller/index.js +43 -51
  219. package/dist/recording-controller/index.js.map +1 -1
  220. package/dist/recording-controller/util.js +1 -2
  221. package/dist/recording-controller/util.js.map +1 -1
  222. package/dist/roap/index.js +17 -3
  223. package/dist/roap/index.js.map +1 -1
  224. package/dist/roap/request.js +10 -10
  225. package/dist/roap/request.js.map +1 -1
  226. package/dist/roap/turnDiscovery.js +316 -134
  227. package/dist/roap/turnDiscovery.js.map +1 -1
  228. package/dist/rtcMetrics/constants.js +1 -2
  229. package/dist/rtcMetrics/constants.js.map +1 -1
  230. package/dist/rtcMetrics/index.js +4 -6
  231. package/dist/rtcMetrics/index.js.map +1 -1
  232. package/dist/statsAnalyzer/global.js +1 -2
  233. package/dist/statsAnalyzer/global.js.map +1 -1
  234. package/dist/statsAnalyzer/index.js +123 -96
  235. package/dist/statsAnalyzer/index.js.map +1 -1
  236. package/dist/statsAnalyzer/mqaUtil.js +24 -31
  237. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  238. package/dist/transcription/index.js +1 -2
  239. package/dist/transcription/index.js.map +1 -1
  240. package/dist/types/common/logs/request.d.ts +1 -1
  241. package/dist/types/config.d.ts +1 -0
  242. package/dist/types/constants.d.ts +10 -5
  243. package/dist/types/index.d.ts +11 -0
  244. package/dist/types/media/MediaConnectionAwaiter.d.ts +61 -0
  245. package/dist/types/meeting/index.d.ts +71 -16
  246. package/dist/types/meeting/request.d.ts +3 -0
  247. package/dist/types/meeting/util.d.ts +1 -0
  248. package/dist/types/meeting/voicea-meeting.d.ts +16 -0
  249. package/dist/types/meeting-info/index.d.ts +1 -1
  250. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -1
  251. package/dist/types/meeting-info/util.d.ts +49 -2
  252. package/dist/types/meeting-info/utilv2.d.ts +65 -2
  253. package/dist/types/meetings/index.d.ts +11 -2
  254. package/dist/types/members/util.d.ts +1 -1
  255. package/dist/types/multistream/mediaRequestManager.d.ts +1 -2
  256. package/dist/types/multistream/remoteMediaGroup.d.ts +1 -1
  257. package/dist/types/multistream/remoteMediaManager.d.ts +1 -2
  258. package/dist/types/multistream/sendSlotManager.d.ts +1 -2
  259. package/dist/types/reachability/clusterReachability.d.ts +1 -0
  260. package/dist/types/reachability/index.d.ts +4 -0
  261. package/dist/types/reachability/util.d.ts +7 -0
  262. package/dist/types/roap/index.d.ts +10 -2
  263. package/dist/types/roap/turnDiscovery.d.ts +64 -17
  264. package/dist/webinar/collection.js +1 -2
  265. package/dist/webinar/collection.js.map +1 -1
  266. package/dist/webinar/index.js +2 -3
  267. package/dist/webinar/index.js.map +1 -1
  268. package/jest.config.js +3 -0
  269. package/package.json +44 -25
  270. package/process +1 -0
  271. package/src/config.ts +3 -4
  272. package/src/constants.ts +13 -4
  273. package/src/index.ts +27 -0
  274. package/src/interpretation/index.ts +2 -2
  275. package/src/locus-info/mediaSharesUtils.ts +16 -0
  276. package/src/locus-info/selfUtils.ts +5 -0
  277. package/src/media/MediaConnectionAwaiter.ts +174 -0
  278. package/src/media/index.ts +3 -1
  279. package/src/media/properties.ts +6 -31
  280. package/src/meeting/index.ts +526 -227
  281. package/src/meeting/request.ts +18 -2
  282. package/src/meeting/util.ts +6 -1
  283. package/src/meeting/voicea-meeting.ts +122 -0
  284. package/src/meeting-info/meeting-info-v2.ts +5 -11
  285. package/src/meeting-info/util.ts +244 -233
  286. package/src/meeting-info/utilv2.ts +262 -245
  287. package/src/meetings/index.ts +18 -0
  288. package/src/member/index.ts +0 -1
  289. package/src/multistream/mediaRequestManager.ts +1 -1
  290. package/src/multistream/remoteMediaGroup.ts +1 -1
  291. package/src/multistream/remoteMediaManager.ts +1 -2
  292. package/src/multistream/sendSlotManager.ts +1 -2
  293. package/src/reachability/clusterReachability.ts +20 -5
  294. package/src/reachability/index.ts +24 -1
  295. package/src/reachability/request.ts +15 -11
  296. package/src/reachability/util.ts +21 -0
  297. package/src/reconnection-manager/index.ts +1 -1
  298. package/src/roap/index.ts +25 -3
  299. package/src/roap/request.ts +2 -2
  300. package/src/roap/turnDiscovery.ts +244 -78
  301. package/src/statsAnalyzer/index.ts +63 -27
  302. package/test/integration/spec/journey.js +2 -2
  303. package/test/unit/spec/breakouts/breakout.ts +2 -1
  304. package/test/unit/spec/breakouts/index.ts +7 -4
  305. package/test/unit/spec/interpretation/index.ts +4 -1
  306. package/test/unit/spec/locus-info/index.js +27 -18
  307. package/test/unit/spec/locus-info/mediaSharesUtils.ts +9 -0
  308. package/test/unit/spec/locus-info/selfUtils.js +41 -11
  309. package/test/unit/spec/media/MediaConnectionAwaiter.ts +344 -0
  310. package/test/unit/spec/media/index.ts +94 -78
  311. package/test/unit/spec/media/properties.ts +16 -70
  312. package/test/unit/spec/meeting/index.js +757 -141
  313. package/test/unit/spec/meeting/request.js +21 -0
  314. package/test/unit/spec/meeting/utils.js +58 -11
  315. package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
  316. package/test/unit/spec/meeting-info/meetinginfov2.js +20 -15
  317. package/test/unit/spec/meeting-info/utilv2.js +6 -0
  318. package/test/unit/spec/meetings/index.js +101 -13
  319. package/test/unit/spec/metrics/index.js +1 -2
  320. package/test/unit/spec/multistream/mediaRequestManager.ts +1 -0
  321. package/test/unit/spec/multistream/remoteMediaGroup.ts +0 -1
  322. package/test/unit/spec/multistream/remoteMediaManager.ts +0 -1
  323. package/test/unit/spec/reachability/clusterReachability.ts +86 -22
  324. package/test/unit/spec/reachability/index.ts +197 -60
  325. package/test/unit/spec/reachability/request.js +15 -7
  326. package/test/unit/spec/reachability/util.ts +32 -2
  327. package/test/unit/spec/reconnection-manager/index.js +28 -0
  328. package/test/unit/spec/recording-controller/index.js +0 -1
  329. package/test/unit/spec/roap/index.ts +61 -6
  330. package/test/unit/spec/roap/turnDiscovery.ts +299 -17
  331. package/test/unit/spec/stats-analyzer/index.js +179 -0
@@ -2,7 +2,7 @@ import {Defer} from '@webex/common';
2
2
 
3
3
  import LoggerProxy from '../common/logs/logger-proxy';
4
4
  import {ClusterNode} from './request';
5
- import {convertStunUrlToTurn} from './util';
5
+ import {convertStunUrlToTurn, convertStunUrlToTurnTls} from './util';
6
6
 
7
7
  import {ICE_GATHERING_STATE, CONNECTION_STATE} from '../constants';
8
8
 
@@ -29,6 +29,7 @@ export type ClusterReachabilityResult = {
29
29
  export class ClusterReachability {
30
30
  private numUdpUrls: number;
31
31
  private numTcpUrls: number;
32
+ private numXTlsUrls: number;
32
33
  private result: ClusterReachabilityResult;
33
34
  private pc?: RTCPeerConnection;
34
35
  private defer: Defer; // this defer is resolved once reachability checks for this cluster are completed
@@ -46,6 +47,7 @@ export class ClusterReachability {
46
47
  this.isVideoMesh = clusterInfo.isVideoMesh;
47
48
  this.numUdpUrls = clusterInfo.udp.length;
48
49
  this.numTcpUrls = clusterInfo.tcp.length;
50
+ this.numXTlsUrls = clusterInfo.xtls.length;
49
51
 
50
52
  this.pc = this.createPeerConnection(clusterInfo);
51
53
 
@@ -94,8 +96,16 @@ export class ClusterReachability {
94
96
  };
95
97
  });
96
98
 
99
+ const turnTlsIceServers = cluster.xtls.map((urlString: string) => {
100
+ return {
101
+ username: 'webexturnreachuser',
102
+ credential: 'webexturnreachpwd',
103
+ urls: [convertStunUrlToTurnTls(urlString)],
104
+ };
105
+ });
106
+
97
107
  return {
98
- iceServers: [...udpIceServers, ...tcpIceServers],
108
+ iceServers: [...udpIceServers, ...tcpIceServers, ...turnTlsIceServers],
99
109
  iceCandidatePoolSize: 0,
100
110
  iceTransportPolicy: 'all',
101
111
  };
@@ -194,7 +204,7 @@ export class ClusterReachability {
194
204
  * @returns {boolean} true if we have all results, false otherwise
195
205
  */
196
206
  private haveWeGotAllResults(): boolean {
197
- return ['udp', 'tcp'].every(
207
+ return ['udp', 'tcp', 'xtls'].every(
198
208
  (protocol) =>
199
209
  this.result[protocol].result === 'reachable' || this.result[protocol].result === 'untested'
200
210
  );
@@ -207,7 +217,7 @@ export class ClusterReachability {
207
217
  * @param {number} latency
208
218
  * @returns {void}
209
219
  */
210
- private storeLatencyResult(protocol: 'udp' | 'tcp', latency: number) {
220
+ private storeLatencyResult(protocol: 'udp' | 'tcp' | 'xtls', latency: number) {
211
221
  const result = this.result[protocol];
212
222
 
213
223
  if (result.latencyInMilliseconds === undefined) {
@@ -227,6 +237,7 @@ export class ClusterReachability {
227
237
  */
228
238
  private registerIceCandidateListener() {
229
239
  this.pc.onicecandidate = (e) => {
240
+ const TURN_TLS_PORT = 443;
230
241
  const CANDIDATE_TYPES = {
231
242
  SERVER_REFLEXIVE: 'srflx',
232
243
  RELAY: 'relay',
@@ -239,7 +250,8 @@ export class ClusterReachability {
239
250
  }
240
251
 
241
252
  if (e.candidate.type === CANDIDATE_TYPES.RELAY) {
242
- this.storeLatencyResult('tcp', this.getElapsedTime());
253
+ const protocol = e.candidate.port === TURN_TLS_PORT ? 'xtls' : 'tcp';
254
+ this.storeLatencyResult(protocol, this.getElapsedTime());
243
255
  // we don't add public IP for TCP, because in the case of relay candidates
244
256
  // e.candidate.address is the TURN server address, not the client's public IP
245
257
  }
@@ -275,6 +287,9 @@ export class ClusterReachability {
275
287
  this.result.tcp = {
276
288
  result: this.numTcpUrls > 0 ? 'unreachable' : 'untested',
277
289
  };
290
+ this.result.xtls = {
291
+ result: this.numXTlsUrls > 0 ? 'unreachable' : 'untested',
292
+ };
278
293
 
279
294
  try {
280
295
  const offer = await this.pc.createOffer({offerToReceiveAudio: true});
@@ -22,10 +22,14 @@ export type ReachabilityMetrics = {
22
22
  reachability_public_udp_failed: number;
23
23
  reachability_public_tcp_success: number;
24
24
  reachability_public_tcp_failed: number;
25
+ reachability_public_xtls_success: number;
26
+ reachability_public_xtls_failed: number;
25
27
  reachability_vmn_udp_success: number;
26
28
  reachability_vmn_udp_failed: number;
27
29
  reachability_vmn_tcp_success: number;
28
30
  reachability_vmn_tcp_failed: number;
31
+ reachability_vmn_xtls_success: number;
32
+ reachability_vmn_xtls_failed: number;
29
33
  };
30
34
 
31
35
  /**
@@ -141,10 +145,14 @@ export default class Reachability {
141
145
  reachability_public_udp_failed: 0,
142
146
  reachability_public_tcp_success: 0,
143
147
  reachability_public_tcp_failed: 0,
148
+ reachability_public_xtls_success: 0,
149
+ reachability_public_xtls_failed: 0,
144
150
  reachability_vmn_udp_success: 0,
145
151
  reachability_vmn_udp_failed: 0,
146
152
  reachability_vmn_tcp_success: 0,
147
153
  reachability_vmn_tcp_failed: 0,
154
+ reachability_vmn_xtls_success: 0,
155
+ reachability_vmn_xtls_failed: 0,
148
156
  };
149
157
 
150
158
  const updateStats = (clusterType: 'public' | 'vmn', result: ClusterReachabilityResult) => {
@@ -156,6 +164,10 @@ export default class Reachability {
156
164
  const outcome = result.tcp.result === 'reachable' ? 'success' : 'failed';
157
165
  stats[`reachability_${clusterType}_tcp_${outcome}`] += 1;
158
166
  }
167
+ if (result.xtls && result.xtls.result !== 'untested') {
168
+ const outcome = result.xtls.result === 'reachable' ? 'success' : 'failed';
169
+ stats[`reachability_${clusterType}_xtls_${outcome}`] += 1;
170
+ }
159
171
  };
160
172
 
161
173
  try {
@@ -338,7 +350,10 @@ export default class Reachability {
338
350
  LoggerProxy.logger.log(
339
351
  `Reachability:index#performReachabilityChecks --> doing UDP${
340
352
  // @ts-ignore
341
- this.webex.config.meetings.experimental.enableTcpReachability ? ' and TCP' : ''
353
+ this.webex.config.meetings.experimental.enableTcpReachability ? ',TCP' : ''
354
+ }${
355
+ // @ts-ignore
356
+ this.webex.config.meetings.experimental.enableTlsReachability ? ',TLS' : ''
342
357
  } reachability checks`
343
358
  );
344
359
 
@@ -354,6 +369,14 @@ export default class Reachability {
354
369
  cluster.tcp = [];
355
370
  }
356
371
 
372
+ const includeTlsReachability =
373
+ // @ts-ignore
374
+ this.webex.config.meetings.experimental.enableTlsReachability && !cluster.isVideoMesh;
375
+
376
+ if (!includeTlsReachability) {
377
+ cluster.xtls = [];
378
+ }
379
+
357
380
  this.clusterReachability[key] = new ClusterReachability(key, cluster);
358
381
 
359
382
  return this.clusterReachability[key].start().then((result) => {
@@ -34,17 +34,21 @@ class ReachabilityRequest {
34
34
  * @returns {Promise}
35
35
  */
36
36
  getClusters = (ipVersion?: IP_VERSION): Promise<{clusters: ClusterList; joinCookie: any}> =>
37
- this.webex
38
- .request({
39
- method: HTTP_VERBS.GET,
40
- shouldRefreshAccessToken: false,
41
- api: API.CALLIOPEDISCOVERY,
42
- resource: RESOURCE.CLUSTERS,
43
- qs: {
44
- JCSupport: 1,
45
- ipver: ipVersion,
46
- },
47
- })
37
+ this.webex.internal.newMetrics.callDiagnosticLatencies
38
+ .measureLatency(
39
+ () =>
40
+ this.webex.request({
41
+ method: HTTP_VERBS.GET,
42
+ shouldRefreshAccessToken: false,
43
+ api: API.CALLIOPEDISCOVERY,
44
+ resource: RESOURCE.CLUSTERS,
45
+ qs: {
46
+ JCSupport: 1,
47
+ ipver: ipVersion,
48
+ },
49
+ }),
50
+ 'internal.get.cluster.time'
51
+ )
48
52
  .then((res) => {
49
53
  const {clusters, joinCookie} = res.body;
50
54
 
@@ -22,3 +22,24 @@ export function convertStunUrlToTurn(stunUrl: string, protocol: 'udp' | 'tcp') {
22
22
 
23
23
  return url.toString();
24
24
  }
25
+
26
+ /**
27
+ * Converts a stun url to a turns url
28
+ *
29
+ * @param {string} stunUrl url of a stun server
30
+ * @returns {string} url of a turns server
31
+ */
32
+ export function convertStunUrlToTurnTls(stunUrl: string) {
33
+ // stunUrl looks like this: "stun:external-media1.public.wjfkm-a-15.prod.infra.webex.com:443"
34
+ // and we need it to be like this: "turns:external-media1.public.wjfkm-a-15.prod.infra.webex.com:443?transport=tcp"
35
+ const url = new URL(stunUrl);
36
+
37
+ if (url.protocol !== 'stun:') {
38
+ throw new Error(`Not a STUN URL: ${stunUrl}`);
39
+ }
40
+
41
+ url.protocol = 'turns:';
42
+ url.searchParams.append('transport', 'tcp');
43
+
44
+ return url.toString();
45
+ }
@@ -568,7 +568,7 @@ export default class ReconnectionManager {
568
568
 
569
569
  const iceServers = [];
570
570
 
571
- if (turnServerResult.turnServerInfo) {
571
+ if (turnServerResult.turnServerInfo?.url) {
572
572
  iceServers.push({
573
573
  urls: turnServerResult.turnServerInfo.url,
574
574
  username: turnServerResult.turnServerInfo.username || '',
package/src/roap/index.ts CHANGED
@@ -5,12 +5,18 @@ import {ROAP} from '../constants';
5
5
  import LoggerProxy from '../common/logs/logger-proxy';
6
6
 
7
7
  import RoapRequest from './request';
8
- import TurnDiscovery from './turnDiscovery';
8
+ import TurnDiscovery, {TurnDiscoveryResult} from './turnDiscovery';
9
9
  import Meeting from '../meeting';
10
10
  import MeetingUtil from '../meeting/util';
11
11
  import Metrics from '../metrics';
12
12
  import BEHAVIORAL_METRICS from '../metrics/constants';
13
13
 
14
+ export {
15
+ type TurnDiscoveryResult,
16
+ type TurnServerInfo,
17
+ type TurnDiscoverySkipReason,
18
+ } from './turnDiscovery';
19
+
14
20
  /**
15
21
  * Roap options
16
22
  * @typedef {Object} RoapOptions
@@ -39,7 +45,7 @@ export default class Roap extends StatelessWebexPlugin {
39
45
  options: any;
40
46
  roapHandler: any;
41
47
  roapRequest: any;
42
- turnDiscovery: any;
48
+ turnDiscovery: TurnDiscovery;
43
49
 
44
50
  /**
45
51
  *
@@ -260,7 +266,23 @@ export default class Roap extends StatelessWebexPlugin {
260
266
  * @param {Boolean} [isForced]
261
267
  * @returns {Promise}
262
268
  */
263
- doTurnDiscovery(meeting: Meeting, isReconnecting: boolean, isForced?: boolean) {
269
+ doTurnDiscovery(
270
+ meeting: Meeting,
271
+ isReconnecting: boolean,
272
+ isForced?: boolean
273
+ ): Promise<TurnDiscoveryResult> {
264
274
  return this.turnDiscovery.doTurnDiscovery(meeting, isReconnecting, isForced);
265
275
  }
276
+
277
+ generateTurnDiscoveryRequestMessage(meeting: Meeting, isForced: boolean) {
278
+ return this.turnDiscovery.generateTurnDiscoveryRequestMessage(meeting, isForced);
279
+ }
280
+
281
+ handleTurnDiscoveryHttpResponse(meeting: Meeting, httpResponse: object) {
282
+ return this.turnDiscovery.handleTurnDiscoveryHttpResponse(meeting, httpResponse);
283
+ }
284
+
285
+ abortTurnDiscovery() {
286
+ return this.turnDiscovery.abort();
287
+ }
266
288
  }
@@ -139,9 +139,9 @@ export default class RoapRequest extends StatelessWebexPlugin {
139
139
  rawError: err,
140
140
  },
141
141
  });
142
- LoggerProxy.logger.error(`Roap:request#sendRoap --> Error:${JSON.stringify(err, null, 2)}`);
142
+ LoggerProxy.logger.error(`Roap:request#sendRoap --> Error:`, err);
143
143
  LoggerProxy.logger.error(
144
- `Roap:request#sendRoapRequest --> errorBody:${JSON.stringify(
144
+ `Roap:request#sendRoapRequest --> roapMessage that caused error:${JSON.stringify(
145
145
  roapMessage,
146
146
  null,
147
147
  2