@webex/plugin-meetings 3.12.0-mobius-socket.2 → 3.12.0-mobius-socket.4

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 (145) 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 +3 -2
  7. package/dist/breakouts/index.js.map +1 -1
  8. package/dist/config.js +1 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/constants.js +6 -3
  11. package/dist/constants.js.map +1 -1
  12. package/dist/controls-options-manager/constants.js +11 -1
  13. package/dist/controls-options-manager/constants.js.map +1 -1
  14. package/dist/controls-options-manager/index.js +38 -24
  15. package/dist/controls-options-manager/index.js.map +1 -1
  16. package/dist/controls-options-manager/util.js +91 -0
  17. package/dist/controls-options-manager/util.js.map +1 -1
  18. package/dist/hashTree/constants.js +10 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +651 -382
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +22 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/locusRetry.js +23 -8
  27. package/dist/interceptors/locusRetry.js.map +1 -1
  28. package/dist/interpretation/index.js +10 -1
  29. package/dist/interpretation/index.js.map +1 -1
  30. package/dist/interpretation/siLanguage.js +1 -1
  31. package/dist/locus-info/controlsUtils.js +4 -1
  32. package/dist/locus-info/controlsUtils.js.map +1 -1
  33. package/dist/locus-info/index.js +289 -87
  34. package/dist/locus-info/index.js.map +1 -1
  35. package/dist/locus-info/types.js +19 -0
  36. package/dist/locus-info/types.js.map +1 -1
  37. package/dist/media/properties.js +1 -0
  38. package/dist/media/properties.js.map +1 -1
  39. package/dist/meeting/in-meeting-actions.js +3 -1
  40. package/dist/meeting/in-meeting-actions.js.map +1 -1
  41. package/dist/meeting/index.js +848 -582
  42. package/dist/meeting/index.js.map +1 -1
  43. package/dist/meeting/util.js +19 -2
  44. package/dist/meeting/util.js.map +1 -1
  45. package/dist/meetings/index.js +205 -77
  46. package/dist/meetings/index.js.map +1 -1
  47. package/dist/meetings/meetings.types.js +6 -1
  48. package/dist/meetings/meetings.types.js.map +1 -1
  49. package/dist/meetings/request.js +39 -0
  50. package/dist/meetings/request.js.map +1 -1
  51. package/dist/meetings/util.js +67 -5
  52. package/dist/meetings/util.js.map +1 -1
  53. package/dist/member/index.js +10 -0
  54. package/dist/member/index.js.map +1 -1
  55. package/dist/member/types.js.map +1 -1
  56. package/dist/member/util.js +3 -0
  57. package/dist/member/util.js.map +1 -1
  58. package/dist/metrics/constants.js +4 -1
  59. package/dist/metrics/constants.js.map +1 -1
  60. package/dist/multistream/receiveSlot.js +9 -0
  61. package/dist/multistream/receiveSlot.js.map +1 -1
  62. package/dist/reactions/reactions.type.js.map +1 -1
  63. package/dist/recording-controller/index.js +1 -3
  64. package/dist/recording-controller/index.js.map +1 -1
  65. package/dist/types/config.d.ts +1 -0
  66. package/dist/types/constants.d.ts +2 -0
  67. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  68. package/dist/types/controls-options-manager/index.d.ts +10 -0
  69. package/dist/types/hashTree/constants.d.ts +1 -0
  70. package/dist/types/hashTree/hashTreeParser.d.ts +83 -16
  71. package/dist/types/hashTree/utils.d.ts +11 -0
  72. package/dist/types/index.d.ts +2 -0
  73. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  74. package/dist/types/locus-info/index.d.ts +46 -6
  75. package/dist/types/locus-info/types.d.ts +21 -1
  76. package/dist/types/media/properties.d.ts +1 -0
  77. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  78. package/dist/types/meeting/index.d.ts +65 -1
  79. package/dist/types/meeting/util.d.ts +8 -0
  80. package/dist/types/meetings/index.d.ts +20 -2
  81. package/dist/types/meetings/meetings.types.d.ts +15 -0
  82. package/dist/types/meetings/request.d.ts +14 -0
  83. package/dist/types/member/index.d.ts +1 -0
  84. package/dist/types/member/types.d.ts +1 -0
  85. package/dist/types/member/util.d.ts +1 -0
  86. package/dist/types/metrics/constants.d.ts +3 -0
  87. package/dist/types/reactions/reactions.type.d.ts +3 -0
  88. package/dist/webinar/index.js +68 -17
  89. package/dist/webinar/index.js.map +1 -1
  90. package/package.json +22 -22
  91. package/src/aiEnableRequest/index.ts +16 -0
  92. package/src/breakouts/breakout.ts +3 -1
  93. package/src/breakouts/index.ts +1 -0
  94. package/src/config.ts +1 -0
  95. package/src/constants.ts +5 -1
  96. package/src/controls-options-manager/constants.ts +14 -1
  97. package/src/controls-options-manager/index.ts +47 -24
  98. package/src/controls-options-manager/util.ts +81 -1
  99. package/src/hashTree/constants.ts +9 -0
  100. package/src/hashTree/hashTreeParser.ts +375 -197
  101. package/src/hashTree/utils.ts +17 -0
  102. package/src/index.ts +5 -0
  103. package/src/interceptors/locusRetry.ts +25 -4
  104. package/src/interpretation/index.ts +25 -8
  105. package/src/locus-info/controlsUtils.ts +3 -1
  106. package/src/locus-info/index.ts +291 -97
  107. package/src/locus-info/types.ts +25 -1
  108. package/src/media/properties.ts +1 -0
  109. package/src/meeting/in-meeting-actions.ts +4 -0
  110. package/src/meeting/index.ts +260 -23
  111. package/src/meeting/util.ts +20 -2
  112. package/src/meetings/index.ts +109 -43
  113. package/src/meetings/meetings.types.ts +19 -0
  114. package/src/meetings/request.ts +43 -0
  115. package/src/meetings/util.ts +80 -1
  116. package/src/member/index.ts +10 -0
  117. package/src/member/types.ts +1 -0
  118. package/src/member/util.ts +3 -0
  119. package/src/metrics/constants.ts +3 -0
  120. package/src/multistream/receiveSlot.ts +18 -0
  121. package/src/reactions/reactions.type.ts +3 -0
  122. package/src/recording-controller/index.ts +1 -2
  123. package/src/webinar/index.ts +88 -21
  124. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  125. package/test/unit/spec/breakouts/breakout.ts +9 -3
  126. package/test/unit/spec/breakouts/index.ts +2 -0
  127. package/test/unit/spec/controls-options-manager/index.js +140 -29
  128. package/test/unit/spec/controls-options-manager/util.js +165 -0
  129. package/test/unit/spec/hashTree/hashTreeParser.ts +1263 -157
  130. package/test/unit/spec/hashTree/utils.ts +88 -1
  131. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  132. package/test/unit/spec/interpretation/index.ts +26 -4
  133. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  134. package/test/unit/spec/locus-info/index.js +475 -81
  135. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  136. package/test/unit/spec/meeting/index.js +902 -14
  137. package/test/unit/spec/meeting/muteState.js +3 -0
  138. package/test/unit/spec/meeting/utils.js +33 -0
  139. package/test/unit/spec/meetings/index.js +309 -10
  140. package/test/unit/spec/meetings/request.js +141 -0
  141. package/test/unit/spec/meetings/utils.js +161 -0
  142. package/test/unit/spec/member/index.js +7 -0
  143. package/test/unit/spec/member/util.js +24 -0
  144. package/test/unit/spec/recording-controller/index.js +9 -8
  145. package/test/unit/spec/webinar/index.ts +81 -16
@@ -496,6 +496,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
496
496
  (0, _defineProperty3.default)(_this, "floorGrantPending", void 0);
497
497
  (0, _defineProperty3.default)(_this, "hasJoinedOnce", void 0);
498
498
  (0, _defineProperty3.default)(_this, "hasWebsocketConnected", void 0);
499
+ (0, _defineProperty3.default)(_this, "mercuryOnlineHandler", void 0);
500
+ (0, _defineProperty3.default)(_this, "mercuryOfflineHandler", void 0);
499
501
  (0, _defineProperty3.default)(_this, "inMeetingActions", void 0);
500
502
  (0, _defineProperty3.default)(_this, "isLocalShareLive", void 0);
501
503
  (0, _defineProperty3.default)(_this, "isRoapInProgress", void 0);
@@ -641,6 +643,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
641
643
  * @returns {void}
642
644
  */
