@webex/plugin-meetings 3.12.0-next.10 → 3.12.0-next.101

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 (230) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +26 -2
  7. package/dist/breakouts/index.js.map +1 -1
  8. package/dist/common/errors/webex-errors.js +49 -5
  9. package/dist/common/errors/webex-errors.js.map +1 -1
  10. package/dist/config.js +2 -2
  11. package/dist/config.js.map +1 -1
  12. package/dist/constants.js +35 -9
  13. package/dist/constants.js.map +1 -1
  14. package/dist/controls-options-manager/constants.js +11 -1
  15. package/dist/controls-options-manager/constants.js.map +1 -1
  16. package/dist/controls-options-manager/index.js +67 -29
  17. package/dist/controls-options-manager/index.js.map +1 -1
  18. package/dist/controls-options-manager/util.js +91 -0
  19. package/dist/controls-options-manager/util.js.map +1 -1
  20. package/dist/hashTree/constants.js +4 -1
  21. package/dist/hashTree/constants.js.map +1 -1
  22. package/dist/hashTree/hashTreeParser.js +880 -382
  23. package/dist/hashTree/hashTreeParser.js.map +1 -1
  24. package/dist/hashTree/utils.js +20 -0
  25. package/dist/hashTree/utils.js.map +1 -1
  26. package/dist/index.js +7 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  29. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  30. package/dist/interceptors/locusRetry.js +23 -8
  31. package/dist/interceptors/locusRetry.js.map +1 -1
  32. package/dist/interpretation/index.js +10 -1
  33. package/dist/interpretation/index.js.map +1 -1
  34. package/dist/interpretation/interpretation.types.js +7 -0
  35. package/dist/interpretation/interpretation.types.js.map +1 -0
  36. package/dist/interpretation/siLanguage.js +1 -1
  37. package/dist/locus-info/controlsUtils.js +4 -1
  38. package/dist/locus-info/controlsUtils.js.map +1 -1
  39. package/dist/locus-info/index.js +401 -115
  40. package/dist/locus-info/index.js.map +1 -1
  41. package/dist/locus-info/infoUtils.js +36 -5
  42. package/dist/locus-info/infoUtils.js.map +1 -1
  43. package/dist/locus-info/types.js +19 -0
  44. package/dist/locus-info/types.js.map +1 -1
  45. package/dist/media/MediaConnectionAwaiter.js +15 -2
  46. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  47. package/dist/media/index.js +8 -2
  48. package/dist/media/index.js.map +1 -1
  49. package/dist/media/properties.js +1 -0
  50. package/dist/media/properties.js.map +1 -1
  51. package/dist/meeting/in-meeting-actions.js +5 -1
  52. package/dist/meeting/in-meeting-actions.js.map +1 -1
  53. package/dist/meeting/index.js +1389 -821
  54. package/dist/meeting/index.js.map +1 -1
  55. package/dist/meeting/locusMediaRequest.js +229 -82
  56. package/dist/meeting/locusMediaRequest.js.map +1 -1
  57. package/dist/meeting/muteState.js +10 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +5 -2
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/util.js +35 -2
  62. package/dist/meeting/util.js.map +1 -1
  63. package/dist/meeting-info/meeting-info-v2.js +2 -2
  64. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  65. package/dist/meetings/index.js +231 -118
  66. package/dist/meetings/index.js.map +1 -1
  67. package/dist/meetings/meetings.types.js +6 -1
  68. package/dist/meetings/meetings.types.js.map +1 -1
  69. package/dist/meetings/request.js +39 -0
  70. package/dist/meetings/request.js.map +1 -1
  71. package/dist/meetings/util.js +116 -18
  72. package/dist/meetings/util.js.map +1 -1
  73. package/dist/member/index.js +10 -0
  74. package/dist/member/index.js.map +1 -1
  75. package/dist/member/types.js.map +1 -1
  76. package/dist/member/util.js +30 -0
  77. package/dist/member/util.js.map +1 -1
  78. package/dist/members/index.js +101 -43
  79. package/dist/members/index.js.map +1 -1
  80. package/dist/members/util.js +8 -1
  81. package/dist/members/util.js.map +1 -1
  82. package/dist/metrics/constants.js +6 -1
  83. package/dist/metrics/constants.js.map +1 -1
  84. package/dist/multistream/codec/constants.js +63 -0
  85. package/dist/multistream/codec/constants.js.map +1 -0
  86. package/dist/multistream/mediaRequestManager.js +62 -15
  87. package/dist/multistream/mediaRequestManager.js.map +1 -1
  88. package/dist/multistream/receiveSlot.js +9 -0
  89. package/dist/multistream/receiveSlot.js.map +1 -1
  90. package/dist/reachability/clusterReachability.js.map +1 -1
  91. package/dist/reachability/index.js +121 -83
  92. package/dist/reachability/index.js.map +1 -1
  93. package/dist/reachability/reachability.types.js +2 -0
  94. package/dist/reachability/reachability.types.js.map +1 -1
  95. package/dist/reachability/util.js +45 -0
  96. package/dist/reachability/util.js.map +1 -1
  97. package/dist/reactions/reactions.type.js.map +1 -1
  98. package/dist/recording-controller/index.js +1 -3
  99. package/dist/recording-controller/index.js.map +1 -1
  100. package/dist/roap/turnDiscovery.js +8 -1
  101. package/dist/roap/turnDiscovery.js.map +1 -1
  102. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  103. package/dist/types/config.d.ts +2 -2
  104. package/dist/types/constants.d.ts +12 -1
  105. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  106. package/dist/types/controls-options-manager/index.d.ts +16 -0
  107. package/dist/types/hashTree/constants.d.ts +1 -0
  108. package/dist/types/hashTree/hashTreeParser.d.ts +146 -17
  109. package/dist/types/hashTree/utils.d.ts +7 -0
  110. package/dist/types/index.d.ts +3 -0
  111. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  112. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  113. package/dist/types/locus-info/index.d.ts +59 -6
  114. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  115. package/dist/types/locus-info/types.d.ts +21 -1
  116. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  117. package/dist/types/media/properties.d.ts +1 -0
  118. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  119. package/dist/types/meeting/index.d.ts +121 -10
  120. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  121. package/dist/types/meeting/request.d.ts +1 -0
  122. package/dist/types/meeting/util.d.ts +9 -0
  123. package/dist/types/meetings/index.d.ts +30 -18
  124. package/dist/types/meetings/meetings.types.d.ts +15 -0
  125. package/dist/types/meetings/request.d.ts +14 -0
  126. package/dist/types/member/index.d.ts +1 -0
  127. package/dist/types/member/types.d.ts +1 -0
  128. package/dist/types/member/util.d.ts +9 -0
  129. package/dist/types/members/index.d.ts +15 -2
  130. package/dist/types/members/util.d.ts +1 -5
  131. package/dist/types/metrics/constants.d.ts +5 -0
  132. package/dist/types/multistream/codec/constants.d.ts +7 -0
  133. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  134. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  135. package/dist/types/reachability/index.d.ts +10 -3
  136. package/dist/types/reachability/reachability.types.d.ts +7 -0
  137. package/dist/types/reachability/util.d.ts +17 -0
  138. package/dist/types/reactions/reactions.type.d.ts +3 -0
  139. package/dist/webinar/index.js +305 -159
  140. package/dist/webinar/index.js.map +1 -1
  141. package/package.json +22 -22
  142. package/src/aiEnableRequest/index.ts +16 -0
  143. package/src/breakouts/breakout.ts +3 -1
  144. package/src/breakouts/index.ts +31 -0
  145. package/src/common/errors/webex-errors.ts +50 -3
  146. package/src/config.ts +2 -2
  147. package/src/constants.ts +20 -3
  148. package/src/controls-options-manager/constants.ts +14 -1
  149. package/src/controls-options-manager/index.ts +87 -28
  150. package/src/controls-options-manager/util.ts +81 -1
  151. package/src/hashTree/constants.ts +7 -0
  152. package/src/hashTree/hashTreeParser.ts +578 -193
  153. package/src/hashTree/utils.ts +19 -0
  154. package/src/index.ts +6 -0
  155. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  156. package/src/interceptors/locusRetry.ts +25 -4
  157. package/src/interpretation/index.ts +27 -9
  158. package/src/interpretation/interpretation.types.ts +11 -0
  159. package/src/locus-info/controlsUtils.ts +3 -1
  160. package/src/locus-info/index.ts +415 -136
  161. package/src/locus-info/infoUtils.ts +41 -6
  162. package/src/locus-info/types.ts +25 -1
  163. package/src/media/MediaConnectionAwaiter.ts +21 -4
  164. package/src/media/index.ts +10 -1
  165. package/src/media/properties.ts +1 -0
  166. package/src/meeting/in-meeting-actions.ts +8 -0
  167. package/src/meeting/index.ts +644 -98
  168. package/src/meeting/locusMediaRequest.ts +106 -6
  169. package/src/meeting/muteState.ts +10 -1
  170. package/src/meeting/request.ts +11 -0
  171. package/src/meeting/util.ts +47 -5
  172. package/src/meeting-info/meeting-info-v2.ts +4 -2
  173. package/src/meetings/index.ts +133 -78
  174. package/src/meetings/meetings.types.ts +19 -0
  175. package/src/meetings/request.ts +43 -0
  176. package/src/meetings/util.ts +117 -4
  177. package/src/member/index.ts +10 -0
  178. package/src/member/types.ts +1 -0
  179. package/src/member/util.ts +29 -0
  180. package/src/members/index.ts +70 -7
  181. package/src/members/util.ts +12 -4
  182. package/src/metrics/constants.ts +5 -0
  183. package/src/multistream/codec/constants.ts +58 -0
  184. package/src/multistream/mediaRequestManager.ts +119 -28
  185. package/src/multistream/receiveSlot.ts +18 -0
  186. package/src/reachability/clusterReachability.ts +3 -2
  187. package/src/reachability/index.ts +47 -16
  188. package/src/reachability/reachability.types.ts +11 -0
  189. package/src/reachability/util.ts +36 -0
  190. package/src/reactions/reactions.type.ts +3 -0
  191. package/src/recording-controller/index.ts +1 -2
  192. package/src/roap/turnDiscovery.ts +9 -1
  193. package/src/webinar/index.ts +214 -36
  194. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  195. package/test/unit/spec/breakouts/breakout.ts +9 -3
  196. package/test/unit/spec/breakouts/index.ts +49 -0
  197. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  198. package/test/unit/spec/controls-options-manager/index.js +244 -29
  199. package/test/unit/spec/controls-options-manager/util.js +165 -0
  200. package/test/unit/spec/hashTree/hashTreeParser.ts +1848 -318
  201. package/test/unit/spec/hashTree/utils.ts +37 -0
  202. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  203. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  204. package/test/unit/spec/interpretation/index.ts +26 -4
  205. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  206. package/test/unit/spec/locus-info/index.js +645 -80
  207. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  208. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  209. package/test/unit/spec/media/index.ts +92 -0
  210. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  211. package/test/unit/spec/meeting/index.js +2119 -98
  212. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  213. package/test/unit/spec/meeting/muteState.js +81 -0
  214. package/test/unit/spec/meeting/request.js +12 -0
  215. package/test/unit/spec/meeting/utils.js +157 -1
  216. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  217. package/test/unit/spec/meetings/index.js +363 -36
  218. package/test/unit/spec/meetings/request.js +141 -0
  219. package/test/unit/spec/meetings/utils.js +402 -51
  220. package/test/unit/spec/member/index.js +7 -0
  221. package/test/unit/spec/member/util.js +89 -0
  222. package/test/unit/spec/members/index.js +216 -0
  223. package/test/unit/spec/members/request.js +37 -1
  224. package/test/unit/spec/members/utils.js +63 -0
  225. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  226. package/test/unit/spec/reachability/index.ts +128 -46
  227. package/test/unit/spec/reachability/util.ts +31 -0
  228. package/test/unit/spec/recording-controller/index.js +9 -8
  229. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  230. package/test/unit/spec/webinar/index.ts +329 -28
@@ -111,6 +111,7 @@ var DEFAULT_ICE_PHASE_CALLBACK = function DEFAULT_ICE_PHASE_CALLBACK() {
111
111
  return 'JOIN_MEETING_FINAL';
112
112
  };
113
113
  var LLM_HEALTHCHECK_TIMER_MS = 3 * 60 * 1000;
114
+ var JOIN_WITH_MEDIA_RETRY_MAX_COUNT = 2;
114
115
  var logRequest = function logRequest(request, _ref) {
115
116
  var _ref$logText = _ref.logText,
116
117
  logText = _ref$logText === void 0 ? '' : _ref$logText;
@@ -496,6 +497,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
496
497
  (0, _defineProperty3.default)(_this, "floorGrantPending", void 0);
497
498
  (0, _defineProperty3.default)(_this, "hasJoinedOnce", void 0);
498
499
  (0, _defineProperty3.default)(_this, "hasWebsocketConnected", void 0);
500
+ (0, _defineProperty3.default)(_this, "mercuryOnlineHandler", void 0);
501
+ (0, _defineProperty3.default)(_this, "mercuryOfflineHandler", void 0);
499
502
  (0, _defineProperty3.default)(_this, "inMeetingActions", void 0);
500
503
  (0, _defineProperty3.default)(_this, "isLocalShareLive", void 0);
501
504
  (0, _defineProperty3.default)(_this, "isRoapInProgress", void 0);
@@ -507,6 +510,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
507
510
  (0, _defineProperty3.default)(_this, "joinedWith", void 0);
508
511
  (0, _defineProperty3.default)(_this, "selfId", void 0);
509
512
  (0, _defineProperty3.default)(_this, "roles", void 0);
513
+ (0, _defineProperty3.default)(_this, "canNotViewTheParticipantList", void 0);
510
514
  // ... there is more ... see SelfUtils.parse()
511
515
  // end of the group
512
516
  (0, _defineProperty3.default)(_this, "locusMediaRequest", void 0);
@@ -568,6 +572,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
568
572
  (0, _defineProperty3.default)(_this, "isMoveToInProgress", false);
569
573
  (0, _defineProperty3.default)(_this, "registrationIdStatus", void 0);
570
574
  (0, _defineProperty3.default)(_this, "brbState", void 0);
575
+ (0, _defineProperty3.default)(_this, "promisesWaitingForPropUpdate", {});
571
576
  (0, _defineProperty3.default)(_this, "voiceaListenerCallbacks", (0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)({}, _internalPluginVoicea.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT, function (payload) {
572
577
  _this.transcription.languageOptions = payload;
573
578
  _loggerProxy.default.logger.debug("".concat(_util.default.getScopeLog({
@@ -641,6 +646,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
641
646
  * @returns {void}
642
647
  */
643
648
  (0, _defineProperty3.default)(_this, "processRelayEvent", function (e) {
649
+ if (!_this.isRelayEventRouteValid(e)) {
650
+ return;
651
+ }
644
652
  switch (e.data.relayType) {
645
653
  case _constants3.REACTION_RELAY_TYPES.REACTION:
646
654
  if (
@@ -680,6 +688,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
680
688
  */
681
689
  (0, _defineProperty3.default)(_this, "handleLLMOnline", function () {
682
690
  _this.restoreLLMSubscriptionsIfNeeded();
691
+ _this.locusInfo.syncAllHashTreeDatasets({
692
+ onlyLLM: true
693
+ });
683
694
  _triggerProxy.default.trigger(_this, {
684
695
  file: 'meeting/index',
685
696
  function: 'handleLLMOnline'
@@ -687,6 +698,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
687
698
  });
688
699
  /**
689
700
  * Disconnects and cleans up the default LLM session listeners/timers.
701
+ *
702
+ * Ownership-aware: only calls `disconnectLLM` when this meeting is the
703
+ * current owner of the default LLM session (or when no owner is recorded).
704
+ * Event listeners belonging to this meeting instance are always detached
705
+ * so they do not receive another meeting's relay events.
706
+ *
690
707
  * @param {Object} options
691
708
  * @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
692
709
  * @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
@@ -698,47 +715,74 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
698
715
  removeOnlineListener,
699
716
  _ref3$throwOnError,
700
717
  throwOnError,
718
+ _this$webex$internal$,
719
+ currentOwner,
720
+ isOwner,
721
+ _this$webex$internal$2,
722
+ currentOwnerAfterCleanup,
723
+ _this$webex$internal$3,
724
+ _this$webex$internal$4,
701
725
  _args = arguments,
702
726
  _t;
703
727
  return _regenerator.default.wrap(function (_context) {
704
728
  while (1) switch (_context.prev = _context.next) {
705
729
  case 0:
706
730
  _ref3 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref3$removeOnlineLis = _ref3.removeOnlineListener, removeOnlineListener = _ref3$removeOnlineLis === void 0 ? true : _ref3$removeOnlineLis, _ref3$throwOnError = _ref3.throwOnError, throwOnError = _ref3$throwOnError === void 0 ? true : _ref3$throwOnError;
731
+ // @ts-ignore - Fix type
732
+ // @ts-ignore - Fix type
733
+ _this$webex$internal$ = _this.webex.internal.llm.resolveSessionOwnership(_this.id, _constants.LLM_DEFAULT_SESSION), currentOwner = _this$webex$internal$.currentOwner, isOwner = _this$webex$internal$.isOwner;
707
734
  _context.prev = 1;
735
+ if (!isOwner) {
736
+ _context.next = 3;
737
+ break;
738
+ }
708
739
  _context.next = 2;
709
740
  return _this.webex.internal.llm.disconnectLLM({
710
741
  code: 3050,
711
742
  reason: 'done (permanent)'
712
- });
743
+ }, _constants.LLM_DEFAULT_SESSION, _this.id);
713
744
  case 2:
714
745
  _context.next = 4;
715
746
  break;
716
747
  case 3:
717
- _context.prev = 3;
748
+ _loggerProxy.default.logger.info("Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
749
+ case 4:
750
+ _context.next = 6;
751
+ break;
752
+ case 5:
753
+ _context.prev = 5;
718
754
  _t = _context["catch"](1);
719
755
  _loggerProxy.default.logger.error('Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session', _t);
720
756
  if (!throwOnError) {
721
- _context.next = 4;
757
+ _context.next = 6;
722
758
  break;
723
759
  }
724
760
  throw _t;
725
- case 4:
726
- _context.prev = 4;
761
+ case 6:
762
+ _context.prev = 6;
727
763
  if (removeOnlineListener) {
728
764
  // @ts-ignore - Fix type
729
765
  _this.webex.internal.llm.off('online', _this.handleLLMOnline);
730
766
  }
731
- // @ts-ignore - fix types
732
- _this.webex.internal.llm.off('event:relay.event', _this.processRelayEvent);
733
- // @ts-ignore - Fix type
734
- _this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, _this.processLocusLLMEvent);
735
- _this.clearLLMHealthCheckTimer();
736
- return _context.finish(4);
737
- case 5:
767
+ _this.stopListeningForLLMEvents();
768
+
769
+ // Re-check ownership after awaiting disconnectLLM. If ownership changed
770
+ // while cleanup was in flight, do not clear another meeting's owner tag.
771
+ if (isOwner) {
772
+ _this$webex$internal$2 =
773
+ // @ts-ignore - Fix type
774
+ _this.webex.internal.llm.resolveSessionOwnership(_this.id, _constants.LLM_DEFAULT_SESSION), currentOwnerAfterCleanup = _this$webex$internal$2.currentOwner;
775
+ if (currentOwnerAfterCleanup === _this.id) {
776
+ // @ts-ignore - Fix type
777
+ (_this$webex$internal$3 = (_this$webex$internal$4 = _this.webex.internal.llm).setOwnerMeetingId) === null || _this$webex$internal$3 === void 0 ? void 0 : _this$webex$internal$3.call(_this$webex$internal$4, undefined);
778
+ }
779
+ }
780
+ return _context.finish(6);
781
+ case 7:
738
782
  case "end":
739
783
  return _context.stop();
740
784
  }
741
- }, _callee, null, [[1, 3, 4, 5]]);
785
+ }, _callee, null, [[1, 5, 6, 7]]);
742
786
  })));
743
787
  /**
744
788
  * Handles ROAP_FAILURE event from the webrtc media connection
@@ -1321,6 +1365,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1321
1365
  }
1322
1366
  }
1323
1367
  });
1368
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.STATS_UPDATE, function (data) {
1369
+ // Extract srtpCipher from transport stats
1370
+ var srtpCipher;
1371
+ var _iterator = _createForOfIteratorHelper(data.stats.values()),
1372
+ _step;
1373
+ try {
1374
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1375
+ var stats = _step.value;
1376
+ if (stats.type === 'transport' && stats.srtpCipher) {
1377
+ srtpCipher = stats.srtpCipher;
1378
+ break;
1379
+ }
1380
+ }
1381
+
1382
+ // Only emit event if srtpCipher has changed
1383
+ } catch (err) {
1384
+ _iterator.e(err);
1385
+ } finally {
1386
+ _iterator.f();
1387
+ }
1388
+ if (srtpCipher && srtpCipher !== _this.mediaProperties.srtpCipher) {
1389
+ _loggerProxy.default.logger.info("Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ".concat(_this.mediaProperties.srtpCipher, " to ").concat(srtpCipher));
1390
+ _this.mediaProperties.srtpCipher = srtpCipher;
1391
+ _triggerProxy.default.trigger(_this, {
1392
+ file: 'meeting/index',
1393
+ function: 'setupStatsAnalyzerEventHandlers'
1394
+ }, _constants.EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED, {
1395
+ srtpCipher: srtpCipher
1396
+ });
1397
+ }
1398
+ });
1324
1399
  });
1325
1400
  /**
1326
1401
  * media failed, so collect a stats report from webrtc using the wcme connection to grab the rtc stats report
@@ -1549,9 +1624,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1549
1624
  _this.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
1550
1625
  }
1551
1626
  _this.queuedMediaUpdates = [];
1552
- _this.stopTranscription();
1553
- _this.transcription = undefined;
1554
- _this.annotation.deregisterEvents();
1627
+
1628
+ // Listener teardown (transcription, annotation, llm/mercury) runs in
1629
+ // stopListeningForMeetingEvents() before /leave and /end so events
1630
+ // received mid-teardown do not trigger Locus syncs. Calling it here
1631
+ // again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
1632
+ // because stopTranscription() always fires its trigger.
1633
+ //
1634
+ // Ownership-aware token clear is encapsulated inside clearDataChannelToken().
1555
1635
  _this.clearDataChannelToken();
1556
1636
  _context5.next = 1;
1557
1637
  return _this.cleanupLLMConneciton({
@@ -1727,7 +1807,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1727
1807
  });
1728
1808
 
1729
1809
  // @ts-ignore
1730
- _this.aiEnableRequest = new _aiEnableRequest.default({}, {
1810
+ _this.aiEnableRequest = new _aiEnableRequest.default({
1811
+ locusUrl: _this.locusUrl
1812
+ }, {
1731
1813
  parent: _this.webex
1732
1814
  });
1733
1815
 
@@ -1766,6 +1848,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1766
1848
  var _this$members$findMem2;
1767
1849
  return (_this$members$findMem2 = _this.members.findMemberByCsi(csi)) === null || _this$members$findMem2 === void 0 ? void 0 : _this$members$findMem2.id;
1768
1850
  });
1851
+
1769
1852
  /**
1770
1853
  * Object containing helper classes for managing media requests for audio/video/screenshare (for multistream media connections)
1771
1854
  * All multistream media requests sent out for this meeting have to go through them.
@@ -1777,7 +1860,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1777
1860
  return;
1778
1861
  }
1779
1862
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.AudioMain, mediaRequests);
1780
- }, {
1863
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1781
1864
  // @ts-ignore - config coming from registerPlugin
1782
1865
  degradationPreferences: _this.config.degradationPreferences,
1783
1866
  kind: 'audio',
@@ -1789,7 +1872,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1789
1872
  return;
1790
1873
  }
1791
1874
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.VideoMain, mediaRequests);
1792
- }, {
1875
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1793
1876
  // @ts-ignore - config coming from registerPlugin
1794
1877
  degradationPreferences: _this.config.degradationPreferences,
1795
1878
  kind: 'video',
@@ -1801,7 +1884,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1801
1884
  return;
1802
1885
  }
1803
1886
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.AudioSlides, mediaRequests);
1804
- }, {
1887
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1805
1888
  // @ts-ignore - config coming from registerPlugin
1806
1889
  degradationPreferences: _this.config.degradationPreferences,
1807
1890
  kind: 'audio',
@@ -1813,11 +1896,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1813
1896
  return;
1814
1897
  }
1815
1898
  _this.mediaProperties.webrtcMediaConnection.requestMedia(_internalMediaCore.MediaType.VideoSlides, mediaRequests);
1816
- }, {
1899
+ }, _this.getIngressPayloadTypeCallback.bind(_this), {
1817
1900
  // @ts-ignore - config coming from registerPlugin
1818
1901
  degradationPreferences: _this.config.degradationPreferences,
1819
1902
  kind: 'video',
1820
- trimRequestsToNumOfSources: false
1903
+ trimRequestsToNumOfSources: false,
1904
+ // @ts-ignore - config coming from registerPlugin
1905
+ enableAv1: _this.config.enableAv1SlidesSupport
1821
1906
  })
1822
1907
  };
1823
1908
  /**
@@ -2325,7 +2410,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2325
2410
  */
2326
2411
  _this.controlsOptionsManager = new _controlsOptionsManager.default(_this.meetingRequest, {
2327
2412
  locusUrl: (_this$locusInfo5 = _this.locusInfo) === null || _this$locusInfo5 === void 0 ? void 0 : _this$locusInfo5.url,
2328
- displayHints: []
2413
+ displayHints: [],
2414
+ getControls: function getControls() {
2415
+ var _this$locusInfo6;
2416
+ return (_this$locusInfo6 = _this.locusInfo) === null || _this$locusInfo6 === void 0 ? void 0 : _this$locusInfo6.controls;
2417
+ },
2418
+ isWebinar: function isWebinar() {
2419
+ var _this$locusInfo7, _this$locusInfo7$info;
2420
+ return (_this$locusInfo7 = _this.locusInfo) === null || _this$locusInfo7 === void 0 ? void 0 : (_this$locusInfo7$info = _this$locusInfo7.info) === null || _this$locusInfo7$info === void 0 ? void 0 : _this$locusInfo7$info.isWebinar;
2421
+ }
2329
2422
  });
2330
2423
  _this.setUpLocusInfoListeners();
2331
2424
  _this.locusInfo.init(attrs.locus ? attrs.locus : {});
@@ -2423,12 +2516,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2423
2516
  /**
2424
2517
  * Information needed for a retry of a call to joinWithMedia
2425
2518
  * @instance
2426
- * @type {{isRetry: boolean; prevJoinResponse?: any}}
2519
+ * @type {{retryCount: number; prevJoinResponse?: any}}
2427
2520
  * @private
2428
2521
  * @memberof Meeting
2429
2522
  */
2430
2523
  _this.joinWithMediaRetryInfo = {
2431
- isRetry: false,
2524
+ retryCount: 0,
2432
2525
  prevJoinResponse: undefined
2433
2526
  };
2434
2527
 
@@ -2486,14 +2579,36 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2486
2579
  }
2487
2580
 
2488
2581
  /**
2489
- * Temporary func to return webex object,
2490
- * in order to access internal plugin metrics
2491
- * in the utils file.
2492
- * @internal
2493
- * @returns {object} webex object
2582
+ * Get the ingress payload type for a given media type and codec mime type
2583
+ * @param {MediaType} mediaType - The media type
2584
+ * @param {MediaCodecMimeType} codecMimeType - The codec mime type
2585
+ * @returns {number | undefined} - The ingress payload type
2586
+ * @private
2587
+ * @memberof Meeting
2494
2588
  */
2495
2589
  (0, _inherits2.default)(Meeting, _StatelessWebexPlugin);
2496
2590
  return (0, _createClass2.default)(Meeting, [{
2591
+ key: "getIngressPayloadTypeCallback",
2592
+ value: function getIngressPayloadTypeCallback(mediaType, codecMimeType) {
2593
+ if (this.isMultistream) {
2594
+ try {
2595
+ return this.mediaProperties.webrtcMediaConnection.getIngressPayloadType(mediaType, codecMimeType);
2596
+ } catch (error) {
2597
+ _loggerProxy.default.logger.info("Meeting:index#mediaRequestManager --> failed to get ingress payload type for mediaType=".concat(mediaType, ", codecMimeType=").concat(codecMimeType), error);
2598
+ return undefined;
2599
+ }
2600
+ }
2601
+ return undefined;
2602
+ }
2603
+
2604
+ /**
2605
+ * Temporary func to return webex object,
2606
+ * in order to access internal plugin metrics
2607
+ * in the utils file.
2608
+ * @internal
2609
+ * @returns {object} webex object
2610
+ */
2611
+ }, {
2497
2612
  key: "getWebexObject",
2498
2613
  value: function getWebexObject() {
2499
2614
  // @ts-ignore
@@ -3525,7 +3640,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3525
3640
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, function (_ref10) {
3526
3641
  var state = _ref10.state,
3527
3642
  modifiedBy = _ref10.modifiedBy,
3528
- lastModified = _ref10.lastModified;
3643
+ lastModified = _ref10.lastModified,
3644
+ modifiedByServiceAppName = _ref10.modifiedByServiceAppName,
3645
+ modifiedByServiceAppId = _ref10.modifiedByServiceAppId;
3529
3646
  var event;
3530
3647
  switch (state) {
3531
3648
  case _constants.RECORDING_STATE.RECORDING:
@@ -3549,7 +3666,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3549
3666
  _this12.recording = {
3550
3667
  state: state === _constants.RECORDING_STATE.RESUMED ? _constants.RECORDING_STATE.RECORDING : state,
3551
3668
  modifiedBy: modifiedBy,
3552
- lastModified: lastModified
3669
+ lastModified: lastModified,
3670
+ modifiedByServiceAppName: modifiedByServiceAppName,
3671
+ modifiedByServiceAppId: modifiedByServiceAppId
3553
3672
  };
3554
3673
  _triggerProxy.default.trigger(_this12, {
3555
3674
  file: 'meeting/index',
@@ -3877,7 +3996,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3877
3996
  else if ((previousContentShare && contentShare.disposition === _constants.FLOOR_ACTION.RELEASED || contentShare.disposition === null) && (previousWhiteboardShare && whiteboardShare.disposition === _constants.FLOOR_ACTION.RELEASED || whiteboardShare.disposition === null)) {
3878
3997
  newShareStatus = _constants.SHARE_STATUS.NO_SHARE;
3879
3998
  }
3880
- _loggerProxy.default.logger.info("Meeting:index#setUpLocusInfoMediaInactiveListener --> this.shareStatus=".concat(_this13.shareStatus, " newShareStatus=").concat(newShareStatus));
3999
+ _loggerProxy.default.logger.info("Meeting:index#setUpLocusMediaSharesListener --> this.shareStatus=".concat(_this13.shareStatus, " newShareStatus=").concat(newShareStatus));
3881
4000
  if (!(newShareStatus !== _this13.shareStatus)) {
3882
4001
  _context0.next = 17;
3883
4002
  break;
@@ -4086,15 +4205,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4086
4205
  _this14.breakouts.locusUrlUpdate(url);
4087
4206
  _this14.simultaneousInterpretation.locusUrlUpdate(url);
4088
4207
  _this14.annotation.locusUrlUpdate(url);
4208
+ _this14.aiEnableRequest.locusUrlUpdate(url);
4089
4209
  _this14.locusUrl = url;
4090
4210
  _this14.locusId = (_this14$locusUrl = _this14.locusUrl) === null || _this14$locusUrl === void 0 ? void 0 : _this14$locusUrl.split('/').pop();
4091
4211
  _this14.recordingController.setLocusUrl(_this14.locusUrl);
4092
4212
  _this14.controlsOptionsManager.setLocusUrl(_this14.locusUrl, !!isMainLocus);
4093
4213
  _this14.webinar.locusUrlUpdate(url);
4094
- // @ts-ignore
4095
- _this14.webex.internal.llm.setRefreshHandler(function () {
4096
- return _this14.refreshDataChannelToken();
4097
- });
4098
4214
  _triggerProxy.default.trigger(_this14, {
4099
4215
  file: 'meeting/index',
4100
4216
  function: 'setUpLocusSelfListener'
@@ -4324,34 +4440,56 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4324
4440
  });
4325
4441
  _this19.updateLLMConnection();
4326
4442
  });
4327
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, function (payload) {
4328
- var _this19$rtcMetrics;
4329
- _this19.stopKeepAlive();
4330
- if (payload) {
4331
- _triggerProxy.default.trigger(_this19, {
4332
- file: 'meeting/index',
4333
- function: 'setUpLocusInfoSelfListener'
4334
- }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4335
- payload: payload
4336
- });
4443
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, /*#__PURE__*/function () {
4444
+ var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4445
+ var _this19$rtcMetrics;
4446
+ var _t9;
4447
+ return _regenerator.default.wrap(function (_context1) {
4448
+ while (1) switch (_context1.prev = _context1.next) {
4449
+ case 0:
4450
+ _this19.stopKeepAlive();
4451
+ if (payload) {
4452
+ _triggerProxy.default.trigger(_this19, {
4453
+ file: 'meeting/index',
4454
+ function: 'setUpLocusInfoSelfListener'
4455
+ }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4456
+ payload: payload
4457
+ });
4337
4458
 
4338
- // @ts-ignore
4339
- _this19.webex.internal.newMetrics.submitClientEvent({
4340
- name: 'client.lobby.exited',
4341
- options: {
4342
- meetingId: _this19.id
4459
+ // @ts-ignore
4460
+ _this19.webex.internal.newMetrics.submitClientEvent({
4461
+ name: 'client.lobby.exited',
4462
+ options: {
4463
+ meetingId: _this19.id
4464
+ }
4465
+ });
4466
+ _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4467
+ correlation_id: _this19.correlationId
4468
+ });
4469
+ }
4470
+ (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4471
+ _context1.prev = 1;
4472
+ _context1.next = 2;
4473
+ return _this19.ensureDefaultDatachannelTokenAfterAdmit();
4474
+ case 2:
4475
+ _context1.next = 4;
4476
+ break;
4477
+ case 3:
4478
+ _context1.prev = 3;
4479
+ _t9 = _context1["catch"](1);
4480
+ _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((_t9 === null || _t9 === void 0 ? void 0 : _t9.message) || String(_t9)));
4481
+ case 4:
4482
+ _this19.updateLLMConnection();
4483
+ case 5:
4484
+ case "end":
4485
+ return _context1.stop();
4343
4486
  }
4344
- });
4345
- _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4346
- correlation_id: _this19.correlationId
4347
- });
4348
- }
4349
- (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4350
- _this19.ensureDefaultDatachannelTokenAfterAdmit().catch(function (error) {
4351
- _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((error === null || error === void 0 ? void 0 : error.message) || String(error)));
4352
- });
4353
- _this19.updateLLMConnection();
4354
- });
4487
+ }, _callee1, null, [[1, 3]]);
4488
+ }));
4489
+ return function (_x9) {
4490
+ return _ref37.apply(this, arguments);
4491
+ };
4492
+ }());
4355
4493
 
4356
4494
  // @ts-ignore - check if MEDIA_INACTIVITY exists
4357
4495
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, function () {
@@ -4387,6 +4525,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4387
4525
  }
4388
4526
  });
4389
4527
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_CANNOT_VIEW_PARTICIPANT_LIST_CHANGE, function (payload) {
4528
+ // canViewTheParticipantList meeting action depends on this value, so we need to update meeting actions
4529
+ _this19.updateMeetingActions();
4390
4530
  _triggerProxy.default.trigger(_this19, {
4391
4531
  file: 'meeting/index',
4392
4532
  function: 'setUpLocusInfoSelfListener'
@@ -4471,49 +4611,49 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4471
4611
  }
4472
4612
  });
4473
4613
  this.locusInfo.on(_constants.EVENTS.DESTROY_MEETING, /*#__PURE__*/function () {
4474
- var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4475
- var _t9;
4476
- return _regenerator.default.wrap(function (_context1) {
4477
- while (1) switch (_context1.prev = _context1.next) {
4614
+ var _ref38 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(payload) {
4615
+ var _t0;
4616
+ return _regenerator.default.wrap(function (_context10) {
4617
+ while (1) switch (_context10.prev = _context10.next) {
4478
4618
  case 0:
4479
4619
  if (!_this20.wirelessShare) {
4480
- _context1.next = 2;
4620
+ _context10.next = 2;
4481
4621
  break;
4482
4622
  }
4483
4623
  if (!_this20.mediaProperties.shareVideoStream) {
4484
- _context1.next = 1;
4624
+ _context10.next = 1;
4485
4625
  break;
4486
4626
  }
4487
- _context1.next = 1;
4627
+ _context10.next = 1;
4488
4628
  return _this20.setLocalShareVideoStream(undefined);
4489
4629
  case 1:
4490
4630
  if (!_this20.mediaProperties.shareAudioStream) {
4491
- _context1.next = 2;
4631
+ _context10.next = 2;
4492
4632
  break;
4493
4633
  }
4494
- _context1.next = 2;
4634
+ _context10.next = 2;
4495
4635
  return _this20.setLocalShareAudioStream(undefined);
4496
4636
  case 2:
4497
4637
  if (!payload.shouldLeave) {
4498
- _context1.next = 7;
4638
+ _context10.next = 7;
4499
4639
  break;
4500
4640
  }
4501
- _context1.prev = 3;
4502
- _context1.next = 4;
4641
+ _context10.prev = 3;
4642
+ _context10.next = 4;
4503
4643
  return _this20.leave({
4504
4644
  reason: payload.reason
4505
4645
  });
4506
4646
  case 4:
4507
4647
  _loggerProxy.default.logger.warn('Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. The meeting has been left, but has not been destroyed, you should see a later event for leave.');
4508
- _context1.next = 6;
4648
+ _context10.next = 6;
4509
4649
  break;
4510
4650
  case 5:
4511
- _context1.prev = 5;
4512
- _t9 = _context1["catch"](3);
4651
+ _context10.prev = 5;
4652
+ _t0 = _context10["catch"](3);
4513
4653
  // @ts-ignore
4514
- _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t9));
4654
+ _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t0));
4515
4655
  case 6:
4516
- _context1.next = 8;
4656
+ _context10.next = 8;
4517
4657
  break;
4518
4658
  case 7:
4519
4659
  _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoMeetingListener --> MEETING_REMOVED_REASON', payload.reason);
@@ -4527,12 +4667,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4527
4667
  });
4528
4668
  case 8:
4529
4669
  case "end":
4530
- return _context1.stop();
4670
+ return _context10.stop();
4531
4671
  }
4532
- }, _callee1, null, [[3, 5]]);
4672
+ }, _callee10, null, [[3, 5]]);
4533
4673
  }));
4534
- return function (_x9) {
4535
- return _ref37.apply(this, arguments);
4674
+ return function (_x0) {
4675
+ return _ref38.apply(this, arguments);
4536
4676
  };
4537
4677
  }());
4538
4678
  }
@@ -4554,7 +4694,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4554
4694
  // is not changed by any delta event
4555
4695
  if (object && (0, _keys.default)(object).length) {
4556
4696
  (0, _keys.default)(object).forEach(function (key) {
4697
+ var previousValue = _this21[key];
4557
4698
  _this21[key] = object[key];
4699
+ if (_this21.promisesWaitingForPropUpdate[key] && previousValue !== object[key]) {
4700
+ _this21.promisesWaitingForPropUpdate[key].resolve();
4701
+ delete _this21.promisesWaitingForPropUpdate[key];
4702
+ }
4558
4703
  });
4559
4704
  }
4560
4705
  }
