@webex/plugin-meetings 3.0.0-stream-classes.4 → 3.0.0

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 (469) hide show
  1. package/.eslintrc.js +6 -0
  2. package/README.md +12 -0
  3. package/babel.config.js +3 -0
  4. package/dist/annotation/constants.js +12 -20
  5. package/dist/annotation/constants.js.map +1 -1
  6. package/dist/annotation/index.js +25 -10
  7. package/dist/annotation/index.js.map +1 -1
  8. package/dist/breakouts/breakout.js +2 -3
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/collection.js +1 -2
  11. package/dist/breakouts/collection.js.map +1 -1
  12. package/dist/breakouts/edit-lock-error.js +1 -2
  13. package/dist/breakouts/edit-lock-error.js.map +1 -1
  14. package/dist/breakouts/events.js +1 -2
  15. package/dist/breakouts/events.js.map +1 -1
  16. package/dist/breakouts/index.js +13 -14
  17. package/dist/breakouts/index.js.map +1 -1
  18. package/dist/breakouts/request.js +1 -2
  19. package/dist/breakouts/request.js.map +1 -1
  20. package/dist/breakouts/utils.js +3 -6
  21. package/dist/breakouts/utils.js.map +1 -1
  22. package/dist/common/browser-detection.js +2 -3
  23. package/dist/common/browser-detection.js.map +1 -1
  24. package/dist/common/collection.js +3 -4
  25. package/dist/common/collection.js.map +1 -1
  26. package/dist/common/config.js +1 -2
  27. package/dist/common/config.js.map +1 -1
  28. package/dist/common/errors/captcha-error.js +1 -2
  29. package/dist/common/errors/captcha-error.js.map +1 -1
  30. package/dist/common/errors/intent-to-join.js +1 -2
  31. package/dist/common/errors/intent-to-join.js.map +1 -1
  32. package/dist/common/errors/join-meeting.js +1 -2
  33. package/dist/common/errors/join-meeting.js.map +1 -1
  34. package/dist/common/errors/media.js +1 -2
  35. package/dist/common/errors/media.js.map +1 -1
  36. package/dist/common/errors/no-meeting-info.d.ts +14 -0
  37. package/dist/common/errors/no-meeting-info.js +50 -0
  38. package/dist/common/errors/no-meeting-info.js.map +1 -0
  39. package/dist/common/errors/parameter.js +3 -4
  40. package/dist/common/errors/parameter.js.map +1 -1
  41. package/dist/common/errors/password-error.js +1 -2
  42. package/dist/common/errors/password-error.js.map +1 -1
  43. package/dist/common/errors/permission.js +1 -2
  44. package/dist/common/errors/permission.js.map +1 -1
  45. package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
  46. package/dist/common/errors/reclaim-host-role-errors.js +154 -0
  47. package/dist/common/errors/reclaim-host-role-errors.js.map +1 -0
  48. package/dist/common/errors/reconnection-in-progress.js +1 -2
  49. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  50. package/dist/common/errors/reconnection.js +1 -2
  51. package/dist/common/errors/reconnection.js.map +1 -1
  52. package/dist/common/errors/stats.js +1 -2
  53. package/dist/common/errors/stats.js.map +1 -1
  54. package/dist/{types/common → common}/errors/webex-errors.d.ts +13 -1
  55. package/dist/common/errors/webex-errors.js +35 -16
  56. package/dist/common/errors/webex-errors.js.map +1 -1
  57. package/dist/common/errors/webex-meetings-error.js +1 -2
  58. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  59. package/dist/common/events/events-scope.js +1 -2
  60. package/dist/common/events/events-scope.js.map +1 -1
  61. package/dist/common/events/events.js +1 -2
  62. package/dist/common/events/events.js.map +1 -1
  63. package/dist/common/events/trigger-proxy.js +1 -2
  64. package/dist/common/events/trigger-proxy.js.map +1 -1
  65. package/dist/common/events/util.js +1 -2
  66. package/dist/common/events/util.js.map +1 -1
  67. package/dist/common/logs/logger-config.js +1 -2
  68. package/dist/common/logs/logger-config.js.map +1 -1
  69. package/dist/common/logs/logger-proxy.js +1 -2
  70. package/dist/common/logs/logger-proxy.js.map +1 -1
  71. package/dist/{types/common → common}/logs/request.d.ts +3 -1
  72. package/dist/common/logs/request.js +8 -5
  73. package/dist/common/logs/request.js.map +1 -1
  74. package/dist/common/queue.js +2 -4
  75. package/dist/common/queue.js.map +1 -1
  76. package/dist/{types/config.d.ts → config.d.ts} +1 -1
  77. package/dist/config.js +3 -3
  78. package/dist/config.js.map +1 -1
  79. package/dist/{types/constants.d.ts → constants.d.ts} +72 -15
  80. package/dist/constants.js +254 -371
  81. package/dist/constants.js.map +1 -1
  82. package/dist/controls-options-manager/constants.js +3 -6
  83. package/dist/controls-options-manager/constants.js.map +1 -1
  84. package/dist/controls-options-manager/enums.js +7 -10
  85. package/dist/controls-options-manager/enums.js.map +1 -1
  86. package/dist/controls-options-manager/index.js +27 -32
  87. package/dist/controls-options-manager/index.js.map +1 -1
  88. package/dist/controls-options-manager/util.js +1 -2
  89. package/dist/controls-options-manager/util.js.map +1 -1
  90. package/dist/index.js +8 -5
  91. package/dist/index.js.map +1 -1
  92. package/dist/interceptors/index.d.ts +2 -0
  93. package/dist/interceptors/index.js +15 -0
  94. package/dist/interceptors/index.js.map +1 -0
  95. package/dist/interceptors/locusRetry.d.ts +27 -0
  96. package/dist/interceptors/locusRetry.js +94 -0
  97. package/dist/interceptors/locusRetry.js.map +1 -0
  98. package/dist/interpretation/collection.js +1 -2
  99. package/dist/interpretation/collection.js.map +1 -1
  100. package/dist/interpretation/index.js +2 -3
  101. package/dist/interpretation/index.js.map +1 -1
  102. package/dist/interpretation/siLanguage.js +2 -3
  103. package/dist/interpretation/siLanguage.js.map +1 -1
  104. package/dist/locus-info/controlsUtils.js +12 -13
  105. package/dist/locus-info/controlsUtils.js.map +1 -1
  106. package/dist/locus-info/embeddedAppsUtils.js +3 -4
  107. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  108. package/dist/locus-info/fullState.js +1 -2
  109. package/dist/locus-info/fullState.js.map +1 -1
  110. package/dist/locus-info/hostUtils.js +1 -2
  111. package/dist/locus-info/hostUtils.js.map +1 -1
  112. package/dist/{types/locus-info → locus-info}/index.d.ts +1 -1
  113. package/dist/locus-info/index.js +63 -38
  114. package/dist/locus-info/index.js.map +1 -1
  115. package/dist/locus-info/infoUtils.js +3 -4
  116. package/dist/locus-info/infoUtils.js.map +1 -1
  117. package/dist/locus-info/mediaSharesUtils.js +16 -3
  118. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  119. package/dist/{types/locus-info → locus-info}/parser.d.ts +3 -2
  120. package/dist/locus-info/parser.js +48 -31
  121. package/dist/locus-info/parser.js.map +1 -1
  122. package/dist/locus-info/selfUtils.js +7 -6
  123. package/dist/locus-info/selfUtils.js.map +1 -1
  124. package/dist/media/index.js +15 -10
  125. package/dist/media/index.js.map +1 -1
  126. package/dist/media/properties.js +16 -7
  127. package/dist/media/properties.js.map +1 -1
  128. package/dist/media/util.js +1 -2
  129. package/dist/media/util.js.map +1 -1
  130. package/dist/mediaQualityMetrics/config.d.ts +241 -0
  131. package/dist/mediaQualityMetrics/config.js +135 -339
  132. package/dist/mediaQualityMetrics/config.js.map +1 -1
  133. package/dist/{types/meeting → meeting}/in-meeting-actions.d.ts +4 -0
  134. package/dist/meeting/in-meeting-actions.js +18 -2
  135. package/dist/meeting/in-meeting-actions.js.map +1 -1
  136. package/dist/{types/meeting → meeting}/index.d.ts +331 -44
  137. package/dist/meeting/index.js +2639 -1367
  138. package/dist/meeting/index.js.map +1 -1
  139. package/dist/{types/meeting → meeting}/locusMediaRequest.d.ts +1 -2
  140. package/dist/meeting/locusMediaRequest.js +4 -5
  141. package/dist/meeting/locusMediaRequest.js.map +1 -1
  142. package/dist/meeting/muteState.js +2 -4
  143. package/dist/meeting/muteState.js.map +1 -1
  144. package/dist/{types/meeting → meeting}/request.d.ts +4 -1
  145. package/dist/meeting/request.js +47 -32
  146. package/dist/meeting/request.js.map +1 -1
  147. package/dist/meeting/state.js +1 -2
  148. package/dist/meeting/state.js.map +1 -1
  149. package/dist/{types/meeting → meeting}/util.d.ts +26 -1
  150. package/dist/meeting/util.js +83 -10
  151. package/dist/meeting/util.js.map +1 -1
  152. package/dist/meeting/voicea-meeting.d.ts +16 -0
  153. package/dist/meeting/voicea-meeting.js +169 -0
  154. package/dist/meeting/voicea-meeting.js.map +1 -0
  155. package/dist/meeting-info/collection.js +3 -4
  156. package/dist/meeting-info/collection.js.map +1 -1
  157. package/dist/{types/meeting-info → meeting-info}/index.d.ts +7 -0
  158. package/dist/meeting-info/index.js +53 -27
  159. package/dist/meeting-info/index.js.map +1 -1
  160. package/dist/{types/meeting-info → meeting-info}/meeting-info-v2.d.ts +1 -0
  161. package/dist/meeting-info/meeting-info-v2.js +52 -33
  162. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  163. package/dist/meeting-info/request.js +1 -2
  164. package/dist/meeting-info/request.js.map +1 -1
  165. package/dist/meeting-info/util.js +8 -8
  166. package/dist/meeting-info/util.js.map +1 -1
  167. package/dist/meeting-info/utilv2.js +12 -9
  168. package/dist/meeting-info/utilv2.js.map +1 -1
  169. package/dist/{types/meetings → meetings}/collection.d.ts +9 -0
  170. package/dist/meetings/collection.js +21 -5
  171. package/dist/meetings/collection.js.map +1 -1
  172. package/dist/{types/meetings → meetings}/index.d.ts +45 -16
  173. package/dist/meetings/index.js +166 -74
  174. package/dist/meetings/index.js.map +1 -1
  175. package/dist/meetings/request.js +2 -3
  176. package/dist/meetings/request.js.map +1 -1
  177. package/dist/meetings/util.js +3 -10
  178. package/dist/meetings/util.js.map +1 -1
  179. package/dist/{types/member → member}/index.d.ts +1 -0
  180. package/dist/member/index.js +10 -3
  181. package/dist/member/index.js.map +1 -1
  182. package/dist/member/member.types.d.ts +11 -0
  183. package/dist/member/member.types.js +17 -0
  184. package/dist/member/member.types.js.map +1 -0
  185. package/dist/member/types.js +6 -8
  186. package/dist/member/types.js.map +1 -1
  187. package/dist/member/util.js +12 -2
  188. package/dist/member/util.js.map +1 -1
  189. package/dist/members/collection.js +1 -2
  190. package/dist/members/collection.js.map +1 -1
  191. package/dist/members/index.js +25 -8
  192. package/dist/members/index.js.map +1 -1
  193. package/dist/members/request.js +2 -3
  194. package/dist/members/request.js.map +1 -1
  195. package/dist/{types/members → members}/types.d.ts +1 -0
  196. package/dist/members/types.js +3 -4
  197. package/dist/members/types.js.map +1 -1
  198. package/dist/{types/members → members}/util.d.ts +6 -1
  199. package/dist/members/util.js +18 -8
  200. package/dist/members/util.js.map +1 -1
  201. package/dist/{types/metrics → metrics}/constants.d.ts +15 -0
  202. package/dist/metrics/constants.js +16 -3
  203. package/dist/metrics/constants.js.map +1 -1
  204. package/dist/metrics/index.js +3 -2
  205. package/dist/metrics/index.js.map +1 -1
  206. package/dist/multistream/mediaRequestManager.js +9 -11
  207. package/dist/multistream/mediaRequestManager.js.map +1 -1
  208. package/dist/multistream/receiveSlot.js +3 -5
  209. package/dist/multistream/receiveSlot.js.map +1 -1
  210. package/dist/multistream/receiveSlotManager.js +7 -9
  211. package/dist/multistream/receiveSlotManager.js.map +1 -1
  212. package/dist/multistream/remoteMedia.js +3 -5
  213. package/dist/multistream/remoteMedia.js.map +1 -1
  214. package/dist/multistream/remoteMediaGroup.js +7 -6
  215. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  216. package/dist/{types/multistream → multistream}/remoteMediaManager.d.ts +9 -1
  217. package/dist/multistream/remoteMediaManager.js +74 -36
  218. package/dist/multistream/remoteMediaManager.js.map +1 -1
  219. package/dist/multistream/sendSlotManager.js +9 -6
  220. package/dist/multistream/sendSlotManager.js.map +1 -1
  221. package/dist/networkQualityMonitor/index.js +1 -2
  222. package/dist/networkQualityMonitor/index.js.map +1 -1
  223. package/dist/personal-meeting-room/index.js +2 -3
  224. package/dist/personal-meeting-room/index.js.map +1 -1
  225. package/dist/personal-meeting-room/request.js +2 -3
  226. package/dist/personal-meeting-room/request.js.map +1 -1
  227. package/dist/personal-meeting-room/util.js +1 -2
  228. package/dist/personal-meeting-room/util.js.map +1 -1
  229. package/dist/reachability/clusterReachability.d.ts +109 -0
  230. package/dist/reachability/clusterReachability.js +357 -0
  231. package/dist/reachability/clusterReachability.js.map +1 -0
  232. package/dist/reachability/index.d.ts +105 -0
  233. package/dist/reachability/index.js +279 -436
  234. package/dist/reachability/index.js.map +1 -1
  235. package/dist/{types/reachability → reachability}/request.d.ts +1 -1
  236. package/dist/reachability/request.js +14 -11
  237. package/dist/reachability/request.js.map +1 -1
  238. package/dist/reachability/util.d.ts +8 -0
  239. package/dist/reachability/util.js +29 -0
  240. package/dist/reachability/util.js.map +1 -0
  241. package/dist/reactions/constants.js +1 -2
  242. package/dist/reactions/constants.js.map +1 -1
  243. package/dist/reactions/reactions.js +2 -4
  244. package/dist/reactions/reactions.js.map +1 -1
  245. package/dist/reactions/reactions.type.js +6 -8
  246. package/dist/reactions/reactions.type.js.map +1 -1
  247. package/dist/{types/reconnection-manager → reconnection-manager}/index.d.ts +10 -0
  248. package/dist/reconnection-manager/index.js +129 -106
  249. package/dist/reconnection-manager/index.js.map +1 -1
  250. package/dist/recording-controller/enums.js +4 -5
  251. package/dist/recording-controller/enums.js.map +1 -1
  252. package/dist/recording-controller/index.js +43 -51
  253. package/dist/recording-controller/index.js.map +1 -1
  254. package/dist/recording-controller/util.js +1 -2
  255. package/dist/recording-controller/util.js.map +1 -1
  256. package/dist/{types/roap → roap}/index.d.ts +2 -1
  257. package/dist/roap/index.js +59 -28
  258. package/dist/roap/index.js.map +1 -1
  259. package/dist/{types/roap → roap}/request.d.ts +2 -1
  260. package/dist/roap/request.js +14 -22
  261. package/dist/roap/request.js.map +1 -1
  262. package/dist/{types/roap → roap}/turnDiscovery.d.ts +21 -4
  263. package/dist/roap/turnDiscovery.js +182 -89
  264. package/dist/roap/turnDiscovery.js.map +1 -1
  265. package/dist/rtcMetrics/constants.js +1 -2
  266. package/dist/rtcMetrics/constants.js.map +1 -1
  267. package/dist/{types/rtcMetrics → rtcMetrics}/index.d.ts +15 -1
  268. package/dist/rtcMetrics/index.js +72 -12
  269. package/dist/rtcMetrics/index.js.map +1 -1
  270. package/dist/statsAnalyzer/global.js +1 -2
  271. package/dist/statsAnalyzer/global.js.map +1 -1
  272. package/dist/{types/statsAnalyzer → statsAnalyzer}/index.d.ts +28 -11
  273. package/dist/statsAnalyzer/index.js +371 -318
  274. package/dist/statsAnalyzer/index.js.map +1 -1
  275. package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
  276. package/dist/statsAnalyzer/mqaUtil.js +295 -162
  277. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  278. package/dist/transcription/index.js +1 -2
  279. package/dist/transcription/index.js.map +1 -1
  280. package/dist/webinar/collection.d.ts +16 -0
  281. package/dist/webinar/collection.js +43 -0
  282. package/dist/webinar/collection.js.map +1 -0
  283. package/dist/webinar/index.d.ts +5 -0
  284. package/dist/webinar/index.js +68 -0
  285. package/dist/webinar/index.js.map +1 -0
  286. package/jest.config.js +3 -0
  287. package/package.json +44 -24
  288. package/process +1 -0
  289. package/src/common/errors/no-meeting-info.ts +24 -0
  290. package/src/common/errors/reclaim-host-role-errors.ts +134 -0
  291. package/src/common/errors/webex-errors.ts +19 -2
  292. package/src/common/logs/request.ts +5 -1
  293. package/src/config.ts +3 -5
  294. package/src/constants.ts +78 -8
  295. package/src/index.ts +4 -0
  296. package/src/interceptors/index.ts +3 -0
  297. package/src/interceptors/locusRetry.ts +67 -0
  298. package/src/locus-info/index.ts +52 -16
  299. package/src/locus-info/mediaSharesUtils.ts +16 -0
  300. package/src/locus-info/parser.ts +47 -21
  301. package/src/media/index.ts +8 -6
  302. package/src/media/properties.ts +17 -2
  303. package/src/mediaQualityMetrics/config.ts +103 -238
  304. package/src/meeting/in-meeting-actions.ts +8 -0
  305. package/src/meeting/index.ts +1692 -627
  306. package/src/meeting/request.ts +19 -1
  307. package/src/meeting/util.ts +102 -1
  308. package/src/meeting/voicea-meeting.ts +122 -0
  309. package/src/meeting-info/index.ts +47 -20
  310. package/src/meeting-info/meeting-info-v2.ts +32 -16
  311. package/src/meeting-info/util.ts +12 -9
  312. package/src/meeting-info/utilv2.ts +25 -15
  313. package/src/meetings/collection.ts +13 -0
  314. package/src/meetings/index.ts +112 -31
  315. package/src/meetings/util.ts +2 -8
  316. package/src/member/index.ts +9 -1
  317. package/src/member/member.types.ts +13 -0
  318. package/src/member/util.ts +14 -0
  319. package/src/members/index.ts +29 -2
  320. package/src/members/types.ts +1 -0
  321. package/src/members/util.ts +15 -1
  322. package/src/metrics/constants.ts +14 -0
  323. package/src/multistream/remoteMediaManager.ts +41 -4
  324. package/src/reachability/clusterReachability.ts +320 -0
  325. package/src/reachability/index.ts +221 -382
  326. package/src/reachability/request.ts +1 -1
  327. package/src/reachability/util.ts +24 -0
  328. package/src/reconnection-manager/index.ts +87 -83
  329. package/src/roap/index.ts +60 -24
  330. package/src/roap/request.ts +4 -17
  331. package/src/roap/turnDiscovery.ts +112 -39
  332. package/src/rtcMetrics/index.ts +71 -5
  333. package/src/statsAnalyzer/index.ts +430 -427
  334. package/src/statsAnalyzer/mqaUtil.ts +317 -168
  335. package/src/webinar/collection.ts +31 -0
  336. package/src/webinar/index.ts +62 -0
  337. package/test/integration/spec/converged-space-meetings.js +7 -7
  338. package/test/integration/spec/journey.js +88 -106
  339. package/test/integration/spec/space-meeting.js +10 -10
  340. package/test/unit/spec/breakouts/breakout.ts +2 -1
  341. package/test/unit/spec/breakouts/index.ts +7 -4
  342. package/test/unit/spec/interceptors/locusRetry.ts +131 -0
  343. package/test/unit/spec/locus-info/index.js +206 -13
  344. package/test/unit/spec/locus-info/lib/SeqCmp.json +16 -0
  345. package/test/unit/spec/locus-info/mediaSharesUtils.ts +10 -0
  346. package/test/unit/spec/locus-info/parser.js +54 -13
  347. package/test/unit/spec/locus-info/selfUtils.js +1 -1
  348. package/test/unit/spec/media/index.ts +25 -4
  349. package/test/unit/spec/media/properties.ts +2 -2
  350. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  351. package/test/unit/spec/meeting/index.js +4354 -1285
  352. package/test/unit/spec/meeting/request.js +63 -12
  353. package/test/unit/spec/meeting/utils.js +145 -10
  354. package/test/unit/spec/meeting/voicea-meeting.ts +266 -0
  355. package/test/unit/spec/meeting-info/index.js +180 -61
  356. package/test/unit/spec/meeting-info/meetinginfov2.js +216 -68
  357. package/test/unit/spec/meetings/collection.js +12 -0
  358. package/test/unit/spec/meetings/index.js +676 -195
  359. package/test/unit/spec/meetings/utils.js +35 -12
  360. package/test/unit/spec/member/index.js +8 -7
  361. package/test/unit/spec/member/util.js +32 -0
  362. package/test/unit/spec/members/index.js +130 -17
  363. package/test/unit/spec/members/utils.js +26 -0
  364. package/test/unit/spec/metrics/index.js +1 -2
  365. package/test/unit/spec/multistream/mediaRequestManager.ts +1 -0
  366. package/test/unit/spec/multistream/remoteMediaManager.ts +10 -2
  367. package/test/unit/spec/reachability/clusterReachability.ts +279 -0
  368. package/test/unit/spec/reachability/index.ts +505 -135
  369. package/test/unit/spec/reachability/util.ts +40 -0
  370. package/test/unit/spec/reconnection-manager/index.js +74 -17
  371. package/test/unit/spec/recording-controller/index.js +0 -1
  372. package/test/unit/spec/roap/index.ts +181 -61
  373. package/test/unit/spec/roap/request.ts +27 -3
  374. package/test/unit/spec/roap/turnDiscovery.ts +363 -102
  375. package/test/unit/spec/rtcMetrics/index.ts +57 -3
  376. package/test/unit/spec/stats-analyzer/index.js +1225 -12
  377. package/test/unit/spec/webinar/collection.ts +13 -0
  378. package/test/unit/spec/webinar/index.ts +60 -0
  379. package/test/utils/integrationTestUtils.js +4 -4
  380. package/test/utils/webex-test-users.js +12 -4
  381. package/dist/types/mediaQualityMetrics/config.d.ts +0 -365
  382. package/dist/types/reachability/index.d.ts +0 -158
  383. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -24
  384. /package/dist/{types/annotation → annotation}/annotation.types.d.ts +0 -0
  385. /package/dist/{types/annotation → annotation}/constants.d.ts +0 -0
  386. /package/dist/{types/annotation → annotation}/index.d.ts +0 -0
  387. /package/dist/{types/breakouts → breakouts}/breakout.d.ts +0 -0
  388. /package/dist/{types/breakouts → breakouts}/collection.d.ts +0 -0
  389. /package/dist/{types/breakouts → breakouts}/edit-lock-error.d.ts +0 -0
  390. /package/dist/{types/breakouts → breakouts}/events.d.ts +0 -0
  391. /package/dist/{types/breakouts → breakouts}/index.d.ts +0 -0
  392. /package/dist/{types/breakouts → breakouts}/request.d.ts +0 -0
  393. /package/dist/{types/breakouts → breakouts}/utils.d.ts +0 -0
  394. /package/dist/{types/common → common}/browser-detection.d.ts +0 -0
  395. /package/dist/{types/common → common}/collection.d.ts +0 -0
  396. /package/dist/{types/common → common}/config.d.ts +0 -0
  397. /package/dist/{types/common → common}/errors/captcha-error.d.ts +0 -0
  398. /package/dist/{types/common → common}/errors/intent-to-join.d.ts +0 -0
  399. /package/dist/{types/common → common}/errors/join-meeting.d.ts +0 -0
  400. /package/dist/{types/common → common}/errors/media.d.ts +0 -0
  401. /package/dist/{types/common → common}/errors/parameter.d.ts +0 -0
  402. /package/dist/{types/common → common}/errors/password-error.d.ts +0 -0
  403. /package/dist/{types/common → common}/errors/permission.d.ts +0 -0
  404. /package/dist/{types/common → common}/errors/reconnection-in-progress.d.ts +0 -0
  405. /package/dist/{types/common → common}/errors/reconnection.d.ts +0 -0
  406. /package/dist/{types/common → common}/errors/stats.d.ts +0 -0
  407. /package/dist/{types/common → common}/errors/webex-meetings-error.d.ts +0 -0
  408. /package/dist/{types/common → common}/events/events-scope.d.ts +0 -0
  409. /package/dist/{types/common → common}/events/events.d.ts +0 -0
  410. /package/dist/{types/common → common}/events/trigger-proxy.d.ts +0 -0
  411. /package/dist/{types/common → common}/events/util.d.ts +0 -0
  412. /package/dist/{types/common → common}/logs/logger-config.d.ts +0 -0
  413. /package/dist/{types/common → common}/logs/logger-proxy.d.ts +0 -0
  414. /package/dist/{types/common → common}/queue.d.ts +0 -0
  415. /package/dist/{types/controls-options-manager → controls-options-manager}/constants.d.ts +0 -0
  416. /package/dist/{types/controls-options-manager → controls-options-manager}/enums.d.ts +0 -0
  417. /package/dist/{types/controls-options-manager → controls-options-manager}/index.d.ts +0 -0
  418. /package/dist/{types/controls-options-manager → controls-options-manager}/types.d.ts +0 -0
  419. /package/dist/{types/controls-options-manager → controls-options-manager}/util.d.ts +0 -0
  420. /package/dist/{types/index.d.ts → index.d.ts} +0 -0
  421. /package/dist/{types/interpretation → interpretation}/collection.d.ts +0 -0
  422. /package/dist/{types/interpretation → interpretation}/index.d.ts +0 -0
  423. /package/dist/{types/interpretation → interpretation}/siLanguage.d.ts +0 -0
  424. /package/dist/{types/locus-info → locus-info}/controlsUtils.d.ts +0 -0
  425. /package/dist/{types/locus-info → locus-info}/embeddedAppsUtils.d.ts +0 -0
  426. /package/dist/{types/locus-info → locus-info}/fullState.d.ts +0 -0
  427. /package/dist/{types/locus-info → locus-info}/hostUtils.d.ts +0 -0
  428. /package/dist/{types/locus-info → locus-info}/infoUtils.d.ts +0 -0
  429. /package/dist/{types/locus-info → locus-info}/mediaSharesUtils.d.ts +0 -0
  430. /package/dist/{types/locus-info → locus-info}/selfUtils.d.ts +0 -0
  431. /package/dist/{types/media → media}/index.d.ts +0 -0
  432. /package/dist/{types/media → media}/properties.d.ts +0 -0
  433. /package/dist/{types/media → media}/util.d.ts +0 -0
  434. /package/dist/{types/meeting → meeting}/muteState.d.ts +0 -0
  435. /package/dist/{types/meeting → meeting}/request.type.d.ts +0 -0
  436. /package/dist/{types/meeting → meeting}/state.d.ts +0 -0
  437. /package/dist/{types/meeting-info → meeting-info}/collection.d.ts +0 -0
  438. /package/dist/{types/meeting-info → meeting-info}/request.d.ts +0 -0
  439. /package/dist/{types/meeting-info → meeting-info}/util.d.ts +0 -0
  440. /package/dist/{types/meeting-info → meeting-info}/utilv2.d.ts +0 -0
  441. /package/dist/{types/meetings → meetings}/meetings.types.d.ts +0 -0
  442. /package/dist/{types/meetings → meetings}/request.d.ts +0 -0
  443. /package/dist/{types/meetings → meetings}/util.d.ts +0 -0
  444. /package/dist/{types/member → member}/types.d.ts +0 -0
  445. /package/dist/{types/member → member}/util.d.ts +0 -0
  446. /package/dist/{types/members → members}/collection.d.ts +0 -0
  447. /package/dist/{types/members → members}/index.d.ts +0 -0
  448. /package/dist/{types/members → members}/request.d.ts +0 -0
  449. /package/dist/{types/metrics → metrics}/index.d.ts +0 -0
  450. /package/dist/{types/multistream → multistream}/mediaRequestManager.d.ts +0 -0
  451. /package/dist/{types/multistream → multistream}/receiveSlot.d.ts +0 -0
  452. /package/dist/{types/multistream → multistream}/receiveSlotManager.d.ts +0 -0
  453. /package/dist/{types/multistream → multistream}/remoteMedia.d.ts +0 -0
  454. /package/dist/{types/multistream → multistream}/remoteMediaGroup.d.ts +0 -0
  455. /package/dist/{types/multistream → multistream}/sendSlotManager.d.ts +0 -0
  456. /package/dist/{types/networkQualityMonitor → networkQualityMonitor}/index.d.ts +0 -0
  457. /package/dist/{types/personal-meeting-room → personal-meeting-room}/index.d.ts +0 -0
  458. /package/dist/{types/personal-meeting-room → personal-meeting-room}/request.d.ts +0 -0
  459. /package/dist/{types/personal-meeting-room → personal-meeting-room}/util.d.ts +0 -0
  460. /package/dist/{types/reactions → reactions}/constants.d.ts +0 -0
  461. /package/dist/{types/reactions → reactions}/reactions.d.ts +0 -0
  462. /package/dist/{types/reactions → reactions}/reactions.type.d.ts +0 -0
  463. /package/dist/{types/recording-controller → recording-controller}/enums.d.ts +0 -0
  464. /package/dist/{types/recording-controller → recording-controller}/index.d.ts +0 -0
  465. /package/dist/{types/recording-controller → recording-controller}/util.d.ts +0 -0
  466. /package/dist/{types/rtcMetrics → rtcMetrics}/constants.d.ts +0 -0
  467. /package/dist/{types/statsAnalyzer → statsAnalyzer}/global.d.ts +0 -0
  468. /package/dist/{types/transcription → transcription}/index.d.ts +0 -0
  469. /package/test/unit/spec/locus-info/{selfConstant.js → lib/selfConstant.js} +0 -0