643
645
  (0, _defineProperty3.default)(_this, "processRelayEvent", function (e) {
646
+ if (!_this.isRelayEventRouteValid(e)) {
647
+ return;
648
+ }
644
649
  switch (e.data.relayType) {
645
650
  case _constants3.REACTION_RELAY_TYPES.REACTION:
646
651
  if (
@@ -687,6 +692,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
687
692
  });
688
693
  /**
689
694
  * Disconnects and cleans up the default LLM session listeners/timers.
695
+ *
696
+ * Ownership-aware: only calls `disconnectLLM` when this meeting is the
697
+ * current owner of the default LLM session (or when no owner is recorded).
698
+ * Event listeners belonging to this meeting instance are always detached
699
+ * so they do not receive another meeting's relay events.
700
+ *
690
701
  * @param {Object} options
691
702
  * @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
692
703
  * @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
@@ -698,13 +709,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
698
709
  removeOnlineListener,
699
710
  _ref3$throwOnError,
700
711
  throwOnError,
712
+ currentOwner,
713
+ isOwner,
714
+ _this$webex$internal$,
715
+ _this$webex$internal$2,
701
716
  _args = arguments,
702
717
  _t;
703
718
  return _regenerator.default.wrap(function (_context) {
704
719
  while (1) switch (_context.prev = _context.next) {
705
720
  case 0:
706
721
  _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;
722
+ // @ts-ignore - Fix type
723
+ currentOwner = _this.webex.internal.llm.getOwnerMeetingId();
724
+ isOwner = !currentOwner || currentOwner === _this.id;
707
725
  _context.prev = 1;
726
+ if (!isOwner) {
727
+ _context.next = 3;
728
+ break;
729
+ }
708
730
  _context.next = 2;
709
731
  return _this.webex.internal.llm.disconnectLLM({
710
732
  code: 3050,
@@ -714,31 +736,43 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
714
736
  _context.next = 4;
715
737
  break;
716
738
  case 3:
717
- _context.prev = 3;
739
+ _loggerProxy.default.logger.info("Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
740
+ case 4:
741
+ _context.next = 6;
742
+ break;
743
+ case 5:
744
+ _context.prev = 5;
718
745
  _t = _context["catch"](1);
719
746
  _loggerProxy.default.logger.error('Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session', _t);
720
747
  if (!throwOnError) {
721
- _context.next = 4;
748
+ _context.next = 6;
722
749
  break;
723
750
  }
724
751
  throw _t;
725
- case 4:
726
- _context.prev = 4;
752
+ case 6:
753
+ _context.prev = 6;
727
754
  if (removeOnlineListener) {
728
755
  // @ts-ignore - Fix type
729
756
  _this.webex.internal.llm.off('online', _this.handleLLMOnline);
730
757
  }
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:
758
+ _this.stopListeningForLLMEvents();
759
+
760
+ // If this meeting owned (or could have owned) the default LLM session,
761
+ // always release the owner tag here regardless of whether disconnectLLM
762
+ // resolved. `disconnectLLM` only clears the owner on its success path,
763
+ // so a failed disconnect would otherwise leave a stale owner pointing
764
+ // at a torn-down meeting and permanently block other meetings'
765
+ // `updateLLMConnection` calls via the ownership guard.
766
+ if (isOwner) {
767
+ // @ts-ignore - Fix type
768
+ (_this$webex$internal$ = (_this$webex$internal$2 = _this.webex.internal.llm).setOwnerMeetingId) === null || _this$webex$internal$ === void 0 ? void 0 : _this$webex$internal$.call(_this$webex$internal$2, undefined);
769
+ }
770
+ return _context.finish(6);
771
+ case 7:
738
772
  case "end":
739
773
  return _context.stop();
740
774
  }
741
- }, _callee, null, [[1, 3, 4, 5]]);
775
+ }, _callee, null, [[1, 5, 6, 7]]);
742
776
  })));
743
777
  /**
744
778
  * Handles ROAP_FAILURE event from the webrtc media connection
@@ -1321,6 +1355,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1321
1355
  }
1322
1356
  }
1323
1357
  });
1358
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.STATS_UPDATE, function (data) {
1359
+ // Extract srtpCipher from transport stats
1360
+ var srtpCipher;
1361
+ var _iterator = _createForOfIteratorHelper(data.stats.values()),
1362
+ _step;
1363
+ try {
1364
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1365
+ var stats = _step.value;
1366
+ if (stats.type === 'transport' && stats.srtpCipher) {
1367
+ srtpCipher = stats.srtpCipher;
1368
+ break;
1369
+ }
1370
+ }
1371
+
1372
+ // Only emit event if srtpCipher has changed
1373
+ } catch (err) {
1374
+ _iterator.e(err);
1375
+ } finally {
1376
+ _iterator.f();
1377
+ }
1378
+ if (srtpCipher && srtpCipher !== _this.mediaProperties.srtpCipher) {
1379
+ _loggerProxy.default.logger.info("Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ".concat(_this.mediaProperties.srtpCipher, " to ").concat(srtpCipher));
1380
+ _this.mediaProperties.srtpCipher = srtpCipher;
1381
+ _triggerProxy.default.trigger(_this, {
1382
+ file: 'meeting/index',
1383
+ function: 'setupStatsAnalyzerEventHandlers'
1384
+ }, _constants.EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED, {
1385
+ srtpCipher: srtpCipher
1386
+ });
1387
+ }
1388
+ });
1324
1389
  });
1325
1390
  /**
1326
1391
  * media failed, so collect a stats report from webrtc using the wcme connection to grab the rtc stats report
@@ -1539,6 +1604,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1539
1604
  * @memberof Meeting
1540
1605
  */
1541
1606
  (0, _defineProperty3.default)(_this, "clearMeetingData", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
1607
+ var currentOwner, isOwner;
1542
1608
  return _regenerator.default.wrap(function (_context5) {
1543
1609
  while (1) switch (_context5.prev = _context5.next) {
1544
1610
  case 0:
@@ -1549,10 +1615,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1549
1615
  _this.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
1550
1616
  }
1551
1617
  _this.queuedMediaUpdates = [];
1552
- _this.stopTranscription();
1553
- _this.transcription = undefined;
1554
- _this.annotation.deregisterEvents();
1555
- _this.clearDataChannelToken();
1618
+
1619
+ // Listener teardown (transcription, annotation, llm/mercury) runs in
1620
+ // stopListeningForMeetingEvents() before /leave and /end so events
1621
+ // received mid-teardown do not trigger Locus syncs. Calling it here
1622
+ // again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
1623
+ // because stopTranscription() always fires its trigger.
1624
+ //
1625
+ // Ownership-aware token clear: only clear the shared LLM data channel
1626
+ // tokens when this meeting owns (or no meeting owns) the default LLM
1627
+ // session. Otherwise we would wipe tokens still in use by another
1628
+ // meeting's active LLM connection.
1629
+ // @ts-ignore - Fix type
1630
+ currentOwner = _this.webex.internal.llm.getOwnerMeetingId();
1631
+ isOwner = !currentOwner || currentOwner === _this.id;
1632
+ if (isOwner) {
1633
+ _this.clearDataChannelToken();
1634
+ } else {
1635
+ _loggerProxy.default.logger.info("Meeting:index#clearMeetingData --> skipping clearDataChannelToken; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
1636
+ }
1556
1637
  _context5.next = 1;
1557
1638
  return _this.cleanupLLMConneciton({
1558
1639
  throwOnError: false
@@ -1727,7 +1808,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1727
1808
  });
1728
1809
 
1729
1810
  // @ts-ignore
1730
- _this.aiEnableRequest = new _aiEnableRequest.default({}, {
1811
+ _this.aiEnableRequest = new _aiEnableRequest.default({
1812
+ locusUrl: _this.locusUrl
1813
+ }, {
1731
1814
  parent: _this.webex
1732
1815
  });
1733
1816
 
@@ -3525,7 +3608,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3525
3608
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, function (_ref10) {
3526
3609
  var state = _ref10.state,
3527
3610
  modifiedBy = _ref10.modifiedBy,
3528
- lastModified = _ref10.lastModified;
3611
+ lastModified = _ref10.lastModified,
3612
+ modifiedByServiceAppName = _ref10.modifiedByServiceAppName,
3613
+ modifiedByServiceAppId = _ref10.modifiedByServiceAppId;
3529
3614
  var event;
3530
3615
  switch (state) {
3531
3616
  case _constants.RECORDING_STATE.RECORDING:
@@ -3549,7 +3634,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3549
3634
  _this12.recording = {
3550
3635
  state: state === _constants.RECORDING_STATE.RESUMED ? _constants.RECORDING_STATE.RECORDING : state,
3551
3636
  modifiedBy: modifiedBy,
3552
- lastModified: lastModified
3637
+ lastModified: lastModified,
3638
+ modifiedByServiceAppName: modifiedByServiceAppName,
3639
+ modifiedByServiceAppId: modifiedByServiceAppId
3553
3640
  };
3554
3641
  _triggerProxy.default.trigger(_this12, {
3555
3642
  file: 'meeting/index',
@@ -4086,6 +4173,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4086
4173
  _this14.breakouts.locusUrlUpdate(url);
4087
4174
  _this14.simultaneousInterpretation.locusUrlUpdate(url);
4088
4175
  _this14.annotation.locusUrlUpdate(url);
4176
+ _this14.aiEnableRequest.locusUrlUpdate(url);
4089
4177
  _this14.locusUrl = url;
4090
4178
  _this14.locusId = (_this14$locusUrl = _this14.locusUrl) === null || _this14$locusUrl === void 0 ? void 0 : _this14$locusUrl.split('/').pop();
4091
4179
  _this14.recordingController.setLocusUrl(_this14.locusUrl);
@@ -5117,7 +5205,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5117
5205
  displayHints: this.userDisplayHints
5118
5206
  }),
5119
5207
  canAttendeeRequestAiAssistantEnabled: _util2.default.canAttendeeRequestAiAssistantEnabled(this.userDisplayHints, this.roles),
5120
- isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints)
5208
+ isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints),
5209
+ isAnonymizeDisplayNamesEnabled: _util2.default.isAnonymizeDisplayNamesEnabled(this.userDisplayHints)
5121
5210
  }) || changed;
5122
5211
  }
5123
5212
  if (changed) {
@@ -5168,6 +5257,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5168
5257
  this.sipUri = sipUri;
5169
5258
  }
5170
5259
 
5260
+ /**
5261
+ * After initial locus setup, refreshes destination with synced locus data and optionally
5262
+ * performs deferred meeting info fetch when initial locus was incomplete.
5263
+ * @param {LocusDTO} locus
5264
+ * @returns {void}
5265
+ */
5266
+ }, {
5267
+ key: "finalizeMeetingAfterInitialLocusSetup",
5268
+ value: (function () {
5269
+ var _finalizeMeetingAfterInitialLocusSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(locus) {
5270
+ var _this$destination;
5271
+ var _t0;
5272
+ return _regenerator.default.wrap(function (_context11) {
5273
+ while (1) switch (_context11.prev = _context11.next) {
5274
+ case 0:
5275
+ if (locus && (this === null || this === void 0 ? void 0 : this.destinationType) === _constants.DESTINATION_TYPE.LOCUS_ID) {
5276
+ // destination is initialized from the initial locus snapshot in constructor,
5277
+ // so refresh it after locus sync to avoid stale partial hash-tree data.
5278
+ this.destination = locus;
5279
+ }
5280
+ if (!((!this.meetingInfo || (0, _lodash.isEmpty)(this.meetingInfo)) && (_this$destination = this.destination) !== null && _this$destination !== void 0 && _this$destination.info && !this.fetchMeetingInfoTimeoutId)) {
5281
+ _context11.next = 4;
5282
+ break;
5283
+ }
5284
+ _context11.prev = 1;
5285
+ _context11.next = 2;
5286
+ return this.fetchMeetingInfo({});
5287
+ case 2:
5288
+ _context11.next = 4;
5289
+ break;
5290
+ case 3:
5291
+ _context11.prev = 3;
5292
+ _t0 = _context11["catch"](1);
5293
+ _loggerProxy.default.logger.info("Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ".concat(_t0.message));
5294
+ case 4:
5295
+ case "end":
5296
+ return _context11.stop();
5297
+ }
5298
+ }, _callee11, this, [[1, 3]]);
5299
+ }));
5300
+ function finalizeMeetingAfterInitialLocusSetup(_x1) {
5301
+ return _finalizeMeetingAfterInitialLocusSetup.apply(this, arguments);
5302
+ }
5303
+ return finalizeMeetingAfterInitialLocusSetup;
5304
+ }()
5171
5305
  /**
5172
5306
  * Set the locus info the class instance. Should be called with the parsed locus
5173
5307
  * we got in the join response.
@@ -5183,6 +5317,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5183
5317
  * @private
5184
5318
  * @memberof Meeting
5185
5319
  */
5320
+ )
5186
5321
  }, {
5187
5322
  key: "setLocus",
5188
5323
  value: function setLocus(data) {
@@ -5362,11 +5497,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5362
5497
  }, {
5363
5498
  key: "setLocalAudioStream",
5364
5499
  value: (function () {
5365
- var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(localStream) {
5500
+ var _setLocalAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
5366
5501
  var _this$audio2;
5367
5502
  var oldStream;
5368
- return _regenerator.default.wrap(function (_context11) {
5369
- while (1) switch (_context11.prev = _context11.next) {
5503
+ return _regenerator.default.wrap(function (_context12) {
5504
+ while (1) switch (_context12.prev = _context12.next) {
5370
5505
  case 0:
5371
5506
  oldStream = this.mediaProperties.audioStream;
5372
5507
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localAudioStreamMuteStateHandler);
@@ -5380,21 +5515,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5380
5515
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.localAudioStreamMuteStateHandler);
5381
5516
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5382
5517
  if (!(!this.isMultistream || !localStream)) {
5383
- _context11.next = 1;
5518
+ _context12.next = 1;
5384
5519
  break;
5385
5520
  }
5386
- _context11.next = 1;
5521
+ _context12.next = 1;
5387
5522
  return this.unpublishStream(_internalMediaCore.MediaType.AudioMain, oldStream);
5388
5523
  case 1:
5389
- _context11.next = 2;
5524
+ _context12.next = 2;
5390
5525
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
5391
5526
  case 2:
5392
5527
  case "end":
5393
- return _context11.stop();
5528
+ return _context12.stop();
5394
5529
  }
5395
- }, _callee11, this);
5530
+ }, _callee12, this);
5396
5531
  }));
5397
- function setLocalAudioStream(_x1) {
5532
+ function setLocalAudioStream(_x10) {
5398
5533
  return _setLocalAudioStream.apply(this, arguments);
5399
5534
  }
5400
5535
  return setLocalAudioStream;
@@ -5410,11 +5545,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5410
5545
  }, {
5411
5546
  key: "setLocalVideoStream",
5412
5547
  value: (function () {
5413
- var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(localStream) {
5548
+ var _setLocalVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localStream) {
5414
5549
  var _this$video2;
5415
5550
  var oldStream;
5416
- return _regenerator.default.wrap(function (_context12) {
5417
- while (1) switch (_context12.prev = _context12.next) {
5551
+ return _regenerator.default.wrap(function (_context13) {
5552
+ while (1) switch (_context13.prev = _context13.next) {
5418
5553
  case 0:
5419
5554
  oldStream = this.mediaProperties.videoStream;
5420
5555
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.UserMuteStateChange, this.localVideoStreamMuteStateHandler);
@@ -5430,21 +5565,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5430
5565
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5431
5566
  localStream === null || localStream === void 0 ? void 0 : localStream.on(_mediaHelpers.LocalStreamEventNames.ConstraintsChange, this.localConstraintsChangeHandler);
5432
5567
  if (!(!this.isMultistream || !localStream)) {
5433
- _context12.next = 1;
5568
+ _context13.next = 1;
5434
5569
  break;
5435
5570
  }
5436
- _context12.next = 1;
5571
+ _context13.next = 1;
5437
5572
  return this.unpublishStream(_internalMediaCore.MediaType.VideoMain, oldStream);
5438
5573
  case 1:
5439
- _context12.next = 2;
5574
+ _context13.next = 2;
5440
5575
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
5441
5576
  case 2:
5442
5577
  case "end":
5443
- return _context12.stop();
5578
+ return _context13.stop();
5444
5579
  }
5445
- }, _callee12, this);
5580
+ }, _callee13, this);
5446
5581
  }));
5447
- function setLocalVideoStream(_x10) {
5582
+ function setLocalVideoStream(_x11) {
5448
5583
  return _setLocalVideoStream.apply(this, arguments);
5449
5584
  }
5450
5585
  return setLocalVideoStream;
@@ -5461,10 +5596,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5461
5596
  }, {
5462
5597
  key: "setLocalShareVideoStream",
5463
5598
  value: (function () {
5464
- var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(localDisplayStream) {
5599
+ var _setLocalShareVideoStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localDisplayStream) {
5465
5600
  var oldStream;
5466
- return _regenerator.default.wrap(function (_context13) {
5467
- while (1) switch (_context13.prev = _context13.next) {
5601
+ return _regenerator.default.wrap(function (_context14) {
5602
+ while (1) switch (_context14.prev = _context14.next) {
5468
5603
  case 0:
5469
5604
  oldStream = this.mediaProperties.shareVideoStream;
5470
5605
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.SystemMuteStateChange, this.handleShareVideoStreamMuteStateChange);
@@ -5476,21 +5611,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5476
5611
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5477
5612
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5478
5613
  if (!(!this.isMultistream || !localDisplayStream)) {
5479
- _context13.next = 1;
5614
+ _context14.next = 1;
5480
5615
  break;
5481
5616
  }
5482
- _context13.next = 1;
5617
+ _context14.next = 1;
5483
5618
  return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
5484
5619
  case 1:
5485
- _context13.next = 2;
5620
+ _context14.next = 2;
5486
5621
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
5487
5622
  case 2:
5488
5623
  case "end":
5489
- return _context13.stop();
5624
+ return _context14.stop();
5490
5625
  }
5491
- }, _callee13, this);
5626
+ }, _callee14, this);
5492
5627
  }));
5493
- function setLocalShareVideoStream(_x11) {
5628
+ function setLocalShareVideoStream(_x12) {
5494
5629
  return _setLocalShareVideoStream.apply(this, arguments);
5495
5630
  }
5496
5631
  return setLocalShareVideoStream;
@@ -5506,10 +5641,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5506
5641
  }, {
5507
5642
  key: "setLocalShareAudioStream",
5508
5643
  value: (function () {
5509
- var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(localSystemAudioStream) {
5644
+ var _setLocalShareAudioStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(localSystemAudioStream) {
5510
5645
  var oldStream;
5511
- return _regenerator.default.wrap(function (_context14) {
5512
- while (1) switch (_context14.prev = _context14.next) {
5646
+ return _regenerator.default.wrap(function (_context15) {
5647
+ while (1) switch (_context15.prev = _context15.next) {
5513
5648
  case 0:
5514
5649
  oldStream = this.mediaProperties.shareAudioStream;
5515
5650
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
@@ -5519,21 +5654,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5519
5654
  localSystemAudioStream === null || localSystemAudioStream === void 0 ? void 0 : localSystemAudioStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
5520
5655
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
5521
5656
  if (!(!this.isMultistream || !localSystemAudioStream)) {
5522
- _context14.next = 1;
5657
+ _context15.next = 1;
5523
5658
  break;
5524
5659
  }
5525
- _context14.next = 1;
5660
+ _context15.next = 1;
5526
5661
  return this.unpublishStream(_internalMediaCore.MediaType.AudioSlides, oldStream);
5527
5662
  case 1:
5528
- _context14.next = 2;
5663
+ _context15.next = 2;
5529
5664
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
5530
5665
  case 2:
5531
5666
  case "end":
5532
- return _context14.stop();
5667
+ return _context15.stop();
5533
5668
  }
5534
- }, _callee14, this);
5669
+ }, _callee15, this);
5535
5670
  }));
5536
- function setLocalShareAudioStream(_x12) {
5671
+ function setLocalShareAudioStream(_x13) {
5537
5672
  return _setLocalShareAudioStream.apply(this, arguments);
5538
5673
  }
5539
5674
  return setLocalShareAudioStream;
@@ -5642,8 +5777,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5642
5777
  var _this25 = this;
5643
5778
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
5644
5779
  // if the meeting has active peer connections, it should try to reconnect.
5645
- // @ts-ignore
5646
- this.webex.internal.mercury.on(_constants.ONLINE, function () {
5780
+ this.mercuryOnlineHandler = function () {
5647
5781
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
5648
5782
 
5649
5783
  // Only send restore event when it was disconnected before and for connected later
@@ -5653,15 +5787,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5653
5787
  });
5654
5788
  }
5655
5789
  _this25.hasWebsocketConnected = true;
5656
- });
5657
-
5658
- // @ts-ignore
5659
- this.webex.internal.mercury.on(_constants.OFFLINE, function () {
5790
+ };
5791
+ this.mercuryOfflineHandler = function () {
5660
5792
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
5661
5793
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
5662
5794
  correlation_id: _this25.correlationId
5663
5795
  });
5664
- });
5796
+ };
5797
+
5798
+ // @ts-ignore
5799
+ this.webex.internal.mercury.on(_constants.ONLINE, this.mercuryOnlineHandler);
5800
+ // @ts-ignore
5801
+ this.webex.internal.mercury.on(_constants.OFFLINE, this.mercuryOfflineHandler);
5802
+ }
5803
+
5804
+ /**
5805
+ * Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
5806
+ * by setMercuryListener(). Must be called before Locus /leave to avoid
5807
+ * unnecessary syncs/metrics triggered by events received while leaving
5808
+ * (per Locus team recommendation).
5809
+ *
5810
+ * Mercury is a process-wide singleton shared with other plugins, so we
5811
+ * pass the bound handler refs to .off() to avoid clearing every listener
5812
+ * for ONLINE/OFFLINE on the shared emitter.
5813
+ *
5814
+ * Idempotent: subsequent calls are no-ops because the handler refs are
5815
+ * cleared after detaching.
5816
+ * @private
5817
+ * @returns {void}
5818
+ */
5819
+ }, {
5820
+ key: "stopListeningForMercuryEvents",
5821
+ value: function stopListeningForMercuryEvents() {
5822
+ if (this.mercuryOnlineHandler) {
5823
+ // @ts-ignore
5824
+ this.webex.internal.mercury.off(_constants.ONLINE, this.mercuryOnlineHandler);
5825
+ this.mercuryOnlineHandler = undefined;
5826
+ }
5827
+ if (this.mercuryOfflineHandler) {
5828
+ // @ts-ignore
5829
+ this.webex.internal.mercury.off(_constants.OFFLINE, this.mercuryOfflineHandler);
5830
+ this.mercuryOfflineHandler = undefined;
5831
+ }
5665
5832
  }
5666
5833
 
5667
5834
  /**
@@ -5972,7 +6139,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5972
6139
  }, {
5973
6140
  key: "joinWithMedia",
5974
6141
  value: (function () {
5975
- var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
6142
+ var _joinWithMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
5976
6143
  var _this30 = this;
5977
6144
  var options,
5978
6145
  mediaOptions,
@@ -5995,20 +6162,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5995
6162
  shouldRetry,
5996
6163
  _error2,
5997
6164
  _error3,
5998
- _args15 = arguments,
5999
- _t0,
6000
- _t1;
6001
- return _regenerator.default.wrap(function (_context15) {
6002
- while (1) switch (_context15.prev = _context15.next) {
6165
+ _args16 = arguments,
6166
+ _t1,
6167
+ _t10;
6168
+ return _regenerator.default.wrap(function (_context16) {
6169
+ while (1) switch (_context16.prev = _context16.next) {
6003
6170
  case 0:
6004
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
6171
+ options = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
6005
6172
  mediaOptions = options.mediaOptions, _options$joinOptions = options.joinOptions, joinOptions = _options$joinOptions === void 0 ? {} : _options$joinOptions;
6006
6173
  _this$joinWithMediaRe = this.joinWithMediaRetryInfo, isRetry = _this$joinWithMediaRe.isRetry, prevJoinResponse = _this$joinWithMediaRe.prevJoinResponse;
6007
6174
  if (mediaOptions !== null && mediaOptions !== void 0 && mediaOptions.allowMediaInLobby) {
6008
- _context15.next = 1;
6175
+ _context16.next = 1;
6009
6176
  break;
6010
6177
  }
6011
- return _context15.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6178
+ return _context16.abrupt("return", _promise.default.reject(new _parameter.default('joinWithMedia() can only be used with allowMediaInLobby set to true')));
6012
6179
  case 1:
6013
6180
  this.allowMediaInLobby = true;
6014
6181
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia called');
@@ -6020,39 +6187,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6020
6187
  in case WebRTC is not available at all.
6021
6188
  */
6022
6189
  if (!(_webCapabilities.WebCapabilities.supportsRTCPeerConnection() === _webCapabilities.CapabilityState.NOT_CAPABLE)) {
6023
- _context15.next = 2;
6190
+ _context16.next = 2;
6024
6191
  break;
6025
6192
  }
6026
6193
  throw new _internalMediaCore.Errors.WebrtcApiNotAvailableError('RTCPeerConnection API is not available in this environment');
6027
6194
  case 2:
6028
- _context15.prev = 2;
6195
+ _context16.prev = 2;
6029
6196
  forceTurnDiscovery = false;
6030
6197
  if (joinResponse) {
6031
- _context15.next = 7;
6198
+ _context16.next = 7;
6032
6199
  break;
6033
6200
  }
6034
- _context15.next = 3;
6201
+ _context16.next = 3;
6035
6202
  return this.roap.generateTurnDiscoveryRequestMessage(this, true);
6036
6203
  case 3:
6037
- turnDiscoveryRequest = _context15.sent;
6204
+ turnDiscoveryRequest = _context16.sent;
6038
6205
  turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
6039
6206
  joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
6040
6207
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia ---> calling join with joinOptions, ', joinOptions);
6041
- _context15.next = 4;
6208
+ _context16.next = 4;
6042
6209
  return this.join(joinOptions);
6043
6210
  case 4:
6044
- joinResponse = _context15.sent;
6211
+ joinResponse = _context16.sent;
6045
6212
  joined = true;
6046
6213
 
6047
6214
  // if we sent out TURN discovery Roap message with join, process the TURN discovery response
6048
6215
  if (!joinOptions.roapMessage) {
6049
- _context15.next = 6;
6216
+ _context16.next = 6;
6050
6217
  break;
6051
6218
  }
6052
- _context15.next = 5;
6219
+ _context16.next = 5;
6053
6220
  return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
6054
6221
  case 5:
6055
- _yield$this$roap$hand = _context15.sent;
6222
+ _yield$this$roap$hand = _context16.sent;
6056
6223
  turnServerInfo = _yield$this$roap$hand.turnServerInfo;
6057
6224
  turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
6058
6225
  this.turnDiscoverySkippedReason = turnDiscoverySkippedReason;
@@ -6061,7 +6228,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6061
6228
  this.roap.abortTurnDiscovery();
6062
6229
  }
6063
6230
  case 6:
6064
- _context15.next = 8;
6231
+ _context16.next = 8;
6065
6232
  break;
6066
6233
  case 7:
6067
6234
  // This is a retry, when join succeeded but addMedia failed, so we'll just call addMedia() again,
@@ -6069,43 +6236,43 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6069
6236
  forceTurnDiscovery = true;
6070
6237
  joined = true;
6071
6238
  case 8:
6072
- _context15.next = 9;
6239
+ _context16.next = 9;
6073
6240
  return this.addMediaInternal(function () {
6074
6241
  return _this30.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6075
6242
  }, turnServerInfo, forceTurnDiscovery, mediaOptions);
6076
6243
  case 9:
6077
- mediaResponse = _context15.sent;
6244
+ mediaResponse = _context16.sent;
6078
6245
  this.joinWithMediaRetryInfo = {
6079
6246
  isRetry: false,
6080
6247
  prevJoinResponse: undefined
6081
6248
  };
6082
- return _context15.abrupt("return", {
6249
+ return _context16.abrupt("return", {
6083
6250
  join: joinResponse,
6084
6251
  media: mediaResponse,
6085
6252
  multistreamEnabled: this.isMultistream
6086
6253
  });
6087
6254
  case 10:
6088
- _context15.prev = 10;
6089
- _t0 = _context15["catch"](2);
6090
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t0);
6255
+ _context16.prev = 10;
6256
+ _t1 = _context16["catch"](2);
6257
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t1);
6091
6258
  this.roap.abortTurnDiscovery();
6092
6259
 
6093
6260
  // if this was the first attempt, let's do a retry
6094
6261
  shouldRetry = !isRetry;
6095
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t0) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t0)) {
6262
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t1) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t1)) {
6096
6263
  // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
6097
6264
  // so there is no point doing a retry
6098
6265
  shouldRetry = false;
6099
6266
  }