@@ -4650,31 +4795,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4650
4795
  }, {
4651
4796
  key: "beRightBack",
4652
4797
  value: (function () {
4653
- var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(enabled) {
4798
+ var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(enabled) {
4654
4799
  var _this22 = this;
4655
4800
  var errorMessage, error, _errorMessage, _error;
4656
- return _regenerator.default.wrap(function (_context10) {
4657
- while (1) switch (_context10.prev = _context10.next) {
4801
+ return _regenerator.default.wrap(function (_context11) {
4802
+ while (1) switch (_context11.prev = _context11.next) {
4658
4803
  case 0:
4659
4804
  if (this.isMultistream) {
4660
- _context10.next = 1;
4805
+ _context11.next = 1;
4661
4806
  break;
4662
4807
  }
4663
4808
  errorMessage = 'Meeting:index#beRightBack --> Not a multistream meeting';
4664
4809
  error = new Error(errorMessage);
4665
4810
  _loggerProxy.default.logger.error(error);
4666
- return _context10.abrupt("return", _promise.default.reject(error));
4811
+ return _context11.abrupt("return", _promise.default.reject(error));
4667
4812
  case 1:
4668
4813
  if (this.mediaProperties.webrtcMediaConnection) {
4669
- _context10.next = 2;
4814
+ _context11.next = 2;
4670
4815
  break;
4671
4816
  }
4672
4817
  _errorMessage = 'Meeting:index#beRightBack --> WebRTC media connection is not defined';
4673
4818
  _error = new Error(_errorMessage);
4674
4819
  _loggerProxy.default.logger.error(_error);
4675
- return _context10.abrupt("return", _promise.default.reject(_error));
4820
+ return _context11.abrupt("return", _promise.default.reject(_error));
4676
4821
  case 2:
4677
- return _context10.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4822
+ return _context11.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4678
4823
  if (_this22.audio && enabled) {
4679
4824
  // locus mutes the participant with brb enabled request,
4680
4825
  // so we need to explicitly update remote mute for correct logic flow
@@ -4685,11 +4830,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4685
4830
  }));
4686
4831
  case 3:
4687
4832
  case "end":
4688
- return _context10.stop();
4833
+ return _context11.stop();
4689
4834
  }
4690
- }, _callee10, this);
4835
+ }, _callee11, this);
4691
4836
  }));
4692
- function beRightBack(_x0) {
4837
+ function beRightBack(_x1) {
4693
4838
  return _beRightBack.apply(this, arguments);
4694
4839
  }
4695
4840
  return beRightBack;
@@ -4724,7 +4869,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4724
4869
  }
4725
4870
 
4726
4871
  /**
4727
- * Transfer the moderator role to another eligible member
4872
+ * Transfer the moderator role to another eligible member.
4873
+ *
4874
+ * If the target member is currently joined in the current session, the request is
4875
+ * sent against the current locus. Otherwise, we search the breakout sessions and,
4876
+ * when the member is found in one, we send the request against that breakout
4877
+ * session's locus url instead.
4728
4878
  * @param {String} memberId
4729
4879
  * @param {Boolean} moderator
4730
4880
  * @returns {Promise} see #members.transferHostToMember
@@ -4734,8 +4884,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4734
4884
  }, {
4735
4885
  key: "transfer",
4736
4886
  value: function transfer(memberId) {
4887
+ var _this$breakouts2, _this$breakouts2$brea, _this$breakouts2$brea2, _breakout$breakoutRos;
4737
4888
  var moderator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
4738
- return this.members.transferHostToMember(memberId, moderator);
4889
+ var targetMember = this.members.membersCollection.get(memberId);
4890
+ if (targetMember !== null && targetMember !== void 0 && targetMember.isInMeeting) {
4891
+ return this.members.transferHostToMember(memberId, moderator);
4892
+ }
4893
+ var breakout = (_this$breakouts2 = this.breakouts) === null || _this$breakouts2 === void 0 ? void 0 : (_this$breakouts2$brea = _this$breakouts2.breakouts) === null || _this$breakouts2$brea === void 0 ? void 0 : (_this$breakouts2$brea2 = _this$breakouts2$brea.models) === null || _this$breakouts2$brea2 === void 0 ? void 0 : _this$breakouts2$brea2.find(function (bo) {
4894
+ var _bo$members, _bo$members$membersCo;
4895
+ var breakoutMember = (_bo$members = bo.members) === null || _bo$members === void 0 ? void 0 : (_bo$members$membersCo = _bo$members.membersCollection) === null || _bo$members$membersCo === void 0 ? void 0 : _bo$members$membersCo.get(memberId);
4896
+ return breakoutMember === null || breakoutMember === void 0 ? void 0 : breakoutMember.isInMeeting;
4897
+ });
4898
+ var breakoutLocusUrl = breakout === null || breakout === void 0 ? void 0 : (_breakout$breakoutRos = breakout.breakoutRosterLocus) === null || _breakout$breakoutRos === void 0 ? void 0 : _breakout$breakoutRos.url;
4899
+ return this.members.transferHostToMember(memberId, moderator, breakoutLocusUrl);
4739
4900
  }
4740
4901
 
4741
4902
  /**
@@ -4863,6 +5024,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4863
5024
  }) && ((_this$meetingInfo5 = this.meetingInfo) === null || _this$meetingInfo5 === void 0 ? void 0 : (_this$meetingInfo5$vi = _this$meetingInfo5.video) === null || _this$meetingInfo5$vi === void 0 ? void 0 : _this$meetingInfo5$vi.supportHQV) || !this.arePolicyRestrictionsSupported()
4864
5025
  });
4865
5026
  if (this.userDisplayHints !== undefined) {
5027
+ var _this$canNotViewThePa;
4866
5028
  changed = this.inMeetingActions.set({
4867
5029
  canInviteNewParticipants: _util2.default.canInviteNewParticipants(this.userDisplayHints),
4868
5030
  canAdmitParticipant: _util2.default.canAdmitParticipant(this.userDisplayHints),
@@ -5117,7 +5279,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5117
5279
  displayHints: this.userDisplayHints
5118
5280
  }),
5119
5281
  canAttendeeRequestAiAssistantEnabled: _util2.default.canAttendeeRequestAiAssistantEnabled(this.userDisplayHints, this.roles),
5120
- isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints)
5282
+ isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints),
5283
+ isAnonymizeDisplayNamesEnabled: _util2.default.isAnonymizeDisplayNamesEnabled(this.userDisplayHints),
5284
+ canViewTheParticipantList: _util2.default.canViewTheParticipantList(this.userDisplayHints, (_this$canNotViewThePa = this.canNotViewTheParticipantList) !== null && _this$canNotViewThePa !== void 0 ? _this$canNotViewThePa : false)
5121
5285
  }) || changed;
5122
5286
  }
5123
5287
  if (changed) {
@@ -5168,6 +5332,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5168
5332
  this.sipUri = sipUri;
5169
5333
  }
5170
5334
 
5335
+ /**
5336
+ * After initial locus setup, refreshes destination with synced locus data and optionally
5337
+ * performs deferred meeting info fetch when initial locus was incomplete.
5338
+ * @param {LocusDTO} locus
5339
+ * @returns {void}
5340
+ */
5341
+ }, {
5342
+ key: "finalizeMeetingAfterInitialLocusSetup",
5343
+ value: (function () {
5344
+ var _finalizeMeetingAfterInitialLocusSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(locus) {
5345
+ var _this$destination;
5346
+ var _t1;
5347
+ return _regenerator.default.wrap(function (_context12) {
5348
+ while (1) switch (_context12.prev = _context12.next) {
5349
+ case 0:
5350
+ if (locus && (this === null || this === void 0 ? void 0 : this.destinationType) === _constants.DESTINATION_TYPE.LOCUS_ID) {
5351
+ // destination is initialized from the initial locus snapshot in constructor,
5352
+ // so refresh it after locus sync to avoid stale partial hash-tree data.
5353
+ this.destination = locus;
5354
+ }
5355
+ if (!((!this.meetingInfo || (0, _lodash.isEmpty)(this.meetingInfo)) && (_this$destination = this.destination) !== null && _this$destination !== void 0 && _this$destination.info && !this.fetchMeetingInfoTimeoutId && !_util3.default.isOneOnOneCall(locus))) {
5356
+ _context12.next = 4;
5357
+ break;
5358
+ }
5359
+ _context12.prev = 1;
5360
+ _context12.next = 2;
5361
+ return this.fetchMeetingInfo({});
5362
+ case 2:
5363
+ _context12.next = 4;
5364
+ break;
5365
+ case 3:
5366
+ _context12.prev = 3;
5367
+ _t1 = _context12["catch"](1);
5368
+ _loggerProxy.default.logger.info("Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ".concat(_t1.message));
5369
+ case 4:
5370
+ case "end":
5371
+ return _context12.stop();
5372
+ }
5373
+ }, _callee12, this, [[1, 3]]);
5374
+ }));
5375
+ function finalizeMeetingAfterInitialLocusSetup(_x10) {
5376
+ return _finalizeMeetingAfterInitialLocusSetup.apply(this, arguments);
5377
+ }
5378
+ return finalizeMeetingAfterInitialLocusSetup;
5379
+ }()
5171
5380
  /**
5172
5381
  * Set the locus info the class instance. Should be called with the parsed locus
5173
5382
  * we got in the join response.
@@ -5183,6 +5392,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5183
5392
  * @private
5184
5393
  * @memberof Meeting
5185
5394
  */
5395
+ )
5186
5396
  }, {
5187
5397
  key: "setLocus",
5188
5398
  value: function setLocus(data) {
@@ -5362,11 +5572,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5362
5572
  }, {
5363
5573
  key: "setLocalAudioStream",
5364
5574
  value: (function () {
5365
- var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
5575
+ var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localStream) {
5366
5576
  var _this$audio2;
5367
5577
  var oldStream;
5368
- return _regenerator.default.wrap(function (_context11) {
5369
- while (1) switch (_context11.prev = _context11.next) {
5578
+ return _regenerator.default.wrap(function (_context13) {
5579
+ while (1) switch (_context13.prev = _context13.next) {
5370
5580
  case 0:
5371
5581
  oldStream = this.mediaProperties.audioStream;
5372
5582
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localAudioStreamMuteStateHandler);
@@ -5380,21 +5590,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5380
5590
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localAudioStreamMuteStateHandler);
5381
5591
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5382
5592
  if (!(!this.isMultistream || !localStream)) {
5383
- _context11.next = 1;
5593
+ _context13.next = 1;
5384
5594
  break;
5385
5595
  }
5386
- _context11.next = 1;
5596
+ _context13.next = 1;
5387
5597
  return this.unpublishStream(_internalMediaCore.MediaType.AudioMain, oldStream);
5388
5598
  case 1:
5389
- _context11.next = 2;
5599
+ _context13.next = 2;
5390
5600
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
5391
5601
  case 2:
5392
5602
  case "end":
5393
- return _context11.stop();
5603
+ return _context13.stop();
5394
5604
  }
5395
- }, _callee11, this);
5605
+ }, _callee13, this);
5396
5606
  }));
5397
- function setLocalAudioStream(_x1) {
5607
+ function setLocalAudioStream(_x11) {
5398
5608
  return _setLocalAudioStream.apply(this, arguments);
5399
5609
  }
5400
5610
  return setLocalAudioStream;
@@ -5410,11 +5620,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5410
5620
  }, {
5411
5621
  key: "setLocalVideoStream",
5412
5622
  value: (function () {
5413
- var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
5623
+ var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localStream) {
5414
5624
  var _this$video2;
5415
5625
  var oldStream;
5416
- return _regenerator.default.wrap(function (_context12) {
5417
- while (1) switch (_context12.prev = _context12.next) {
5626
+ return _regenerator.default.wrap(function (_context14) {
5627
+ while (1) switch (_context14.prev = _context14.next) {
5418
5628
  case 0:
5419
5629
  oldStream = this.mediaProperties.videoStream;
5420
5630
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localVideoStreamMuteStateHandler);
@@ -5430,21 +5640,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5430
5640
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5431
5641
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.ConstraintsChange, this.localConstraintsChangeHandler);
5432
5642
  if (!(!this.isMultistream || !localStream)) {
5433
- _context12.next = 1;
5643
+ _context14.next = 1;
5434
5644
  break;
5435
5645
  }
5436
- _context12.next = 1;
5646
+ _context14.next = 1;
5437
5647
  return this.unpublishStream(_internalMediaCore.MediaType.VideoMain, oldStream);
5438
5648
  case 1:
5439
- _context12.next = 2;
5649
+ _context14.next = 2;
5440
5650
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
5441
5651
  case 2:
5442
5652
  case "end":
5443
- return _context12.stop();
5653
+ return _context14.stop();
5444
5654
  }
5445
- }, _callee12, this);
5655
+ }, _callee14, this);
5446
5656
  }));