@@ -0,0 +1,40 @@
1
+ import {assert} from '@webex/test-helper-chai';
2
+
3
+ import {convertStunUrlToTurn} from '@webex/plugin-meetings/src/reachability/util';
4
+
5
+ describe('plugin-meetings/src/reachability/util', () => {
6
+ describe('#convertStunUrlToTurn()', () => {
7
+ [
8
+ {
9
+ title: 'a stun url with port',
10
+ stunUrl: 'stun:external-media91.public.wjfkm-a-10.prod.infra.webex.com:5004',
11
+ expectedUrlPart: 'external-media91.public.wjfkm-a-10.prod.infra.webex.com:5004',
12
+ },
13
+ {
14
+ title: 'a stun url without port',
15
+ stunUrl: 'stun:something.somewhere.com',
16
+ expectedUrlPart: 'something.somewhere.com',
17
+ },
18
+ ].forEach(({title, stunUrl, expectedUrlPart}) => {
19
+ it(`should convert ${title} to a TCP turn url`, () => {
20
+ const turnUrl = convertStunUrlToTurn(stunUrl, 'tcp');
21
+
22
+ assert.equal(turnUrl, `turn:${expectedUrlPart}?transport=tcp`);
23
+ });
24
+
25
+ it(`should convert ${title} to a UDP turn url`, () => {
26
+ const turnUrl = convertStunUrlToTurn(stunUrl, 'udp');
27
+
28
+ assert.equal(turnUrl, `turn:${expectedUrlPart}`);
29
+ });
30
+ });
31
+
32
+ it('show fail if stunUrl is not a valid url', () => {
33
+ assert.throws(() => convertStunUrlToTurn('not a url', 'tcp'), 'Invalid URL: not a url');
34
+ });
35
+
36
+ it('show fail if stunUrl is not a STUN url', () => {
37
+ assert.throws(() => convertStunUrlToTurn('http://webex.com', 'tcp'), 'Not a STUN URL: http://webex.com');
38
+ });
39
+ });
40
+ });
@@ -3,6 +3,9 @@ import chai from 'chai';
3
3
  import chaiAsPromised from 'chai-as-promised';