6100
- if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t0)) {
6267
+ if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t1)) {
6101
6268
  shouldRetry = false;
6102
6269
  // eslint-disable-next-line no-ex-assign
6103
- _t0 = (0, _lodash.merge)({
6270
+ _t1 = (0, _lodash.merge)({
6104
6271
  error: {
6105
6272
  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
6273
+ errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t1),
6274
+ message: (_error2 = _t1) === null || _error2 === void 0 ? void 0 : _error2.message,
6275
+ name: (_error3 = _t1) === null || _error3 === void 0 ? void 0 : _error3.name
6109
6276
  }
6110
6277
  }
6111
6278
  });
@@ -6113,54 +6280,54 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6113
6280
 
6114
6281
  // 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
6282
  if (!(joined && (isRetry || !shouldRetry))) {
6116
- _context15.next = 14;
6283
+ _context16.next = 14;
6117
6284
  break;
6118
6285
  }
6119
- _context15.prev = 11;
6120
- _context15.next = 12;
6286
+ _context16.prev = 11;
6287
+ _context16.next = 12;
6121
6288
  return this.leave({
6122
6289
  resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
6123
6290
  reason: 'joinWithMedia failure'
6124
6291
  });
6125
6292
  case 12:
6126
- _context15.next = 14;
6293
+ _context16.next = 14;
6127
6294
  break;
6128
6295
  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;
6296
+ _context16.prev = 13;
6297
+ _t10 = _context16["catch"](11);
6298
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t10);
6299
+ leaveError = _t10;
6133
6300
  case 14:
6134
6301
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
6135
6302
  correlation_id: this.correlationId,
6136
6303
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
6137
6304
  // if join fails, we may end up with no locusUrl
6138
- reason: _t0.message,
6139
- stack: _t0.stack,
6305
+ reason: _t1.message,
6306
+ stack: _t1.stack,
6140
6307
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
6141
6308
  isRetry: isRetry
6142
6309
  }, {
6143
- type: _t0.name
6310
+ type: _t1.name
6144
6311
  });
6145
6312
  if (!shouldRetry) {
6146
- _context15.next = 15;
6313
+ _context16.next = 15;
6147
6314
  break;
6148
6315
  }
6149
6316
  _loggerProxy.default.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
6150
6317
  this.joinWithMediaRetryInfo.isRetry = true;
6151
6318
  this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
6152
- return _context15.abrupt("return", this.joinWithMedia(options));
6319
+ return _context16.abrupt("return", this.joinWithMedia(options));
6153
6320
  case 15:
6154
6321
  this.joinWithMediaRetryInfo = {
6155
6322
  isRetry: false,
6156
6323
  prevJoinResponse: undefined
6157
6324
  };
6158
- throw _t0;
6325
+ throw _t1;
6159
6326
  case 16:
6160
6327
  case "end":
6161
- return _context15.stop();
6328
+ return _context16.stop();
6162
6329
  }
6163
- }, _callee15, this, [[2, 10], [11, 13]]);
6330
+ }, _callee16, this, [[2, 10], [11, 13]]);
6164
6331
  }));
6165
6332
  function joinWithMedia() {
6166
6333
  return _joinWithMedia.apply(this, arguments);
@@ -6190,20 +6357,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6190
6357
  return _promise.default.reject(new _parameter.default('Cannot reconnect, Media has not established to reconnect'));
6191
6358
  }
6192
6359
  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) {
6360
+ return this.reconnectionManager.reconnect(options, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
6361
+ return _regenerator.default.wrap(function (_context17) {
6362
+ while (1) switch (_context17.prev = _context17.next) {
6196
6363
  case 0:
6197
- _context16.next = 1;
6364
+ _context17.next = 1;
6198
6365
  return _this31.waitForRemoteSDPAnswer();
6199
6366
  case 1:
6200
- _context16.next = 2;
6367
+ _context17.next = 2;
6201
6368
  return _this31.waitForMediaConnectionConnected();
6202
6369
  case 2:
6203
6370
  case "end":
6204
- return _context16.stop();
6371
+ return _context17.stop();
6205
6372
  }
6206
- }, _callee16);
6373
+ }, _callee17);
6207
6374
  }))).then(function () {
6208
6375
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
6209
6376
  }).catch(function (error) {
@@ -6344,53 +6511,75 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6344
6511
  }, {
6345
6512
  key: "startTranscription",
6346
6513
  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) {
6514
+ var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(options) {
6515
+ var _t11;
6516
+ return _regenerator.default.wrap(function (_context18) {
6517
+ while (1) switch (_context18.prev = _context18.next) {
6351
6518
  case 0:
6352
6519
  if (!this.isJoined()) {
6353
- _context17.next = 5;
6520
+ _context18.next = 5;
6354
6521
  break;
6355
6522
  }
6356
6523
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
6357
- _context17.prev = 1;
6524
+ _context18.prev = 1;
6358
6525
  if (!this.areVoiceaEventsSetup) {
6359
6526
  this.setUpVoiceaListeners();
6360
6527
  }
6361
6528
 
6362
6529
  // @ts-ignore
6363
- _context17.next = 2;
6530
+ _context18.next = 2;
6364
6531
  return this.webex.internal.voicea.turnOnCaptions(options === null || options === void 0 ? void 0 : options.spokenLanguage);
6365
6532
  case 2:
6366
- _context17.next = 4;
6533
+ _context18.next = 4;
6367
6534
  break;
6368
6535
  case 3:
6369
- _context17.prev = 3;
6370
- _t10 = _context17["catch"](1);
6371
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t10));
6536
+ _context18.prev = 3;
6537
+ _t11 = _context18["catch"](1);
6538
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t11));
6372
6539
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
6373
6540
  correlation_id: this.correlationId,
6374
- reason: _t10.message,
6375
- stack: _t10.stack
6541
+ reason: _t11.message,
6542
+ stack: _t11.stack
6376
6543
  });
6377
6544
  case 4:
6378
- _context17.next = 6;
6545
+ _context18.next = 6;
6379
6546
  break;
6380
6547
  case 5:
6381
6548
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
6382
6549
  throw new Error('Meeting is not joined');
6383
6550
  case 6:
6384
6551
  case "end":
6385
- return _context17.stop();
6552
+ return _context18.stop();
6386
6553
  }
6387
- }, _callee17, this, [[1, 3]]);
6554
+ }, _callee18, this, [[1, 3]]);
6388
6555
  }));
6389
- function startTranscription(_x13) {
6556
+ function startTranscription(_x14) {
6390
6557
  return _startTranscription.apply(this, arguments);
6391
6558
  }
6392
6559
  return startTranscription;
6393
6560
  }())