5447
- function setLocalVideoStream(_x10) {
5657
+ function setLocalVideoStream(_x12) {
5448
5658
  return _setLocalVideoStream.apply(this, arguments);
5449
5659
  }
5450
5660
  return setLocalVideoStream;
@@ -5461,10 +5671,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5461
5671
  }, {
5462
5672
  key: "setLocalShareVideoStream",
5463
5673
  value: (function () {
5464
- var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localDisplayStream) {
5674
+ var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(localDisplayStream) {
5465
5675
  var oldStream;
5466
- return _regenerator.default.wrap(function (_context13) {
5467
- while (1) switch (_context13.prev = _context13.next) {
5676
+ return _regenerator.default.wrap(function (_context15) {
5677
+ while (1) switch (_context15.prev = _context15.next) {
5468
5678
  case 0:
5469
5679
  oldStream = this.mediaProperties.shareVideoStream;
5470
5680
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.handleShareVideoStreamMuteStateChange);
@@ -5476,21 +5686,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5476
5686
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5477
5687
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5478
5688
  if (!(!this.isMultistream || !localDisplayStream)) {
5479
- _context13.next = 1;
5689
+ _context15.next = 1;
5480
5690
  break;
5481
5691
  }
5482
- _context13.next = 1;
5692
+ _context15.next = 1;
5483
5693
  return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
5484
5694
  case 1:
5485
- _context13.next = 2;
5695
+ _context15.next = 2;
5486
5696
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
5487
5697
  case 2:
5488
5698
  case "end":
5489
- return _context13.stop();
5699
+ return _context15.stop();
5490
5700
  }
5491
- }, _callee13, this);
5701
+ }, _callee15, this);
5492
5702
  }));
5493
- function setLocalShareVideoStream(_x11) {
5703
+ function setLocalShareVideoStream(_x13) {
5494
5704
  return _setLocalShareVideoStream.apply(this, arguments);
5495
5705
  }
5496
5706
  return setLocalShareVideoStream;
@@ -5506,10 +5716,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5506
5716
  }, {
5507
5717
  key: "setLocalShareAudioStream",
5508
5718
  value: (function () {
5509
- var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localSystemAudioStream) {
5719
+ var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16(localSystemAudioStream) {
5510
5720
  var oldStream;
5511
- return _regenerator.default.wrap(function (_context14) {
5512
- while (1) switch (_context14.prev = _context14.next) {
5721
+ return _regenerator.default.wrap(function (_context16) {
5722
+ while (1) switch (_context16.prev = _context16.next) {
5513
5723
  case 0:
5514
5724
  oldStream = this.mediaProperties.shareAudioStream;
5515
5725
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
@@ -5519,21 +5729,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5519
5729
  localSystemAudioStream === null || localSystemAudioStream === void 0 ? void 0 : localSystemAudioStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5520
5730
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5521
5731
  if (!(!this.isMultistream || !localSystemAudioStream)) {
5522
- _context14.next = 1;
5732
+ _context16.next = 1;
5523
5733
  break;
5524
5734
  }
5525
- _context14.next = 1;
5735
+ _context16.next = 1;
5526
5736
  return this.unpublishStream(_internalMediaCore.MediaType.AudioSlides, oldStream);
5527
5737
  case 1:
5528
- _context14.next = 2;
5738
+ _context16.next = 2;
5529
5739
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
5530
5740
  case 2:
5531
5741
  case "end":
5532
- return _context14.stop();
5742
+ return _context16.stop();
5533
5743
  }
5534
- }, _callee14, this);
5744
+ }, _callee16, this);
5535
5745
  }));
5536
- function setLocalShareAudioStream(_x12) {
5746
+ function setLocalShareAudioStream(_x14) {
5537
5747
  return _setLocalShareAudioStream.apply(this, arguments);
5538
5748
  }
5539
5749
  return setLocalShareAudioStream;
@@ -5642,8 +5852,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5642
5852
  var _this25 = this;
5643
5853
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
5644
5854
  // if the meeting has active peer connections, it should try to reconnect.
5645
- // @ts-ignore
5646
- this.webex.internal.mercury.on(_constants.ONLINE, function () {
5855
+ this.mercuryOnlineHandler = function () {
5647
5856
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
5648
5857
 
5649
5858
  // Only send restore event when it was disconnected before and for connected later
@@ -5653,15 +5862,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5653
5862
  });
5654
5863
  }
5655
5864
  _this25.hasWebsocketConnected = true;
5656
- });
5657
-
5658
- // @ts-ignore
5659
- this.webex.internal.mercury.on(_constants.OFFLINE, function () {
5865
+ };
5866
+ this.mercuryOfflineHandler = function () {
5660
5867
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
5661
5868
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
5662
5869
  correlation_id: _this25.correlationId
5663
5870
  });
5664
- });
5871
+ };
5872
+
5873
+ // @ts-ignore
5874
+ this.webex.internal.mercury.on(_constants.ONLINE, this.mercuryOnlineHandler);
5875
+ // @ts-ignore
5876
+ this.webex.internal.mercury.on(_constants.OFFLINE, this.mercuryOfflineHandler);
5877
+ }
5878
+
5879
+ /**
5880
+ * Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
5881
+ * by setMercuryListener(). Must be called before Locus /leave to avoid
5882
+ * unnecessary syncs/metrics triggered by events received while leaving
5883
+ * (per Locus team recommendation).
5884
+ *
5885
+ * Mercury is a process-wide singleton shared with other plugins, so we
5886
+ * pass the bound handler refs to .off() to avoid clearing every listener
5887
+ * for ONLINE/OFFLINE on the shared emitter.
5888
+ *
5889
+ * Idempotent: subsequent calls are no-ops because the handler refs are
5890
+ * cleared after detaching.
5891
+ * @private
5892
+ * @returns {void}
5893
+ */
5894
+ }, {
5895
+ key: "stopListeningForMercuryEvents",
5896
+ value: function stopListeningForMercuryEvents() {
5897
+ if (this.mercuryOnlineHandler) {
5898
+ // @ts-ignore
5899
+ this.webex.internal.mercury.off(_constants.ONLINE, this.mercuryOnlineHandler);
5900
+ this.mercuryOnlineHandler = undefined;
5901
+ }
5902
+ if (this.mercuryOfflineHandler) {
5903
+ // @ts-ignore
5904
+ this.webex.internal.mercury.off(_constants.OFFLINE, this.mercuryOfflineHandler);
5905
+ this.mercuryOfflineHandler = undefined;
5906
+ }
5665
5907
  }
5666
5908
 
5667
5909
  /**
@@ -5972,22 +6214,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5972
6214
  }, {
5973
6215
  key: "joinWithMedia",
5974
6216
  value: (function () {
5975
- var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
6217
+ var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
5976
6218
  var _this30 = this;
5977
6219
  var options,
5978
6220
  mediaOptions,
5979
6221
  _options$joinOptions,
5980
6222
  joinOptions,
5981
6223
  _this$joinWithMediaRe,
5982
- isRetry,
6224
+ retryCount,
5983
6225
  prevJoinResponse,
6226
+ prevError,
5984
6227
  joined,
5985
6228
  joinResponse,
6229
+ shouldJoin,
5986
6230
  turnServerInfo,
5987
6231
  turnDiscoverySkippedReason,
5988
6232
  forceTurnDiscovery,
5989
6233
  turnDiscoveryRequest,
5990
6234
  _yield$this$roap$hand,
6235
+ shouldRetryMediaWithOnlyTurnTLS,
5991
6236
  mediaResponse,
5992
6237
  _this$locusUrl,
5993
6238
  _leaveError,
@@ -5995,64 +6240,77 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5995
6240
  shouldRetry,
5996
6241
  _error2,
5997
6242
  _error3,
5998
- _args15 = arguments,
5999
- _t0,
6000
- _t1;
6001
- return _regenerator.default.wrap(function (_context15) {
6002
- while (1) switch (_context15.prev = _context15.next) {
6243
+ firstError,
6244
+ _args17 = arguments,
6245
+ _t10,
6246
+ _t11;
6247
+ return _regenerator.default.wrap(function (_context17) {
6248
+ while (1) switch (_context17.prev = _context17.next) {
6003
6249
  case 0:
6004
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
6250
+ options = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
6005
6251
  mediaOptions = options.mediaOptions, _options$joinOptions = options.joinOptions, joinOptions = _options$joinOptions === void 0 ? {} : _options$joinOptions;
6006
- _this$joinWithMediaRe = this.joinWithMediaRetryInfo, isRetry = _this$joinWithMediaRe.isRetry, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse;
6252
+ _this$joinWithMediaRe = this.joinWithMediaRetryInfo, retryCount = _this$joinWithMediaRe.retryCount, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse, prevError = _this$joinWithMediaRe.prevError;
6007
6253
  if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby) {
6008
- _context15.next = 1;
6254
+ _context17.next = 1;
6009
6255
  break;
6010
6256
  }
6011
- return _context15.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6257
+ return _context17.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6012
6258
  case 1:
6013
6259
  this.allowMediaInLobby = true;
6014
6260
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
6015
- joined = false;
6016
- joinResponse = prevJoinResponse;
6261
+
6017
6262
  /* Before we do anything, check if RTCPeerConnection is available. Normally this is checked
6018
6263
  by addMediaInternal() itself when creating the media connection, but since joinWithMedia()
6019
6264
  is a convenience method that does both join() and addMedia(), we want to fail fast here
6020
6265
  in case WebRTC is not available at all.
6021
6266
  */
6022
6267
  if (!(_webCapabilities.WebCapabilities.supportsRTCPeerConnection() === _webCapabilities.CapabilityState.NOT_CAPABLE)) {
6023
- _context15.next = 2;
6268
+ _context17.next = 2;
6024
6269
  break;
6025
6270
  }
6026
6271
  throw new _internalMediaCore.Errors.WebrtcApiNotAvailableError('RTCPeerConnection API is not available in this environment');
6027
6272
  case 2:
6028
- _context15.prev = 2;
6273
+ /* While we're trying to join, we may fail and be doing a retry. In that case,
6274
+ we sometimes get dropped by Locus as a result of the 1st failed attempt.
6275
+ That notification from Locus needs to be ignored, otherwise it causes the meeting to be
6276
+ cleaned up and prevents the retry from running correctly.
6277
+ */
6278
+ this.locusInfo.suspendDestroyMeeting(true);
6279
+ joined = false;
6280
+ joinResponse = prevJoinResponse;
6281
+ shouldJoin = !joinResponse ||
6282
+ // first try, when the join response is empty
6283
+ prevError && prevError instanceof _webexErrors.UserNotJoinedError ||
6284
+ // last try failed with UserNotJoinedError
6285
+ this.isErrorMeaningLocusDroppedUs(prevError) || _util2.default.isUserInLeftState(this.locusInfo); // locus dropped the connection before we can re-try addMedia
6286
+ _context17.prev = 3;
6029
6287
  forceTurnDiscovery = false;
6030
- if (joinResponse) {
6031
- _context15.next = 7;
6288
+ if (!shouldJoin) {
6289
+ _context17.next = 8;
6032
6290
  break;
6033
6291
  }
6034
- _context15.next = 3;
6292
+ _context17.next = 4;
6035
6293
  return this.roap.generateTurnDiscoveryRequestMessage(this, true);
6036
- case 3:
6037
- turnDiscoveryRequest = _context15.sent;
6294
+ case 4:
6295
+ turnDiscoveryRequest = _context17.sent;
6038
6296
  turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
6039
6297
  joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
6040
6298
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia ---> calling join with joinOptions, ', joinOptions);
6041
- _context15.next = 4;
6299
+ _context17.next = 5;
6042
6300
  return this.join(joinOptions);
6043
- case 4:
6044
- joinResponse = _context15.sent;
6301
+ case 5:
6302
+ joinResponse = _context17.sent;
6045
6303
  joined = true;
6046
6304
 
6047
6305
  // if we sent out TURN discovery Roap message with join, process the TURN discovery response
6048
6306
  if (!joinOptions.roapMessage) {
6049
- _context15.next = 6;
6307
+ _context17.next = 7;
6050
6308
  break;
6051
6309
  }
6052
- _context15.next = 5;
6310
+ _context17.next = 6;
6053
6311
  return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
6054
- case 5:
6055
- _yield$this$roap$hand = _context15.sent;
6312
+ case 6:
6313
+ _yield$this$roap$hand = _context17.sent;
6056
6314
  turnServerInfo = _yield$this$roap$hand.turnServerInfo;
6057
6315
  turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
6058
6316
  this.turnDiscoverySkippedReason = turnDiscoverySkippedReason;
@@ -6060,107 +6318,121 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6060
6318
  if (turnServerInfo === undefined) {
6061
6319
  this.roap.abortTurnDiscovery();
6062
6320
  }
6063
- case 6:
6064
- _context15.next = 8;
6065
- break;
6066
6321
  case 7:
6322
+ _context17.next = 9;
6323
+ break;
6324
+ case 8:
6067
6325
  // This is a retry, when join succeeded but addMedia failed, so we'll just call addMedia() again,
6068
6326
  // but we need to ensure that it also does a new TURN discovery
6069
6327
  forceTurnDiscovery = true;
6070
6328
  joined = true;
6071
- case 8:
6072
- _context15.next = 9;
6073
- return this.addMediaInternal(function () {
6074
- return _this30.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6075
- }, turnServerInfo, forceTurnDiscovery, mediaOptions);
6076
6329
  case 9:
6077
- mediaResponse = _context15.sent;
6330
+ _context17.next = 10;
6331
+ return this.shouldRetryMediaWithOnlyTurnTLS(prevError);
6332
+ case 10:
6333
+ shouldRetryMediaWithOnlyTurnTLS = _context17.sent;
6334
+ _context17.next = 11;
6335
+ return this.addMediaInternal(function () {
6336
+ // callback is not called when UserNotJoinedError is thrown
6337
+ return _this30.joinWithMediaRetryInfo.retryCount >= 1 ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6338
+ }, forceTurnDiscovery, turnServerInfo, shouldRetryMediaWithOnlyTurnTLS ? 'relay' : undefined, mediaOptions);
6339
+ case 11:
6340
+ mediaResponse = _context17.sent;
6078
6341
  this.joinWithMediaRetryInfo = {
6079
- isRetry: false,
6342
+ retryCount: 0,
6080
6343
  prevJoinResponse: undefined
6081
6344
  };
6082
- return _context15.abrupt("return", {
6345
+ this.locusInfo.suspendDestroyMeeting(false);
6346
+ return _context17.abrupt("return", {
6083
6347
  join: joinResponse,
6084
6348
  media: mediaResponse,
6085
6349
  multistreamEnabled: this.isMultistream
6086
6350
  });
6087
- case 10:
6088
- _context15.prev = 10;
6089
- _t0 = _context15["catch"](2);
6090
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t0);
6351
+ case 12:
6352
+ _context17.prev = 12;
6353
+ _t10 = _context17["catch"](3);
6354
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t10);
6091
6355
  this.roap.abortTurnDiscovery();
6092
6356
 
6093
- // if this was the first attempt, let's do a retry
6094
- shouldRetry = !isRetry;
6095
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t0) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t0)) {
6357
+ // let's do a retry (but not on 1-1 calls, because the flow would get too complicated)
6358
+ shouldRetry = !_util3.default.isOneOnOneCall(this.locusInfo.parsedLocus) && (retryCount < 1 || (_t10 instanceof _webexErrors.UserNotJoinedError || this.isErrorMeaningLocusDroppedUs(_t10)) && retryCount < JOIN_WITH_MEDIA_RETRY_MAX_COUNT);
6359
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t10) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t10)) {
6096
6360
  // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
6097
6361
  // so there is no point doing a retry
6098
6362
  shouldRetry = false;
6099
6363
  }
6100
- if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t0)) {
6364
+ if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t10)) {
6101
6365
  shouldRetry = false;
6102
6366
  // eslint-disable-next-line no-ex-assign
6103
- _t0 = (0, _lodash.merge)({
6367
+ _t10 = (0, _lodash.merge)({
6104
6368
  error: {
6105
6369
  body: {
6106
- errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t0),
6107
- message: (_error2 = _t0) === null || _error2 === void 0 ? void 0 : _error2.message,
6108
- name: (_error3 = _t0) === null || _error3 === void 0 ? void 0 : _error3.name
6370
+ errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t10),
6371
+ message: (_error2 = _t10) === null || _error2 === void 0 ? void 0 : _error2.message,
6372
+ name: (_error3 = _t10) === null || _error3 === void 0 ? void 0 : _error3.name
6109
6373
  }
6110
6374
  }
6111
6375
  });
6112
6376
  }
6113
6377
 
6114
- // we only want to call leave if join was successful and this was a retry or we won't be doing any more retries
6115
- if (!(joined && (isRetry || !shouldRetry))) {
6116
- _context15.next = 14;
6378
+ // we only want to call leave if join was successful, and we won't be doing any more retries
6379
+ if (!(joined && !shouldRetry)) {
6380
+ _context17.next = 16;
6117
6381
  break;
6118
6382
  }
6119
- _context15.prev = 11;
6120
- _context15.next = 12;
6383
+ _context17.prev = 13;
6384
+ _context17.next = 14;
6121
6385
  return this.leave({
6122
6386
  resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
6123
6387
  reason: 'joinWithMedia failure'
6124
6388
  });
6125
- case 12:
6126
- _context15.next = 14;
6127
- break;
6128
- case 13:
6129
- _context15.prev = 13;
6130
- _t1 = _context15["catch"](11);
6131
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t1);
6132
- leaveError = _t1;
6133
6389
  case 14:
6390
+ _context17.next = 16;
6391
+ break;
6392
+ case 15:
6393
+ _context17.prev = 15;
6394
+ _t11 = _context17["catch"](13);
6395
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t11);
6396
+ leaveError = _t11;
6397
+ case 16:
6134
6398
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
6135
6399
  correlation_id: this.correlationId,
6136
6400
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
6137
6401
  // if join fails, we may end up with no locusUrl
6138
- reason: _t0.message,
6139
- stack: _t0.stack,
6402
+ reason: _t10.message,
6403
+ stack: _t10.stack,
6140
6404
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
6141
- isRetry: isRetry
6405
+ isRetry: retryCount > 0
6142
6406
  }, {
6143
- type: _t0.name
6407
+ type: _t10.name
6144
6408
  });
6145
6409
  if (!shouldRetry) {
6146
- _context15.next = 15;
6410
+ _context17.next = 17;
6147
6411
  break;
6148
6412
  }
6149
6413
  _loggerProxy.default.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
6150
- this.joinWithMediaRetryInfo.isRetry = true;
6414
+ this.joinWithMediaRetryInfo.retryCount = retryCount + 1;
6151
6415
  this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
6152
- return _context15.abrupt("return", this.joinWithMedia(options));
6153
- case 15:
6416
+ this.joinWithMediaRetryInfo.prevError = _t10;
6417
+ if (!this.joinWithMediaRetryInfo.firstError) {
6418
+ this.joinWithMediaRetryInfo.firstError = _t10;
6419
+ }
6420
+ return _context17.abrupt("return", this.joinWithMedia(options));
6421
+ case 17:
6422
+ firstError = this.joinWithMediaRetryInfo.firstError;
6154
6423
  this.joinWithMediaRetryInfo = {
6155
- isRetry: false,
6156
- prevJoinResponse: undefined
6424
+ retryCount: 0,
6425
+ prevJoinResponse: undefined,
6426
+ firstError: undefined,
6427
+ prevError: undefined
6157
6428
  };
6158
- throw _t0;
6159
- case 16:
6429
+ this.locusInfo.suspendDestroyMeeting(false);
6430
+ throw firstError !== null && firstError !== void 0 ? firstError : _t10;
6431
+ case 18:
6160
6432
  case "end":
6161
- return _context15.stop();
6433
+ return _context17.stop();
6162
6434
  }
6163
- }, _callee15, this, [[2, 10], [11, 13]]);
6435
+ }, _callee17, this, [[3, 12], [13, 15]]);
6164
6436
  }));
6165
6437
  function joinWithMedia() {
6166
6438
  return _joinWithMedia.apply(this, arguments);
@@ -6190,20 +6462,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6190
6462
  return _promise.default.reject(new _parameter.default('Cannot reconnect, Media has not established to reconnect'));
6191
6463
  }
6192
6464
  this.cleanUpBeforeReconnection();
6193
- return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
6194
- return _regenerator.default.wrap(function (_context16) {
6195
- while (1) switch (_context16.prev = _context16.next) {
6465
+ return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6466
+ return _regenerator.default.wrap(function (_context18) {
6467
+ while (1) switch (_context18.prev = _context18.next) {
6196
6468
  case 0:
6197
- _context16.next = 1;
6469
+ _context18.next = 1;
6198
6470
  return _this31.waitForRemoteSDPAnswer();
6199
6471
  case 1:
6200
- _context16.next = 2;
6472
+ _context18.next = 2;
6201
6473
  return _this31.waitForMediaConnectionConnected();
6202
6474
  case 2:
6203
6475
  case "end":
6204
- return _context16.stop();
6476
+ return _context18.stop();
6205
6477
  }
6206
- }, _callee16);
6478
+ }, _callee18);
6207
6479
  }))).then(function () {
6208
6480
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
6209
6481
  }).catch(function (error) {
@@ -6243,8 +6515,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6243
6515
  }, {
6244
6516
  key: "isReactionsSupported",
6245
6517
  value: function isReactionsSupported() {
6246
- var _this$locusInfo6, _this$locusInfo6$cont;
6247
- if ((_this$locusInfo6 = this.locusInfo) !== null && _this$locusInfo6 !== void 0 && (_this$locusInfo6$cont = _this$locusInfo6.controls) !== null && _this$locusInfo6$cont !== void 0 && _this$locusInfo6$cont.reactions.enabled) {
6518
+ var _this$locusInfo8, _this$locusInfo8$cont;
6519
+ if ((_this$locusInfo8 = this.locusInfo) !== null && _this$locusInfo8 !== void 0 && (_this$locusInfo8$cont = _this$locusInfo8.controls) !== null && _this$locusInfo8$cont !== void 0 && _this$locusInfo8$cont.reactions.enabled) {
6248
6520
  return true;
6249
6521
  }
6250
6522
  _loggerProxy.default.logger.error('Meeting:index#isReactionsSupported --> Reactions is not supported');
@@ -6344,53 +6616,75 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6344
6616
  }, {
6345
6617
  key: "startTranscription",
6346
6618
  value: (function () {
6347
- var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17(options) {
6348
- var _t10;
6349
- return _regenerator.default.wrap(function (_context17) {
6350
- while (1) switch (_context17.prev = _context17.next) {
6619
+ var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19(options) {
6620
+ var _t12;
6621
+ return _regenerator.default.wrap(function (_context19) {
6622
+ while (1) switch (_context19.prev = _context19.next) {
6351
6623
  case 0:
6352
6624
  if (!this.isJoined()) {
6353
- _context17.next = 5;
6625
+ _context19.next = 5;
6354
6626
  break;
6355
6627
  }
6356
6628
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
6357
- _context17.prev = 1;
6629
+ _context19.prev = 1;
6358
6630
  if (!this.areVoiceaEventsSetup) {
6359
6631
  this.setUpVoiceaListeners();
6360
6632
  }
6361
6633
 
6362
6634
  // @ts-ignore
6363
- _context17.next = 2;
6635
+ _context19.next = 2;
6364
6636
  return this.webex.internal.voicea.turnOnCaptions(options === null || options === void 0 ? void 0 : options.spokenLanguage);
6365
6637
  case 2:
6366
- _context17.next = 4;
6638
+ _context19.next = 4;
6367
6639
  break;
6368
6640
  case 3:
6369
- _context17.prev = 3;
6370
- _t10 = _context17["catch"](1);
6371
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t10));
6641
+ _context19.prev = 3;
6642
+ _t12 = _context19["catch"](1);
6643
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t12));
6372
6644
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
6373
6645
  correlation_id: this.correlationId,
6374
- reason: _t10.message,
6375
- stack: _t10.stack
6646
+ reason: _t12.message,
6647
+ stack: _t12.stack
6376
6648
  });
6377
6649
  case 4:
6378
- _context17.next = 6;
6650
+ _context19.next = 6;
6379
6651
  break;
6380
6652
  case 5:
6381
6653
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
6382
6654
  throw new Error('Meeting is not joined');
6383
6655
  case 6:
6384
6656
  case "end":
6385
- return _context17.stop();
6657
+ return _context19.stop();
6386
6658
  }
6387
- }, _callee17, this, [[1, 3]]);
6659
+ }, _callee19, this, [[1, 3]]);
6388
6660
  }));
6389
- function startTranscription(_x13) {
6661
+ function startTranscription(_x15) {
6390
6662
  return _startTranscription.apply(this, arguments);
6391
6663
  }
6392
6664
  return startTranscription;
6393
6665
  }())