4
4
  import sinon from 'sinon';
5
5
  import ReconnectionManager from '@webex/plugin-meetings/src/reconnection-manager';
6
+ import { RECONNECTION } from '../../../../src/constants';
7
+ import LoggerProxy from '../../../../src/common/logs/logger-proxy';
8
+ import LoggerConfig from '../../../../src/common/logs/logger-config';
6
9
 
7
10
  const {assert} = chai;
8
11
 
@@ -11,8 +14,16 @@ sinon.assert.expose(chai.assert, {prefix: ''});
11
14
 
12
15
  describe('plugin-meetings', () => {
13
16
  describe('ReconnectionManager.reconnect', () => {
17
+ const sandbox = sinon.createSandbox();
14
18
  let fakeMediaConnection;
15
19
  let fakeMeeting;
20
+ let loggerSpy;
21
+
22
+ before(() => {
23
+ LoggerConfig.set({ enable: false });
24
+ LoggerProxy.set();
25
+ loggerSpy = sandbox.spy(LoggerProxy.logger, 'info');
26
+ });
16
27
 
17
28
  beforeEach(() => {
18
29
  fakeMediaConnection = {
@@ -64,6 +75,7 @@ describe('plugin-meetings', () => {
64
75
  meetings: {
65
76
  getMeetingByType: sinon.stub().returns(true),
66
77
  syncMeetings: sinon.stub().resolves({}),
78
+ startReachability: sinon.stub().resolves({}),
67
79
  },
68
80
  internal: {
69
81
  newMetrics: {
@@ -74,22 +86,38 @@ describe('plugin-meetings', () => {
74
86
  };
75
87
  });
76
88
 
77
- it('syncs meetings if it is not an unverified guest', async () => {
89
+ afterEach(() => {
90
+ sandbox.reset();
91
+ });
92
+
93
+ it('calls syncMeetings', async () => {
78
94
  const rm = new ReconnectionManager(fakeMeeting);
79
95
 
80
96
  await rm.reconnect();
81
97
 
82
98
  assert.calledOnce(rm.webex.meetings.syncMeetings);
99
+ assert.calledWith(rm.webex.meetings.syncMeetings, {keepOnlyLocusMeetings: false});
83
100
  });
84
101
 
85
- it('does not sync meetings if it is an unverified guest', async () => {
102
+ it('calls startReachability on reconnect', async () => {
86
103
  const rm = new ReconnectionManager(fakeMeeting);
87
104
 
88
- rm.webex.credentials.isUnverifiedGuest = true;
105
+ await rm.reconnect();
106
+
107
+ assert.calledOnce(rm.webex.meetings.startReachability);
108
+ });
109
+
110
+ it('continues with reconnection attempt if startReachability throws an error', async () => {
111
+ const reachabilityError = new Error();
112
+ fakeMeeting.webex.meetings.startReachability = sinon.stub().throws(reachabilityError);
113
+
114
+ const rm = new ReconnectionManager(fakeMeeting);
89
115
 
90
116
  await rm.reconnect();
91
117
 
92
- assert.notCalled(rm.webex.meetings.syncMeetings);
118
+ assert.calledOnce(rm.webex.meetings.startReachability);
119
+ assert.calledWith(loggerSpy, 'ReconnectionManager:index#reconnect --> Reachability failed, continuing with reconnection attempt, err: ', reachabilityError);
120
+ assert.calledWith(loggerSpy, 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.');
93
121
  });
94
122
 
95
123
  it('uses correct TURN TLS information on the reconnection', async () => {
@@ -98,6 +126,7 @@ describe('plugin-meetings', () => {
98
126
  await rm.reconnect();
99
127
 
100
128
  assert.calledOnce(fakeMeeting.roap.doTurnDiscovery);
129
+ assert.calledWith(fakeMeeting.roap.doTurnDiscovery, fakeMeeting, true, true);
101
130
  assert.calledOnce(fakeMediaConnection.reconnect);
102
131
  assert.calledWith(fakeMediaConnection.reconnect, [
103
132
  {
@@ -113,16 +142,6 @@ describe('plugin-meetings', () => {
113
142
  meetingId: rm.meeting.id,
114
143
  },
115
144
  });
116
-
117
- assert.calledWith(fakeMeeting.webex.internal.newMetrics.submitClientEvent, {
118
- name: 'client.media.recovered',
119
- payload: {
120
- recoveredBy: 'new',
121
- },
122
- options: {
123
- meetingId: rm.meeting.id,
124
- },
125
- });
126
145
  });
127
146
 
128
147
  it('does not clear previous requests and re-request media for non-multistream meetings', async () => {
@@ -149,7 +168,6 @@ describe('plugin-meetings', () => {
149
168
  assert.calledOnce(fakeMeeting.mediaRequestManagers.video.commit);
150
169
  });
151
170
 
152
-
153
171
  it('sends the correct client event when reconnection fails', async () => {
154
172
  sinon.stub(ReconnectionManager.prototype, 'executeReconnection').rejects();
155
173
  fakeMeeting.isMultistream = true;
@@ -186,9 +204,10 @@ describe('plugin-meetings', () => {
186
204
  */
187
205
  describe('ReconnectionManager', () => {
188
206
  let reconnectionManager;
207
+ let fakeMeeting;
189
208
 
190
209
  beforeEach(() => {
191
- reconnectionManager = new ReconnectionManager({
210
+ fakeMeeting = {
192
211
  config: {
193
212
  reconnection: {
194
213
  enabled: true,
@@ -203,7 +222,9 @@ describe('plugin-meetings', () => {
203
222
  },
204
223
  },
205
224
  },
206
- });
225
+ };
226
+
227
+ reconnectionManager = new ReconnectionManager(fakeMeeting);
207
228
  });
208
229
 
209
230
  describe('iceReconnected()', () => {
@@ -309,5 +330,41 @@ describe('plugin-meetings', () => {
309
330
  });
310
331
  });
311
332
  });
333
+
334
+ describe('setStatus()', () => {
335
+ beforeEach(() => {
336
+ reconnectionManager.status = RECONNECTION.STATE.DEFAULT_STATUS;
337
+ });
338
+
339
+ it('should correctly change status to in progress', () => {
340
+ reconnectionManager.setStatus(RECONNECTION.STATE.IN_PROGRESS);
341
+
342
+ assert.equal(reconnectionManager.status, RECONNECTION.STATE.IN_PROGRESS);
343
+ });
344
+
345
+ it('should correctly change status to complete', () => {
346
+ reconnectionManager.setStatus(RECONNECTION.STATE.COMPLETE);
347
+
348
+ assert.equal(reconnectionManager.status, RECONNECTION.STATE.COMPLETE);
349
+ });
350
+
351
+ it('should correctly change status to failure', () => {
352
+ reconnectionManager.setStatus(RECONNECTION.STATE.FAILURE);
353
+
354
+ assert.equal(reconnectionManager.status, RECONNECTION.STATE.FAILURE);
355
+ });
356
+ });
357
+
358
+ describe('cleanUp()', () => {
359
+ it('should call reset and keep reference to meeting object', () => {
360
+ const resetSpy = sinon.spy(reconnectionManager, 'reset');
361
+ assert.equal(reconnectionManager.meeting, fakeMeeting);
362
+
363
+ reconnectionManager.cleanUp();
364
+
365
+ assert.equal(reconnectionManager.meeting, fakeMeeting);
366
+ assert.calledOnce(reconnectionManager.reset);
367
+ });
368
+ });
312
369
  });
313
370
  });
@@ -3,7 +3,6 @@ import sinon from 'sinon';
3
3
  import {assert} from '@webex/test-helper-chai';
4
4
  import {HTTP_VERBS, SELF_POLICY} from '@webex/plugin-meetings/src/constants';
5
5
 
6
-
7
6
  describe('plugin-meetings', () => {
8
7
  describe('recording-controller tests', () => {
9
8
  describe('index', () => {
@@ -7,38 +7,35 @@ import RoapRequest from '@webex/plugin-meetings/src/roap/request';
7
7
  import Roap from '@webex/plugin-meetings/src/roap/';
8
8
  import Meeting from '@webex/plugin-meetings/src/meeting';
9
9
  import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
10
+ import Metrics from '@webex/plugin-meetings/src/metrics';
11
+ import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
10
12
 
11
13
  import { IP_VERSION } from '../../../../src/constants';
12
14
 
13
15
  describe('Roap', () => {
14
16
  describe('doTurnDiscovery', () => {
15
- it('calls this.turnDiscovery.doTurnDiscovery() and forwards all the arguments', async () => {
16
- const webex = new MockWebex({});
17
+ [false, true].forEach(function (isReconnecting) {
18
+ [false, true, undefined].forEach(function (isForced) {
19
+ it(`calls this.turnDiscovery.doTurnDiscovery() and forwards all the arguments when isReconnecting = ${isReconnecting} and isForced = ${isForced}`, async () => {
20
+ const webex = new MockWebex({});
17
21
 
18
- const RESULT = {something: 'some value'};
19
- const meeting = {id: 'some meeting id'} as Meeting;
22
+ const RESULT = {something: 'some value'};
23
+ const meeting = {id: 'some meeting id'} as Meeting;
20
24
 
21
- const doTurnDiscoveryStub = sinon
22
- .stub(TurnDiscovery.prototype, 'doTurnDiscovery')
23
- .resolves(RESULT);
25
+ const doTurnDiscoveryStub = sinon
26
+ .stub(TurnDiscovery.prototype, 'doTurnDiscovery')
27
+ .resolves(RESULT);
24
28
 
25
- const roap = new Roap({}, {parent: webex});
29
+ const roap = new Roap({}, {parent: webex});
26
30
 
27
- // call with isReconnecting: true
28
- const result = await roap.doTurnDiscovery(meeting, true);
31
+ const result = await roap.doTurnDiscovery(meeting, isReconnecting, isForced);
29
32
 
30
- assert.calledOnceWithExactly(doTurnDiscoveryStub, meeting, true);
31
- assert.deepEqual(result, RESULT);
33
+ assert.calledOnceWithExactly(doTurnDiscoveryStub, meeting, isReconnecting, isForced);
34
+ assert.deepEqual(result, RESULT);
32
35
 
33
- doTurnDiscoveryStub.resetHistory();
34
-
35
- // and with isReconnecting: false
36
- const result2 = await roap.doTurnDiscovery(meeting, false);
37
-
38
- assert.calledOnceWithExactly(doTurnDiscoveryStub, meeting, false);
39
- assert.deepEqual(result2, RESULT);
40
-
41
- sinon.restore();
36
+ sinon.restore();
37
+ });
38
+ });
42
39
  });
43
40
  });
44
41
 
@@ -47,6 +44,9 @@ describe('Roap', () => {
47
44
  let meeting;
48
45
 
49
46
  let webex;
47
+ let roap;
48
+
49
+ const fakeLocus = {id: 'fake locus'};
50
50
 
51
51
  beforeEach(() => {
52
52
  webex = new MockWebex({});
@@ -55,68 +55,188 @@ describe('Roap', () => {
55
55
  correlationId: 'correlation id',
56
56
  selfUrl: 'self url',
57
57
  mediaId: 'media id',
58
- audio:{
58
+ audio: {
59
59
  isLocallyMuted: () => true,
60
60
  },
61
- video:{
61
+ video: {
62
62
  isLocallyMuted: () => false,
63
63
  },
64
+ isMultistream: true,
64
65
  setRoapSeq: sinon.stub(),
65
- config: {experimental: {enableTurnDiscovery: false}},
66
66
  locusMediaRequest: {fake: true},
67
- webex: { meetings: { reachability: { isAnyClusterReachable: () => true}}},
67
+ webex: {meetings: {reachability: {isAnyPublicClusterReachable: () => true}}},
68
+ updateMediaConnections: sinon.stub(),
68
69
  };
69
70
 
70
71
  sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
72
+ sinon.stub(Metrics, 'sendBehavioralMetric');
71
73
 
72
74
  sendRoapStub = sinon.stub(RoapRequest.prototype, 'sendRoap').resolves({});
73
75
  meeting.setRoapSeq.resetHistory();
76
+
77
+ roap = new Roap({}, {parent: webex});
78
+ sinon.stub(roap.turnDiscovery, 'isSkipped').resolves(false);
74
79
  });
75
80
 
76
81
  afterEach(() => {
77
82
  sinon.restore();
78
83
  });
79
84
 
80
- [
81
- {reconnect: true, turnDiscoverySkipped: false, expectEmptyMediaId: false},
82
- {reconnect: true, turnDiscoverySkipped: true, expectEmptyMediaId: true},
83
- {reconnect: false, turnDiscoverySkipped: false, expectEmptyMediaId: false},
84
- {reconnect: false, turnDiscoverySkipped: true, expectEmptyMediaId: false},
85
- ].forEach(({reconnect, turnDiscoverySkipped, expectEmptyMediaId}) =>
86
- it(`sends roap OFFER with ${expectEmptyMediaId ? 'empty ' : ''}mediaId when ${
87
- reconnect ? '' : 'not '
88
- }reconnecting and TURN discovery is ${
89
- turnDiscoverySkipped ? 'skipped' : 'not skipped'
90
- }`, async () => {
91
- const roap = new Roap({}, {parent: webex});
92
-
93
- sinon.stub(roap.turnDiscovery, 'isSkipped').resolves(turnDiscoverySkipped);
94
-
95
- await roap.sendRoapMediaRequest({
96
- meeting,
97
- sdp: 'sdp',
98
- reconnect,
99
- seq: 2,
100
- tieBreaker: 4294967294,
101
- });
102
-
103
- const expectedRoapMessage = {
104
- messageType: 'OFFER',
105
- sdps: ['sdp'],
106
- version: '2',
107
- seq: 2,
108
- tieBreaker: 4294967294,
109
- };
85
+ it(`sends roap OFFER`, async () => {
86
+ await roap.sendRoapMediaRequest({
87
+ meeting,
88
+ sdp: 'sdp',
89
+ seq: 2,
90
+ tieBreaker: 4294967294,
91
+ });
92
+
93
+ const expectedRoapMessage = {
94
+ messageType: 'OFFER',
95
+ sdps: ['sdp'],
96
+ version: '2',
97
+ seq: 2,
98
+ tieBreaker: 4294967294,
99
+ headers: ['includeAnswerInHttpResponse', 'noOkInTransaction'],
100
+ };
110
101
 
111
- assert.calledOnce(sendRoapStub);
112
- assert.calledWith(sendRoapStub, sinon.match({
102
+ assert.calledOnce(sendRoapStub);
103
+ assert.calledWith(
104
+ sendRoapStub,
105
+ sinon.match({
113
106
  roapMessage: expectedRoapMessage,
114
107
  locusSelfUrl: meeting.selfUrl,
115
- mediaId: expectEmptyMediaId ? '' : meeting.mediaId,
108
+ mediaId: meeting.mediaId,
116
109
  meetingId: meeting.id,
117
110
  locusMediaRequest: meeting.locusMediaRequest,
118
- }));
119
- })
120
- );
111
+ })
112
+ );
113
+ });
114
+
115
+ it('reads SDP answer from the http response', async () => {
116
+ const roapAnswer = {
117
+ seq: 5,
118
+ messageType: 'ANSWER',
119
+ sdps: ['sdp answer'],
120
+ errorType: 'error type', // normally ANSWER would not have errorType or errorCause (only error messages have these)
121
+ errorCause: 'error cause', // but we're just testing here that all the fields are forwarded to the caller of sendRoapMediaRequest()
122
+ headers: ['header1', 'header2'],
123
+ };
124
+ const fakeMediaConnections = [
125
+ {
126
+ remoteSdp: JSON.stringify({
127
+ roapMessage: roapAnswer,
128
+ }),
129
+ },
130
+ ];
131
+
132
+ sendRoapStub.resolves({
133
+ mediaConnections: fakeMediaConnections,
134
+ locus: fakeLocus,
135
+ });
136
+
137
+ const result = await roap.sendRoapMediaRequest({
138
+ meeting,
139
+ sdp: 'sdp',
140
+ reconnect: false,
141
+ seq: 1,
142
+ tieBreaker: 4294967294,
143
+ });
144
+
145
+ assert.calledOnce(sendRoapStub);
146
+ assert.calledOnceWithExactly(meeting.updateMediaConnections, fakeMediaConnections);
147
+ assert.deepEqual(result, {
148
+ locus: fakeLocus,
149
+ roapAnswer: {
150
+ seq: 5,
151
+ messageType: 'ANSWER',
152
+ sdp: 'sdp answer',
153
+ errorType: 'error type',
154
+ errorCause: 'error cause',
155
+ headers: ['header1', 'header2'],
156
+ },
157
+ });
158
+ });
159
+
160
+ it('handles the case when there is no answer in the http response', async () => {
161
+ const fakeMediaConnections = [
162
+ {
163
+ // this is the actual value Locus returns to us when they don't send Roap ANSWER in the http response
164
+ remoteSdp:
165
+ '{"audioMuted":false,"videoMuted":false,"csis":[],"dtmfReceiveSupported":true,"type":"SDP"}',
166
+ },
167
+ ];
168
+
169
+ sendRoapStub.resolves({
170
+ mediaConnections: fakeMediaConnections,
171
+ locus: fakeLocus,
172
+ });
173
+
174
+ const result = await roap.sendRoapMediaRequest({
175
+ meeting,
176
+ sdp: 'sdp',
177
+ reconnect: false,
178
+ seq: 1,
179
+ tieBreaker: 4294967294,
180
+ });
181
+
182
+ assert.calledOnce(sendRoapStub);
183
+ assert.calledOnceWithExactly(meeting.updateMediaConnections, fakeMediaConnections);
184
+ assert.deepEqual(result, {
185
+ locus: fakeLocus,
186
+ roapAnswer: undefined,
187
+ });
188
+ assert.calledOnceWithExactly(
189
+ Metrics.sendBehavioralMetric,
190
+ BEHAVIORAL_METRICS.ROAP_HTTP_RESPONSE_MISSING,
191
+ {
192
+ correlationId: meeting.correlationId,
193
+ messageType: 'ANSWER',
194
+ isMultistream: meeting.isMultistream,
195
+ }
196
+ );
197
+ });
198
+
199
+ describe('does not crash when http response is missing things', () => {
200
+ [
201
+ {mediaConnections: undefined, title: 'mediaConnections are undefined'},
202
+ {mediaConnections: [], title: 'mediaConnections are empty array'},
203
+ {mediaConnections: [{}], title: 'mediaConnections[0] has no remoteSdp'},
204
+ {
205
+ mediaConnections: [{remoteSdp: '{}'}],
206
+ title: 'mediaConnections[0].remoteSdp is an empty json',
207
+ },
208
+ ].forEach(({mediaConnections, title}) =>
209
+ it(title, async () => {
210
+ sendRoapStub.resolves({
211
+ mediaConnections,
212
+ locus: fakeLocus,
213
+ });
214
+
215
+ const result = await roap.sendRoapMediaRequest({
216
+ meeting,
217
+ sdp: 'sdp',
218
+ reconnect: false,
219
+ seq: 1,
220
+ tieBreaker: 4294967294,
221
+ });
222
+
223
+ assert.calledOnce(sendRoapStub);
224
+ assert.deepEqual(result, {
225
+ locus: fakeLocus,
226
+ roapAnswer: undefined,
227
+ });
228
+
229
+ assert.calledOnceWithExactly(
230
+ Metrics.sendBehavioralMetric,
231
+ BEHAVIORAL_METRICS.ROAP_HTTP_RESPONSE_MISSING,
232
+ {
233
+ correlationId: meeting.correlationId,
234
+ messageType: 'ANSWER',
235
+ isMultistream: meeting.isMultistream,
236
+ }
237
+ );
238
+ })
239
+ );
240
+ });
121
241
  });
122
242
  });
@@ -65,7 +65,9 @@ describe('plugin-meetings/roap', () => {
65
65
  REACHABILITY.localStorageResult,
66
66
  JSON.stringify({
67
67
  clusterId: {
68
- udp: 'test',
68
+ udp: { result: 'reachable', latencyInMilliseconds: 10 },
69
+ tcp: { result: 'unreachable' },
70
+ isVideoMesh: false,
69
71
  },
70
72
  })
71
73
  );
@@ -78,7 +80,16 @@ describe('plugin-meetings/roap', () => {
78
80
  assert.deepEqual(res.localSdp, {
79
81
  reachability: {
80
82
  clusterId: {
81
- udp: 'test',
83
+ udp: {
84
+ reachable: 'true',
85
+ latencyInMilliseconds: '10',
86
+ },
87
+ tcp: {
88
+ reachable: 'false',
89
+ },
90
+ xtls: {
91
+ untested: 'true',
92
+ }
82
93
  },
83
94
  },
84
95
  });
@@ -148,7 +159,20 @@ describe('plugin-meetings/roap', () => {
148
159
  roapMessage: {
149
160
  seq: 'seq',
150
161
  },
151
- reachability: {clusterId: {udp: 'test'}},
162
+ reachability: {
163
+ clusterId: {
164
+ tcp: {
165
+ reachable: 'false',
166
+ },
167
+ udp: {
168
+ latencyInMilliseconds: '10',
169
+ reachable: 'true',
170
+ },
171
+ xtls: {
172
+ untested: 'true',
173
+ },
174
+ },
175
+ },
152
176
  });
153
177
  });
154
178