6561
+ }, {
6562
+ key: "isRelayEventRouteValid",
6563
+ value:
6564
+ /**
6565
+ * Verifies the relay event was delivered for the active LLM session binding.
6566
+ * @param {RelayEvent} event Event object coming from LLM Connection
6567
+ * @returns {boolean}
6568
+ */
6569
+ function isRelayEventRouteValid(event) {
6570
+ var _event$headers;
6571
+ var route = event === null || event === void 0 ? void 0 : (_event$headers = event.headers) === null || _event$headers === void 0 ? void 0 : _event$headers.route;
6572
+ if (!route) {
6573
+ return true;
6574
+ }
6575
+ var llm = this.webex.internal.llm;
6576
+ var isPracticeSession = llm.isConnected(_constants.LLM_PRACTICE_SESSION);
6577
+ var expectedBinding = isPracticeSession ? llm.getBinding(_constants.LLM_PRACTICE_SESSION) : llm.getBinding();
6578
+ if (!expectedBinding || route === expectedBinding) {
6579
+ return true;
6580
+ }
6581
+ return false;
6582
+ }
6394
6583
  }, {
6395
6584
  key: "stopTranscription",
6396
6585
  value:
@@ -6441,9 +6630,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6441
6630
  key: "restoreLLMSubscriptionsIfNeeded",
6442
6631
  value: function restoreLLMSubscriptionsIfNeeded() {
6443
6632
  try {
6444
- var _this$webex$internal$, _this$webex$internal$2;
6633
+ var _this$webex$internal$3, _this$webex$internal$4;
6445
6634
  // @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$);
6635
+ var isCaptionBoxOn = (_this$webex$internal$3 = this.webex.internal.voicea) === null || _this$webex$internal$3 === void 0 ? void 0 : (_this$webex$internal$4 = _this$webex$internal$3.getIsCaptionBoxOn) === null || _this$webex$internal$4 === void 0 ? void 0 : _this$webex$internal$4.call(_this$webex$internal$3);
6447
6636
  if (!isCaptionBoxOn) {
6448
6637
  return;
6449
6638
  }
@@ -6473,7 +6662,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6473
6662
  * Scenario D: Joining any other way (sip, pstn, conversationUrl, link just need to specify resourceId)
6474
6663
  */
6475
6664
  function () {
6476
- var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
6665
+ var _join = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
6477
6666
  var _this34 = this;
6478
6667
  var options,
6479
6668
  errorMessage,
@@ -6484,26 +6673,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6484
6673
  _error4,
6485
6674
  _errorMessage3,
6486
6675
  _error5,
6487
- _args18 = arguments,
6488
- _t11;
6489
- return _regenerator.default.wrap(function (_context18) {
6490
- while (1) switch (_context18.prev = _context18.next) {
6676
+ _args19 = arguments,
6677
+ _t12;
6678
+ return _regenerator.default.wrap(function (_context19) {
6679
+ while (1) switch (_context19.prev = _context19.next) {
6491
6680
  case 0:
6492
- options = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
6681
+ options = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
6493
6682
  if (this.webex.meetings.registered) {
6494
- _context18.next = 1;
6683
+ _context19.next = 1;
6495
6684
  break;
6496
6685
  }
6497
6686
  errorMessage = 'Meeting:index#join --> Device not registered';
6498
6687
  error = new Error(errorMessage);
6499
6688
  _loggerProxy.default.logger.error(errorMessage);
6500
- return _context18.abrupt("return", _promise.default.reject(error));
6689
+ return _context19.abrupt("return", _promise.default.reject(error));
6501
6690
  case 1:
6502
6691
  if (!this.deferJoin) {
6503
- _context18.next = 2;
6692
+ _context19.next = 2;
6504
6693
  break;
6505
6694
  }
6506
- return _context18.abrupt("return", this.deferJoin);
6695
+ return _context19.abrupt("return", this.deferJoin);
6507
6696
  case 2:
6508
6697
  // Create a deferred promise for a consistent resolve value from utils.
6509
6698
  // This also prevents redundant API calls.
@@ -6555,15 +6744,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6555
6744
  this.wirelessShare = true;
6556
6745
  }
6557
6746
  if (!options.meetingQuality) {
6558
- _context18.next = 6;
6747
+ _context19.next = 6;
6559
6748
  break;
6560
6749
  }
6561
6750
  if (!(typeof options.meetingQuality === 'string')) {
6562
- _context18.next = 4;
6751
+ _context19.next = 4;
6563
6752
  break;
6564
6753
  }
6565
6754
  if (_constants.QUALITY_LEVELS[options.meetingQuality]) {
6566
- _context18.next = 3;
6755
+ _context19.next = 3;
6567
6756
  break;
6568
6757
  }
6569
6758
  _errorMessage2 = "Meeting:index#join --> ".concat(options.meetingQuality, " not defined");
@@ -6571,16 +6760,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6571
6760
  _loggerProxy.default.logger.error(_errorMessage2);
6572
6761
  joinFailed(_error4);
6573
6762
  this.deferJoin = undefined;
6574
- return _context18.abrupt("return", _promise.default.reject(_error4));
6763
+ return _context19.abrupt("return", _promise.default.reject(_error4));
6575
6764
  case 3:
6576
6765
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality);
6577
6766
  case 4:
6578
6767
  if (!((0, _typeof2.default)(options.meetingQuality) === 'object')) {
6579
- _context18.next = 6;
6768
+ _context19.next = 6;
6580
6769
  break;
6581
6770
  }
6582
6771
  if (_constants.QUALITY_LEVELS[options.meetingQuality.remote]) {
6583
- _context18.next = 5;
6772
+ _context19.next = 5;
6584
6773
  break;
6585
6774
  }
6586
6775
  _errorMessage3 = "Meeting:index#join --> ".concat(options.meetingQuality.remote, " not defined");
@@ -6588,42 +6777,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6588
6777
  _error5 = new Error(_errorMessage3);
6589
6778
  joinFailed(_error5);
6590
6779
  this.deferJoin = undefined;
6591
- return _context18.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6780
+ return _context19.abrupt("return", _promise.default.reject(new Error(_errorMessage3)));
6592
6781
  case 5:
6593
6782
  if (options.meetingQuality.remote) {
6594
6783
  this.mediaProperties.setRemoteQualityLevel(options.meetingQuality.remote);
6595
6784
  }
6596
6785
  case 6:
6597
6786
  this.isMultistream = !!options.enableMultistream;
6598
- _context18.prev = 7;
6599
- _context18.next = 8;
6787
+ _context19.prev = 7;
6788
+ _context19.next = 8;
6600
6789
  return this.checkAndRefreshPermissionToken(_constants.MEETING_PERMISSION_TOKEN_REFRESH_THRESHOLD_IN_SEC, _constants.MEETING_PERMISSION_TOKEN_REFRESH_REASON);
6601
6790
  case 8:
6602
- _context18.next = 10;
6791
+ _context19.next = 10;
6603
6792
  break;
6604
6793
  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;
6794
+ _context19.prev = 9;
6795
+ _t12 = _context19["catch"](7);
6796
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t12);
6797
+ if (!(_t12 instanceof _captchaError.default || _t12 instanceof _passwordError.default || _t12 instanceof _permission.default)) {
6798
+ _context19.next = 10;
6610
6799
  break;
6611
6800
  }
6612
- this.meetingFiniteStateMachine.fail(_t11);
6801
+ this.meetingFiniteStateMachine.fail(_t12);
6613
6802
 
6614
6803
  // Upload logs on refreshpermissionToken refresh Failure
6615
6804
  _triggerProxy.default.trigger(this, {
6616
6805
  file: 'meeting/index',
6617
6806
  function: 'join'
6618
6807
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6619
- joinFailed(_t11);
6808
+ joinFailed(_t12);
6620
6809
  this.deferJoin = undefined;
6621
6810
 
6622
6811
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
6623
6812
  // and bubble it up to client
6624
- return _context18.abrupt("return", _promise.default.reject(_t11));
6813
+ return _context19.abrupt("return", _promise.default.reject(_t12));
6625
6814
  case 10:
6626
- return _context18.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6815
+ return _context19.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6627
6816
  _this34.meetingFiniteStateMachine.join();
6628
6817
  _this34.setupLocusMediaRequest();
6629
6818
 
@@ -6679,9 +6868,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6679
6868
  }));
6680
6869
  case 11:
6681
6870
  case "end":
6682
- return _context18.stop();
6871
+ return _context19.stop();
6683
6872
  }
6684
- }, _callee18, this, [[7, 9]]);
6873
+ }, _callee19, this, [[7, 9]]);
6685
6874
  }));
6686
6875
  function join() {
6687
6876
  return _join.apply(this, arguments);
@@ -6730,6 +6919,53 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6730
6919
  this.llmHealthCheckTimer = undefined;
6731
6920
  }
6732
6921
  }
6922
+
6923
+ /**
6924
+ * Removes LLM event listeners and clears the health check timer.
6925
+ * Must be called before Locus /leave to avoid unnecessary syncs triggered
6926
+ * by events received while leaving (per Locus team recommendation).
6927
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6928
+ * matching listener is registered.
6929
+ * @private
6930
+ * @returns {void}
6931
+ */
6932
+ }, {
6933
+ key: "stopListeningForLLMEvents",
6934
+ value: function stopListeningForLLMEvents() {
6935
+ // @ts-ignore - fix types
6936
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
6937
+ // @ts-ignore - fix types
6938
+ this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, this.processLocusLLMEvent);
6939
+ this.clearLLMHealthCheckTimer();
6940
+ }
6941
+
6942
+ /**
6943
+ * Stops listening on every event bus (LLM, Mercury, voicea/transcription,
6944
+ * annotation) that could otherwise deliver events to this meeting while
6945
+ * Locus is processing /leave or /end. Per the Locus team recommendation,
6946
+ * this must run before the Locus request is dispatched to avoid
6947
+ * unnecessary syncs triggered by in-flight events.
6948
+ *
6949
+ * Voicea (transcription) subscribes to llm 'event:relay.event' internally,
6950
+ * and the annotation plugin subscribes to both mercury and llm, so both
6951
+ * must be torn down alongside the direct LLM/Mercury listeners.
6952
+ *
6953
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6954
+ * matching listener is registered, and stopTranscription is guarded.
6955
+ * @private
6956
+ * @returns {void}
6957
+ */
6958
+ }, {
6959
+ key: "stopListeningForMeetingEvents",
6960
+ value: function stopListeningForMeetingEvents() {
6961
+ this.stopListeningForLLMEvents();
6962
+ this.stopListeningForMercuryEvents();
6963
+ if (this.transcription) {
6964
+ this.stopTranscription();
6965
+ this.transcription = undefined;
6966
+ }
6967
+ this.annotation.deregisterEvents();
6968
+ }
6733
6969
  }, {
6734
6970
  key: "clearDataChannelToken",
6735
6971
  value:
@@ -6773,55 +7009,55 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6773
7009
  }, {
6774
7010
  key: "ensureDefaultDatachannelTokenAfterAdmit",
6775
7011
  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) {
7012
+ var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
7013
+ var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t13;
7014
+ return _regenerator.default.wrap(function (_context20) {
7015
+ while (1) switch (_context20.prev = _context20.next) {
6780
7016
  case 0:
6781
- _context19.prev = 0;
7017
+ _context20.prev = 0;
6782
7018
  // @ts-ignore
6783
7019
  datachannelToken = this.webex.internal.llm.getDatachannelToken(); // @ts-ignore
6784
- _context19.next = 1;
7020
+ _context20.next = 1;
6785
7021
  return this.webex.internal.llm.isDataChannelTokenEnabled();
6786
7022
  case 1:
6787
- isDataChannelTokenEnabled = _context19.sent;
7023
+ isDataChannelTokenEnabled = _context20.sent;
6788
7024
  if (!(!isDataChannelTokenEnabled || datachannelToken)) {
6789
- _context19.next = 2;
7025
+ _context20.next = 2;
6790
7026
  break;
6791
7027
  }
6792
- return _context19.abrupt("return", false);
7028
+ return _context20.abrupt("return", false);
6793
7029
  case 2:
6794
- _context19.next = 3;
7030
+ _context20.next = 3;
6795
7031
  return this.meetingRequest.fetchDatachannelToken({
6796
7032
  locusUrl: this.locusUrl,
6797
7033
  requestingParticipantId: this.members.selfId,
6798
7034
  isPracticeSession: false
6799
7035
  });
6800
7036
  case 3:
6801
- response = _context19.sent;
7037
+ response = _context20.sent;
6802
7038
  fetchedDatachannelToken = response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.datachannelToken;
6803
7039
  if (fetchedDatachannelToken) {
6804
- _context19.next = 4;
7040
+ _context20.next = 4;
6805
7041
  break;
6806
7042
  }
6807
- return _context19.abrupt("return", false);
7043
+ return _context20.abrupt("return", false);
6808
7044
  case 4:
6809
7045
  // @ts-ignore
6810
7046
  this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
6811
- return _context19.abrupt("return", true);
7047
+ return _context20.abrupt("return", true);
6812
7048
  case 5:
6813
- _context19.prev = 5;
6814
- _t12 = _context19["catch"](0);
6815
- msg = (_t12 === null || _t12 === void 0 ? void 0 : _t12.message) || String(_t12);
7049
+ _context20.prev = 5;
7050
+ _t13 = _context20["catch"](0);
7051
+ msg = (_t13 === null || _t13 === void 0 ? void 0 : _t13.message) || String(_t13);
6816
7052
  _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
7053
+ statusCode: _t13 === null || _t13 === void 0 ? void 0 : _t13.statusCode
6818
7054
  });
6819
- return _context19.abrupt("return", false);
7055
+ return _context20.abrupt("return", false);
6820
7056
  case 6:
6821
7057
  case "end":
6822
- return _context19.stop();
7058
+ return _context20.stop();
6823
7059
  }
6824
- }, _callee19, this, [[0, 5]]);
7060
+ }, _callee20, this, [[0, 5]]);
6825
7061
  }));
6826
7062
  function ensureDefaultDatachannelTokenAfterAdmit() {
6827
7063
  return _ensureDefaultDatachannelTokenAfterAdmit.apply(this, arguments);
@@ -6837,43 +7073,71 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6837
7073
  }, {
6838
7074
  key: "updateLLMConnection",
6839
7075
  value: (function () {
6840
- var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
7076
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
6841
7077
  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) {
7078
+ var _ref39, _ref39$url, url, _ref39$info, _ref39$info2, _ref39$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl, currentOwner;
7079
+ return _regenerator.default.wrap(function (_context21) {
7080
+ while (1) switch (_context21.prev = _context21.next) {
6845
7081
  case 0:
6846
7082
  // @ts-ignore - Fix type
6847
7083
  _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
7084
  isJoined = this.isJoined(); // @ts-ignore
6849
7085
  datachannelToken = this.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.Default);
6850
- dataChannelUrl = datachannelUrl; // @ts-ignore - Fix type
7086
+ dataChannelUrl = datachannelUrl; // Ownership guard: when the default LLM session is already connected and
7087
+ // owned by a *different* Meeting instance, do not disconnect or reconfigure
7088
+ // it. Another meeting's `updateLLMConnection` must be ignored here to
7089
+ // avoid killing the socket it relies on. We only proceed to manage the
7090
+ // connection when this meeting is the current owner, or when no owner is
7091
+ // set yet (first claim).
7092
+ // @ts-ignore - Fix type
7093
+ currentOwner = this.webex.internal.llm.getOwnerMeetingId(); // @ts-ignore - Fix type
6851
7094
  if (!this.webex.internal.llm.isConnected()) {
6852
- _context20.next = 2;
7095
+ _context21.next = 3;
6853
7096
  break;
6854
7097
  }
7098
+ if (!(currentOwner && currentOwner !== this.id)) {
7099
+ _context21.next = 1;
7100
+ break;
7101
+ }
7102
+ // Another meeting owns the live LLM socket. We must not disconnect
7103
+ // or reconfigure it -- doing so would tear down a session the
7104
+ // owning meeting still relies on. Locus/datachannel URL mismatch is
7105
+ // expected here (each meeting has its own locus URL) and is NOT a
7106
+ // valid signal of staleness, so we never reclaim from this path.
7107
+ // The only safe reclaim mechanism is the `finally`-block owner-tag
7108
+ // release in `cleanupLLMConneciton`, which fires when this meeting
7109
+ // itself is being torn down.
7110
+ _loggerProxy.default.logger.info("Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ".concat(currentOwner, ", not ").concat(this.id));
7111
+ return _context21.abrupt("return", undefined);
7112
+ case 1:
6855
7113
  if (!(
6856
7114
  // @ts-ignore - Fix type
6857
7115
  url === this.webex.internal.llm.getLocusUrl() &&
6858
7116
  // @ts-ignore - Fix type
6859
7117
  dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6860
- _context20.next = 1;
7118
+ _context21.next = 2;
6861
7119
  break;
6862
7120
  }
6863
- return _context20.abrupt("return", undefined);
6864
- case 1:
6865
- _context20.next = 2;
7121
+ return _context21.abrupt("return", undefined);
7122
+ case 2:
7123
+ _context21.next = 3;
6866
7124
  return this.cleanupLLMConneciton({
6867
7125
  removeOnlineListener: false
6868
7126
  });
6869
- case 2:
7127
+ case 3:
6870
7128
  if (isJoined) {
6871
- _context20.next = 3;
7129
+ _context21.next = 4;
6872
7130
  break;
6873
7131
  }
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) {
7132
+ return _context21.abrupt("return", undefined);
7133
+ case 4:
7134
+ return _context21.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7135
+ var _this36$webex$interna, _this36$webex$interna2;
7136
+ // Record ownership of the default LLM session for this meeting so
7137
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7138
+ // calls can detect and skip work that doesn't belong to them.
7139
+ // @ts-ignore - Fix type
7140
+ (_this36$webex$interna = (_this36$webex$interna2 = _this36.webex.internal.llm).setOwnerMeetingId) === null || _this36$webex$interna === void 0 ? void 0 : _this36$webex$interna.call(_this36$webex$interna2, _this36.id);
6877
7141
  // @ts-ignore - Fix type
6878
7142
  _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
6879
7143
  // @ts-ignore - Fix type
@@ -6886,11 +7150,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6886
7150
  _this36.startLLMHealthCheckTimer();
6887
7151
  return _promise.default.resolve(registerAndConnectResult);
6888
7152
  }));
6889
- case 4:
7153
+ case 5:
6890
7154
  case "end":
6891
- return _context20.stop();
7155
+ return _context21.stop();
6892
7156
  }
6893
- }, _callee20, this);
7157
+ }, _callee21, this);
6894
7158
  }));