6666
+ }, {
6667
+ key: "isRelayEventRouteValid",
6668
+ value:
6669
+ /**
6670
+ * Verifies the relay event was delivered for the active LLM session binding.
6671
+ * @param {RelayEvent} event Event object coming from LLM Connection
6672
+ * @returns {boolean}
6673
+ */
6674
+ function isRelayEventRouteValid(event) {
6675
+ var _event$headers;
6676
+ var route = event === null || event === void 0 ? void 0 : (_event$headers = event.headers) === null || _event$headers === void 0 ? void 0 : _event$headers.route;
6677
+ if (!route) {
6678
+ return true;
6679
+ }
6680
+ var llm = this.webex.internal.llm;
6681
+ var isPracticeSession = llm.isConnected(_constants.LLM_PRACTICE_SESSION);
6682
+ var expectedBinding = isPracticeSession ? llm.getBinding(_constants.LLM_PRACTICE_SESSION) : llm.getBinding();
6683
+ if (!expectedBinding || route === expectedBinding) {
6684
+ return true;
6685
+ }
6686
+ return false;
6687
+ }
6394
6688
  }, {
6395
6689
  key: "stopTranscription",
6396
6690
  value:
@@ -6441,9 +6735,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6441
6735
  key: "restoreLLMSubscriptionsIfNeeded",
6442
6736
  value: function restoreLLMSubscriptionsIfNeeded() {
6443
6737
  try {
6444
- var _this$webex$internal$, _this$webex$internal$2;
6738
+ var _this$webex$internal$5, _this$webex$internal$6;
6445
6739
  // @ts-ignore
6446
- var isCaptionBoxOn = (_this$webex$internal$ = this.webex.internal.voicea) === null || _this$webex$internal$ === void 0 ? void 0 : (_this$webex$internal$2 = _this$webex$internal$.getIsCaptionBoxOn) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.call(_this$webex$internal$);
6740
+ var isCaptionBoxOn = (_this$webex$internal$5 = this.webex.internal.voicea) === null || _this$webex$internal$5 === void 0 ? void 0 : (_this$webex$internal$6 = _this$webex$internal$5.getIsCaptionBoxOn) === null || _this$webex$internal$6 === void 0 ? void 0 : _this$webex$internal$6.call(_this$webex$internal$5);
6447
6741
  if (!isCaptionBoxOn) {
6448
6742
  return;
6449
6743
  }
@@ -6473,7 +6767,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6473
6767
  * Scenario D: Joining any other way (sip, pstn, conversationUrl, link just need to specify resourceId)
6474
6768
  */
6475
6769
  function () {
6476
- var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6770
+ var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
6477
6771
  var _this34 = this;
6478
6772
  var options,
6479
6773
  errorMessage,
@@ -6484,26 +6778,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6484
6778
  _error4,
6485
6779
  _errorMessage3,
6486
6780
  _error5,
6487
- _args18 = arguments,
6488
- _t11;
6489
- return _regenerator.default.wrap(function (_context18) {
6490
- while (1) switch (_context18.prev = _context18.next) {
6781
+ _args20 = arguments,
6782
+ _t13;
6783
+ return _regenerator.default.wrap(function (_context20) {
6784
+ while (1) switch (_context20.prev = _context20.next) {
6491
6785
  case 0:
6492
- options = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
6786
+ options = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {};
6493
6787
  if (this.webex.meetings.registered) {
6494
- _context18.next = 1;
6788
+ _context20.next = 1;
6495
6789
  break;
6496
6790
  }
6497
6791
  errorMessage = 'Meeting:index#join --> Device not registered';
6498
6792
  error = new Error(errorMessage);
6499
6793
  _loggerProxy.default.logger.error(errorMessage);
6500
- return _context18.abrupt("return", _promise.default.reject(error));
6794
+ return _context20.abrupt("return", _promise.default.reject(error));
6501
6795
  case 1:
6502
6796
  if (!this.deferJoin) {
6503
- _context18.next = 2;
6797
+ _context20.next = 2;
6504
6798
  break;
6505
6799
  }
6506
- return _context18.abrupt("return", this.deferJoin);
6800
+ return _context20.abrupt("return", this.deferJoin);
6507
6801
  case 2:
6508
6802
  // Create a deferred promise for a consistent resolve value from utils.
6509
6803
  // This also prevents redundant API calls.
@@ -6555,15 +6849,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6555
6849
  this.wirelessShare = true;
6556
6850
  }
6557
6851
  if (!options.meetingQuality) {
6558
- _context18.next = 6;
6852
+ _context20.next = 6;
6559
6853
  break;
6560
6854
  }
6561
6855
  if (!(typeof options.meetingQuality === 'string')) {
6562
- _context18.next = 4;
6856
+ _context20.next = 4;
6563
6857
  break;
6564
6858
  }
6565
6859
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
6566
- _context18.next = 3;
6860
+ _context20.next = 3;
6567
6861
  break;
6568
6862
  }
6569
6863
  _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
@@ -6571,16 +6865,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6571
6865
  _loggerProxy.default.logger.error(_errorMessage2);
6572
6866
  joinFailed(_error4);
6573
6867
  this.deferJoin = undefined;
6574
- return _context18.abrupt("return", _promise.default.reject(_error4));
6868
+ return _context20.abrupt("return", _promise.default.reject(_error4));
6575
6869
  case 3:
6576
6870
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
6577
6871
  case 4:
6578
6872
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
6579
- _context18.next = 6;
6873
+ _context20.next = 6;
6580
6874
  break;
6581
6875
  }
6582
6876
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
6583
- _context18.next = 5;
6877
+ _context20.next = 5;
6584
6878
  break;
6585
6879
  }
6586
6880
  _errorMessage3 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
@@ -6588,42 +6882,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6588
6882
  _error5 = new Error(_errorMessage3);
6589
6883
  joinFailed(_error5);
6590
6884
  this.deferJoin = undefined;
6591
- return _context18.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6885
+ return _context20.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6592
6886
  case 5:
6593
6887
  if (options.meetingQuality.remote) {
6594
6888
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
6595
6889
  }
6596
6890
  case 6:
6597
6891
  this.isMultistream = !!options.enableMultistream;
6598
- _context18.prev = 7;
6599
- _context18.next = 8;
6892
+ _context20.prev = 7;
6893
+ _context20.next = 8;
6600
6894
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
6601
6895
  case 8:
6602
- _context18.next = 10;
6896
+ _context20.next = 10;
6603
6897
  break;
6604
6898
  case 9:
6605
- _context18.prev = 9;
6606
- _t11 = _context18["catch"](7);
6607
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t11);
6608
- if (!(_t11 instanceof _captchaError.default || _t11 instanceof _passwordError.default || _t11 instanceof _permission.default)) {
6609
- _context18.next = 10;
6899
+ _context20.prev = 9;
6900
+ _t13 = _context20["catch"](7);
6901
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t13);
6902
+ if (!(_t13 instanceof _captchaError.default || _t13 instanceof _passwordError.default || _t13 instanceof _permission.default)) {
6903
+ _context20.next = 10;
6610
6904
  break;
6611
6905
  }
6612
- this.meetingFiniteStateMachine.fail(_t11);
6906
+ this.meetingFiniteStateMachine.fail(_t13);
6613
6907
 
6614
6908
  // Upload logs on refreshpermissionToken refresh Failure
6615
6909
  _triggerProxy.default.trigger(this, {
6616
6910
  file: 'meeting/index',
6617
6911
  function: 'join'
6618
6912
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6619
- joinFailed(_t11);
6913
+ joinFailed(_t13);
6620
6914
  this.deferJoin = undefined;
6621
6915
 
6622
6916
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
6623
6917
  // and bubble it up to client
6624
- return _context18.abrupt("return", _promise.default.reject(_t11));
6918
+ return _context20.abrupt("return", _promise.default.reject(_t13));
6625
6919
  case 10:
6626
- return _context18.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6920
+ return _context20.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6627
6921
  _this34.meetingFiniteStateMachine.join();
6628
6922
  _this34.setupLocusMediaRequest();
6629
6923
 
@@ -6679,9 +6973,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6679
6973
  }));
6680
6974
  case 11:
6681
6975
  case "end":
6682
- return _context18.stop();
6976
+ return _context20.stop();
6683
6977
  }
6684
- }, _callee18, this, [[7, 9]]);
6978
+ }, _callee20, this, [[7, 9]]);
6685
6979
  }));
6686
6980
  function join() {
6687
6981
  return _join.apply(this, arguments);
@@ -6730,17 +7024,66 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6730
7024
  this.llmHealthCheckTimer = undefined;
6731
7025
  }
6732
7026
  }
7027
+
7028
+ /**
7029
+ * Removes LLM event listeners and clears the health check timer.
7030
+ * Must be called before Locus /leave to avoid unnecessary syncs triggered
7031
+ * by events received while leaving (per Locus team recommendation).
7032
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
7033
+ * matching listener is registered.
7034
+ * @private
7035
+ * @returns {void}
7036
+ */
7037
+ }, {
7038
+ key: "stopListeningForLLMEvents",
7039
+ value: function stopListeningForLLMEvents() {
7040
+ // @ts-ignore - fix types
7041
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
7042
+ // @ts-ignore - fix types
7043
+ this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, this.processLocusLLMEvent);
7044
+ this.clearLLMHealthCheckTimer();
7045
+ }
7046
+
7047
+ /**
7048
+ * Stops listening on every event bus (LLM, Mercury, voicea/transcription,
7049
+ * annotation) that could otherwise deliver events to this meeting while
7050
+ * Locus is processing /leave or /end. Per the Locus team recommendation,
7051
+ * this must run before the Locus request is dispatched to avoid
7052
+ * unnecessary syncs triggered by in-flight events.
7053
+ *
7054
+ * Voicea (transcription) subscribes to llm 'event:relay.event' internally,
7055
+ * and the annotation plugin subscribes to both mercury and llm, so both
7056
+ * must be torn down alongside the direct LLM/Mercury listeners.
7057
+ *
7058
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
7059
+ * matching listener is registered, and stopTranscription is guarded.
7060
+ * @private
7061
+ * @returns {void}
7062
+ */
7063
+ }, {
7064
+ key: "stopListeningForMeetingEvents",
7065
+ value: function stopListeningForMeetingEvents() {
7066
+ this.stopListeningForLLMEvents();
7067
+ this.stopListeningForMercuryEvents();
7068
+ if (this.transcription) {
7069
+ this.stopTranscription();
7070
+ this.transcription = undefined;
7071
+ }
7072
+ this.annotation.deregisterEvents();
7073
+ }
6733
7074
  }, {
6734
7075
  key: "clearDataChannelToken",
6735
7076
  value:
6736
7077
  /**
6737
- * Clears all data channel tokens stored in LLM.
6738
- * Called during meeting cleanup to ensure stale tokens are not reused.
7078
+ * Clears data channel tokens associated with this meeting ownership.
7079
+ * Ownership checks are enforced in internal-plugin-llm.
6739
7080
  * @returns {void}
6740
7081
  */
6741
7082
  function clearDataChannelToken() {
6742
7083
  // @ts-ignore
6743
- this.webex.internal.llm.resetDatachannelTokens();
7084
+ this.webex.internal.llm.clearDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id);
7085
+ // @ts-ignore
7086
+ this.webex.internal.llm.clearDatachannelToken(_constants.LLM_PRACTICE_SESSION, this.id);
6744
7087
  }
6745
7088
 
6746
7089
  /**
@@ -6757,11 +7100,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6757
7100
  var practiceSessionDatachannelToken = join === null || join === void 0 ? void 0 : (_join$locus2 = join.locus) === null || _join$locus2 === void 0 ? void 0 : (_join$locus2$self = _join$locus2.self) === null || _join$locus2$self === void 0 ? void 0 : _join$locus2$self.practiceSessionDatachannelToken;
6758
7101
  if (datachannelToken) {
6759
7102
  // @ts-ignore
6760
- this.webex.internal.llm.setDatachannelToken(datachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
7103
+ this.webex.internal.llm.setDatachannelToken(datachannelToken, _constants.LLM_DEFAULT_SESSION, this.id);
6761
7104
  }
6762
7105
  if (practiceSessionDatachannelToken) {
6763
7106
  // @ts-ignore
6764
- this.webex.internal.llm.setDatachannelToken(practiceSessionDatachannelToken, _internalPluginLlm.DataChannelTokenType.PracticeSession);
7107
+ this.webex.internal.llm.setDatachannelToken(practiceSessionDatachannelToken, _constants.LLM_PRACTICE_SESSION, this.id);
6765
7108
  }
6766
7109
  }
6767
7110
 
@@ -6773,55 +7116,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6773
7116
  }, {
6774
7117
  key: "ensureDefaultDatachannelTokenAfterAdmit",
6775
7118
  value: (function () {
6776
- var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
6777
- var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t12;
6778
- return _regenerator.default.wrap(function (_context19) {
6779
- while (1) switch (_context19.prev = _context19.next) {
7119
+ var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7120
+ var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t14;
7121
+ return _regenerator.default.wrap(function (_context21) {
7122
+ while (1) switch (_context21.prev = _context21.next) {
6780
7123
  case 0:
6781
- _context19.prev = 0;
7124
+ _context21.prev = 0;
6782
7125
  // @ts-ignore
6783
- datachannelToken = this.webex.internal.llm.getDatachannelToken(); // @ts-ignore
6784
- _context19.next = 1;
7126
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id); // @ts-ignore
7127
+ _context21.next = 1;
6785
7128
  return this.webex.internal.llm.isDataChannelTokenEnabled();
6786
7129
  case 1:
6787
- isDataChannelTokenEnabled = _context19.sent;
7130
+ isDataChannelTokenEnabled = _context21.sent;
6788
7131
  if (!(!isDataChannelTokenEnabled || datachannelToken)) {
6789
- _context19.next = 2;
7132
+ _context21.next = 2;
6790
7133
  break;
6791
7134
  }
6792
- return _context19.abrupt("return", false);
7135
+ return _context21.abrupt("return", false);
6793
7136
  case 2:
6794
- _context19.next = 3;
7137
+ _context21.next = 3;
6795
7138
  return this.meetingRequest.fetchDatachannelToken({
6796
7139
  locusUrl: this.locusUrl,
6797
7140
  requestingParticipantId: this.members.selfId,
6798
7141
  isPracticeSession: false
6799
7142
  });
6800
7143
  case 3:
6801
- response = _context19.sent;
7144
+ response = _context21.sent;
6802
7145
  fetchedDatachannelToken = response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.datachannelToken;
6803
7146
  if (fetchedDatachannelToken) {
6804
- _context19.next = 4;
7147
+ _context21.next = 4;
6805
7148
  break;
6806
7149
  }
6807
- return _context19.abrupt("return", false);
7150
+ return _context21.abrupt("return", false);
6808
7151
  case 4:
6809
7152
  // @ts-ignore
6810
- this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
6811
- return _context19.abrupt("return", true);
7153
+ this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _constants.LLM_DEFAULT_SESSION, this.id);
7154
+ return _context21.abrupt("return", true);
6812
7155
  case 5:
6813
- _context19.prev = 5;
6814
- _t12 = _context19["catch"](0);
6815
- msg = (_t12 === null || _t12 === void 0 ? void 0 : _t12.message) || String(_t12);
7156
+ _context21.prev = 5;
7157
+ _t14 = _context21["catch"](0);
7158
+ msg = (_t14 === null || _t14 === void 0 ? void 0 : _t14.message) || String(_t14);
6816
7159
  _loggerProxy.default.logger.warn("Meeting:index#ensureDefaultDatachannelTokenAfterAdmit --> failed to proactively fetch default data channel token after admit: ".concat(msg), {
6817
- statusCode: _t12 === null || _t12 === void 0 ? void 0 : _t12.statusCode
7160
+ statusCode: _t14 === null || _t14 === void 0 ? void 0 : _t14.statusCode
6818
7161
  });
6819
- return _context19.abrupt("return", false);
7162
+ return _context21.abrupt("return", false);
6820
7163
  case 6:
6821
7164
  case "end":
6822
- return _context19.stop();
7165
+ return _context21.stop();
6823
7166
  }
6824
- }, _callee19, this, [[0, 5]]);
7167
+ }, _callee21, this, [[0, 5]]);
6825
7168
  }));
6826
7169
  function ensureDefaultDatachannelTokenAfterAdmit() {
6827
7170
  return _ensureDefaultDatachannelTokenAfterAdmit.apply(this, arguments);
@@ -6837,43 +7180,120 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6837
7180
  }, {
6838
7181
  key: "updateLLMConnection",
6839
7182
  value: (function () {
6840
- var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
7183
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
6841
7184
  var _this36 = this;
6842
- var _ref39, _ref39$url, url, _ref39$info, _ref39$info2, _ref39$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl;
6843
- return _regenerator.default.wrap(function (_context20) {
6844
- while (1) switch (_context20.prev = _context20.next) {
7185
+ var _ref40, _ref40$url, url, _ref40$info, _ref40$info2, _ref40$info2$datachan, datachannelUrl, isJoined, dataChannelUrl, _this$webex$internal$7, currentOwner, wasConnected, datachannelToken, refreshHandlerOwnerMeetingId, shouldAlignRefreshHandlerAfterOwnershipClaim;
7186
+ return _regenerator.default.wrap(function (_context22) {
7187
+ while (1) switch (_context22.prev = _context22.next) {
6845
7188
  case 0:
6846
7189
  // @ts-ignore - Fix type
6847
- _ref39 = this.locusInfo || {}, _ref39$url = _ref39.url, url = _ref39$url === void 0 ? undefined : _ref39$url, _ref39$info = _ref39.info, _ref39$info2 = _ref39$info === void 0 ? {} : _ref39$info, _ref39$info2$datachan = _ref39$info2.datachannelUrl, datachannelUrl = _ref39$info2$datachan === void 0 ? undefined : _ref39$info2$datachan;
6848
- isJoined = this.isJoined(); // @ts-ignore
6849
- datachannelToken = this.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.Default);
6850
- dataChannelUrl = datachannelUrl; // @ts-ignore - Fix type
6851
- if (!this.webex.internal.llm.isConnected()) {
6852
- _context20.next = 2;
7190
+ _ref40 = this.locusInfo || {}, _ref40$url = _ref40.url, url = _ref40$url === void 0 ? undefined : _ref40$url, _ref40$info = _ref40.info, _ref40$info2 = _ref40$info === void 0 ? {} : _ref40$info, _ref40$info2$datachan = _ref40$info2.datachannelUrl, datachannelUrl = _ref40$info2$datachan === void 0 ? undefined : _ref40$info2$datachan;
7191
+ isJoined = this.isJoined();
7192
+ dataChannelUrl = datachannelUrl; // Ownership guard: when the default LLM session is already connected and
7193
+ // owned by a *different* Meeting instance, do not disconnect or reconfigure
7194
+ // it. Another meeting's `updateLLMConnection` must be ignored here to
7195
+ // avoid killing the socket it relies on. We only proceed to manage the
7196
+ // connection when this meeting is the current owner, or when no owner is
7197
+ // set yet (first claim).
7198
+ // @ts-ignore - Fix type
7199
+ _this$webex$internal$7 = this.webex.internal.llm.resolveSessionOwnership(this.id, _constants.LLM_DEFAULT_SESSION), currentOwner = _this$webex$internal$7.currentOwner; // Capture connectivity before any reconnect attempt. If LLM was already
7200
+ // connected, we must respect current ownership. If it was disconnected,
7201
+ // this flow may reclaim stale owner tags after a fresh connect.
7202
+ // @ts-ignore - Fix type
7203
+ wasConnected = this.webex.internal.llm.isConnected(); // Prefer ownership-scoped token read. For disconnected stale-owner reclaim
7204
+ // flows, fallback to ownerless read so initial register can still carry a
7205
+ // token and recover from stale ownership without 401/403 dead-end.
7206
+ // @ts-ignore - Fix type
7207
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION, this.id);
7208
+ if (!datachannelToken && !wasConnected && currentOwner && currentOwner !== this.id) {
7209
+ // @ts-ignore - Fix type
7210
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(_constants.LLM_DEFAULT_SESSION);
7211
+ }
7212
+
7213
+ // @ts-ignore - Fix type
7214
+ if (!wasConnected) {
7215
+ _context22.next = 3;
6853
7216
  break;
6854
7217
  }
7218
+ if (!(currentOwner && currentOwner !== this.id)) {
7219
+ _context22.next = 1;
7220
+ break;
7221
+ }
7222
+ // Another meeting owns the live LLM socket. We must not disconnect
7223
+ // or reconfigure it -- doing so would tear down a session the
7224
+ // owning meeting still relies on. Locus/datachannel URL mismatch is
7225
+ // expected here (each meeting has its own locus URL) and is NOT a
7226
+ // valid signal of staleness, so we never reclaim from this path.
7227
+ // The only safe reclaim mechanism is the `finally`-block owner-tag
7228
+ // release in `cleanupLLMConneciton`, which fires when this meeting
7229
+ // itself is being torn down.
7230
+ _loggerProxy.default.logger.info("Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ".concat(currentOwner, ", not ").concat(this.id));
7231
+ return _context22.abrupt("return", undefined);
7232
+ case 1:
6855
7233
  if (!(
6856
7234
  // @ts-ignore - Fix type
6857
7235
  url === this.webex.internal.llm.getLocusUrl() &&
6858
7236
  // @ts-ignore - Fix type
6859
7237
  dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6860
- _context20.next = 1;
7238
+ _context22.next = 2;
6861
7239
  break;
6862
7240
  }
6863
- return _context20.abrupt("return", undefined);
6864
- case 1:
6865
- _context20.next = 2;
7241
+ return _context22.abrupt("return", undefined);
7242
+ case 2:
7243
+ _context22.next = 3;
6866
7244
  return this.cleanupLLMConneciton({
6867
7245
  removeOnlineListener: false
6868
7246
  });
6869
- case 2:
7247
+ case 3:
6870
7248
  if (isJoined) {
6871
- _context20.next = 3;
7249
+ _context22.next = 4;
6872
7250
  break;
6873
7251
  }
6874
- return _context20.abrupt("return", undefined);
6875
- case 3:
6876
- return _context20.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7252
+ return _context22.abrupt("return", undefined);
7253
+ case 4:
7254
+ // Bind refresh handler before registration so interceptor-triggered token
7255
+ // refresh during register POST can resolve a valid handler.
7256
+ // Prefer this meeting as owner, but allow owner-less fallback when a stale
7257
+ // foreign owner tag is present on a disconnected session.
7258
+ refreshHandlerOwnerMeetingId = currentOwner && currentOwner !== this.id ? undefined : this.id;
7259
+ shouldAlignRefreshHandlerAfterOwnershipClaim = refreshHandlerOwnerMeetingId !== this.id; // @ts-ignore - Fix type
7260
+ this.webex.internal.llm.setRefreshHandler(function () {
7261
+ return _this36.refreshDataChannelToken();
7262
+ }, _constants.LLM_DEFAULT_SESSION, refreshHandlerOwnerMeetingId);
7263
+
7264
+ // @ts-ignore - Fix type
7265
+ return _context22.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7266
+ _this36.locusInfo.syncAllHashTreeDatasets({
7267
+ onlyLLM: true
7268
+ });
7269
+ // Record ownership of the default LLM session for this meeting so
7270
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7271
+ // calls can detect and skip work that doesn't belong to them.
7272
+ // @ts-ignore - Fix type
7273
+ var _this36$webex$interna = _this36.webex.internal.llm.resolveSessionOwnership(_this36.id, _constants.LLM_DEFAULT_SESSION),
7274
+ isOwner = _this36$webex$interna.isOwner;
7275
+ var canReclaimAfterDisconnectedStart = !wasConnected;
7276
+
7277
+ // Refresh handler is pre-bound before registerAndConnect so token
7278
+ // refresh can work even during the registration request itself.
7279
+ if (isOwner || canReclaimAfterDisconnectedStart) {
7280
+ var _this36$webex$interna2, _this36$webex$interna3;
7281
+ // Record ownership of the default LLM session for this meeting so
7282
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7283
+ // calls can detect and skip work that doesn't belong to them.
7284
+ // @ts-ignore - Fix type
7285
+ (_this36$webex$interna2 = (_this36$webex$interna3 = _this36.webex.internal.llm).setOwnerMeetingId) === null || _this36$webex$interna2 === void 0 ? void 0 : _this36$webex$interna2.call(_this36$webex$interna3, _this36.id);
7286
+
7287
+ // If we pre-bound refresh ownerlessly (stale-owner reclaim path),
7288
+ // align the handler with the newly claimed owner immediately after
7289
+ // ownership is updated.
7290
+ if (shouldAlignRefreshHandlerAfterOwnershipClaim) {
7291
+ // @ts-ignore - Fix type
7292
+ _this36.webex.internal.llm.setRefreshHandler(function () {
7293
+ return _this36.refreshDataChannelToken();
7294
+ }, _constants.LLM_DEFAULT_SESSION, _this36.id);
7295
+ }
7296
+ }
6877
7297
  // @ts-ignore - Fix type
6878
7298
  _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
6879
7299
  // @ts-ignore - Fix type
@@ -6886,11 +7306,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6886
7306
  _this36.startLLMHealthCheckTimer();
6887
7307
  return _promise.default.resolve(registerAndConnectResult);
6888
7308
  }));
6889
- case 4:
7309
+ case 5:
6890
7310
  case "end":
6891
- return _context20.stop();
7311
+ return _context22.stop();
6892
7312
  }
6893
- }, _callee20, this);
7313
+ }, _callee22, this);
6894
7314
  }));
6895
7315
  function updateLLMConnection() {
6896
7316
  return _updateLLMConnection.apply(this, arguments);
@@ -7076,17 +7496,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7076
7496
  meetingId: this.id
7077
7497
  }
7078
7498
  });
7079
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7080
- var mediaSettings, _t13;
7081
- return _regenerator.default.wrap(function (_context21) {
7082
- while (1) switch (_context21.prev = _context21.next) {
7499
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
7500
+ var mediaSettings, _t15;
7501
+ return _regenerator.default.wrap(function (_context23) {
7502
+ while (1) switch (_context23.prev = _context23.next) {
7083
7503
  case 0:
7084
- _context21.prev = 0;
7504
+ _context23.prev = 0;
7085
7505
  if (!(_this40.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
7086
- _context21.next = 1;
7506
+ _context23.next = 1;
7087
7507
  break;
7088
7508
  }
7089
- _context21.next = 1;
7509
+ _context23.next = 1;
7090
7510
  return _this40.releaseScreenShareFloor();
7091
7511
  case 1:
7092
7512
  mediaSettings = {
@@ -7105,23 +7525,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7105
7525
  // when a move to is intiated by the client , Locus delets the existing media node from the server as soon the device answers the meeting
7106
7526
  // once the device answers we close the old connection and create new media server connection with only share enabled
7107
7527
  if (!_this40.statsAnalyzer) {
7108
- _context21.next = 2;
7528
+ _context23.next = 2;
7109
7529
  break;
7110
7530
  }
7111
- _context21.next = 2;
7531
+ _context23.next = 2;
7112
7532
  return _this40.statsAnalyzer.stopAnalyzer();
7113
7533
  case 2:
7114
- _context21.next = 3;
7534
+ _context23.next = 3;
7115
7535
  return _this40.closeRemoteStreams();
7116
7536
  case 3:
7117
- _context21.next = 4;
7537
+ _context23.next = 4;
7118
7538
  return _this40.closePeerConnections();
7119
7539
  case 4:
7120
7540
  _this40.cleanupLocalStreams();
7121
7541
  _this40.unsetRemoteStreams();
7122
7542
  _this40.unsetPeerConnections();
7123
7543
  _this40.reconnectionManager.cleanUp();
7124
- _context21.next = 5;
7544
+ _context23.next = 5;
7125
7545
  return _this40.addMedia({
7126
7546
  audioEnabled: false,
7127
7547
  videoEnabled: false,
@@ -7130,24 +7550,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7130
7550
  case 5:
7131
7551
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
7132
7552
  _this40.isMoveToInProgress = false;
7133
- _context21.next = 7;
7553
+ _context23.next = 7;
7134
7554
  break;
7135
7555
  case 6:
7136
- _context21.prev = 6;
7137
- _t13 = _context21["catch"](0);
7138
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t13);
7556
+ _context23.prev = 6;
7557
+ _t15 = _context23["catch"](0);
7558
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t15);
7139
7559
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
7140
7560
  correlation_id: _this40.correlationId,
7141
7561
  locus_id: _this40.locusUrl.split('/').pop(),
7142
- reason: _t13.message,
7143
- stack: _t13.stack
7562
+ reason: _t15.message,
7563
+ stack: _t15.stack
7144
7564
  });
7145
7565
  _this40.isMoveToInProgress = false;
7146
7566
  case 7:
7147
7567
  case "end":
7148
- return _context21.stop();
7568
+ return _context23.stop();
7149
7569
  }
7150
- }, _callee21, null, [[0, 6]]);
7570
+ }, _callee23, null, [[0, 6]]);
7151
7571
  })));
7152
7572
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
7153
7573
 
@@ -7224,21 +7644,87 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7224
7644
  return "MC-".concat(this.id.substring(0, 4));
7225
7645
  }
7226
7646
 
7647
+ /**
7648
+ * Checks if the error indicates that Locus dropped us from the meeting,
7649
+ * either directly on the error or wrapped inside an AddMediaFailed cause.
7650
+ * This method is meant to be called only with errors thrown by Meeting.addMediaInternal()
7651
+ *
7652
+ * @param {Error} error
7653
+ * @returns {boolean}
7654
+ */
7655
+ }, {
7656
+ key: "isErrorMeaningLocusDroppedUs",
7657
+ value: function isErrorMeaningLocusDroppedUs(error) {
7658
+ var _cause;
7659
+ var statusCode = error === null || error === void 0 ? void 0 : error.statusCode;
7660
+ var causeStatusCode = error === null || error === void 0 ? void 0 : (_cause = error.cause) === null || _cause === void 0 ? void 0 : _cause.statusCode;
7661
+ return statusCode === 409 || statusCode === 403 || causeStatusCode === 409 || causeStatusCode === 403;
7662
+ }
7663
+
7664
+ /**
7665
+ * Determines if the next media attempt should use only TURN-TLS (iceTransportPolicy='relay').
7666
+ * We do this in the hope that it will minimize the chance of Homer sending DTLS packets on a wrong
7667
+ * transport (as there will be only 1 transport) and dealing with firewalls that let STUN packets through, but block
7668
+ * other UDP traffic.
7669
+ *
7670
+ * For clients landing on video mesh nodes (VMN), reachability might still have successful TLS (to public nodes)
7671
+ * but TURN discovery will result in empty TURN urls array and iceTransportPolicy='relay' will still be overriden to undefined,
7672
+ * see the code in establishMediaConnection()
7673
+ *
7674
+ * @param {Error} prevError - The error from the previous addMedia attempt
7675
+ * @returns {Promise<boolean>}
7676
+ */
7677
+ }, {
7678
+ key: "shouldRetryMediaWithOnlyTurnTLS",
7679
+ value: (function () {
7680
+ var _shouldRetryMediaWithOnlyTurnTLS = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(prevError) {
7681
+ var hasTlsReachability;
7682
+ return _regenerator.default.wrap(function (_context24) {
7683
+ while (1) switch (_context24.prev = _context24.next) {
7684
+ case 0:
7685
+ if (!(this.isMultistream && prevError instanceof _webexErrors.AddMediaFailed && prevError.isDtlsHandshakeFailure && prevError.connectionType === 'UDP')) {
7686
+ _context24.next = 2;
7687
+ break;
7688
+ }
7689
+ _context24.next = 1;
7690
+ return this.webex.meetings.reachability.isAnyClusterReachableViaProtocol('xtls');
7691
+ case 1:
7692
+ hasTlsReachability = _context24.sent;
7693
+ if (!hasTlsReachability) {
7694
+ _context24.next = 2;
7695
+ break;
7696
+ }
7697
+ _loggerProxy.default.logger.info('Meeting:index#shouldRetryMediaWithOnlyTurnTLS --> previous attempt failed due to DTLS handshake failure over UDP and TLS reachability is available');
7698
+ return _context24.abrupt("return", true);
7699
+ case 2:
7700
+ return _context24.abrupt("return", false);
7701
+ case 3:
7702
+ case "end":
7703
+ return _context24.stop();
7704
+ }
7705
+ }, _callee24, this);
7706
+ }));
7707
+ function shouldRetryMediaWithOnlyTurnTLS(_x16) {
7708
+ return _shouldRetryMediaWithOnlyTurnTLS.apply(this, arguments);
7709
+ }
7710
+ return shouldRetryMediaWithOnlyTurnTLS;
7711
+ }()
7227
7712
  /**
7228
7713
  * Creates a webrtc media connection and publishes streams to it
7229
7714
  *
7230
7715
  * @param {Object} turnServerInfo TURN server information
7231
7716
  * @param {BundlePolicy} [bundlePolicy] Bundle policy settings
7232
- * @param {AddMediaOptions} [options] Options for enabling/disabling audio/video
7717
+ * @param {RTCIceTransportPolicy} [iceTransportPolicy] ICE transport policy override
7233
7718
  * @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
7234
7719
  */