6895
7159
  function updateLLMConnection() {
6896
7160
  return _updateLLMConnection.apply(this, arguments);
@@ -7076,17 +7340,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7076
7340
  meetingId: this.id
7077
7341
  }
7078
7342
  });
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) {
7343
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
7344
+ var mediaSettings, _t14;
7345
+ return _regenerator.default.wrap(function (_context22) {
7346
+ while (1) switch (_context22.prev = _context22.next) {
7083
7347
  case 0:
7084
- _context21.prev = 0;
7348
+ _context22.prev = 0;
7085
7349
  if (!(_this40.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
7086
- _context21.next = 1;
7350
+ _context22.next = 1;
7087
7351
  break;
7088
7352
  }
7089
- _context21.next = 1;
7353
+ _context22.next = 1;
7090
7354
  return _this40.releaseScreenShareFloor();
7091
7355
  case 1:
7092
7356
  mediaSettings = {
@@ -7105,23 +7369,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7105
7369
  // 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
7370
  // once the device answers we close the old connection and create new media server connection with only share enabled
7107
7371
  if (!_this40.statsAnalyzer) {
7108
- _context21.next = 2;
7372
+ _context22.next = 2;
7109
7373
  break;
7110
7374
  }
7111
- _context21.next = 2;
7375
+ _context22.next = 2;
7112
7376
  return _this40.statsAnalyzer.stopAnalyzer();
7113
7377
  case 2:
7114
- _context21.next = 3;
7378
+ _context22.next = 3;
7115
7379
  return _this40.closeRemoteStreams();
7116
7380
  case 3:
7117
- _context21.next = 4;
7381
+ _context22.next = 4;
7118
7382
  return _this40.closePeerConnections();
7119
7383
  case 4:
7120
7384
  _this40.cleanupLocalStreams();
7121
7385
  _this40.unsetRemoteStreams();
7122
7386
  _this40.unsetPeerConnections();
7123
7387
  _this40.reconnectionManager.cleanUp();
7124
- _context21.next = 5;
7388
+ _context22.next = 5;
7125
7389
  return _this40.addMedia({
7126
7390
  audioEnabled: false,
7127
7391
  videoEnabled: false,
@@ -7130,24 +7394,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7130
7394
  case 5:
7131
7395
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
7132
7396
  _this40.isMoveToInProgress = false;
7133
- _context21.next = 7;
7397
+ _context22.next = 7;
7134
7398
  break;
7135
7399
  case 6:
7136
- _context21.prev = 6;
7137
- _t13 = _context21["catch"](0);
7138
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t13);
7400
+ _context22.prev = 6;
7401
+ _t14 = _context22["catch"](0);
7402
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t14);
7139
7403
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
7140
7404
  correlation_id: _this40.correlationId,
7141
7405
  locus_id: _this40.locusUrl.split('/').pop(),
7142
- reason: _t13.message,
7143
- stack: _t13.stack
7406
+ reason: _t14.message,
7407
+ stack: _t14.stack
7144
7408
  });
7145
7409
  _this40.isMoveToInProgress = false;
7146
7410
  case 7:
7147
7411
  case "end":
7148
- return _context21.stop();
7412
+ return _context22.stop();
7149
7413
  }
7150
- }, _callee21, null, [[0, 6]]);
7414
+ }, _callee22, null, [[0, 6]]);
7151
7415
  })));
7152
7416
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
7153
7417
 
@@ -7235,10 +7499,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7235
7499
  }, {
7236
7500
  key: "createMediaConnection",
7237
7501
  value: (function () {
7238
- var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
7502
+ var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(turnServerInfo, bundlePolicy) {
7239
7503
  var mc, audioEnabled, videoEnabled, shareEnabled;
7240
- return _regenerator.default.wrap(function (_context22) {
7241
- while (1) switch (_context22.prev = _context22.next) {
7504
+ return _regenerator.default.wrap(function (_context23) {
7505
+ while (1) switch (_context23.prev = _context23.next) {
7242
7506
  case 0:
7243
7507
  this.rtcMetrics = this.isMultistream ?
7244
7508
  // @ts-ignore
@@ -7280,42 +7544,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7280
7544
 
7281
7545
  // publish the streams
7282
7546
  if (!this.mediaProperties.audioStream) {
7283
- _context22.next = 1;
7547
+ _context23.next = 1;
7284
7548
  break;
7285
7549
  }
7286
7550
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
7287
- _context22.next = 1;
7551
+ _context23.next = 1;
7288
7552
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
7289
7553
  case 1:
7290
7554
  if (!this.mediaProperties.videoStream) {
7291
- _context22.next = 2;
7555
+ _context23.next = 2;
7292
7556
  break;
7293
7557
  }
7294
- _context22.next = 2;
7558
+ _context23.next = 2;
7295
7559
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
7296
7560
  case 2:
7297
7561
  if (!this.mediaProperties.shareVideoStream) {
7298
- _context22.next = 3;
7562
+ _context23.next = 3;
7299
7563
  break;
7300
7564
  }
7301
- _context22.next = 3;
7565
+ _context23.next = 3;
7302
7566
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
7303
7567
  case 3:
7304
7568
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
7305
- _context22.next = 4;
7569
+ _context23.next = 4;
7306
7570
  break;
7307
7571
  }
7308
- _context22.next = 4;
7572
+ _context23.next = 4;
7309
7573
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
7310
7574
  case 4:
7311
- return _context22.abrupt("return", mc);
7575
+ return _context23.abrupt("return", mc);
7312
7576
  case 5:
7313
7577
  case "end":
7314
- return _context22.stop();
7578
+ return _context23.stop();
7315
7579
  }
7316
- }, _callee22, this);
7580
+ }, _callee23, this);
7317
7581
  }));
7318
- function createMediaConnection(_x14, _x15) {
7582
+ function createMediaConnection(_x15, _x16) {
7319
7583
  return _createMediaConnection.apply(this, arguments);
7320
7584
  }
7321
7585
  return createMediaConnection;
@@ -7353,11 +7617,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7353
7617
  }, {
7354
7618
  key: "setUpLocalStreamReferences",
7355
7619
  value: (function () {
7356
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
7620
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(localStreams) {
7357
7621
  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) {
7622
+ var setUpStreamPromises, _t15;
7623
+ return _regenerator.default.wrap(function (_context24) {
7624
+ while (1) switch (_context24.prev = _context24.next) {
7361
7625
  case 0:
7362
7626
  setUpStreamPromises = [];
7363
7627
  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 +7636,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7372
7636
  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
7637
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
7374
7638
  }
7375
- _context23.prev = 1;
7376
- _context23.next = 2;
7639
+ _context24.prev = 1;
7640
+ _context24.next = 2;
7377
7641
  return _promise.default.all(setUpStreamPromises);
7378
7642
  case 2:
7379
- _context23.next = 4;
7643
+ _context24.next = 4;
7380
7644
  break;
7381
7645
  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;
7646
+ _context24.prev = 3;
7647
+ _t15 = _context24["catch"](1);
7648
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t15);
7649
+ throw _t15;
7386
7650
  case 4:
7387
7651
  case "end":
7388
- return _context23.stop();
7652
+ return _context24.stop();
7389
7653
  }
7390
- }, _callee23, this, [[1, 3]]);
7654
+ }, _callee24, this, [[1, 3]]);
7391
7655
  }));
7392
- function setUpLocalStreamReferences(_x16) {
7656
+ function setUpLocalStreamReferences(_x17) {
7393
7657
  return _setUpLocalStreamReferences.apply(this, arguments);
7394
7658
  }
7395
7659
  return setUpLocalStreamReferences;
@@ -7404,72 +7668,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7404
7668
  }, {
7405
7669
  key: "waitForMediaConnectionConnected",
7406
7670
  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) {
7671
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7672
+ var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29, _t30;
7673
+ return _regenerator.default.wrap(function (_context25) {
7674
+ while (1) switch (_context25.prev = _context25.next) {
7411
7675
  case 0:
7412
- _context24.prev = 0;
7413
- _context24.next = 1;
7676
+ _context25.prev = 0;
7677
+ _context25.next = 1;
7414
7678
  return this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
7415
7679
  case 1:
7416
- _context24.next = 5;
7680
+ _context25.next = 5;
7417
7681
  break;
7418
7682
  case 2:
7419
- _context24.prev = 2;
7420
- _t15 = _context24["catch"](0);
7421
- iceConnected = _t15.iceConnected;
7683
+ _context25.prev = 2;
7684
+ _t16 = _context25["catch"](0);
7685
+ iceConnected = _t16.iceConnected;
7422
7686
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
7423
- _context24.next = 4;
7687
+ _context25.next = 4;
7424
7688
  break;
7425
7689
  }
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;
7690
+ _t17 = this.webex.internal.newMetrics;
7691
+ _t18 = !this.turnServerUsed;
7692
+ _t19 = this.addMediaData.icePhaseCallback();
7693
+ _t20 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7694
+ _t21 = _internalPluginMetrics.CallDiagnosticUtils;
7695
+ _t22 = ((_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';
7696
+ _t23 = iceConnected;
7697
+ _t24 = this.turnServerUsed;
7698
+ _context25.next = 3;
7435
7699
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
7436
7700
  return false;
7437
7701
  });
7438
7702
  case 3:
7439
- _t24 = _context24.sent;
7440
- _t25 = _t20.generateClientErrorCodeForIceFailure.call(_t20, {
7441
- signalingState: _t21,
7442
- iceConnected: _t22,
7443
- turnServerUsed: _t23,
7444
- unreachable: _t24
7703
+ _t25 = _context25.sent;
7704
+ _t26 = _t21.generateClientErrorCodeForIceFailure.call(_t21, {
7705
+ signalingState: _t22,
7706
+ iceConnected: _t23,
7707
+ turnServerUsed: _t24,
7708
+ unreachable: _t25
7445
7709
  });
7446
- _t26 = _t19.getErrorPayloadForClientErrorCode.call(_t19, {
7447
- clientErrorCode: _t25
7710
+ _t27 = _t20.getErrorPayloadForClientErrorCode.call(_t20, {
7711
+ clientErrorCode: _t26
7448
7712
  });
7449
- _t27 = [_t26];
7450
- _t28 = {
7451
- canProceed: _t17,
7452
- icePhase: _t18,
7453
- errors: _t27
7454
- };
7713
+ _t28 = [_t27];
7455
7714
  _t29 = {
7715
+ canProceed: _t18,
7716
+ icePhase: _t19,
7717
+ errors: _t28
7718
+ };
7719
+ _t30 = {
7456
7720
  meetingId: this.id,
7457
- rawError: _t15
7721
+ rawError: _t16
7458
7722
  };
7459
- _t16.submitClientEvent.call(_t16, {
7723
+ _t17.submitClientEvent.call(_t17, {
7460
7724
  name: 'client.ice.end',
7461
- payload: _t28,
7462
- options: _t29
7725
+ payload: _t29,
7726
+ options: _t30
7463
7727
  });
7464
7728
  case 4:
7465
7729
  timedOutError = new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
7466
- timedOutError.cause = _t15;
7730
+ timedOutError.cause = _t16;
7467
7731
  throw timedOutError;
7468
7732
  case 5:
7469
7733
  case "end":
7470
- return _context24.stop();
7734
+ return _context25.stop();
7471
7735
  }
7472
- }, _callee24, this, [[0, 2]]);
7736
+ }, _callee25, this, [[0, 2]]);
7473
7737
  }));
7474
7738
  function waitForMediaConnectionConnected() {
7475
7739
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -7536,19 +7800,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7536
7800
  }, {
7537
7801
  key: "waitForRemoteSDPAnswer",
7538
7802
  value: (function () {
7539
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7803
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
7540
7804
  var _this44 = this;
7541
7805
  var LOG_HEADER, deferSDPAnswer;
7542
- return _regenerator.default.wrap(function (_context25) {
7543
- while (1) switch (_context25.prev = _context25.next) {
7806
+ return _regenerator.default.wrap(function (_context26) {
7807
+ while (1) switch (_context26.prev = _context26.next) {
7544
7808
  case 0:
7545
7809
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
7546
7810
  if (this.deferSDPAnswer) {
7547
- _context25.next = 1;
7811
+ _context26.next = 1;
7548
7812
  break;
7549
7813
  }
7550
7814
  _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')));
7815
+ return _context26.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7552
7816
  case 1:
7553
7817
  deferSDPAnswer = this.deferSDPAnswer;
7554
7818
  this.sdpResponseTimer = setTimeout(function () {
@@ -7574,12 +7838,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7574
7838
  deferSDPAnswer.reject(error);
7575
7839
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
7576
7840
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
7577
- return _context25.abrupt("return", deferSDPAnswer.promise);
7841
+ return _context26.abrupt("return", deferSDPAnswer.promise);
7578
7842
  case 2:
7579
7843
  case "end":
7580
- return _context25.stop();
7844
+ return _context26.stop();
7581
7845
  }
7582
- }, _callee25, this);
7846
+ }, _callee26, this);
7583
7847
  }));
7584
7848
  function waitForRemoteSDPAnswer() {
7585
7849
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -7598,30 +7862,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7598
7862
  }, {
7599
7863
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
7600
7864
  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) {
7865
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7866
+ var LOG_HEADER, _t31;
7867
+ return _regenerator.default.wrap(function (_context27) {
7868
+ while (1) switch (_context27.prev = _context27.next) {
7605
7869
  case 0:
7606
7870
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
7607
- _context26.prev = 1;
7608
- _context26.next = 2;
7871
+ _context27.prev = 1;
7872
+ _context27.next = 2;
7609
7873
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
7610
7874
  case 2:
7611
- _context26.next = 4;
7875
+ _context27.next = 4;
7612
7876
  break;
7613
7877
  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;
7878
+ _context27.prev = 3;
7879
+ _t31 = _context27["catch"](1);
7880
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t31);
7881
+ throw _t31;
7618
7882
  case 4:
7619
7883
  case "end":
7620
- return _context26.stop();
7884
+ return _context27.stop();
7621
7885
  }
7622
- }, _callee26, this, [[1, 3]]);
7886
+ }, _callee27, this, [[1, 3]]);
7623
7887
  }));
7624
- function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x17, _x18) {
7888
+ function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x18, _x19) {
7625
7889
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
7626
7890
  }
7627
7891
  return retryEstablishMediaConnectionWithForcedTurnDiscovery;
@@ -7639,14 +7903,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7639
7903
  }, {
7640
7904
  key: "retryWithForcedTurnDiscovery",
7641
7905
  value: (function () {
7642
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7906
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(remoteMediaManagerConfig, bundlePolicy) {
7643
7907
  var LOG_HEADER;
7644
- return _regenerator.default.wrap(function (_context27) {
7645
- while (1) switch (_context27.prev = _context27.next) {
7908
+ return _regenerator.default.wrap(function (_context28) {
7909
+ while (1) switch (_context28.prev = _context28.next) {
7646
7910
  case 0:
7647
7911
  this.addMediaData.retriedWithTurnServer = true;
7648
7912
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
7649
- _context27.next = 1;
7913
+ _context28.next = 1;
7650
7914
  return this.cleanUpBeforeRetryWithTurnServer();
7651
7915
  case 1:
7652
7916
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -7656,24 +7920,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7656
7920
  reason: 'forcingTurnTls'
7657
7921
  });
7658
7922
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
7659
- _context27.next = 2;
7923
+ _context28.next = 2;
7660
7924
  break;
7661
7925
  }
7662
7926
  _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;
7927
+ _context28.next = 2;
7664
7928
  return this.join({
7665
7929
  rejoin: true
7666
7930
  });
7667
7931
  case 2:
7668
- _context27.next = 3;
7932
+ _context28.next = 3;
7669
7933
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7670
7934
  case 3:
7671
7935
  case "end":
7672
- return _context27.stop();
7936
+ return _context28.stop();
7673
7937
  }
7674
- }, _callee27, this);
7938
+ }, _callee28, this);
7675
7939
  }));
7676
- function retryWithForcedTurnDiscovery(_x19, _x20) {
7940
+ function retryWithForcedTurnDiscovery(_x20, _x21) {
7677
7941
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
7678
7942
  }
7679
7943
  return retryWithForcedTurnDiscovery;
@@ -7693,32 +7957,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7693
7957
  }, {
7694
7958
  key: "handleWaitForMediaConnectionConnectedError",
7695
7959
  value: (function () {
7696
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
7960
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(error, remoteMediaManagerConfig, bundlePolicy) {
7697
7961
  var LOG_HEADER;
7698
- return _regenerator.default.wrap(function (_context28) {
7699
- while (1) switch (_context28.prev = _context28.next) {
7962
+ return _regenerator.default.wrap(function (_context29) {
7963
+ while (1) switch (_context29.prev = _context29.next) {
7700
7964
  case 0:
7701
7965
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
7702
7966
  if (this.turnServerUsed) {
7703
- _context28.next = 2;
7967
+ _context29.next = 2;
7704
7968
  break;
7705
7969
  }
7706
7970
  _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;
7971
+ _context29.next = 1;
7708
7972
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7709
7973
  case 1:
7710
- _context28.next = 3;
7974
+ _context29.next = 3;
7711
7975
  break;
7712
7976
  case 2:
7713
7977
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
7714
7978
  throw new _webexErrors.AddMediaFailed(error);
7715
7979
  case 3:
7716
7980
  case "end":
7717
- return _context28.stop();
7981
+ return _context29.stop();
7718
7982
  }
7719
- }, _callee28, this);
7983
+ }, _callee29, this);
7720
7984
  }));
7721
- function handleWaitForMediaConnectionConnectedError(_x21, _x22, _x23) {
7985
+ function handleWaitForMediaConnectionConnectedError(_x22, _x23, _x24) {
7722
7986
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
7723
7987
  }
7724
7988
  return handleWaitForMediaConnectionConnectedError;
@@ -7734,20 +7998,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7734
7998
  }, {
7735
7999
  key: "doTurnDiscovery",
7736
8000
  value: (function () {
7737
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
8001
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(isReconnecting, isForced) {
7738
8002
  var cdl, turnDiscoveryResult;
7739
- return _regenerator.default.wrap(function (_context29) {
7740
- while (1) switch (_context29.prev = _context29.next) {
8003
+ return _regenerator.default.wrap(function (_context30) {
8004
+ while (1) switch (_context30.prev = _context30.next) {
7741
8005
  case 0:
7742
8006
  // @ts-ignore
7743
8007
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
7744
8008
  this.webex.internal.newMetrics.submitInternalEvent({
7745
8009
  name: 'internal.client.add-media.turn-discovery.start'
7746
8010
  });
7747
- _context29.next = 1;
8011
+ _context30.next = 1;
7748
8012
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
7749
8013
  case 1:
7750
- turnDiscoveryResult = _context29.sent;
8014
+ turnDiscoveryResult = _context30.sent;
7751
8015
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
7752
8016
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
7753
8017
 
@@ -7763,14 +8027,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7763
8027
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
7764
8028
  });
7765
8029
  }
7766
- return _context29.abrupt("return", turnDiscoveryResult);
8030
+ return _context30.abrupt("return", turnDiscoveryResult);
7767
8031
  case 2:
7768
8032
  case "end":
7769
- return _context29.stop();
8033
+ return _context30.stop();
7770
8034
  }
7771
- }, _callee29, this);
8035
+ }, _callee30, this);
7772
8036
  }));
7773
- function doTurnDiscovery(_x24, _x25) {
8037
+ function doTurnDiscovery(_x25, _x26) {
7774
8038
  return _doTurnDiscovery.apply(this, arguments);
7775
8039
  }
7776
8040
  return doTurnDiscovery;
@@ -7789,35 +8053,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7789
8053
  }, {
7790
8054
  key: "establishMediaConnection",
7791
8055
  value: (function () {
7792
- var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
8056
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7793
8057
  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) {
8058
+ var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t32, _t33;
8059
+ return _regenerator.default.wrap(function (_context31) {
8060
+ while (1) switch (_context31.prev = _context31.next) {
7797
8061
  case 0:
7798
8062
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
7799
8063
  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
8064
  if (this.isMoveToInProgress && this.turnServerUsed) {
7801
8065
  isForced = true;
7802
8066
  }
7803
- _context30.prev = 1;
8067
+ _context31.prev = 1;
7804
8068
  if (turnServerInfo) {
7805
- _context30.next = 3;
8069
+ _context31.next = 3;
7806
8070
  break;
7807
8071
  }
7808
- _context30.next = 2;
8072
+ _context31.next = 2;
7809
8073
  return this.doTurnDiscovery(isReconnecting, isForced);
7810
8074
  case 2:
7811
- _yield$this$doTurnDis = _context30.sent;
8075
+ _yield$this$doTurnDis = _context31.sent;
7812
8076
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
7813
8077
  case 3:
7814
- _context30.next = 4;
8078
+ _context31.next = 4;
7815
8079
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
7816
8080
  case 4:
7817
- mc = _context30.sent;
8081
+ mc = _context31.sent;
7818
8082
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
7819
8083
  if (!this.isMultistream) {
7820
- _context30.next = 5;
8084
+ _context31.next = 5;
7821
8085
  break;
7822
8086
  }
7823
8087
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -7825,42 +8089,42 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7825
8089
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
7826
8090
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
7827
8091
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
7828
- _context30.next = 5;
8092
+ _context31.next = 5;
7829
8093
  return this.remoteMediaManager.start();
7830
8094
  case 5:
7831
- _context30.next = 6;
8095
+ _context31.next = 6;
7832
8096
  return mc.initiateOffer();
7833
8097
  case 6:
7834
- _context30.next = 7;
8098
+ _context31.next = 7;
7835
8099
  return this.waitForRemoteSDPAnswer();
7836
8100
  case 7:
7837
8101
  this.handleMediaLogging(this.mediaProperties);
7838
- _context30.next = 9;
8102
+ _context31.next = 9;
7839
8103
  break;
7840
8104
  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;
8105
+ _context31.prev = 8;
8106
+ _t32 = _context31["catch"](1);
8107
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t32);
8108
+ throw _t32;
7845
8109
  case 9:
7846
- _context30.prev = 9;
7847
- _context30.next = 10;
8110
+ _context31.prev = 9;
8111
+ _context31.next = 10;
7848
8112
  return this.waitForMediaConnectionConnected();
7849
8113
  case 10:
7850
- _context30.next = 12;
8114
+ _context31.next = 12;
7851
8115
  break;
7852
8116
  case 11:
7853
- _context30.prev = 11;
7854
- _t32 = _context30["catch"](9);
7855
- _context30.next = 12;
7856
- return this.handleWaitForMediaConnectionConnectedError(_t32, remoteMediaManagerConfig, bundlePolicy);
8117
+ _context31.prev = 11;
8118
+ _t33 = _context31["catch"](9);
8119
+ _context31.next = 12;
8120
+ return this.handleWaitForMediaConnectionConnectedError(_t33, remoteMediaManagerConfig, bundlePolicy);
7857
8121
  case 12:
7858
8122
  case "end":
7859
- return _context30.stop();
8123
+ return _context31.stop();
7860
8124
  }
7861
- }, _callee30, this, [[1, 8], [9, 11]]);
8125
+ }, _callee31, this, [[1, 8], [9, 11]]);
7862
8126
  }));
7863
- function establishMediaConnection(_x26, _x27, _x28, _x29) {
8127
+ function establishMediaConnection(_x27, _x28, _x29, _x30) {
7864
8128
  return _establishMediaConnection.apply(this, arguments);
7865
8129
  }
7866
8130
  return establishMediaConnection;
@@ -7875,16 +8139,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7875
8139
  }, {
7876
8140
  key: "cleanUpOnAddMediaFailure",
7877
8141
  value: (function () {
7878
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
8142
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
7879
8143
  var _this$networkQualityM, _this$statsMonitor;
7880
- return _regenerator.default.wrap(function (_context31) {
7881
- while (1) switch (_context31.prev = _context31.next) {
8144
+ return _regenerator.default.wrap(function (_context32) {
8145
+ while (1) switch (_context32.prev = _context32.next) {
7882
8146
  case 0:
7883
8147
  if (!this.statsAnalyzer) {
7884
- _context31.next = 1;
8148
+ _context32.next = 1;
7885
8149
  break;
7886
8150
  }
7887
- _context31.next = 1;
8151
+ _context32.next = 1;
7888
8152
  return this.statsAnalyzer.stopAnalyzer();
7889
8153
  case 1:
7890
8154
  this.statsAnalyzer = null;
@@ -7895,7 +8159,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7895
8159
 
7896
8160
  // when media fails, we want to upload a webrtc dump to see whats going on
7897
8161
  // this function is async, but returns once the stats have been gathered
7898
- _context31.next = 2;
8162
+ _context32.next = 2;
7899
8163
  return this.forceSendStatsReport({
7900
8164
  callFrom: 'addMedia'
7901
8165
  });
@@ -7906,9 +8170,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7906
8170
  }
7907
8171
  case 3:
7908
8172
  case "end":
7909
- return _context31.stop();
8173
+ return _context32.stop();
7910
8174
  }
7911
- }, _callee31, this);
8175
+ }, _callee32, this);
7912
8176
  }));
7913
8177
  function cleanUpOnAddMediaFailure() {
7914
8178
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -7926,16 +8190,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7926
8190
  }, {
7927
8191
  key: "downgradeFromMultistreamToTranscoded",
7928
8192
  value: (function () {
7929
- var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
8193
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7930
8194
  var _this$networkQualityM2, _this$statsMonitor2, _this$locusMediaReque2;
7931
- return _regenerator.default.wrap(function (_context32) {
7932
- while (1) switch (_context32.prev = _context32.next) {
8195
+ return _regenerator.default.wrap(function (_context33) {
8196
+ while (1) switch (_context33.prev = _context33.next) {
7933
8197
  case 0:
7934
8198
  if (!this.statsAnalyzer) {
7935
- _context32.next = 1;
8199
+ _context33.next = 1;
7936
8200
  break;
7937
8201
  }
7938
- _context32.next = 1;
8202
+ _context33.next = 1;
7939
8203
  return this.statsAnalyzer.stopAnalyzer();
7940
8204
  case 1:
7941
8205
  this.statsAnalyzer = null;
@@ -7953,9 +8217,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7953
8217
  this.createStatsAnalyzer();
7954
8218
  case 2:
7955
8219
  case "end":
7956
- return _context32.stop();
8220
+ return _context33.stop();
7957
8221
  }
7958
- }, _callee32, this);
8222
+ }, _callee33, this);
7959
8223
  }));
7960
8224
  function downgradeFromMultistreamToTranscoded() {
7961
8225
  return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
@@ -7973,11 +8237,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7973
8237
  }, {
7974
8238
  key: "cleanUpBeforeRetryWithTurnServer",
7975
8239
  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) {
8240
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
8241
+ return _regenerator.default.wrap(function (_context34) {
8242
+ while (1) switch (_context34.prev = _context34.next) {
7979
8243
  case 0:
7980
- _context33.next = 1;
8244
+ _context34.next = 1;
7981
8245
  return this.forceSendStatsReport({
7982
8246
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
7983
8247
  });
@@ -7997,9 +8261,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7997
8261
  }
7998
8262
  case 2:
7999
8263
  case "end":
8000
- return _context33.stop();
8264
+ return _context34.stop();
8001
8265
  }
8002
- }, _callee33, this);
8266
+ }, _callee34, this);
8003
8267
  }));
8004
8268
  function cleanUpBeforeRetryWithTurnServer() {
8005
8269
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -8009,35 +8273,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8009
8273
  }, {
8010
8274
  key: "cleanUpBeforeReconnection",
8011
8275
  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) {
8276
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
8277
+ var _t34;
8278
+ return _regenerator.default.wrap(function (_context35) {
8279
+ while (1) switch (_context35.prev = _context35.next) {
8016
8280
  case 0:
8017
- _context34.prev = 0;
8018
- _context34.next = 1;
8281
+ _context35.prev = 0;
8282
+ _context35.next = 1;
8019
8283
  return this.forceSendStatsReport({
8020
8284
  callFrom: 'cleanUpBeforeReconnection'
8021
8285
  });
8022
8286
  case 1:
8023
8287
  if (!this.statsAnalyzer) {
8024
- _context34.next = 2;
8288
+ _context35.next = 2;
8025
8289
  break;
8026
8290
  }
8027
- _context34.next = 2;
8291
+ _context35.next = 2;
8028
8292
  return this.statsAnalyzer.stopAnalyzer();
8029
8293
  case 2:
8030
- _context34.next = 4;
8294
+ _context35.next = 4;
8031
8295
  break;
8032
8296
  case 3:
8033
- _context34.prev = 3;
8034
- _t33 = _context34["catch"](0);
8035
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t33);
8297
+ _context35.prev = 3;
8298
+ _t34 = _context35["catch"](0);
8299
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t34);
8036
8300
  case 4:
8037
8301
  case "end":
8038
- return _context34.stop();
8302
+ return _context35.stop();
8039
8303
  }
8040
- }, _callee34, this, [[0, 3]]);
8304
+ }, _callee35, this, [[0, 3]]);
8041
8305
  }));