7720
+ )
7235
7721
  }, {
7236
7722
  key: "createMediaConnection",
7237
7723
  value: (function () {
7238
- var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
7724
+ var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25(turnServerInfo, bundlePolicy, iceTransportPolicy) {
7239
7725
  var mc, audioEnabled, videoEnabled, shareEnabled;
7240
- return _regenerator.default.wrap(function (_context22) {
7241
- while (1) switch (_context22.prev = _context22.next) {
7726
+ return _regenerator.default.wrap(function (_context25) {
7727
+ while (1) switch (_context25.prev = _context25.next) {
7242
7728
  case 0:
7243
7729
  this.rtcMetrics = this.isMultistream ?
7244
7730
  // @ts-ignore
@@ -7258,12 +7744,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7258
7744
  enableExtmap: this.config.enableExtmap,
7259
7745
  turnServerInfo: turnServerInfo,
7260
7746
  bundlePolicy: bundlePolicy,
7747
+ iceTransportPolicy: iceTransportPolicy,
7261
7748
  // @ts-ignore - config coming from registerPlugin
7262
7749
  iceCandidatesTimeout: this.config.iceCandidatesGatheringTimeout,
7263
7750
  // @ts-ignore - config coming from registerPlugin
7264
7751
  disableAudioMainDtx: this.config.experimental.disableAudioMainDtx,
7265
7752
  // @ts-ignore - config coming from registerPlugin
7266
7753
  enableAudioTwcc: this.config.enableAudioTwccForMultistream,
7754
+ // @ts-ignore - config coming from registerPlugin
7755
+ enableAv1SlidesSupport: this.config.enableAv1SlidesSupport,
7267
7756
  stopIceGatheringAfterFirstRelayCandidate:
7268
7757
  // @ts-ignore - config coming from registerPlugin
7269
7758
  this.config.stopIceGatheringAfterFirstRelayCandidate
@@ -7280,42 +7769,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7280
7769
 
7281
7770
  // publish the streams
7282
7771
  if (!this.mediaProperties.audioStream) {
7283
- _context22.next = 1;
7772
+ _context25.next = 1;
7284
7773
  break;
7285
7774
  }
7286
7775
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
7287
- _context22.next = 1;
7776
+ _context25.next = 1;
7288
7777
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
7289
7778
  case 1:
7290
7779
  if (!this.mediaProperties.videoStream) {
7291
- _context22.next = 2;
7780
+ _context25.next = 2;
7292
7781
  break;
7293
7782
  }
7294
- _context22.next = 2;
7783
+ _context25.next = 2;
7295
7784
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
7296
7785
  case 2:
7297
7786
  if (!this.mediaProperties.shareVideoStream) {
7298
- _context22.next = 3;
7787
+ _context25.next = 3;
7299
7788
  break;
7300
7789
  }
7301
- _context22.next = 3;
7790
+ _context25.next = 3;
7302
7791
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
7303
7792
  case 3:
7304
7793
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
7305
- _context22.next = 4;
7794
+ _context25.next = 4;
7306
7795
  break;
7307
7796
  }
7308
- _context22.next = 4;
7797
+ _context25.next = 4;
7309
7798
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
7310
7799
  case 4:
7311
- return _context22.abrupt("return", mc);
7800
+ return _context25.abrupt("return", mc);
7312
7801
  case 5:
7313
7802
  case "end":
7314
- return _context22.stop();
7803
+ return _context25.stop();
7315
7804
  }
7316
- }, _callee22, this);
7805
+ }, _callee25, this);
7317
7806
  }));
7318
- function createMediaConnection(_x14, _x15) {
7807
+ function createMediaConnection(_x17, _x18, _x19) {
7319
7808
  return _createMediaConnection.apply(this, arguments);
7320
7809
  }
7321
7810
  return createMediaConnection;
@@ -7353,11 +7842,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7353
7842
  }, {
7354
7843
  key: "setUpLocalStreamReferences",
7355
7844
  value: (function () {
7356
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
7845
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(localStreams) {
7357
7846
  var _localStreams$microph, _localStreams$camera, _localStreams$screenS, _localStreams$screenS2, _localStreams$screenS3, _localStreams$screenS4, _localStreams$screenS5, _localStreams$screenS6;
7358
- var setUpStreamPromises, _t14;
7359
- return _regenerator.default.wrap(function (_context23) {
7360
- while (1) switch (_context23.prev = _context23.next) {
7847
+ var setUpStreamPromises, _t16;
7848
+ return _regenerator.default.wrap(function (_context26) {
7849
+ while (1) switch (_context26.prev = _context26.next) {
7361
7850
  case 0:
7362
7851
  setUpStreamPromises = [];
7363
7852
  if (localStreams !== null && localStreams !== void 0 && localStreams.microphone && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$microph = localStreams.microphone) === null || _localStreams$microph === void 0 ? void 0 : _localStreams$microph.readyState) !== 'ended') {
@@ -7372,24 +7861,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7372
7861
  if (localStreams !== null && localStreams !== void 0 && (_localStreams$screenS4 = localStreams.screenShare) !== null && _localStreams$screenS4 !== void 0 && _localStreams$screenS4.audio && (localStreams === null || localStreams === void 0 ? void 0 : (_localStreams$screenS5 = localStreams.screenShare) === null || _localStreams$screenS5 === void 0 ? void 0 : (_localStreams$screenS6 = _localStreams$screenS5.audio) === null || _localStreams$screenS6 === void 0 ? void 0 : _localStreams$screenS6.readyState) !== 'ended') {
7373
7862
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
7374
7863
  }
7375
- _context23.prev = 1;
7376
- _context23.next = 2;
7864
+ _context26.prev = 1;
7865
+ _context26.next = 2;
7377
7866
  return _promise.default.all(setUpStreamPromises);
7378
7867
  case 2:
7379
- _context23.next = 4;
7868
+ _context26.next = 4;
7380
7869
  break;
7381
7870
  case 3:
7382
- _context23.prev = 3;
7383
- _t14 = _context23["catch"](1);
7384
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t14);
7385
- throw _t14;
7871
+ _context26.prev = 3;
7872
+ _t16 = _context26["catch"](1);
7873
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t16);
7874
+ throw _t16;
7386
7875
  case 4:
7387
7876
  case "end":
7388
- return _context23.stop();
7877
+ return _context26.stop();
7389
7878
  }
7390
- }, _callee23, this, [[1, 3]]);
7879
+ }, _callee26, this, [[1, 3]]);
7391
7880
  }));