8042
8306
  function cleanUpBeforeReconnection() {
8043
8307
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -8105,7 +8369,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8105
8369
  }, {
8106
8370
  key: "addMediaInternal",
8107
8371
  value: (function () {
8108
- var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8372
+ var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8109
8373
  var options,
8110
8374
  LOG_HEADER,
8111
8375
  localStreams,
@@ -8167,26 +8431,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8167
8431
  _selectedCandidatePairChanges,
8168
8432
  _numTransports,
8169
8433
  _iceCandidateErrors,
8170
- _args35 = arguments,
8171
- _t34,
8172
- _t35;
8173
- return _regenerator.default.wrap(function (_context35) {
8174
- while (1) switch (_context35.prev = _context35.next) {
8434
+ _args36 = arguments,
8435
+ _t35,
8436
+ _t36;
8437
+ return _regenerator.default.wrap(function (_context36) {
8438
+ while (1) switch (_context36.prev = _context36.next) {
8175
8439
  case 0:
8176
- options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
8440
+ options = _args36.length > 3 && _args36[3] !== undefined ? _args36[3] : {};
8177
8441
  this.addMediaData.retriedWithTurnServer = false;
8178
8442
  this.addMediaData.icePhaseCallback = icePhaseCallback;
8179
8443
  this.hasMediaConnectionConnectedAtLeastOnce = false;
8180
8444
  LOG_HEADER = 'Meeting:index#addMedia -->';
8181
8445
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
8182
8446
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
8183
- _context35.next = 1;
8447
+ _context36.next = 1;
8184
8448
  break;
8185
8449
  }
8186
8450
  throw new _webexErrors.MeetingNotActiveError();
8187
8451
  case 1:
8188
8452
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
8189
- _context35.next = 2;
8453
+ _context36.next = 2;
8190
8454
  break;
8191
8455
  }
8192
8456
  throw new _webexErrors.UserNotJoinedError();
@@ -8203,7 +8467,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8203
8467
  ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
8204
8468
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
8205
8469
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
8206
- _context35.next = 3;
8470
+ _context36.next = 3;
8207
8471
  break;
8208
8472
  }
8209
8473
  throw new _webexErrors.UserInLobbyError();
@@ -8247,62 +8511,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8247
8511
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
8248
8512
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
8249
8513
  this.brbState = (0, _brbState.createBrbState)(this, false);
8250
- _context35.prev = 4;
8514
+ _context36.prev = 4;
8251
8515
  if (!(allowPublishMediaInLobby || !this.isUserUnadmitted)) {
8252
- _context35.next = 5;
8516
+ _context36.next = 5;
8253
8517
  break;
8254
8518
  }
8255
- _context35.next = 5;
8519
+ _context36.next = 5;
8256
8520
  return this.setUpLocalStreamReferences(localStreams);
8257
8521
  case 5:
8258
8522
  this.setMercuryListener();
8259
8523
  this.createStatsAnalyzer();
8260
- _context35.prev = 6;
8261
- _context35.next = 7;
8524
+ _context36.prev = 6;
8525
+ _context36.next = 7;
8262
8526
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
8263
8527
  case 7:
8264
- _context35.next = 12;
8528
+ _context36.next = 12;
8265
8529
  break;
8266
8530
  case 8:
8267
- _context35.prev = 8;
8268
- _t34 = _context35["catch"](6);
8269
- if (!(_t34 instanceof _multistreamNotSupportedError.default)) {
8270
- _context35.next = 11;
8531
+ _context36.prev = 8;
8532
+ _t35 = _context36["catch"](6);
8533
+ if (!(_t35 instanceof _multistreamNotSupportedError.default)) {
8534
+ _context36.next = 11;
8271
8535
  break;
8272
8536
  }
8273
8537
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
8274
- _context35.next = 9;
8538
+ _context36.next = 9;
8275
8539
  return this.downgradeFromMultistreamToTranscoded();
8276
8540
  case 9:
8277
- _context35.next = 10;
8541
+ _context36.next = 10;
8278
8542
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
8279
8543
  case 10:
8280
- _context35.next = 12;
8544
+ _context36.next = 12;
8281
8545
  break;
8282
8546
  case 11:
8283
- throw _t34;
8547
+ throw _t35;
8284
8548
  case 12:
8285
8549
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
8286
8550
  if (!this.mediaProperties.hasLocalShareStream()) {
8287
- _context35.next = 13;
8551
+ _context36.next = 13;
8288
8552
  break;
8289
8553
  }
8290
- _context35.next = 13;
8554
+ _context36.next = 13;
8291
8555
  return this.enqueueScreenShareFloorRequest();
8292
8556
  case 13:
8293
- _context35.next = 14;
8557
+ _context36.next = 14;
8294
8558
  return this.mediaProperties.getCurrentConnectionInfo();
8295
8559
  case 14:
8296
- _yield$this$mediaProp = _context35.sent;
8560
+ _yield$this$mediaProp = _context36.sent;
8297
8561
  connectionType = _yield$this$mediaProp.connectionType;
8298
8562
  ipVersion = _yield$this$mediaProp.ipVersion;
8299
8563
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8300
8564
  numTransports = _yield$this$mediaProp.numTransports;
8301
8565
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8302
- _context35.next = 15;
8566
+ _context36.next = 15;
8303
8567
  return this.getMediaReachabilityMetricFields();
8304
8568
  case 15:
8305
- reachabilityMetrics = _context35.sent;
8569
+ reachabilityMetrics = _context36.sent;
8306
8570
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
8307
8571
  correlation_id: this.correlationId,
8308
8572
  locus_id: this.locusUrl.split('/').pop(),
@@ -8332,31 +8596,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8332
8596
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
8333
8597
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
8334
8598
  this.startPeriodicLogUpload();
8335
- _context35.next = 20;
8599
+ _context36.next = 20;
8336
8600
  break;
8337
8601
  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);
8602
+ _context36.prev = 16;
8603
+ _t36 = _context36["catch"](4);
8604
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t36);
8341
8605
 
8342
8606
  // @ts-ignore
8343
- _context35.next = 17;
8607
+ _context36.next = 17;
8344
8608
  return this.getMediaReachabilityMetricFields();
8345
8609
  case 17:
8346
- _reachabilityMetrics = _context35.sent;
8347
- _context35.next = 18;
8610
+ _reachabilityMetrics = _context36.sent;
8611
+ _context36.next = 18;
8348
8612
  return this.mediaProperties.getCurrentConnectionInfo();
8349
8613
  case 18:
8350
- _yield$this$mediaProp2 = _context35.sent;
8614
+ _yield$this$mediaProp2 = _context36.sent;
8351
8615
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8352
8616
  _numTransports = _yield$this$mediaProp2.numTransports;
8353
8617
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8354
8618
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
8355
8619
  correlation_id: this.correlationId,
8356
8620
  locus_id: this.locusUrl.split('/').pop(),
8357
- reason: _t35.message,
8358
- stack: _t35.stack,
8359
- code: _t35.code,
8621
+ reason: _t36.message,
8622
+ stack: _t36.stack,
8623
+ code: _t36.code,
8360
8624
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
8361
8625
  numTransports: _numTransports,
8362
8626
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
@@ -8371,7 +8635,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8371
8635
  iceCandidatesCount: this.iceCandidatesCount,
8372
8636
  ipver: ipver
8373
8637
  }));
8374
- _context35.next = 19;
8638
+ _context36.next = 19;
8375
8639
  return this.cleanUpOnAddMediaFailure();
8376
8640
  case 19:
8377
8641
  // Upload logs on error while adding media
@@ -8379,23 +8643,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8379
8643
  file: 'meeting/index',
8380
8644
  function: 'addMedia'
8381
8645
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
8382
- if (_t35 instanceof _internalMediaCore.Errors.SdpError) {
8646
+ if (_t36 instanceof _internalMediaCore.Errors.SdpError) {
8383
8647
  this.leave({
8384
8648
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
8385
8649
  });
8386
8650
  }
8387
- throw _t35;
8651
+ throw _t36;
8388
8652
  case 20:
8389
- _context35.prev = 20;
8653
+ _context36.prev = 20;
8390
8654
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
8391
- return _context35.finish(20);
8655
+ return _context36.finish(20);
8392
8656
  case 21:
8393
8657
  case "end":
8394
- return _context35.stop();
8658
+ return _context36.stop();
8395
8659
  }
8396
- }, _callee35, this, [[4, 16, 20, 21], [6, 8]]);
8660
+ }, _callee36, this, [[4, 16, 20, 21], [6, 8]]);
8397
8661
  }));
8398
- function addMediaInternal(_x30, _x31, _x32) {
8662
+ function addMediaInternal(_x31, _x32, _x33) {
8399
8663
  return _addMediaInternal.apply(this, arguments);
8400
8664
  }
8401
8665
  return addMediaInternal;
@@ -8461,35 +8725,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8461
8725
  * @memberof Meeting
8462
8726
  */
8463
8727
  function () {
8464
- var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
8728
+ var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(options) {
8465
8729
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
8466
- return _regenerator.default.wrap(function (_context36) {
8467
- while (1) switch (_context36.prev = _context36.next) {
8730
+ return _regenerator.default.wrap(function (_context37) {
8731
+ while (1) switch (_context37.prev = _context37.next) {
8468
8732
  case 0:
8469
8733
  this.checkMediaConnection();
8470
8734
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
8471
8735
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
8472
8736
  if (this.canUpdateMedia()) {
8473
- _context36.next = 1;
8737
+ _context37.next = 1;
8474
8738
  break;
8475
8739
  }
8476
- return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8740
+ return _context37.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8477
8741
  case 1:
8478
8742
  if (!this.isMultistream) {
8479
- _context36.next = 3;
8743
+ _context37.next = 3;
8480
8744
  break;
8481
8745
  }
8482
8746
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
8483
- _context36.next = 2;
8747
+ _context37.next = 2;
8484
8748
  break;
8485
8749
  }
8486
8750
  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
8751
  case 2:
8488
- _context36.next = 4;
8752
+ _context37.next = 4;
8489
8753
  break;
8490
8754
  case 3:
8491
8755
  if (!(shareAudioEnabled !== undefined)) {
8492
- _context36.next = 4;
8756
+ _context37.next = 4;
8493
8757
  break;
8494
8758
  }
8495
8759
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -8514,20 +8778,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8514
8778
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
8515
8779
  }
8516
8780
  if (this.isMultistream) {
8517
- _context36.next = 5;
8781
+ _context37.next = 5;
8518
8782
  break;
8519
8783
  }
8520
- _context36.next = 5;
8784
+ _context37.next = 5;
8521
8785
  return this.updateTranscodedMediaConnection();
8522
8786
  case 5:
8523
- return _context36.abrupt("return", undefined);
8787
+ return _context37.abrupt("return", undefined);
8524
8788
  case 6:
8525
8789
  case "end":
8526
- return _context36.stop();
8790
+ return _context37.stop();
8527
8791
  }
8528
- }, _callee36, this);
8792
+ }, _callee37, this);
8529
8793
  }));
8530
- function updateMedia(_x33) {
8794
+ function updateMedia(_x34) {
8531
8795
  return _updateMedia.apply(this, arguments);
8532
8796
  }
8533
8797
  return updateMedia;
@@ -8667,15 +8931,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8667
8931
  );
8668
8932
  };
8669
8933
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
8934
+ this.stopListeningForMeetingEvents();
8670
8935
  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) {
8936
+ var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(leave) {
8937
+ return _regenerator.default.wrap(function (_context38) {
8938
+ while (1) switch (_context38.prev = _context38.next) {
8674
8939
  case 0:
8675
8940
  // CA team recommends submitting this *after* locus /leave
8676
8941
  submitLeaveMetric();
8677
8942
  _this49.meetingFiniteStateMachine.leave();
8678
- _context37.next = 1;
8943
+ _context38.next = 1;
8679
8944
  return _this49.clearMeetingData();
8680
8945
  case 1:
8681
8946
  // upload logs on leave irrespective of meeting delete
@@ -8696,14 +8961,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8696
8961
  });
8697
8962
  }
8698
8963
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
8699
- return _context37.abrupt("return", leave);
8964
+ return _context38.abrupt("return", leave);
8700
8965
  case 2:
8701
8966
  case "end":
8702
- return _context37.stop();
8967
+ return _context38.stop();
8703
8968
  }
8704
- }, _callee37);
8969
+ }, _callee38);
8705
8970
  }));
8706
- return function (_x34) {
8971
+ return function (_x35) {
8707
8972
  return _ref41.apply(this, arguments);
8708
8973
  };
8709
8974
  }()).catch(function (error) {
@@ -9368,13 +9633,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9368
9633
  correlation_id: this.correlationId,
9369
9634
  locus_id: this.locusId
9370
9635
  });
9636
+ this.stopListeningForMeetingEvents();
9371
9637
  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) {
9638
+ var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(end) {
9639
+ return _regenerator.default.wrap(function (_context39) {
9640
+ while (1) switch (_context39.prev = _context39.next) {
9375
9641
  case 0:
9376
9642
  _this56.meetingFiniteStateMachine.end();
9377
- _context38.next = 1;
9643
+ _context39.next = 1;
9378
9644
  return _this56.clearMeetingData();
9379
9645
  case 1:
9380
9646
  // upload logs on leave irrespective of meeting delete
@@ -9382,14 +9648,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9382
9648
  file: 'meeting/index',
9383
9649
  function: 'endMeetingForAll'
9384
9650
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9385
- return _context38.abrupt("return", end);
9651
+ return _context39.abrupt("return", end);
9386
9652
  case 2:
9387
9653
  case "end":
9388
- return _context38.stop();
9654
+ return _context39.stop();
9389
9655
  }
9390
- }, _callee38);
9656
+ }, _callee39);
9391
9657
  }));
9392
- return function (_x35) {
9658
+ return function (_x36) {
9393
9659
  return _ref42.apply(this, arguments);
9394
9660
  };
9395
9661
  }()).catch(function (error) {
@@ -9540,39 +9806,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9540
9806
  }, {
9541
9807
  key: "enableMusicMode",
9542
9808
  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) {
9809
+ var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(shouldEnableMusicMode) {
9810
+ return _regenerator.default.wrap(function (_context40) {
9811
+ while (1) switch (_context40.prev = _context40.next) {
9546
9812
  case 0:
9547
9813
  this.checkMediaConnection();
9548
9814
  if (this.isMultistream) {
9549
- _context39.next = 1;
9815
+ _context40.next = 1;
9550
9816
  break;
9551
9817
  }
9552
9818
  throw new Error('enableMusicMode() only supported with multistream');
9553
9819
  case 1:
9554
9820
  if (!shouldEnableMusicMode) {
9555
- _context39.next = 3;
9821
+ _context40.next = 3;
9556
9822
  break;
9557
9823
  }
9558
- _context39.next = 2;
9824
+ _context40.next = 2;
9559
9825
  return this.sendSlotManager.setCustomCodecParameters(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, {
9560
9826
  maxaveragebitrate: '64000',
9561
9827
  maxplaybackrate: '48000'
9562
9828
  });
9563
9829
  case 2:
9564
- _context39.next = 4;
9830
+ _context40.next = 4;
9565
9831
  break;
9566
9832
  case 3:
9567
- _context39.next = 4;
9833
+ _context40.next = 4;
9568
9834
  return this.sendSlotManager.markCustomCodecParametersForDeletion(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, ['maxaveragebitrate', 'maxplaybackrate']);
9569
9835
  case 4:
9570
9836
  case "end":
9571
- return _context39.stop();
9837
+ return _context40.stop();
9572
9838
  }
9573
- }, _callee39, this);
9839
+ }, _callee40, this);
9574
9840
  }));
9575
- function enableMusicMode(_x36) {
9841
+ function enableMusicMode(_x37) {
9576
9842
  return _enableMusicMode.apply(this, arguments);
9577
9843
  }
9578
9844
  return enableMusicMode;
@@ -9663,25 +9929,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9663
9929
  }, {
9664
9930
  key: "publishStream",
9665
9931
  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) {
9932
+ var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9933
+ return _regenerator.default.wrap(function (_context41) {
9934
+ while (1) switch (_context41.prev = _context41.next) {
9669
9935
  case 0:
9670
9936
  if (stream) {
9671
- _context40.next = 1;
9937
+ _context41.next = 1;
9672
9938
  break;
9673
9939
  }
9674
- return _context40.abrupt("return");
9940
+ return _context41.abrupt("return");
9675
9941
  case 1:
9676
9942
  if (!this.mediaProperties.webrtcMediaConnection) {
9677
- _context40.next = 3;
9943
+ _context41.next = 3;
9678
9944
  break;
9679
9945
  }
9680
9946
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9681
- _context40.next = 2;
9947
+ _context41.next = 2;
9682
9948
  break;
9683
9949
  }
9684
- _context40.next = 2;
9950
+ _context41.next = 2;
9685
9951
  return this.sendSlotManager.publishStream(mediaType, stream);
9686
9952
  case 2:
9687
9953
  this.emitPublishStateChangeEvent({
@@ -9692,11 +9958,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9692
9958
  });
9693
9959
  case 3:
9694
9960
  case "end":
9695
- return _context40.stop();
9961
+ return _context41.stop();
9696
9962
  }
9697
- }, _callee40, this);
9963
+ }, _callee41, this);
9698
9964
  }));
9699
- function publishStream(_x37, _x38) {
9965
+ function publishStream(_x38, _x39) {
9700
9966
  return _publishStream.apply(this, arguments);
9701
9967
  }
9702
9968
  return publishStream;
@@ -9712,21 +9978,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9712
9978
  }, {
9713
9979
  key: "unpublishStream",
9714
9980
  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) {
9981
+ var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(mediaType, stream) {
9982
+ return _regenerator.default.wrap(function (_context42) {
9983
+ while (1) switch (_context42.prev = _context42.next) {
9718
9984
  case 0:
9719
9985
  if (stream) {
9720
- _context41.next = 1;
9986
+ _context42.next = 1;
9721
9987
  break;
9722
9988
  }
9723
- return _context41.abrupt("return");
9989
+ return _context42.abrupt("return");
9724
9990
  case 1:
9725
9991
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9726
- _context41.next = 2;
9992
+ _context42.next = 2;
9727
9993
  break;
9728
9994
  }
9729
- _context41.next = 2;
9995
+ _context42.next = 2;
9730
9996
  return this.sendSlotManager.unpublishStream(mediaType);
9731
9997
  case 2:
9732
9998
  this.emitPublishStateChangeEvent({
@@ -9737,11 +10003,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9737
10003
  });
9738
10004
  case 3:
9739
10005
  case "end":
9740
- return _context41.stop();
10006
+ return _context42.stop();
9741
10007
  }
9742
- }, _callee41, this);
10008
+ }, _callee42, this);
9743
10009
  }));
9744
- function unpublishStream(_x39, _x40) {
10010
+ function unpublishStream(_x40, _x41) {
9745
10011
  return _unpublishStream.apply(this, arguments);
9746
10012
  }
9747
10013
  return unpublishStream;
@@ -9756,19 +10022,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9756
10022
  }, {
9757
10023
  key: "publishStreams",
9758
10024
  value: (function () {
9759
- var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(streams) {
10025
+ var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9760
10026
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
9761
10027
  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) {
10028
+ return _regenerator.default.wrap(function (_context43) {
10029
+ while (1) switch (_context43.prev = _context43.next) {
9764
10030
  case 0:
9765
10031
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9766
10032
  this.checkMediaConnection();
9767
10033
  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;
10034
+ _context43.next = 1;
9769
10035
  break;
9770
10036
  }
9771
- return _context42.abrupt("return");
10037
+ return _context43.abrupt("return");
9772
10038
  case 1:
9773
10039
  streamChecks = [{
9774
10040
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -9786,62 +10052,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9786
10052
  _i = 0, _streamChecks = streamChecks;
9787
10053
  case 2:
9788
10054
  if (!(_i < _streamChecks.length)) {
9789
- _context42.next = 4;
10055
+ _context43.next = 4;
9790
10056
  break;
9791
10057
  }
9792
10058
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
9793
10059
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
9794
- _context42.next = 3;
10060
+ _context43.next = 3;
9795
10061
  break;
9796
10062
  }
9797
10063
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
9798
10064
  case 3:
9799
10065
  _i++;
9800
- _context42.next = 2;
10066
+ _context43.next = 2;
9801
10067
  break;
9802
10068
  case 4:
9803
10069
  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
10070
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
9805
- _context42.next = 6;
10071
+ _context43.next = 6;
9806
10072
  break;
9807
10073
  }
9808
- _context42.next = 5;
10074
+ _context43.next = 5;
9809
10075
  return this.setLocalShareAudioStream(streams.screenShare.audio);
9810
10076
  case 5:
9811
10077
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9812
10078
  case 6:
9813
10079
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
9814
- _context42.next = 8;
10080
+ _context43.next = 8;
9815
10081
  break;
9816
10082
  }
9817
- _context42.next = 7;
10083
+ _context43.next = 7;
9818
10084
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
9819
10085
  case 7:
9820
10086
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9821
10087
  case 8:
9822
10088
  if (!streams.microphone) {
9823
- _context42.next = 9;
10089
+ _context43.next = 9;
9824
10090
  break;
9825
10091
  }
9826
- _context42.next = 9;
10092
+ _context43.next = 9;
9827
10093
  return this.setLocalAudioStream(streams.microphone);
9828
10094
  case 9:
9829
10095
  if (!streams.camera) {
9830
- _context42.next = 10;
10096
+ _context43.next = 10;
9831
10097
  break;
9832
10098
  }
9833
- _context42.next = 10;
10099
+ _context43.next = 10;
9834
10100
  return this.setLocalVideoStream(streams.camera);
9835
10101
  case 10:
9836
10102
  if (this.isMultistream) {
9837
- _context42.next = 11;
10103
+ _context43.next = 11;
9838
10104
  break;
9839
10105
  }
9840
- _context42.next = 11;
10106
+ _context43.next = 11;
9841
10107
  return this.updateTranscodedMediaConnection();
9842
10108
  case 11:
9843
10109
  if (!floorRequestNeeded) {
9844
- _context42.next = 12;
10110
+ _context43.next = 12;
9845
10111
  break;
9846
10112
  }
9847
10113
  this.localShareInstanceId = _uuid.default.v4();
@@ -9872,15 +10138,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9872
10138
  // we're sending the http request to Locus to request the screen share floor
9873
10139
  // only after the SDP update, because that's how it's always been done for transcoded meetings
9874
10140
  // and also if sharing from the start, we need confluence to have been created
9875
- _context42.next = 12;
10141
+ _context43.next = 12;
9876
10142
  return this.enqueueScreenShareFloorRequest();
9877
10143
  case 12:
9878
10144
  case "end":
9879
- return _context42.stop();
10145
+ return _context43.stop();
9880
10146
  }
9881
- }, _callee42, this);
10147
+ }, _callee43, this);
9882
10148
  }));
9883
- function publishStreams(_x41) {
10149
+ function publishStreams(_x42) {
9884
10150
  return _publishStreams.apply(this, arguments);
9885
10151
  }
9886
10152
  return publishStreams;
@@ -9895,20 +10161,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9895
10161
  }, {
9896
10162
  key: "unpublishStreams",
9897
10163
  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) {
10164
+ var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(streams) {
10165
+ var promises, _iterator2, _step2, stream;
10166
+ return _regenerator.default.wrap(function (_context44) {
10167
+ while (1) switch (_context44.prev = _context44.next) {
9902
10168
  case 0:
9903
10169
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9904
10170
  this.checkMediaConnection();
9905
10171
  promises = [];
9906
- _iterator = _createForOfIteratorHelper(streams.filter(function (t) {
10172
+ _iterator2 = _createForOfIteratorHelper(streams.filter(function (t) {
9907
10173
  return !!t;
9908
10174
  }));
9909
10175
  try {
9910
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
9911
- stream = _step.value;
10176
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
10177
+ stream = _step2.value;
9912
10178
  if (stream === this.mediaProperties.shareAudioStream) {
9913
10179
  promises.push(this.setLocalShareAudioStream(undefined));
9914
10180
  }
@@ -9923,14 +10189,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9923
10189
  }
9924
10190
  }
9925
10191
  } catch (err) {
9926
- _iterator.e(err);
10192
+ _iterator2.e(err);
9927
10193
  } finally {
9928
- _iterator.f();
10194
+ _iterator2.f();
9929
10195
  }
9930
10196
  if (!this.isMultistream) {
9931
10197
  promises.push(this.updateTranscodedMediaConnection());
9932
10198
  }
9933
- _context43.next = 1;
10199
+ _context44.next = 1;
9934
10200
  return _promise.default.all(promises);
9935
10201
  case 1:
9936
10202
  // we're allowing for the SDK to support just audio share as well
@@ -9951,11 +10217,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9951
10217
  }
9952
10218
  case 2:
9953
10219
  case "end":
9954
- return _context43.stop();
10220
+ return _context44.stop();
9955
10221
  }
9956
- }, _callee43, this);
10222
+ }, _callee44, this);
9957
10223
  }));
9958
- function unpublishStreams(_x42) {
10224
+ function unpublishStreams(_x43) {
9959
10225
  return _unpublishStreams.apply(this, arguments);
9960
10226
  }
9961
10227
  return unpublishStreams;
@@ -10021,16 +10287,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10021
10287
  }, {
10022
10288
  key: "getMediaReachabilityMetricFields",
10023
10289
  value: (function () {
10024
- var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
10290
+ var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
10025
10291
  var _this$mediaServerIp, _this$mediaConnection, _this$mediaConnection2, _this$mediaConnection3;
10026
10292
  var reachabilityMetrics, successKeys, totalSuccessCases, selectedSubnetFirstOctet, isSubnetReachable, selectedCluster;
10027
- return _regenerator.default.wrap(function (_context44) {
10028
- while (1) switch (_context44.prev = _context44.next) {
10293
+ return _regenerator.default.wrap(function (_context45) {
10294
+ while (1) switch (_context45.prev = _context45.next) {
10029
10295
  case 0:
10030
- _context44.next = 1;
10296
+ _context45.next = 1;
10031
10297
  return this.webex.meetings.reachability.getReachabilityMetrics();
10032
10298
  case 1:
10033
- reachabilityMetrics = _context44.sent;
10299
+ reachabilityMetrics = _context45.sent;
10034
10300
  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
10301
  totalSuccessCases = successKeys.reduce(function (total, key) {
10036
10302
  var value = reachabilityMetrics[key];
@@ -10047,16 +10313,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10047
10313
  this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
10048
10314
  }
10049
10315
  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), {}, {
10316
+ return _context45.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10051
10317
  subnet_reachable: isSubnetReachable,
10052
10318
  selected_cluster: selectedCluster,
10053
10319
  selected_subnet: selectedSubnetFirstOctet ? "".concat(selectedSubnetFirstOctet, ".X.X.X") : null
10054
10320
  }));
10055
10321
  case 2:
10056
10322
  case "end":
10057
- return _context44.stop();
10323
+ return _context45.stop();
10058
10324
  }
10059
- }, _callee44, this);
10325
+ }, _callee45, this);
10060
10326
  }));
10061
10327
  function getMediaReachabilityMetricFields() {
10062
10328
  return _getMediaReachabilityMetricFields.apply(this, arguments);
@@ -10187,41 +10453,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10187
10453
  }, {
10188
10454
  key: "refreshDataChannelToken",
10189
10455
  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) {
10456
+ var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
10457
+ var isPracticeSession, dataChannelTokenType, res, msg, _t37;
10458
+ return _regenerator.default.wrap(function (_context46) {
10459
+ while (1) switch (_context46.prev = _context46.next) {
10194
10460
  case 0:
10195
10461
  isPracticeSession = this.webinar.isJoinPracticeSessionDataChannel();
10196
10462
  dataChannelTokenType = this.getDataChannelTokenType();
10197
- _context45.prev = 1;
10198
- _context45.next = 2;
10463
+ _context46.prev = 1;
10464
+ _context46.next = 2;
10199
10465
  return this.meetingRequest.fetchDatachannelToken({
10200
10466
  locusUrl: this.locusUrl,
10201
10467
  requestingParticipantId: this.members.selfId,
10202
10468
  isPracticeSession: isPracticeSession
10203
10469
  });
10204
10470
  case 2:
10205
- res = _context45.sent;
10206
- return _context45.abrupt("return", {
10471
+ res = _context46.sent;
10472
+ return _context46.abrupt("return", {
10207
10473
  body: {
10208
10474
  datachannelToken: res.body.datachannelToken,
10209
10475
  dataChannelTokenType: dataChannelTokenType
10210
10476
  }
10211
10477
  });
10212
10478
  case 3:
10213
- _context45.prev = 3;
10214
- _t36 = _context45["catch"](1);
10215
- msg = (_t36 === null || _t36 === void 0 ? void 0 : _t36.message) || String(_t36);
10479
+ _context46.prev = 3;
10480
+ _t37 = _context46["catch"](1);
10481
+ msg = (_t37 === null || _t37 === void 0 ? void 0 : _t37.message) || String(_t37);
10216
10482
  _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
10483
+ statusCode: _t37 === null || _t37 === void 0 ? void 0 : _t37.statusCode
10218
10484
  });
10219
- return _context45.abrupt("return", null);
10485
+ return _context46.abrupt("return", null);
10220
10486
  case 4:
10221
10487
  case "end":
10222
- return _context45.stop();
10488
+ return _context46.stop();
10223
10489
  }
10224
- }, _callee45, this, [[1, 3]]);
10490
+ }, _callee46, this, [[1, 3]]);
10225
10491
  }));
10226
10492
  function refreshDataChannelToken() {
10227
10493
  return _refreshDataChannelToken.apply(this, arguments);