7392
- function setUpLocalStreamReferences(_x16) {
7881
+ function setUpLocalStreamReferences(_x20) {
7393
7882
  return _setUpLocalStreamReferences.apply(this, arguments);
7394
7883
  }
7395
7884
  return setUpLocalStreamReferences;
@@ -7404,72 +7893,71 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7404
7893
  }, {
7405
7894
  key: "waitForMediaConnectionConnected",
7406
7895
  value: (function () {
7407
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
7408
- var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29;
7409
- return _regenerator.default.wrap(function (_context24) {
7410
- while (1) switch (_context24.prev = _context24.next) {
7896
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
7897
+ var _ref42, iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29, _t30, _t31;
7898
+ return _regenerator.default.wrap(function (_context27) {
7899
+ while (1) switch (_context27.prev = _context27.next) {
7411
7900
  case 0:
7412
- _context24.prev = 0;
7413
- _context24.next = 1;
7901
+ _context27.prev = 0;
7902
+ _context27.next = 1;
7414
7903
  return this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
7415
7904
  case 1:
7416
- _context24.next = 5;
7905
+ _context27.next = 5;
7417
7906
  break;
7418
7907
  case 2:
7419
- _context24.prev = 2;
7420
- _t15 = _context24["catch"](0);
7421
- iceConnected = _t15.iceConnected;
7908
+ _context27.prev = 2;
7909
+ _t17 = _context27["catch"](0);
7910
+ _ref42 = _t17, iceConnected = _ref42.iceConnected;
7422
7911
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
7423
- _context24.next = 4;
7912
+ _context27.next = 4;
7424
7913
  break;
7425
7914
  }
7426
- _t16 = this.webex.internal.newMetrics;
7427
- _t17 = !this.turnServerUsed;
7428
- _t18 = this.addMediaData.icePhaseCallback();
7429
- _t19 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7430
- _t20 = _internalPluginMetrics.CallDiagnosticUtils;
7431
- _t21 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7432
- _t22 = iceConnected;
7433
- _t23 = this.turnServerUsed;
7434
- _context24.next = 3;
7915
+ _t18 = this.webex.internal.newMetrics;
7916
+ _t19 = !this.turnServerUsed;
7917
+ _t20 = this.addMediaData.icePhaseCallback();
7918
+ _t21 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7919
+ _t22 = _internalPluginMetrics.CallDiagnosticUtils;
7920
+ _t23 = ((_this$mediaProperties9 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties9 === void 0 ? void 0 : (_this$mediaProperties0 = _this$mediaProperties9.multistreamConnection) === null || _this$mediaProperties0 === void 0 ? void 0 : (_this$mediaProperties1 = _this$mediaProperties0.pc) === null || _this$mediaProperties1 === void 0 ? void 0 : (_this$mediaProperties10 = _this$mediaProperties1.pc) === null || _this$mediaProperties10 === void 0 ? void 0 : _this$mediaProperties10.signalingState) || ((_this$mediaProperties11 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.mediaConnection) === null || _this$mediaProperties12 === void 0 ? void 0 : (_this$mediaProperties13 = _this$mediaProperties12.pc) === null || _this$mediaProperties13 === void 0 ? void 0 : _this$mediaProperties13.signalingState) || 'unknown';
7921
+ _t24 = iceConnected;
7922
+ _t25 = this.turnServerUsed;
7923
+ _context27.next = 3;
7435
7924
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
7436
7925
  return false;
7437
7926
  });
7438
7927
  case 3:
7439
- _t24 = _context24.sent;
7440
- _t25 = _t20.generateClientErrorCodeForIceFailure.call(_t20, {
7441
- signalingState: _t21,
7442
- iceConnected: _t22,
7443
- turnServerUsed: _t23,
7444
- unreachable: _t24
7928
+ _t26 = _context27.sent;
7929
+ _t27 = _t22.generateClientErrorCodeForIceFailure.call(_t22, {
7930
+ signalingState: _t23,
7931
+ iceConnected: _t24,
7932
+ turnServerUsed: _t25,
7933
+ unreachable: _t26
7445
7934
  });
7446
- _t26 = _t19.getErrorPayloadForClientErrorCode.call(_t19, {
7447
- clientErrorCode: _t25
7935
+ _t28 = _t21.getErrorPayloadForClientErrorCode.call(_t21, {
7936
+ clientErrorCode: _t27
7448
7937
  });
7449
- _t27 = [_t26];
7450
- _t28 = {
7451
- canProceed: _t17,
7452
- icePhase: _t18,
7453
- errors: _t27
7938
+ _t29 = [_t28];
7939
+ _t30 = {
7940
+ canProceed: _t19,
7941
+ icePhase: _t20,
7942
+ errors: _t29
7454
7943
  };
7455
- _t29 = {
7944
+ _t31 = {
7456
7945
  meetingId: this.id,
7457
- rawError: _t15
7946
+ rawError: _t17
7458
7947
  };
7459
- _t16.submitClientEvent.call(_t16, {
7948
+ _t18.submitClientEvent.call(_t18, {
7460
7949
  name: 'client.ice.end',
7461
- payload: _t28,
7462
- options: _t29
7950
+ payload: _t30,
7951
+ options: _t31
7463
7952
  });
7464
7953
  case 4:
7465
- timedOutError = new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
7466
- timedOutError.cause = _t15;
7467
- throw timedOutError;
7954
+ throw new _webexErrors.MediaConnectionTimedOutError("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId), iceConnected, // keep reference to the original rejected result (which is the object the SDK reports to CA as rawError above)
7955
+ _t17);
7468
7956
  case 5:
7469
7957
  case "end":
7470
- return _context24.stop();
7958
+ return _context27.stop();
7471
7959
  }
7472
- }, _callee24, this, [[0, 2]]);
7960
+ }, _callee27, this, [[0, 2]]);
7473
7961
  }));
7474
7962
  function waitForMediaConnectionConnected() {
7475
7963
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -7536,19 +8024,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7536
8024
  }, {
7537
8025
  key: "waitForRemoteSDPAnswer",
7538
8026
  value: (function () {
7539
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
8027
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
7540
8028
  var _this44 = this;
7541
8029
  var LOG_HEADER, deferSDPAnswer;
7542
- return _regenerator.default.wrap(function (_context25) {
7543
- while (1) switch (_context25.prev = _context25.next) {
8030
+ return _regenerator.default.wrap(function (_context28) {
8031
+ while (1) switch (_context28.prev = _context28.next) {
7544
8032
  case 0:
7545
8033
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
7546
8034
  if (this.deferSDPAnswer) {
7547
- _context25.next = 1;
8035
+ _context28.next = 1;
7548
8036
  break;
7549
8037
  }
7550
8038
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
7551
- return _context25.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
8039
+ return _context28.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7552
8040
  case 1:
7553
8041
  deferSDPAnswer = this.deferSDPAnswer;
7554
8042
  this.sdpResponseTimer = setTimeout(function () {
@@ -7574,12 +8062,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7574
8062
  deferSDPAnswer.reject(error);
7575
8063
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
7576
8064
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
7577
- return _context25.abrupt("return", deferSDPAnswer.promise);
8065
+ return _context28.abrupt("return", deferSDPAnswer.promise);
7578
8066
  case 2:
7579
8067
  case "end":
7580
- return _context25.stop();
8068
+ return _context28.stop();
7581
8069
  }
7582
- }, _callee25, this);
8070
+ }, _callee28, this);
7583
8071
  }));
7584
8072
  function waitForRemoteSDPAnswer() {
7585
8073
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -7598,30 +8086,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7598
8086
  }, {
7599
8087
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
7600
8088
  value: (function () {
7601
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
7602
- var LOG_HEADER, _t30;
7603
- return _regenerator.default.wrap(function (_context26) {
7604
- while (1) switch (_context26.prev = _context26.next) {
8089
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(remoteMediaManagerConfig, bundlePolicy) {
8090
+ var LOG_HEADER, _t32;
8091
+ return _regenerator.default.wrap(function (_context29) {
8092
+ while (1) switch (_context29.prev = _context29.next) {
7605
8093
  case 0:
7606
8094
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
7607
- _context26.prev = 1;
7608
- _context26.next = 2;
8095
+ _context29.prev = 1;
8096
+ _context29.next = 2;
7609
8097
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
7610
8098
  case 2:
7611
- _context26.next = 4;
8099
+ _context29.next = 4;
7612
8100
  break;
7613
8101
  case 3:
7614
- _context26.prev = 3;
7615
- _t30 = _context26["catch"](1);
7616
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t30);
7617
- throw _t30;
8102
+ _context29.prev = 3;
8103
+ _t32 = _context29["catch"](1);
8104
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t32);
8105
+ throw _t32;
7618
8106
  case 4:
7619
8107
  case "end":
7620
- return _context26.stop();
8108
+ return _context29.stop();
7621
8109
  }
7622
- }, _callee26, this, [[1, 3]]);
8110
+ }, _callee29, this, [[1, 3]]);
7623
8111
  }));
7624
- function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x17, _x18) {
8112
+ function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x21, _x22) {
7625
8113
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
7626
8114
  }
7627
8115
  return retryEstablishMediaConnectionWithForcedTurnDiscovery;
@@ -7639,14 +8127,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7639
8127
  }, {
7640
8128
  key: "retryWithForcedTurnDiscovery",
7641
8129
  value: (function () {
7642
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
8130
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy) {
7643
8131
  var LOG_HEADER;
7644
- return _regenerator.default.wrap(function (_context27) {
7645
- while (1) switch (_context27.prev = _context27.next) {
8132
+ return _regenerator.default.wrap(function (_context30) {
8133
+ while (1) switch (_context30.prev = _context30.next) {
7646
8134
  case 0:
7647
8135
  this.addMediaData.retriedWithTurnServer = true;
7648
8136
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
7649
- _context27.next = 1;
8137
+ _context30.next = 1;
7650
8138
  return this.cleanUpBeforeRetryWithTurnServer();
7651
8139
  case 1:
7652
8140
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -7656,24 +8144,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7656
8144
  reason: 'forcingTurnTls'
7657
8145
  });
7658
8146
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
7659
- _context27.next = 2;
8147
+ _context30.next = 2;
7660
8148
  break;
7661
8149
  }
7662
8150
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
7663
- _context27.next = 2;
8151
+ _context30.next = 2;
7664
8152
  return this.join({
7665
8153
  rejoin: true
7666
8154
  });
7667
8155
  case 2:
7668
- _context27.next = 3;
8156
+ _context30.next = 3;
7669
8157
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7670
8158
  case 3:
7671
8159
  case "end":
7672
- return _context27.stop();
8160
+ return _context30.stop();
7673
8161
  }
7674
- }, _callee27, this);
8162
+ }, _callee30, this);
7675
8163
  }));
7676
- function retryWithForcedTurnDiscovery(_x19, _x20) {
8164
+ function retryWithForcedTurnDiscovery(_x23, _x24) {
7677
8165
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
7678
8166
  }
7679
8167
  return retryWithForcedTurnDiscovery;
@@ -7693,32 +8181,46 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7693
8181
  }, {
7694
8182
  key: "handleWaitForMediaConnectionConnectedError",
7695
8183
  value: (function () {
7696
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
7697
- var LOG_HEADER;
7698
- return _regenerator.default.wrap(function (_context28) {
7699
- while (1) switch (_context28.prev = _context28.next) {
8184
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(error, remoteMediaManagerConfig, bundlePolicy) {
8185
+ var LOG_HEADER, _yield$this$mediaProp, connectionType, selectedCandidatePairChanges, numTransports, iceConnected;
8186
+ return _regenerator.default.wrap(function (_context31) {
8187
+ while (1) switch (_context31.prev = _context31.next) {
7700
8188
  case 0:
7701
8189
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
7702
8190
  if (this.turnServerUsed) {
7703
- _context28.next = 2;
8191
+ _context31.next = 2;
7704
8192
  break;
7705
8193
  }
7706
8194
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
7707
- _context28.next = 1;
8195
+ _context31.next = 1;
7708
8196
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7709
8197
  case 1:
7710
- _context28.next = 3;
8198
+ _context31.next = 4;
7711
8199
  break;
7712
8200
  case 2:
7713
8201
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
7714
- throw new _webexErrors.AddMediaFailed(error);
8202
+ _context31.next = 3;
8203
+ return this.mediaProperties.getCurrentConnectionInfo();
7715
8204
  case 3:
8205
+ _yield$this$mediaProp = _context31.sent;
8206
+ connectionType = _yield$this$mediaProp.connectionType;
8207
+ selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8208
+ numTransports = _yield$this$mediaProp.numTransports;
8209
+ iceConnected = error instanceof _webexErrors.MediaConnectionTimedOutError && error.iceConnected;
8210
+ throw new _webexErrors.AddMediaFailed({
8211
+ cause: error,
8212
+ connectionType: connectionType,
8213
+ selectedCandidatePairChanges: selectedCandidatePairChanges,
8214
+ numTransports: numTransports,
8215
+ iceConnected: iceConnected
8216
+ });
8217
+ case 4:
7716
8218
  case "end":
7717
- return _context28.stop();
8219
+ return _context31.stop();
7718
8220
  }
7719
- }, _callee28, this);
8221
+ }, _callee31, this);
7720
8222
  }));
7721
- function handleWaitForMediaConnectionConnectedError(_x21, _x22, _x23) {
8223
+ function handleWaitForMediaConnectionConnectedError(_x25, _x26, _x27) {
7722
8224
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
7723
8225
  }
7724
8226
  return handleWaitForMediaConnectionConnectedError;
@@ -7734,20 +8236,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7734
8236
  }, {
7735
8237
  key: "doTurnDiscovery",
7736
8238
  value: (function () {
7737
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
8239
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32(isReconnecting, isForced) {
7738
8240
  var cdl, turnDiscoveryResult;
7739
- return _regenerator.default.wrap(function (_context29) {
7740
- while (1) switch (_context29.prev = _context29.next) {
8241
+ return _regenerator.default.wrap(function (_context32) {
8242
+ while (1) switch (_context32.prev = _context32.next) {
7741
8243
  case 0:
7742
8244
  // @ts-ignore
7743
8245
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
7744
8246
  this.webex.internal.newMetrics.submitInternalEvent({
7745
8247
  name: 'internal.client.add-media.turn-discovery.start'
7746
8248
  });
7747
- _context29.next = 1;
8249
+ _context32.next = 1;
7748
8250
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
7749
8251
  case 1:
7750
- turnDiscoveryResult = _context29.sent;
8252
+ turnDiscoveryResult = _context32.sent;
7751
8253
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
7752
8254
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
7753
8255
 
@@ -7763,14 +8265,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7763
8265
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
7764
8266
  });
7765
8267
  }
7766
- return _context29.abrupt("return", turnDiscoveryResult);
8268
+ return _context32.abrupt("return", turnDiscoveryResult);
7767
8269
  case 2:
7768
8270
  case "end":
7769
- return _context29.stop();
8271
+ return _context32.stop();
7770
8272
  }
7771
- }, _callee29, this);
8273
+ }, _callee32, this);
7772
8274
  }));
7773
- function doTurnDiscovery(_x24, _x25) {
8275
+ function doTurnDiscovery(_x28, _x29) {
7774
8276
  return _doTurnDiscovery.apply(this, arguments);
7775
8277
  }
7776
8278
  return doTurnDiscovery;
@@ -7789,35 +8291,40 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7789
8291
  }, {
7790
8292
  key: "establishMediaConnection",
7791
8293
  value: (function () {
7792
- var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
8294
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7793
8295
  var _this$locusMediaReque;
7794
- var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t31, _t32;
7795
- return _regenerator.default.wrap(function (_context30) {
7796
- while (1) switch (_context30.prev = _context30.next) {
8296
+ var LOG_HEADER, isReconnecting, _turnServerInfo$urls, _yield$this$doTurnDis, mediaConnection, _t33, _t34;
8297
+ return _regenerator.default.wrap(function (_context33) {
8298
+ while (1) switch (_context33.prev = _context33.next) {
7797
8299
  case 0:
7798
8300
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
7799
8301
  isReconnecting = this.isMoveToInProgress || !!((_this$locusMediaReque = this.locusMediaRequest) !== null && _this$locusMediaReque !== void 0 && _this$locusMediaReque.isConfluenceCreated()); // We are forcing turn discovery if the case is moveTo and a turn server was used already
7800
8302
  if (this.isMoveToInProgress && this.turnServerUsed) {
7801
8303
  isForced = true;
7802
8304
  }
7803
- _context30.prev = 1;
8305
+ _context33.prev = 1;
7804
8306
  if (turnServerInfo) {
7805
- _context30.next = 3;
8307
+ _context33.next = 3;
7806
8308
  break;
7807
8309
  }
7808
- _context30.next = 2;
8310
+ _context33.next = 2;
7809
8311
  return this.doTurnDiscovery(isReconnecting, isForced);
7810
8312
  case 2:
7811
- _yield$this$doTurnDis = _context30.sent;
8313
+ _yield$this$doTurnDis = _context33.sent;
7812
8314
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
7813
8315
  case 3:
7814
- _context30.next = 4;
7815
- return this.createMediaConnection(turnServerInfo, bundlePolicy);
8316
+ if ((!turnServerInfo || !((_turnServerInfo$urls = turnServerInfo.urls) !== null && _turnServerInfo$urls !== void 0 && _turnServerInfo$urls.length)) && this.addMediaData.iceTransportPolicy === 'relay') {
8317
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " cannot do iceTransportPolicy=relay, because there is no turn server info available"));
8318
+ // drop the forced relay policy and use the default, because we don't have a TURN server
8319
+ this.addMediaData.iceTransportPolicy = undefined;
8320
+ }
8321
+ _context33.next = 4;
8322
+ return this.createMediaConnection(turnServerInfo, bundlePolicy, this.addMediaData.iceTransportPolicy);
7816
8323
  case 4:
7817
- mc = _context30.sent;
8324
+ mediaConnection = _context33.sent;
7818
8325
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
7819
8326
  if (!this.isMultistream) {
7820
- _context30.next = 5;
8327
+ _context33.next = 5;
7821
8328
  break;
7822
8329
  }
7823
8330
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -7825,42 +8332,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7825
8332
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
7826
8333
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
7827
8334
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
7828
- _context30.next = 5;
8335
+ _context33.next = 5;
7829
8336
  return this.remoteMediaManager.start();
7830
8337
  case 5:
7831
- _context30.next = 6;
7832
- return mc.initiateOffer();
8338
+ _context33.next = 6;
8339
+ return mediaConnection.initiateOffer();
7833
8340
  case 6:
7834
- _context30.next = 7;
8341
+ _context33.next = 7;
7835
8342
  return this.waitForRemoteSDPAnswer();
7836
8343
  case 7:
7837
8344
  this.handleMediaLogging(this.mediaProperties);
7838
- _context30.next = 9;
8345
+ _context33.next = 9;
7839
8346
  break;
7840
8347
  case 8:
7841
- _context30.prev = 8;
7842
- _t31 = _context30["catch"](1);
7843
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t31);
7844
- throw _t31;
8348
+ _context33.prev = 8;
8349
+ _t33 = _context33["catch"](1);
8350
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t33);
8351
+ throw _t33;
7845
8352
  case 9:
7846
- _context30.prev = 9;
7847
- _context30.next = 10;
8353
+ _context33.prev = 9;
8354
+ _context33.next = 10;
7848
8355
  return this.waitForMediaConnectionConnected();
7849
8356
  case 10:
7850
- _context30.next = 12;
8357
+ _context33.next = 12;
7851
8358
  break;
7852
8359
  case 11:
7853
- _context30.prev = 11;
7854
- _t32 = _context30["catch"](9);
7855
- _context30.next = 12;
7856
- return this.handleWaitForMediaConnectionConnectedError(_t32, remoteMediaManagerConfig, bundlePolicy);
8360
+ _context33.prev = 11;
8361
+ _t34 = _context33["catch"](9);
8362
+ _context33.next = 12;
8363
+ return this.handleWaitForMediaConnectionConnectedError(_t34, remoteMediaManagerConfig, bundlePolicy);
7857
8364
  case 12:
7858
8365
  case "end":
7859
- return _context30.stop();
8366
+ return _context33.stop();
7860
8367
  }
7861
- }, _callee30, this, [[1, 8], [9, 11]]);
8368
+ }, _callee33, this, [[1, 8], [9, 11]]);
7862
8369
  }));
7863
- function establishMediaConnection(_x26, _x27, _x28, _x29) {
8370
+ function establishMediaConnection(_x30, _x31, _x32, _x33) {
7864
8371
  return _establishMediaConnection.apply(this, arguments);
7865
8372
  }
7866
8373
  return establishMediaConnection;
@@ -7875,16 +8382,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7875
8382
  }, {
7876
8383
  key: "cleanUpOnAddMediaFailure",
7877
8384
  value: (function () {
7878
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
8385
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
7879
8386
  var _this$networkQualityM, _this$statsMonitor;
7880
- return _regenerator.default.wrap(function (_context31) {
7881
- while (1) switch (_context31.prev = _context31.next) {
8387
+ return _regenerator.default.wrap(function (_context34) {
8388
+ while (1) switch (_context34.prev = _context34.next) {
7882
8389
  case 0:
7883
8390
  if (!this.statsAnalyzer) {
7884
- _context31.next = 1;
8391
+ _context34.next = 1;
7885
8392
  break;
7886
8393
  }
7887
- _context31.next = 1;
8394
+ _context34.next = 1;
7888
8395
  return this.statsAnalyzer.stopAnalyzer();
7889
8396
  case 1:
7890
8397
  this.statsAnalyzer = null;
@@ -7895,7 +8402,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7895
8402
 
7896
8403
  // when media fails, we want to upload a webrtc dump to see whats going on
7897
8404
  // this function is async, but returns once the stats have been gathered
7898
- _context31.next = 2;
8405
+ _context34.next = 2;
7899
8406
  return this.forceSendStatsReport({
7900
8407
  callFrom: 'addMedia'
7901
8408
  });
@@ -7906,9 +8413,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7906
8413
  }
7907
8414
  case 3:
7908
8415
  case "end":
7909
- return _context31.stop();
8416
+ return _context34.stop();
7910
8417
  }
7911
- }, _callee31, this);
8418
+ }, _callee34, this);
7912
8419
  }));
7913
8420
  function cleanUpOnAddMediaFailure() {
7914
8421
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -7926,16 +8433,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7926
8433
  }, {
7927
8434
  key: "downgradeFromMultistreamToTranscoded",
7928
8435
  value: (function () {
7929
- var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
8436
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
7930
8437
  var _this$networkQualityM2, _this$statsMonitor2, _this$locusMediaReque2;
7931
- return _regenerator.default.wrap(function (_context32) {
7932
- while (1) switch (_context32.prev = _context32.next) {
8438
+ return _regenerator.default.wrap(function (_context35) {
8439
+ while (1) switch (_context35.prev = _context35.next) {
7933
8440
  case 0:
7934
8441
  if (!this.statsAnalyzer) {
7935
- _context32.next = 1;
8442
+ _context35.next = 1;
7936
8443
  break;
7937
8444
  }
7938
- _context32.next = 1;
8445
+ _context35.next = 1;
7939
8446
  return this.statsAnalyzer.stopAnalyzer();
7940
8447
  case 1:
7941
8448
  this.statsAnalyzer = null;
@@ -7944,6 +8451,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7944
8451
  (_this$statsMonitor2 = this.statsMonitor) === null || _this$statsMonitor2 === void 0 ? void 0 : _this$statsMonitor2.removeAllListeners();
7945
8452
  this.statsMonitor = null;
7946
8453
  this.isMultistream = false;
8454
+
8455
+ // reset iceTransportPolicy, because it's only applied for multistream media connections
8456
+ this.addMediaData.iceTransportPolicy = undefined;
7947
8457
  if (this.mediaProperties.webrtcMediaConnection) {
7948
8458
  // close peer connection, but don't reset mute state information, because we will want to use it on the retry
7949
8459
  this.closePeerConnections(false);
@@ -7953,9 +8463,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7953
8463
  this.createStatsAnalyzer();
7954
8464
  case 2:
7955
8465
  case "end":
7956
- return _context32.stop();
8466
+ return _context35.stop();
7957
8467
  }
7958
- }, _callee32, this);
8468
+ }, _callee35, this);
7959
8469
  }));
7960
8470
  function downgradeFromMultistreamToTranscoded() {
7961
8471
  return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
@@ -7973,11 +8483,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7973
8483
  }, {
7974
8484
  key: "cleanUpBeforeRetryWithTurnServer",
7975
8485
  value: (function () {
7976
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7977
- return _regenerator.default.wrap(function (_context33) {
7978
- while (1) switch (_context33.prev = _context33.next) {
8486
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36() {
8487
+ return _regenerator.default.wrap(function (_context36) {
8488
+ while (1) switch (_context36.prev = _context36.next) {
7979
8489
  case 0:
7980
- _context33.next = 1;
8490
+ _context36.next = 1;
7981
8491
  return this.forceSendStatsReport({
7982
8492
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
7983
8493
  });
@@ -7997,9 +8507,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7997
8507
  }
7998
8508
  case 2:
7999
8509
  case "end":
8000
- return _context33.stop();
8510
+ return _context36.stop();
8001
8511
  }
8002
- }, _callee33, this);
8512
+ }, _callee36, this);
8003
8513
  }));
8004
8514
  function cleanUpBeforeRetryWithTurnServer() {
8005
8515
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -8009,35 +8519,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8009
8519
  }, {
8010
8520
  key: "cleanUpBeforeReconnection",
8011
8521
  value: function () {
8012
- var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
8013
- var _t33;
8014
- return _regenerator.default.wrap(function (_context34) {
8015
- while (1) switch (_context34.prev = _context34.next) {
8522
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37() {
8523
+ var _t35;
8524
+ return _regenerator.default.wrap(function (_context37) {
8525
+ while (1) switch (_context37.prev = _context37.next) {
8016
8526
  case 0:
8017
- _context34.prev = 0;
8018
- _context34.next = 1;
8527
+ _context37.prev = 0;
8528
+ _context37.next = 1;
8019
8529
  return this.forceSendStatsReport({
8020
8530
  callFrom: 'cleanUpBeforeReconnection'
8021
8531
  });
8022
8532
  case 1:
8023
8533
  if (!this.statsAnalyzer) {
8024
- _context34.next = 2;
8534
+ _context37.next = 2;
8025
8535
  break;
8026
8536
  }
8027
- _context34.next = 2;
8537
+ _context37.next = 2;
8028
8538
  return this.statsAnalyzer.stopAnalyzer();
8029
8539
  case 2:
8030
- _context34.next = 4;
8540
+ _context37.next = 4;
8031
8541
  break;
8032
8542
  case 3:
8033
- _context34.prev = 3;
8034
- _t33 = _context34["catch"](0);
8035
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t33);
8543
+ _context37.prev = 3;
8544
+ _t35 = _context37["catch"](0);
8545
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t35);
8036
8546
  case 4:
8037
8547
  case "end":
8038
- return _context34.stop();
8548
+ return _context37.stop();
8039
8549
  }
8040
- }, _callee34, this, [[0, 3]]);
8550
+ }, _callee37, this, [[0, 3]]);
8041
8551
  }));
8042
8552
  function cleanUpBeforeReconnection() {
8043
8553
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -8053,7 +8563,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8053
8563
  }, {
8054
8564
  key: "setupLocusMediaRequest",
8055
8565
  value: function setupLocusMediaRequest() {
8056
- var _this$webex$meetings$2, _this$webex$meetings$3;
8566
+ var _this$webex$meetings$2,
8567
+ _this$webex$meetings$3,
8568
+ _this45 = this;
8057
8569
  this.locusMediaRequest = new _locusMediaRequest.LocusMediaRequest({
8058
8570
  correlationId: this.correlationId,
8059
8571
  meetingId: this.id,
@@ -8066,13 +8578,50 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8066
8578
  // @ts-ignore
8067
8579
  regionCode: (_this$webex$meetings$3 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$3 === void 0 ? void 0 : _this$webex$meetings$3.regionCode
8068
8580
  },
8069
- preferTranscoding: !this.isMultistream
8581
+ preferTranscoding: !this.isMultistream,
8582
+ getCurrentSelfUrl: function getCurrentSelfUrl() {
8583
+ return _this45.selfUrl;
8584
+ },
8585
+ waitForSelfUrlChange: function waitForSelfUrlChange() {
8586
+ return _this45.waitForSelfUrlChange();
8587
+ }
8070
8588
  }, {
8071
8589
  // @ts-ignore
8072
8590
  parent: this.webex
8073
8591
  });
8074
8592
  }
8075
8593
 
8594
+ /**
8595
+ * Waits for LocusInfo to update meeting.selfUrl, with a timeout fallback.
8596
+ * @returns {Promise<void>}
8597
+ * @private
8598
+ * @memberof Meeting
8599
+ */
8600
+ }, {
8601
+ key: "waitForSelfUrlChange",
8602
+ value: function waitForSelfUrlChange() {
8603
+ var _this46 = this;
8604
+ if (this.joinWithMediaRetryInfo.retryCount > 0) {
8605
+ /* During joinWithMedia() retries we can get 403/409 from Locus and it doesn't mean
8606
+ * that the selfUrl will change, it is usually caused by Locus dropping us as a result of
8607
+ * media connection failure during joinWithMedia's earlier media connection attempt,
8608
+ * so we don't want to wait for selfUrl change as this would only slow down the join process. */
8609
+ _loggerProxy.default.logger.info('Meeting:index#waitForSelfUrlChange --> joinWithMedia retry in progress, will not wait for selfUrl change');
8610
+ return _promise.default.resolve();
8611
+ }
8612
+ if (!this.promisesWaitingForPropUpdate.selfUrl) {
8613
+ var pendingSelfUrlUpdate = new _common.Defer();
8614
+ this.promisesWaitingForPropUpdate.selfUrl = pendingSelfUrlUpdate;
8615
+ setTimeout(function () {
8616
+ if (_this46.promisesWaitingForPropUpdate.selfUrl === pendingSelfUrlUpdate) {
8617
+ delete _this46.promisesWaitingForPropUpdate.selfUrl;
8618
+ pendingSelfUrlUpdate.resolve();
8619
+ }
8620
+ }, 5000);
8621
+ }
8622
+ return this.promisesWaitingForPropUpdate.selfUrl.promise;
8623
+ }
8624
+
8076
8625
  /**
8077
8626
  * Creates a media connection to the server. Media connection is required for sending or receiving any audio/video.
8078
8627
  *
@@ -8084,19 +8633,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8084
8633
  }, {
8085
8634
  key: "addMedia",
8086
8635
  value: function addMedia() {
8087
- var _this45 = this;
8636
+ var _this47 = this;
8088
8637
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8089
8638
  return this.addMediaInternal(function () {
8090
- return _this45.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
8091
- }, undefined, false, options);
8639
+ return _this47.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
8640
+ }, false, undefined /* turnServerInfo - it will be fetched via doTurnDiscovery() */, undefined /* iceTransportPolicy - we're relying on the default value */, options);
8092
8641
  }
8093
8642
 
8094
8643
  /**
8095
8644
  * Internal version of addMedia() with some more arguments for finer control of its behavior
8096
8645
  *
8097
8646
  * @param {Function} icePhaseCallback - callback to determine the icePhase for CA "client.ice.end" failure events
8098
- * @param {TurnServerInfo} turnServerInfo - TURN server information
8099
8647
  * @param {boolean} forceTurnDiscovery - if true, TURN discovery will be done
8648
+ * @param {TurnServerInfo} turnServerInfo - TURN server information
8649
+ * @param {RTCIceTransportPolicy} [iceTransportPolicy] - ICE transport policy override
8100
8650
  * @param {AddMediaOptions} options - same as options of the public addMedia() method
8101
8651
  * @returns {Promise<void>}
8102
8652
  * @protected
@@ -8105,7 +8655,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8105
8655
  }, {
8106
8656
  key: "addMediaInternal",
8107
8657
  value: (function () {
8108
- var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8658
+ var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(icePhaseCallback, forceTurnDiscovery, turnServerInfo, iceTransportPolicy) {
8109
8659
  var options,
8110
8660
  LOG_HEADER,
8111
8661
  localStreams,
@@ -8134,7 +8684,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8134
8684
  receiveAudio,
8135
8685
  ipver,
8136
8686
  _this$remoteMediaMana,
8137
- _yield$this$mediaProp,
8687
+ _yield$this$mediaProp2,
8138
8688
  connectionType,
8139
8689
  ipVersion,
8140
8690
  selectedCandidatePairChanges,
@@ -8163,30 +8713,33 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8163
8713
  _this$mediaProperties33,
8164
8714
  _this$mediaProperties34,
8165
8715
  _reachabilityMetrics,
8166
- _yield$this$mediaProp2,
8716
+ _ref43,
8717
+ _connectionType,
8167
8718
  _selectedCandidatePairChanges,
8168
8719
  _numTransports,
8169
8720
  _iceCandidateErrors,
8170
- _args35 = arguments,
8171
- _t34,
8172
- _t35;
8173
- return _regenerator.default.wrap(function (_context35) {
8174
- while (1) switch (_context35.prev = _context35.next) {
8721
+ _args38 = arguments,
8722
+ _t36,
8723
+ _t37,
8724
+ _t38;
8725
+ return _regenerator.default.wrap(function (_context38) {
8726
+ while (1) switch (_context38.prev = _context38.next) {
8175
8727
  case 0:
8176
- options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
8728
+ options = _args38.length > 4 && _args38[4] !== undefined ? _args38[4] : {};
8177
8729
  this.addMediaData.retriedWithTurnServer = false;
8178
8730
  this.addMediaData.icePhaseCallback = icePhaseCallback;
8731
+ this.addMediaData.iceTransportPolicy = iceTransportPolicy;
8179
8732
  this.hasMediaConnectionConnectedAtLeastOnce = false;
8180
8733
  LOG_HEADER = 'Meeting:index#addMedia -->';
8181
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
8734
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery, ", iceTransportPolicy=").concat(iceTransportPolicy));
8182
8735
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
8183
- _context35.next = 1;
8736
+ _context38.next = 1;
8184
8737
  break;
8185
8738
  }
8186
8739
  throw new _webexErrors.MeetingNotActiveError();
8187
8740
  case 1:
8188
8741
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
8189
- _context35.next = 2;
8742
+ _context38.next = 2;
8190
8743
  break;
8191
8744
  }
8192
8745
  throw new _webexErrors.UserNotJoinedError();
@@ -8203,7 +8756,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8203
8756
  ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
8204
8757
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
8205
8758
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
8206
- _context35.next = 3;
8759
+ _context38.next = 3;
8207
8760
  break;
8208
8761
  }
8209
8762
  throw new _webexErrors.UserInLobbyError();
@@ -8247,62 +8800,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8247
8800
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
8248
8801
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
8249
8802
  this.brbState = (0, _brbState.createBrbState)(this, false);
8250
- _context35.prev = 4;
8803
+ _context38.prev = 4;
8251
8804
  if (!(allowPublishMediaInLobby || !this.isUserUnadmitted)) {
8252
- _context35.next = 5;
8805
+ _context38.next = 5;
8253
8806
  break;
8254
8807
  }
8255
- _context35.next = 5;
8808
+ _context38.next = 5;
8256
8809
  return this.setUpLocalStreamReferences(localStreams);
8257
8810
  case 5:
8258
8811
  this.setMercuryListener();
8259
8812
  this.createStatsAnalyzer();
8260
- _context35.prev = 6;
8261
- _context35.next = 7;
8813
+ _context38.prev = 6;
8814
+ _context38.next = 7;
8262
8815
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
8263
8816
  case 7:
8264
- _context35.next = 12;
8817
+ _context38.next = 12;
8265
8818
  break;
8266
8819
  case 8:
8267
- _context35.prev = 8;
8268
- _t34 = _context35["catch"](6);
8269
- if (!(_t34 instanceof _multistreamNotSupportedError.default)) {
8270
- _context35.next = 11;
8820
+ _context38.prev = 8;
8821
+ _t36 = _context38["catch"](6);
8822
+ if (!(_t36 instanceof _multistreamNotSupportedError.default)) {
8823
+ _context38.next = 11;
8271
8824
  break;
8272
8825
  }
8273
8826
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
8274
- _context35.next = 9;
8827
+ _context38.next = 9;
8275
8828
  return this.downgradeFromMultistreamToTranscoded();
8276
8829
  case 9:
8277
- _context35.next = 10;
8278
- return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
8830
+ _context38.next = 10;
8831
+ return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
8279
8832
  case 10:
8280
- _context35.next = 12;
8833
+ _context38.next = 12;
8281
8834
  break;
8282
8835
  case 11:
8283
- throw _t34;
8836
+ throw _t36;
8284
8837
  case 12:
8285
8838
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
8286
8839
  if (!this.mediaProperties.hasLocalShareStream()) {
8287
- _context35.next = 13;
8840
+ _context38.next = 13;
8288
8841
  break;
8289
8842
  }
8290
- _context35.next = 13;
8843
+ _context38.next = 13;
8291
8844
  return this.enqueueScreenShareFloorRequest();
8292
8845
  case 13:
8293
- _context35.next = 14;
8846
+ _context38.next = 14;
8294
8847
  return this.mediaProperties.getCurrentConnectionInfo();
8295
8848
  case 14:
8296
- _yield$this$mediaProp = _context35.sent;
8297
- connectionType = _yield$this$mediaProp.connectionType;
8298
- ipVersion = _yield$this$mediaProp.ipVersion;
8299
- selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8300
- numTransports = _yield$this$mediaProp.numTransports;
8849
+ _yield$this$mediaProp2 = _context38.sent;
8850
+ connectionType = _yield$this$mediaProp2.connectionType;
8851
+ ipVersion = _yield$this$mediaProp2.ipVersion;
8852
+ selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8853
+ numTransports = _yield$this$mediaProp2.numTransports;
8301
8854
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8302
- _context35.next = 15;
8855
+ _context38.next = 15;
8303
8856
  return this.getMediaReachabilityMetricFields();
8304
8857
  case 15:
8305
- reachabilityMetrics = _context35.sent;
8858
+ reachabilityMetrics = _context38.sent;
8306
8859
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
8307
8860
  correlation_id: this.correlationId,
8308
8861
  locus_id: this.locusUrl.split('/').pop(),
@@ -8313,7 +8866,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8313
8866
  numTransports: numTransports,
8314
8867
  isMultistream: this.isMultistream,
8315
8868
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
8316
- isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry
8869
+ isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
8870
+ iceTransportPolicy: this.addMediaData.iceTransportPolicy || 'all'
8317
8871
  }, reachabilityMetrics), iceCandidateErrors), {}, {
8318
8872
  iceCandidatesCount: this.iceCandidatesCount
8319
8873
  }));
@@ -8332,70 +8886,83 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8332
8886
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
8333
8887
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
8334
8888
  this.startPeriodicLogUpload();
8335
- _context35.next = 20;
8889
+ _context38.next = 22;
8336
8890
  break;
8337
8891
  case 16:
8338
- _context35.prev = 16;
8339
- _t35 = _context35["catch"](4);
8340
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t35);
8892
+ _context38.prev = 16;
8893
+ _t37 = _context38["catch"](4);
8894
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t37);
8341
8895
 
8342
8896
  // @ts-ignore
8343
- _context35.next = 17;
8897
+ _context38.next = 17;
8344
8898
  return this.getMediaReachabilityMetricFields();
8345
8899
  case 17:
8346
- _reachabilityMetrics = _context35.sent;
8347
- _context35.next = 18;
8348
- return this.mediaProperties.getCurrentConnectionInfo();
8900
+ _reachabilityMetrics = _context38.sent;
8901
+ if (!(_t37 instanceof _webexErrors.AddMediaFailed)) {
8902
+ _context38.next = 18;
8903
+ break;
8904
+ }
8905
+ _t38 = _t37;
8906
+ _context38.next = 20;
8907
+ break;
8349
8908
  case 18:
8350
- _yield$this$mediaProp2 = _context35.sent;
8351
- _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8352
- _numTransports = _yield$this$mediaProp2.numTransports;
8909
+ _context38.next = 19;
8910
+ return this.mediaProperties.getCurrentConnectionInfo();
8911
+ case 19:
8912
+ _t38 = _context38.sent;
8913
+ case 20:
8914
+ _ref43 = _t38;
8915
+ _connectionType = _ref43.connectionType;
8916
+ _selectedCandidatePairChanges = _ref43.selectedCandidatePairChanges;
8917
+ _numTransports = _ref43.numTransports;
8353
8918
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8354
8919
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
8355
8920
  correlation_id: this.correlationId,
8356
8921
  locus_id: this.locusUrl.split('/').pop(),
8357
- reason: _t35.message,
8358
- stack: _t35.stack,
8359
- code: _t35.code,
8922
+ reason: _t37.message,
8923
+ stack: _t37.stack,
8924
+ code: _t37.code,
8360
8925
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
8361
8926
  numTransports: _numTransports,
8362
8927
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
8363
8928
  turnServerUsed: this.turnServerUsed,
8364
8929
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
8365
8930
  isMultistream: this.isMultistream,
8366
- isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry,
8931
+ isJoinWithMediaRetry: this.joinWithMediaRetryInfo.retryCount > 0,
8932
+ iceTransportPolicy: this.addMediaData.iceTransportPolicy || 'all',
8367
8933
  signalingState: ((_this$mediaProperties14 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.multistreamConnection) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : (_this$mediaProperties17 = _this$mediaProperties16.pc) === null || _this$mediaProperties17 === void 0 ? void 0 : _this$mediaProperties17.signalingState) || ((_this$mediaProperties18 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.mediaConnection) === null || _this$mediaProperties19 === void 0 ? void 0 : (_this$mediaProperties20 = _this$mediaProperties19.pc) === null || _this$mediaProperties20 === void 0 ? void 0 : _this$mediaProperties20.signalingState) || 'unknown',
8368
8934
  connectionState: ((_this$mediaProperties21 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties21 === void 0 ? void 0 : (_this$mediaProperties22 = _this$mediaProperties21.multistreamConnection) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.pc) === null || _this$mediaProperties23 === void 0 ? void 0 : (_this$mediaProperties24 = _this$mediaProperties23.pc) === null || _this$mediaProperties24 === void 0 ? void 0 : _this$mediaProperties24.connectionState) || ((_this$mediaProperties25 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties25 === void 0 ? void 0 : (_this$mediaProperties26 = _this$mediaProperties25.mediaConnection) === null || _this$mediaProperties26 === void 0 ? void 0 : (_this$mediaProperties27 = _this$mediaProperties26.pc) === null || _this$mediaProperties27 === void 0 ? void 0 : _this$mediaProperties27.connectionState) || 'unknown',
8369
- iceConnectionState: ((_this$mediaProperties28 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.multistreamConnection) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : (_this$mediaProperties31 = _this$mediaProperties30.pc) === null || _this$mediaProperties31 === void 0 ? void 0 : _this$mediaProperties31.iceConnectionState) || ((_this$mediaProperties32 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.mediaConnection) === null || _this$mediaProperties33 === void 0 ? void 0 : (_this$mediaProperties34 = _this$mediaProperties33.pc) === null || _this$mediaProperties34 === void 0 ? void 0 : _this$mediaProperties34.iceConnectionState) || 'unknown'
8935
+ iceConnectionState: ((_this$mediaProperties28 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.multistreamConnection) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : (_this$mediaProperties31 = _this$mediaProperties30.pc) === null || _this$mediaProperties31 === void 0 ? void 0 : _this$mediaProperties31.iceConnectionState) || ((_this$mediaProperties32 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.mediaConnection) === null || _this$mediaProperties33 === void 0 ? void 0 : (_this$mediaProperties34 = _this$mediaProperties33.pc) === null || _this$mediaProperties34 === void 0 ? void 0 : _this$mediaProperties34.iceConnectionState) || 'unknown',
8936
+ connectionType: _connectionType
8370
8937
  }, _reachabilityMetrics), _iceCandidateErrors), {}, {
8371
8938
  iceCandidatesCount: this.iceCandidatesCount,
8372
8939
  ipver: ipver
8373
8940
  }));
8374
- _context35.next = 19;
8941
+ _context38.next = 21;
8375
8942
  return this.cleanUpOnAddMediaFailure();
8376
- case 19:
8943
+ case 21:
8377
8944
  // Upload logs on error while adding media
8378
8945
  _triggerProxy.default.trigger(this, {
8379
8946
  file: 'meeting/index',
8380
8947
  function: 'addMedia'
8381
8948
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
8382
- if (_t35 instanceof _internalMediaCore.Errors.SdpError) {
8949
+ if (_t37 instanceof _internalMediaCore.Errors.SdpError) {
8383
8950
  this.leave({
8384
8951
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
8385
8952
  });
8386
8953
  }
8387
- throw _t35;
8388
- case 20:
8389
- _context35.prev = 20;
8954
+ throw _t37;
8955
+ case 22:
8956
+ _context38.prev = 22;
8390
8957
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
8391
- return _context35.finish(20);
8392
- case 21:
8958
+ return _context38.finish(22);
8959
+ case 23:
8393
8960
  case "end":
8394
- return _context35.stop();
8961
+ return _context38.stop();
8395
8962
  }
8396
- }, _callee35, this, [[4, 16, 20, 21], [6, 8]]);
8963
+ }, _callee38, this, [[4, 16, 22, 23], [6, 8]]);
8397
8964
  }));
8398
- function addMediaInternal(_x30, _x31, _x32) {
8965
+ function addMediaInternal(_x34, _x35, _x36, _x37) {
8399
8966
  return _addMediaInternal.apply(this, arguments);
8400
8967
  }
8401
8968
  return addMediaInternal;
@@ -8425,7 +8992,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8425
8992
  * @memberof Meeting
8426
8993
  */
8427
8994
  function enqueueMediaUpdate(mediaUpdateType) {
8428
- var _this46 = this;
8995
+ var _this48 = this;
8429
8996
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8430
8997
  var canUpdateMediaNow = this.canUpdateMedia();
8431
8998
  return new _promise.default(function (resolve, reject) {
@@ -8436,9 +9003,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8436
9003
  options: options
8437
9004
  };
8438
9005
  _loggerProxy.default.logger.log("Meeting:index#enqueueMediaUpdate --> enqueuing media update type=".concat(mediaUpdateType));
8439
- _this46.queuedMediaUpdates.push(queueItem);
9006
+ _this48.queuedMediaUpdates.push(queueItem);
8440
9007
  if (canUpdateMediaNow) {
8441
- _this46.processNextQueuedMediaUpdate();
9008
+ _this48.processNextQueuedMediaUpdate();
8442
9009
  }
8443
9010
  });
8444
9011
  }
@@ -8461,35 +9028,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8461
9028
  * @memberof Meeting
8462
9029
  */
8463
9030
  function () {
8464
- var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
9031
+ var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(options) {
8465
9032
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
8466
- return _regenerator.default.wrap(function (_context36) {
8467
- while (1) switch (_context36.prev = _context36.next) {
9033
+ return _regenerator.default.wrap(function (_context39) {
9034
+ while (1) switch (_context39.prev = _context39.next) {
8468
9035
  case 0:
8469
9036
  this.checkMediaConnection();
8470
9037
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
8471
9038
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
8472
9039
  if (this.canUpdateMedia()) {
8473
- _context36.next = 1;
9040
+ _context39.next = 1;
8474
9041
  break;
8475
9042
  }
8476
- return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
9043
+ return _context39.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8477
9044
  case 1:
8478
9045
  if (!this.isMultistream) {
8479
- _context36.next = 3;
9046
+ _context39.next = 3;
8480
9047
  break;
8481
9048
  }
8482
9049
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
8483
- _context36.next = 2;
9050
+ _context39.next = 2;
8484
9051
  break;
8485
9052
  }
8486
9053
  throw new Error('toggling shareAudioEnabled or shareVideoEnabled in a multistream meeting is not supported, to control receiving screen share call meeting.remoteMediaManager.setLayout() with appropriate layout');
8487
9054
  case 2:
8488
- _context36.next = 4;
9055
+ _context39.next = 4;
8489
9056
  break;
8490
9057
  case 3:
8491
9058
  if (!(shareAudioEnabled !== undefined)) {
8492
- _context36.next = 4;
9059
+ _context39.next = 4;
8493
9060
  break;
8494
9061
  }
8495
9062
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -8514,20 +9081,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8514
9081
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
8515
9082
  }
8516
9083
  if (this.isMultistream) {
8517
- _context36.next = 5;
9084
+ _context39.next = 5;
8518
9085
  break;
8519
9086
  }
8520
- _context36.next = 5;
9087
+ _context39.next = 5;
8521
9088
  return this.updateTranscodedMediaConnection();
8522
9089
  case 5:
8523
- return _context36.abrupt("return", undefined);
9090
+ return _context39.abrupt("return", undefined);
8524
9091
  case 6:
8525
9092
  case "end":
8526
- return _context36.stop();
9093
+ return _context39.stop();
8527
9094
  }
8528
- }, _callee36, this);
9095
+ }, _callee39, this);
8529
9096
  }));
8530
- function updateMedia(_x33) {
9097
+ function updateMedia(_x38) {
8531
9098
  return _updateMedia.apply(this, arguments);
8532
9099
  }
8533
9100
  return updateMedia;
@@ -8543,7 +9110,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8543
9110
  }, {
8544
9111
  key: "acknowledge",
8545
9112
  value: function acknowledge(type) {
8546
- var _this47 = this;
9113
+ var _this49 = this;
8547
9114
  if (!type) {
8548
9115
  return _promise.default.reject(new _parameter.default('Type must be set to acknowledge the meeting.'));
8549
9116
  }
@@ -8555,12 +9122,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8555
9122
  }).then(function (response) {
8556
9123
  return _promise.default.resolve(response);
8557
9124
  }).then(function (response) {
8558
- _this47.meetingFiniteStateMachine.ring(type);
9125
+ _this49.meetingFiniteStateMachine.ring(type);
8559
9126
  // @ts-ignore
8560
- _this47.webex.internal.newMetrics.submitClientEvent({
9127
+ _this49.webex.internal.newMetrics.submitClientEvent({
8561
9128
  name: 'client.alert.displayed',
8562
9129
  options: {
8563
- meetingId: _this47.id
9130
+ meetingId: _this49.id
8564
9131
  }
8565
9132
  });
8566
9133
  return _promise.default.resolve({
@@ -8585,12 +9152,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8585
9152
  }, {
8586
9153
  key: "decline",
8587
9154
  value: function decline(reason) {
8588
- var _this48 = this;
9155
+ var _this50 = this;
8589
9156
  return _util2.default.declineMeeting(this, reason).then(function (decline) {
8590
- _this48.meetingFiniteStateMachine.decline();
9157
+ _this50.meetingFiniteStateMachine.decline();
8591
9158
  return _promise.default.resolve(decline);
8592
9159
  }).catch(function (error) {
8593
- _this48.meetingFiniteStateMachine.fail(error);
9160
+ _this50.meetingFiniteStateMachine.fail(error);
8594
9161
  return _promise.default.reject(error);
8595
9162
  });
8596
9163
  }
@@ -8641,7 +9208,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8641
9208
  }, {
8642
9209
  key: "leave",
8643
9210
  value: function leave() {
8644
- var _this49 = this;
9211
+ var _this51 = this;
8645
9212
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8646
9213
  var leaveReason = options.reason || _constants.MEETING_REMOVED_REASON.CLIENT_LEAVE_REQUEST;
8647
9214
 
@@ -8653,7 +9220,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8653
9220
  var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8654
9221
  return (
8655
9222
  // @ts-ignore
8656
- _this49.webex.internal.newMetrics.submitClientEvent({
9223
+ _this51.webex.internal.newMetrics.submitClientEvent({
8657
9224
  name: 'client.call.leave',
8658
9225
  payload: _objectSpread({
8659
9226
  trigger: 'user-interaction',
@@ -8661,50 +9228,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8661
9228
  leaveReason: options.clientEventLeaveReason
8662
9229
  }, payload),
8663
9230
  options: {
8664
- meetingId: _this49.id
9231
+ meetingId: _this51.id
8665
9232
  }
8666
9233
  })
8667
9234
  );
8668
9235
  };
8669
9236
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
9237
+ this.stopListeningForMeetingEvents();
8670
9238
  return _util2.default.leaveMeeting(this, options).then(/*#__PURE__*/function () {
8671
- var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(leave) {
8672
- return _regenerator.default.wrap(function (_context37) {
8673
- while (1) switch (_context37.prev = _context37.next) {
9239
+ var _ref44 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(leave) {
9240
+ return _regenerator.default.wrap(function (_context40) {
9241
+ while (1) switch (_context40.prev = _context40.next) {
8674
9242
  case 0:
8675
9243
  // CA team recommends submitting this *after* locus /leave
8676
9244
  submitLeaveMetric();
8677
- _this49.meetingFiniteStateMachine.leave();
8678
- _context37.next = 1;
8679
- return _this49.clearMeetingData();
9245
+ _this51.meetingFiniteStateMachine.leave();
9246
+ _context40.next = 1;
9247
+ return _this51.clearMeetingData();
8680
9248
  case 1:
8681
9249
  // upload logs on leave irrespective of meeting delete
8682
- _triggerProxy.default.trigger(_this49, {
9250
+ _triggerProxy.default.trigger(_this51, {
8683
9251
  file: 'meeting/index',
8684
9252
  function: 'leave'
8685
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
9253
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this51);
8686
9254
 
8687
9255
  // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
8688
- if (_this49.wirelessShare || _this49.guest) {
9256
+ if (_this51.wirelessShare || _this51.guest) {
8689
9257
  // If screen sharing clean the meeting object
8690
- _triggerProxy.default.trigger(_this49, {
9258
+ _triggerProxy.default.trigger(_this51, {
8691
9259
  file: 'meeting/index',
8692
9260
  function: 'leave'
8693
9261
  }, _constants.EVENTS.DESTROY_MEETING, {
8694
9262
  reason: options.reason,
8695
- meetingId: _this49.id
9263
+ meetingId: _this51.id
8696
9264
  });
8697
9265
  }
8698
9266
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
8699
- return _context37.abrupt("return", leave);
9267
+ return _context40.abrupt("return", leave);
8700
9268
  case 2:
8701
9269
  case "end":
8702
- return _context37.stop();
9270
+ return _context40.stop();
8703
9271
  }
8704
- }, _callee37);
9272
+ }, _callee40);
8705
9273
  }));
8706
- return function (_x34) {
8707
- return _ref41.apply(this, arguments);
9274
+ return function (_x39) {
9275
+ return _ref44.apply(this, arguments);
8708
9276
  };
8709
9277
  }()).catch(function (error) {
8710
9278
  // CA team recommends submitting this *after* locus /leave
@@ -8718,16 +9286,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8718
9286
  shownToUser: false
8719
9287
  }]
8720
9288
  });
8721
- _this49.meetingFiniteStateMachine.fail(error);
9289
+ _this51.meetingFiniteStateMachine.fail(error);
8722
9290
  _loggerProxy.default.logger.error('Meeting:index#leave --> Failed to leave ', error);
8723
9291
  // upload logs on leave irrespective of meeting delete
8724
- _triggerProxy.default.trigger(_this49, {
9292
+ _triggerProxy.default.trigger(_this51, {
8725
9293
  file: 'meeting/index',
8726
9294
  function: 'leave'
8727
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
9295
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this51);
8728
9296
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_LEAVE_FAILURE, {
8729
- correlation_id: _this49.correlationId,
8730
- locus_id: _this49.locusUrl.split('/').pop(),
9297
+ correlation_id: _this51.correlationId,
9298
+ locus_id: _this51.locusUrl.split('/').pop(),
8731
9299
  reason: error.message,
8732
9300
  stack: error.stack,
8733
9301
  code: error.code
@@ -8747,7 +9315,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8747
9315
  }, {
8748
9316
  key: "startWhiteboardShare",
8749
9317
  value: function startWhiteboardShare(channelUrl, resourceToken) {
8750
- var _this50 = this;
9318
+ var _this52 = this;
8751
9319
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
8752
9320
  return element.name === 'whiteboard';
8753
9321
  });
@@ -8780,13 +9348,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8780
9348
  body.resourceToken = resourceToken;
8781
9349
  }
8782
9350
  return this.meetingRequest.changeMeetingFloor(body).then(function () {
8783
- _this50.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
9351
+ _this52.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
8784
9352
  return _promise.default.resolve();
8785
9353
  }).catch(function (error) {
8786
9354
  _loggerProxy.default.logger.error('Meeting:index#startWhiteboardShare --> Error ', error);
8787
9355
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_START_WHITEBOARD_SHARE_FAILURE, {
8788
- correlation_id: _this50.correlationId,
8789
- locus_id: _this50.locusUrl.split('/').pop(),
9356
+ correlation_id: _this52.correlationId,
9357
+ locus_id: _this52.locusUrl.split('/').pop(),
8790
9358
  reason: error.message,
8791
9359
  stack: error.stack,
8792
9360
  board: {
@@ -8809,7 +9377,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8809
9377
  }, {
8810
9378
  key: "stopWhiteboardShare",
8811
9379
  value: function stopWhiteboardShare(channelUrl) {
8812
- var _this51 = this;
9380
+ var _this53 = this;
8813
9381
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
8814
9382
  return element.name === 'whiteboard';
8815
9383
  });
@@ -8838,8 +9406,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8838
9406
  }).catch(function (error) {
8839
9407
  _loggerProxy.default.logger.error('Meeting:index#stopWhiteboardShare --> Error ', error);
8840
9408
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_STOP_WHITEBOARD_SHARE_FAILURE, {
8841
- correlation_id: _this51.correlationId,
8842
- locus_id: _this51.locusUrl.split('/').pop(),
9409
+ correlation_id: _this53.correlationId,
9410
+ locus_id: _this53.locusUrl.split('/').pop(),
8843
9411
  reason: error.message,
8844
9412
  stack: error.stack,
8845
9413
  board: {
@@ -8861,7 +9429,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8861
9429
  }, {
8862
9430
  key: "requestScreenShareFloor",
8863
9431
  value: function requestScreenShareFloor() {
8864
- var _this52 = this;
9432
+ var _this54 = this;
8865
9433
  if (!this.mediaProperties.hasLocalShareStream() || !this.mediaProperties.mediaDirection.sendShare) {
8866
9434
  _loggerProxy.default.logger.log("Meeting:index#requestScreenShareFloor --> NOT requesting floor, because we don't have the share stream anymore (shareStream=".concat(this.mediaProperties.shareVideoStream ? 'yes' : 'no', ", sendShare=").concat(this.mediaProperties.mediaDirection.sendShare, ")"));
8867
9435
  this.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
@@ -8892,34 +9460,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8892
9460
  resourceUrl: this.resourceUrl,
8893
9461
  shareInstanceId: this.localShareInstanceId
8894
9462
  }).then(function () {
8895
- _this52.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
9463
+ _this54.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
8896
9464
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
8897
- correlation_id: _this52.correlationId,
8898
- locus_id: _this52.locusUrl.split('/').pop()
9465
+ correlation_id: _this54.correlationId,
9466
+ locus_id: _this54.locusUrl.split('/').pop()
8899
9467
  });
8900
9468
  return _promise.default.resolve();
8901
9469
  }).catch(function (error) {
8902
9470
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
8903
9471
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_FAILURE, {
8904
- correlation_id: _this52.correlationId,
8905
- locus_id: _this52.locusUrl.split('/').pop(),
9472
+ correlation_id: _this54.correlationId,
9473
+ locus_id: _this54.locusUrl.split('/').pop(),
8906
9474
  reason: error.message,
8907
9475
  stack: error.stack
8908
9476
  });
8909
9477
 
8910
9478
  // @ts-ignore
8911
- _this52.webex.internal.newMetrics.submitClientEvent({
9479
+ _this54.webex.internal.newMetrics.submitClientEvent({
8912
9480
  name: 'client.share.floor-granted.local',
8913
9481
  payload: {
8914
9482
  mediaType: 'share',
8915
9483
  errors: _util2.default.getChangeMeetingFloorErrorPayload(error.message),
8916
- shareInstanceId: _this52.localShareInstanceId
9484
+ shareInstanceId: _this54.localShareInstanceId
8917
9485
  },
8918
9486
  options: {
8919
- meetingId: _this52.id
9487
+ meetingId: _this54.id
8920
9488
  }
8921
9489
  });
8922
- _this52.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
9490
+ _this54.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
8923
9491
  return _promise.default.reject(error);
8924
9492
  });
8925
9493
  }
@@ -8942,10 +9510,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8942
9510
  }, {
8943
9511
  key: "requestScreenShareFloorIfPending",
8944
9512
  value: function requestScreenShareFloorIfPending() {
8945
- var _this53 = this;
9513
+ var _this55 = this;
8946
9514
  if (this.floorGrantPending && this.state === _constants.MEETING_STATE.STATES.JOINED) {
8947
9515
  this.requestScreenShareFloor().then(function () {
8948
- _this53.floorGrantPending = false;
9516
+ _this55.floorGrantPending = false;
8949
9517
  });
8950
9518
  }
8951
9519
  }
@@ -8959,7 +9527,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8959
9527
  }, {
8960
9528
  key: "releaseScreenShareFloor",
8961
9529
  value: function releaseScreenShareFloor() {
8962
- var _this54 = this;
9530
+ var _this56 = this;
8963
9531
  var content = this.locusInfo.mediaShares.find(function (element) {
8964
9532
  return element.name === _constants.CONTENT;
8965
9533
  });
@@ -9000,8 +9568,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9000
9568
  }).catch(function (error) {
9001
9569
  _loggerProxy.default.logger.error('Meeting:index#releaseScreenShareFloor --> Error ', error);
9002
9570
  _metrics.default.sendBehavioralMetric(_constants2.default.STOP_FLOOR_REQUEST_FAILURE, {
9003
- correlation_id: _this54.correlationId,
9004
- locus_id: _this54.locusUrl.split('/').pop(),
9571
+ correlation_id: _this56.correlationId,
9572
+ locus_id: _this56.locusUrl.split('/').pop(),
9005
9573
  reason: error.message,
9006
9574
  stack: error.stack
9007
9575
  });
@@ -9181,7 +9749,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9181
9749
  }, {
9182
9750
  key: "changeVideoLayout",
9183
9751
  value: function changeVideoLayout(layoutType) {
9184
- var _this55 = this;
9752
+ var _this57 = this;
9185
9753
  var renderInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9186
9754
  var main = renderInfo.main,
9187
9755
  content = renderInfo.content;
@@ -9235,7 +9803,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9235
9803
  }
9236
9804
  this.lastVideoLayoutInfo = (0, _lodash.cloneDeep)(layoutInfo);
9237
9805
  this.locusInfo.once(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED, function (envelope) {
9238
- _triggerProxy.default.trigger(_this55, {
9806
+ _triggerProxy.default.trigger(_this57, {
9239
9807
  file: 'meeting/index',
9240
9808
  function: 'changeVideoLayout'
9241
9809
  }, _constants.EVENT_TRIGGERS.MEETING_CONTROLS_LAYOUT_UPDATE, {
@@ -9351,7 +9919,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9351
9919
  }, {
9352
9920
  key: "endMeetingForAll",
9353
9921
  value: function endMeetingForAll() {
9354
- var _this56 = this;
9922
+ var _this58 = this;
9355
9923
  // @ts-ignore
9356
9924
  this.webex.internal.newMetrics.submitClientEvent({
9357
9925
  name: 'client.call.leave',
@@ -9368,41 +9936,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9368
9936
  correlation_id: this.correlationId,
9369
9937
  locus_id: this.locusId
9370
9938
  });
9939
+ this.stopListeningForMeetingEvents();
9371
9940
  return _util2.default.endMeetingForAll(this).then(/*#__PURE__*/function () {
9372
- var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(end) {
9373
- return _regenerator.default.wrap(function (_context38) {
9374
- while (1) switch (_context38.prev = _context38.next) {
9941
+ var _ref45 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(end) {
9942
+ return _regenerator.default.wrap(function (_context41) {
9943
+ while (1) switch (_context41.prev = _context41.next) {
9375
9944
  case 0:
9376
- _this56.meetingFiniteStateMachine.end();
9377
- _context38.next = 1;
9378
- return _this56.clearMeetingData();
9945
+ _this58.meetingFiniteStateMachine.end();
9946
+ _context41.next = 1;
9947
+ return _this58.clearMeetingData();
9379
9948
  case 1:
9380
9949
  // upload logs on leave irrespective of meeting delete
9381
- _triggerProxy.default.trigger(_this56, {
9950
+ _triggerProxy.default.trigger(_this58, {
9382
9951
  file: 'meeting/index',
9383
9952
  function: 'endMeetingForAll'
9384
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9385
- return _context38.abrupt("return", end);
9953
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this58);
9954
+ return _context41.abrupt("return", end);
9386
9955
  case 2:
9387
9956
  case "end":
9388
- return _context38.stop();
9957
+ return _context41.stop();
9389
9958
  }
9390
- }, _callee38);
9959
+ }, _callee41);
9391
9960
  }));
9392
- return function (_x35) {
9393
- return _ref42.apply(this, arguments);
9961
+ return function (_x40) {
9962
+ return _ref45.apply(this, arguments);
9394
9963
  };
9395
9964
  }()).catch(function (error) {
9396
- _this56.meetingFiniteStateMachine.fail(error);
9965
+ _this58.meetingFiniteStateMachine.fail(error);
9397
9966
  _loggerProxy.default.logger.error('Meeting:index#endMeetingForAll --> Failed to end meeting ', error);
9398
9967
  // upload logs on leave irrespective of meeting delete
9399
- _triggerProxy.default.trigger(_this56, {
9968
+ _triggerProxy.default.trigger(_this58, {
9400
9969
  file: 'meeting/index',
9401
9970
  function: 'endMeetingForAll'
9402
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9971
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this58);
9403
9972
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_END_ALL_FAILURE, {
9404
- correlation_id: _this56.correlationId,
9405
- locus_id: _this56.locusUrl.split('/').pop(),
9973
+ correlation_id: _this58.correlationId,
9974
+ locus_id: _this58.locusUrl.split('/').pop(),
9406
9975
  reason: error.message,
9407
9976
  stack: error.stack,
9408
9977
  code: error.code
@@ -9423,13 +9992,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9423
9992
  * @memberof Meeting
9424
9993
  */
9425
9994
  function sendReaction(reactionType, skinToneType) {
9426
- var _this$locusInfo7, _this$locusInfo7$cont, _this$locusInfo7$cont2;
9427
- var reactionChannelUrl = (_this$locusInfo7 = this.locusInfo) === null || _this$locusInfo7 === void 0 ? void 0 : (_this$locusInfo7$cont = _this$locusInfo7.controls) === null || _this$locusInfo7$cont === void 0 ? void 0 : (_this$locusInfo7$cont2 = _this$locusInfo7$cont.reactions) === null || _this$locusInfo7$cont2 === void 0 ? void 0 : _this$locusInfo7$cont2.reactionChannelUrl;
9995
+ var _this$locusInfo9, _this$locusInfo9$cont, _this$locusInfo9$cont2;
9996
+ var reactionChannelUrl = (_this$locusInfo9 = this.locusInfo) === null || _this$locusInfo9 === void 0 ? void 0 : (_this$locusInfo9$cont = _this$locusInfo9.controls) === null || _this$locusInfo9$cont === void 0 ? void 0 : (_this$locusInfo9$cont2 = _this$locusInfo9$cont.reactions) === null || _this$locusInfo9$cont2 === void 0 ? void 0 : _this$locusInfo9$cont2.reactionChannelUrl;
9428
9997
  var participantId = this.members.selfId;
9429
- var reactionData = _reactions.Reactions[reactionType];
9430
- if (!reactionData) {
9431
- return _promise.default.reject(new Error("".concat(reactionType, " is not a valid reaction.")));
9432
- }
9998
+ var reactionData = _reactions.Reactions[reactionType] || {
9999
+ type: reactionType
10000
+ };
9433
10001
  var skinToneData = _reactions.SkinTones[skinToneType] || _reactions.SkinTones.normal;
9434
10002
  var reaction = _objectSpread(_objectSpread({}, reactionData), {}, {
9435
10003
  tone: skinToneData
@@ -9454,12 +10022,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9454
10022
  */
9455
10023
  }, {
9456
10024
  key: "extendMeeting",
9457
- value: function extendMeeting(_ref43) {
9458
- var meetingPolicyUrl = _ref43.meetingPolicyUrl,
9459
- meetingInstanceId = _ref43.meetingInstanceId,
9460
- participantId = _ref43.participantId,
9461
- _ref43$extensionMinut = _ref43.extensionMinutes,
9462
- extensionMinutes = _ref43$extensionMinut === void 0 ? 30 : _ref43$extensionMinut;
10025
+ value: function extendMeeting(_ref46) {
10026
+ var meetingPolicyUrl = _ref46.meetingPolicyUrl,
10027
+ meetingInstanceId = _ref46.meetingInstanceId,
10028
+ participantId = _ref46.participantId,
10029
+ _ref46$extensionMinut = _ref46.extensionMinutes,
10030
+ extensionMinutes = _ref46$extensionMinut === void 0 ? 30 : _ref46$extensionMinut;
9463
10031
  if (!meetingInstanceId || !participantId) {
9464
10032
  return _promise.default.reject(new Error('Missing meetingInstanceId or participantId'));
9465
10033
  }
@@ -9485,8 +10053,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9485
10053
  }, {
9486
10054
  key: "toggleReactions",
9487
10055
  value: function toggleReactions(enable) {
9488
- var _this$locusInfo8, _this$locusInfo8$cont, _this$locusInfo8$cont2;
9489
- var isEnabled = (_this$locusInfo8 = this.locusInfo) === null || _this$locusInfo8 === void 0 ? void 0 : (_this$locusInfo8$cont = _this$locusInfo8.controls) === null || _this$locusInfo8$cont === void 0 ? void 0 : (_this$locusInfo8$cont2 = _this$locusInfo8$cont.reactions) === null || _this$locusInfo8$cont2 === void 0 ? void 0 : _this$locusInfo8$cont2.enabled;
10056
+ var _this$locusInfo0, _this$locusInfo0$cont, _this$locusInfo0$cont2;
10057
+ var isEnabled = (_this$locusInfo0 = this.locusInfo) === null || _this$locusInfo0 === void 0 ? void 0 : (_this$locusInfo0$cont = _this$locusInfo0.controls) === null || _this$locusInfo0$cont === void 0 ? void 0 : (_this$locusInfo0$cont2 = _this$locusInfo0$cont.reactions) === null || _this$locusInfo0$cont2 === void 0 ? void 0 : _this$locusInfo0$cont2.enabled;
9490
10058
  if (isEnabled && enable || !isEnabled && !enable) {
9491
10059
  return _promise.default.resolve("Reactions are already ".concat(isEnabled ? 'enabled' : 'disabled', "."));
9492
10060
  }
@@ -9540,39 +10108,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9540
10108
  }, {
9541
10109
  key: "enableMusicMode",
9542
10110
  value: (function () {
9543
- var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(shouldEnableMusicMode) {
9544
- return _regenerator.default.wrap(function (_context39) {
9545
- while (1) switch (_context39.prev = _context39.next) {
10111
+ var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(shouldEnableMusicMode) {
10112
+ return _regenerator.default.wrap(function (_context42) {
10113
+ while (1) switch (_context42.prev = _context42.next) {
9546
10114
  case 0:
9547
10115
  this.checkMediaConnection();
9548
10116
  if (this.isMultistream) {
9549
- _context39.next = 1;
10117
+ _context42.next = 1;
9550
10118
  break;
9551
10119
  }
9552
10120
  throw new Error('enableMusicMode() only supported with multistream');
9553
10121
  case 1:
9554
10122
  if (!shouldEnableMusicMode) {
9555
- _context39.next = 3;
10123
+ _context42.next = 3;
9556
10124
  break;
9557
10125
  }
9558
- _context39.next = 2;
10126
+ _context42.next = 2;
9559
10127
  return this.sendSlotManager.setCustomCodecParameters(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, {
9560
10128
  maxaveragebitrate: '64000',
9561
10129
  maxplaybackrate: '48000'
9562
10130
  });
9563
10131
  case 2:
9564
- _context39.next = 4;
10132
+ _context42.next = 4;
9565
10133
  break;
9566
10134
  case 3:
9567
- _context39.next = 4;
10135
+ _context42.next = 4;
9568
10136
  return this.sendSlotManager.markCustomCodecParametersForDeletion(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, ['maxaveragebitrate', 'maxplaybackrate']);
9569
10137
  case 4:
9570
10138
  case "end":
9571
- return _context39.stop();
10139
+ return _context42.stop();
9572
10140
  }
9573
- }, _callee39, this);
10141
+ }, _callee42, this);
9574
10142
  }));
9575
- function enableMusicMode(_x36) {
10143
+ function enableMusicMode(_x41) {
9576
10144
  return _enableMusicMode.apply(this, arguments);
9577
10145
  }
9578
10146
  return enableMusicMode;
@@ -9593,7 +10161,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9593
10161
  _this$mediaProperties42,
9594
10162
  _this$mediaProperties43,
9595
10163
  _this$mediaProperties44,
9596
- _this57 = this;
10164
+ _this59 = this;
9597
10165
  var LOG_HEADER = 'Meeting:index#updateTranscodedMediaConnection -->';
9598
10166
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " starting"));
9599
10167
  if (!this.canUpdateMedia()) {
@@ -9618,8 +10186,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9618
10186
  }).catch(function (error) {
9619
10187
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error: "), error);
9620
10188
  _metrics.default.sendBehavioralMetric(_constants2.default.UPDATE_MEDIA_FAILURE, {
9621
- correlation_id: _this57.correlationId,
9622
- locus_id: _this57.locusUrl.split('/').pop(),
10189
+ correlation_id: _this59.correlationId,
10190
+ locus_id: _this59.locusUrl.split('/').pop(),
9623
10191
  reason: error.message,
9624
10192
  stack: error.stack
9625
10193
  });
@@ -9663,25 +10231,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9663
10231
  }, {
9664
10232
  key: "publishStream",
9665
10233
  value: (function () {
9666
- var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(mediaType, stream) {
9667
- return _regenerator.default.wrap(function (_context40) {
9668
- while (1) switch (_context40.prev = _context40.next) {
10234
+ var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(mediaType, stream) {
10235
+ return _regenerator.default.wrap(function (_context43) {
10236
+ while (1) switch (_context43.prev = _context43.next) {
9669
10237
  case 0:
9670
10238
  if (stream) {
9671
- _context40.next = 1;
10239
+ _context43.next = 1;
9672
10240
  break;
9673
10241
  }
9674
- return _context40.abrupt("return");
10242
+ return _context43.abrupt("return");
9675
10243
  case 1:
9676
10244
  if (!this.mediaProperties.webrtcMediaConnection) {
9677
- _context40.next = 3;
10245
+ _context43.next = 3;
9678
10246
  break;
9679
10247
  }
9680
10248
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9681
- _context40.next = 2;
10249
+ _context43.next = 2;
9682
10250
  break;
9683
10251
  }
9684
- _context40.next = 2;
10252
+ _context43.next = 2;
9685
10253
  return this.sendSlotManager.publishStream(mediaType, stream);
9686
10254
  case 2:
9687
10255
  this.emitPublishStateChangeEvent({
@@ -9692,11 +10260,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9692
10260
  });
9693
10261
  case 3:
9694
10262
  case "end":
9695
- return _context40.stop();
10263
+ return _context43.stop();
9696
10264
  }
9697
- }, _callee40, this);
10265
+ }, _callee43, this);
9698
10266
  }));
9699
- function publishStream(_x37, _x38) {
10267
+ function publishStream(_x42, _x43) {
9700
10268
  return _publishStream.apply(this, arguments);
9701
10269
  }
9702
10270
  return publishStream;
@@ -9712,21 +10280,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9712
10280
  }, {
9713
10281
  key: "unpublishStream",
9714
10282
  value: (function () {
9715
- var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9716
- return _regenerator.default.wrap(function (_context41) {
9717
- while (1) switch (_context41.prev = _context41.next) {
10283
+ var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(mediaType, stream) {
10284
+ return _regenerator.default.wrap(function (_context44) {
10285
+ while (1) switch (_context44.prev = _context44.next) {
9718
10286
  case 0:
9719
10287
  if (stream) {
9720
- _context41.next = 1;
10288
+ _context44.next = 1;
9721
10289
  break;
9722
10290
  }
9723
- return _context41.abrupt("return");
10291
+ return _context44.abrupt("return");
9724
10292
  case 1:
9725
10293
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9726
- _context41.next = 2;
10294
+ _context44.next = 2;
9727
10295
  break;
9728
10296
  }
9729
- _context41.next = 2;
10297
+ _context44.next = 2;
9730
10298
  return this.sendSlotManager.unpublishStream(mediaType);
9731
10299
  case 2:
9732
10300
  this.emitPublishStateChangeEvent({
@@ -9737,11 +10305,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9737
10305
  });
9738
10306
  case 3:
9739
10307
  case "end":
9740
- return _context41.stop();
10308
+ return _context44.stop();
9741
10309
  }
9742
- }, _callee41, this);
10310
+ }, _callee44, this);
9743
10311
  }));
9744
- function unpublishStream(_x39, _x40) {
10312
+ function unpublishStream(_x44, _x45) {
9745
10313
  return _unpublishStream.apply(this, arguments);
9746
10314
  }
9747
10315
  return unpublishStream;
@@ -9756,19 +10324,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9756
10324
  }, {
9757
10325
  key: "publishStreams",
9758
10326
  value: (function () {
9759
- var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(streams) {
10327
+ var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45(streams) {
9760
10328
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
9761
10329
  var streamChecks, _i, _streamChecks, _streamChecks$_i, stream, name, floorRequestNeeded, _streams$screenShare7;
9762
- return _regenerator.default.wrap(function (_context42) {
9763
- while (1) switch (_context42.prev = _context42.next) {
10330
+ return _regenerator.default.wrap(function (_context45) {
10331
+ while (1) switch (_context45.prev = _context45.next) {
9764
10332
  case 0:
9765
10333
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9766
10334
  this.checkMediaConnection();
9767
10335
  if (!(!streams.microphone && !streams.camera && !((_streams$screenShare = streams.screenShare) !== null && _streams$screenShare !== void 0 && _streams$screenShare.audio) && !((_streams$screenShare2 = streams.screenShare) !== null && _streams$screenShare2 !== void 0 && _streams$screenShare2.video))) {
9768
- _context42.next = 1;
10336
+ _context45.next = 1;
9769
10337
  break;
9770
10338
  }
9771
- return _context42.abrupt("return");
10339
+ return _context45.abrupt("return");
9772
10340
  case 1:
9773
10341
  streamChecks = [{
9774
10342
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -9786,62 +10354,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9786
10354
  _i = 0, _streamChecks = streamChecks;
9787
10355
  case 2:
9788
10356
  if (!(_i < _streamChecks.length)) {
9789
- _context42.next = 4;
10357
+ _context45.next = 4;
9790
10358
  break;
9791
10359
  }
9792
10360
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
9793
10361
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
9794
- _context42.next = 3;
10362
+ _context45.next = 3;
9795
10363
  break;
9796
10364
  }
9797
10365
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
9798
10366
  case 3:
9799
10367
  _i++;
9800
- _context42.next = 2;
10368
+ _context45.next = 2;
9801
10369
  break;
9802
10370
  case 4:
9803
10371
  floorRequestNeeded = false; // Screenshare Audio is supported only in multi stream. So we check for screenshare audio presence only if it's a multi stream meeting
9804
10372
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
9805
- _context42.next = 6;
10373
+ _context45.next = 6;
9806
10374
  break;
9807
10375
  }
9808
- _context42.next = 5;
10376
+ _context45.next = 5;
9809
10377
  return this.setLocalShareAudioStream(streams.screenShare.audio);
9810
10378
  case 5:
9811
10379
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9812
10380
  case 6:
9813
10381
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
9814
- _context42.next = 8;
10382
+ _context45.next = 8;
9815
10383
  break;
9816
10384
  }
9817
- _context42.next = 7;
10385
+ _context45.next = 7;
9818
10386
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
9819
10387
  case 7:
9820
10388
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9821
10389
  case 8:
9822
10390
  if (!streams.microphone) {
9823
- _context42.next = 9;
10391
+ _context45.next = 9;
9824
10392
  break;
9825
10393
  }
9826
- _context42.next = 9;
10394
+ _context45.next = 9;
9827
10395
  return this.setLocalAudioStream(streams.microphone);
9828
10396
  case 9:
9829
10397
  if (!streams.camera) {
9830
- _context42.next = 10;
10398
+ _context45.next = 10;
9831
10399
  break;
9832
10400
  }
9833
- _context42.next = 10;
10401
+ _context45.next = 10;
9834
10402
  return this.setLocalVideoStream(streams.camera);
9835
10403
  case 10:
9836
10404
  if (this.isMultistream) {
9837
- _context42.next = 11;
10405
+ _context45.next = 11;
9838
10406
  break;
9839
10407
  }
9840
- _context42.next = 11;
10408
+ _context45.next = 11;
9841
10409
  return this.updateTranscodedMediaConnection();
9842
10410
  case 11:
9843
10411
  if (!floorRequestNeeded) {
9844
- _context42.next = 12;
10412
+ _context45.next = 12;
9845
10413
  break;
9846
10414
  }
9847
10415
  this.localShareInstanceId = _uuid.default.v4();
@@ -9872,15 +10440,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9872
10440
  // we're sending the http request to Locus to request the screen share floor
9873
10441
  // only after the SDP update, because that's how it's always been done for transcoded meetings
9874
10442
  // and also if sharing from the start, we need confluence to have been created
9875
- _context42.next = 12;
10443
+ _context45.next = 12;
9876
10444
  return this.enqueueScreenShareFloorRequest();
9877
10445
  case 12:
9878
10446
  case "end":
9879
- return _context42.stop();
10447
+ return _context45.stop();
9880
10448
  }
9881
- }, _callee42, this);
10449
+ }, _callee45, this);
9882
10450
  }));
9883
- function publishStreams(_x41) {
10451
+ function publishStreams(_x46) {
9884
10452
  return _publishStreams.apply(this, arguments);
9885
10453
  }
9886
10454
  return publishStreams;
@@ -9895,20 +10463,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9895
10463
  }, {
9896
10464
  key: "unpublishStreams",
9897
10465
  value: (function () {
9898
- var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9899
- var promises, _iterator, _step, stream;
9900
- return _regenerator.default.wrap(function (_context43) {
9901
- while (1) switch (_context43.prev = _context43.next) {
10466
+ var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46(streams) {
10467
+ var promises, _iterator2, _step2, stream;
10468
+ return _regenerator.default.wrap(function (_context46) {
10469
+ while (1) switch (_context46.prev = _context46.next) {
9902
10470
  case 0:
9903
10471
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9904
10472
  this.checkMediaConnection();
9905
10473
  promises = [];
9906
- _iterator = _createForOfIteratorHelper(streams.filter(function (t) {
10474
+ _iterator2 = _createForOfIteratorHelper(streams.filter(function (t) {
9907
10475
  return !!t;
9908
10476
  }));
9909
10477
  try {
9910
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
9911
- stream = _step.value;
10478
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
10479
+ stream = _step2.value;
9912
10480
  if (stream === this.mediaProperties.shareAudioStream) {
9913
10481
  promises.push(this.setLocalShareAudioStream(undefined));
9914
10482
  }
@@ -9923,14 +10491,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9923
10491
  }
9924
10492
  }
9925
10493
  } catch (err) {
9926
- _iterator.e(err);
10494
+ _iterator2.e(err);
9927
10495
  } finally {
9928
- _iterator.f();
10496
+ _iterator2.f();
9929
10497
  }
9930
10498
  if (!this.isMultistream) {
9931
10499
  promises.push(this.updateTranscodedMediaConnection());
9932
10500
  }
9933
- _context43.next = 1;
10501
+ _context46.next = 1;
9934
10502
  return _promise.default.all(promises);
9935
10503
  case 1:
9936
10504
  // we're allowing for the SDK to support just audio share as well
@@ -9951,11 +10519,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9951
10519
  }
9952
10520
  case 2:
9953
10521
  case "end":
9954
- return _context43.stop();
10522
+ return _context46.stop();
9955
10523
  }
9956
- }, _callee43, this);
10524
+ }, _callee46, this);
9957
10525
  }));
9958
- function unpublishStreams(_x42) {
10526
+ function unpublishStreams(_x47) {
9959
10527
  return _unpublishStreams.apply(this, arguments);
9960
10528
  }
9961
10529
  return unpublishStreams;
@@ -10021,16 +10589,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10021
10589
  }, {
10022
10590
  key: "getMediaReachabilityMetricFields",
10023
10591
  value: (function () {
10024
- var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
10592
+ var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee47() {
10025
10593
  var _this$mediaServerIp, _this$mediaConnection, _this$mediaConnection2, _this$mediaConnection3;
10026
10594
  var reachabilityMetrics, successKeys, totalSuccessCases, selectedSubnetFirstOctet, isSubnetReachable, selectedCluster;
10027
- return _regenerator.default.wrap(function (_context44) {
10028
- while (1) switch (_context44.prev = _context44.next) {
10595
+ return _regenerator.default.wrap(function (_context47) {
10596
+ while (1) switch (_context47.prev = _context47.next) {
10029
10597
  case 0:
10030
- _context44.next = 1;
10598
+ _context47.next = 1;
10031
10599
  return this.webex.meetings.reachability.getReachabilityMetrics();
10032
10600
  case 1:
10033
- reachabilityMetrics = _context44.sent;
10601
+ reachabilityMetrics = _context47.sent;
10034
10602
  successKeys = ['reachability_public_udp_success', 'reachability_public_tcp_success', 'reachability_public_xtls_success', 'reachability_vmn_udp_success', 'reachability_vmn_tcp_success', 'reachability_vmn_xtls_success'];
10035
10603
  totalSuccessCases = successKeys.reduce(function (total, key) {
10036
10604
  var value = reachabilityMetrics[key];
@@ -10047,16 +10615,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10047
10615
  this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
10048
10616
  }
10049
10617
  selectedCluster = (_this$mediaConnection = (_this$mediaConnection2 = this.mediaConnections) === null || _this$mediaConnection2 === void 0 ? void 0 : (_this$mediaConnection3 = _this$mediaConnection2[0]) === null || _this$mediaConnection3 === void 0 ? void 0 : _this$mediaConnection3.mediaAgentCluster) !== null && _this$mediaConnection !== void 0 ? _this$mediaConnection : null;
10050
- return _context44.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10618
+ return _context47.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10051
10619
  subnet_reachable: isSubnetReachable,
10052
10620
  selected_cluster: selectedCluster,
10053
10621
  selected_subnet: selectedSubnetFirstOctet ? "".concat(selectedSubnetFirstOctet, ".X.X.X") : null
10054
10622
  }));
10055
10623
  case 2:
10056
10624
  case "end":
10057
- return _context44.stop();
10625
+ return _context47.stop();
10058
10626
  }
10059
- }, _callee44, this);
10627
+ }, _callee47, this);
10060
10628
  }));
10061
10629
  function getMediaReachabilityMetricFields() {
10062
10630
  return _getMediaReachabilityMetricFields.apply(this, arguments);
@@ -10073,17 +10641,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10073
10641
  }, {
10074
10642
  key: "setStage",
10075
10643
  value: function setStage() {
10076
- var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10077
- _ref44$activeSpeakerP = _ref44.activeSpeakerProportion,
10078
- activeSpeakerProportion = _ref44$activeSpeakerP === void 0 ? 0.5 : _ref44$activeSpeakerP,
10079
- customBackground = _ref44.customBackground,
10080
- customLogo = _ref44.customLogo,
10081
- customNameLabel = _ref44.customNameLabel,
10082
- importantParticipants = _ref44.importantParticipants,
10083
- _ref44$lockAttendeeVi = _ref44.lockAttendeeViewOnStage,
10084
- lockAttendeeViewOnStage = _ref44$lockAttendeeVi === void 0 ? false : _ref44$lockAttendeeVi,
10085
- _ref44$showActiveSpea = _ref44.showActiveSpeaker,
10086
- showActiveSpeaker = _ref44$showActiveSpea === void 0 ? false : _ref44$showActiveSpea;
10644
+ var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10645
+ _ref47$activeSpeakerP = _ref47.activeSpeakerProportion,
10646
+ activeSpeakerProportion = _ref47$activeSpeakerP === void 0 ? 0.5 : _ref47$activeSpeakerP,
10647
+ customBackground = _ref47.customBackground,
10648
+ customLogo = _ref47.customLogo,
10649
+ customNameLabel = _ref47.customNameLabel,
10650
+ importantParticipants = _ref47.importantParticipants,
10651
+ _ref47$lockAttendeeVi = _ref47.lockAttendeeViewOnStage,
10652
+ lockAttendeeViewOnStage = _ref47$lockAttendeeVi === void 0 ? false : _ref47$lockAttendeeVi,
10653
+ _ref47$showActiveSpea = _ref47.showActiveSpeaker,
10654
+ showActiveSpeaker = _ref47$showActiveSpea === void 0 ? false : _ref47$showActiveSpea;
10087
10655
  var videoLayout = {
10088
10656
  overrideDefault: true,
10089
10657
  lockAttendeeViewOnStageOnly: lockAttendeeViewOnStage,
@@ -10187,41 +10755,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10187
10755
  }, {
10188
10756
  key: "refreshDataChannelToken",
10189
10757
  value: (function () {
10190
- var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
10191
- var isPracticeSession, dataChannelTokenType, res, msg, _t36;
10192
- return _regenerator.default.wrap(function (_context45) {
10193
- while (1) switch (_context45.prev = _context45.next) {
10758
+ var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee48() {
10759
+ var isPracticeSession, dataChannelTokenType, res, msg, _t39;
10760
+ return _regenerator.default.wrap(function (_context48) {
10761
+ while (1) switch (_context48.prev = _context48.next) {
10194
10762
  case 0:
10195
10763
  isPracticeSession = this.webinar.isJoinPracticeSessionDataChannel();
10196
10764
  dataChannelTokenType = this.getDataChannelTokenType();
10197
- _context45.prev = 1;
10198
- _context45.next = 2;
10765
+ _context48.prev = 1;
10766
+ _context48.next = 2;
10199
10767
  return this.meetingRequest.fetchDatachannelToken({
10200
10768
  locusUrl: this.locusUrl,
10201
10769
  requestingParticipantId: this.members.selfId,
10202
10770
  isPracticeSession: isPracticeSession
10203
10771
  });
10204
10772
  case 2:
10205
- res = _context45.sent;
10206
- return _context45.abrupt("return", {
10773
+ res = _context48.sent;
10774
+ return _context48.abrupt("return", {
10207
10775
  body: {
10208
10776
  datachannelToken: res.body.datachannelToken,
10209
10777
  dataChannelTokenType: dataChannelTokenType
10210
10778
  }
10211
10779
  });
10212
10780
  case 3:
10213
- _context45.prev = 3;
10214
- _t36 = _context45["catch"](1);
10215
- msg = (_t36 === null || _t36 === void 0 ? void 0 : _t36.message) || String(_t36);
10781
+ _context48.prev = 3;
10782
+ _t39 = _context48["catch"](1);
10783
+ msg = (_t39 === null || _t39 === void 0 ? void 0 : _t39.message) || String(_t39);
10216
10784
  _loggerProxy.default.logger.warn("Meeting:index#refreshDataChannelToken --> DataChannel token refresh failed (likely locus changed or participant left): ".concat(msg), {
10217
- statusCode: _t36 === null || _t36 === void 0 ? void 0 : _t36.statusCode
10785
+ statusCode: _t39 === null || _t39 === void 0 ? void 0 : _t39.statusCode
10218
10786
  });
10219
- return _context45.abrupt("return", null);
10787
+ return _context48.abrupt("return", null);
10220
10788
  case 4:
10221
10789
  case "end":
10222
- return _context45.stop();
10790
+ return _context48.stop();
10223
10791
  }
10224
- }, _callee45, this, [[1, 3]]);
10792
+ }, _callee48, this, [[1, 3]]);
10225
10793
  }));
10226
10794
  function refreshDataChannelToken() {
10227
10795
  return _refreshDataChannelToken.apply(this, arguments);