@webex/plugin-meetings 3.12.0-next.5 → 3.12.0-next.50

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 (136) 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 +6 -2
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +1 -1
  7. package/dist/config.js +1 -0
  8. package/dist/config.js.map +1 -1
  9. package/dist/constants.js +6 -3
  10. package/dist/constants.js.map +1 -1
  11. package/dist/controls-options-manager/constants.js +11 -1
  12. package/dist/controls-options-manager/constants.js.map +1 -1
  13. package/dist/controls-options-manager/index.js +38 -24
  14. package/dist/controls-options-manager/index.js.map +1 -1
  15. package/dist/controls-options-manager/util.js +91 -0
  16. package/dist/controls-options-manager/util.js.map +1 -1
  17. package/dist/hashTree/constants.js +10 -1
  18. package/dist/hashTree/constants.js.map +1 -1
  19. package/dist/hashTree/hashTreeParser.js +593 -358
  20. package/dist/hashTree/hashTreeParser.js.map +1 -1
  21. package/dist/hashTree/utils.js +22 -0
  22. package/dist/hashTree/utils.js.map +1 -1
  23. package/dist/index.js +7 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/interceptors/locusRetry.js +23 -8
  26. package/dist/interceptors/locusRetry.js.map +1 -1
  27. package/dist/interpretation/index.js +10 -1
  28. package/dist/interpretation/index.js.map +1 -1
  29. package/dist/interpretation/siLanguage.js +1 -1
  30. package/dist/locus-info/controlsUtils.js +4 -1
  31. package/dist/locus-info/controlsUtils.js.map +1 -1
  32. package/dist/locus-info/index.js +277 -86
  33. package/dist/locus-info/index.js.map +1 -1
  34. package/dist/locus-info/types.js +16 -0
  35. package/dist/locus-info/types.js.map +1 -1
  36. package/dist/media/properties.js +1 -0
  37. package/dist/media/properties.js.map +1 -1
  38. package/dist/meeting/in-meeting-actions.js +3 -1
  39. package/dist/meeting/in-meeting-actions.js.map +1 -1
  40. package/dist/meeting/index.js +842 -521
  41. package/dist/meeting/index.js.map +1 -1
  42. package/dist/meeting/util.js +19 -2
  43. package/dist/meeting/util.js.map +1 -1
  44. package/dist/meetings/index.js +199 -77
  45. package/dist/meetings/index.js.map +1 -1
  46. package/dist/meetings/meetings.types.js +6 -1
  47. package/dist/meetings/meetings.types.js.map +1 -1
  48. package/dist/meetings/request.js +39 -0
  49. package/dist/meetings/request.js.map +1 -1
  50. package/dist/meetings/util.js +67 -5
  51. package/dist/meetings/util.js.map +1 -1
  52. package/dist/member/index.js +10 -0
  53. package/dist/member/index.js.map +1 -1
  54. package/dist/member/types.js.map +1 -1
  55. package/dist/member/util.js +3 -0
  56. package/dist/member/util.js.map +1 -1
  57. package/dist/metrics/constants.js +2 -1
  58. package/dist/metrics/constants.js.map +1 -1
  59. package/dist/recording-controller/index.js +1 -3
  60. package/dist/recording-controller/index.js.map +1 -1
  61. package/dist/types/config.d.ts +1 -0
  62. package/dist/types/constants.d.ts +2 -0
  63. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  64. package/dist/types/controls-options-manager/index.d.ts +10 -0
  65. package/dist/types/hashTree/constants.d.ts +1 -0
  66. package/dist/types/hashTree/hashTreeParser.d.ts +61 -15
  67. package/dist/types/hashTree/utils.d.ts +11 -0
  68. package/dist/types/index.d.ts +2 -0
  69. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  70. package/dist/types/locus-info/index.d.ts +46 -6
  71. package/dist/types/locus-info/types.d.ts +17 -1
  72. package/dist/types/media/properties.d.ts +1 -0
  73. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  74. package/dist/types/meeting/index.d.ts +70 -1
  75. package/dist/types/meeting/util.d.ts +8 -0
  76. package/dist/types/meetings/index.d.ts +18 -1
  77. package/dist/types/meetings/meetings.types.d.ts +15 -0
  78. package/dist/types/meetings/request.d.ts +14 -0
  79. package/dist/types/member/index.d.ts +1 -0
  80. package/dist/types/member/types.d.ts +1 -0
  81. package/dist/types/member/util.d.ts +1 -0
  82. package/dist/types/metrics/constants.d.ts +1 -0
  83. package/dist/webinar/index.js +361 -235
  84. package/dist/webinar/index.js.map +1 -1
  85. package/package.json +22 -22
  86. package/src/aiEnableRequest/index.ts +16 -0
  87. package/src/breakouts/breakout.ts +2 -1
  88. package/src/config.ts +1 -0
  89. package/src/constants.ts +5 -1
  90. package/src/controls-options-manager/constants.ts +14 -1
  91. package/src/controls-options-manager/index.ts +47 -24
  92. package/src/controls-options-manager/util.ts +81 -1
  93. package/src/hashTree/constants.ts +9 -0
  94. package/src/hashTree/hashTreeParser.ts +306 -160
  95. package/src/hashTree/utils.ts +17 -0
  96. package/src/index.ts +5 -0
  97. package/src/interceptors/locusRetry.ts +25 -4
  98. package/src/interpretation/index.ts +25 -8
  99. package/src/locus-info/controlsUtils.ts +3 -1
  100. package/src/locus-info/index.ts +276 -93
  101. package/src/locus-info/types.ts +19 -1
  102. package/src/media/properties.ts +1 -0
  103. package/src/meeting/in-meeting-actions.ts +4 -0
  104. package/src/meeting/index.ts +315 -26
  105. package/src/meeting/util.ts +20 -2
  106. package/src/meetings/index.ts +104 -43
  107. package/src/meetings/meetings.types.ts +19 -0
  108. package/src/meetings/request.ts +43 -0
  109. package/src/meetings/util.ts +80 -1
  110. package/src/member/index.ts +10 -0
  111. package/src/member/types.ts +1 -0
  112. package/src/member/util.ts +3 -0
  113. package/src/metrics/constants.ts +1 -0
  114. package/src/recording-controller/index.ts +1 -2
  115. package/src/webinar/index.ts +162 -21
  116. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  117. package/test/unit/spec/breakouts/breakout.ts +7 -3
  118. package/test/unit/spec/controls-options-manager/index.js +140 -29
  119. package/test/unit/spec/controls-options-manager/util.js +165 -0
  120. package/test/unit/spec/hashTree/hashTreeParser.ts +1294 -191
  121. package/test/unit/spec/hashTree/utils.ts +88 -1
  122. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  123. package/test/unit/spec/interpretation/index.ts +26 -4
  124. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  125. package/test/unit/spec/locus-info/index.js +443 -81
  126. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  127. package/test/unit/spec/meeting/index.js +836 -41
  128. package/test/unit/spec/meeting/muteState.js +3 -0
  129. package/test/unit/spec/meeting/utils.js +33 -0
  130. package/test/unit/spec/meetings/index.js +275 -10
  131. package/test/unit/spec/meetings/request.js +141 -0
  132. package/test/unit/spec/meetings/utils.js +161 -0
  133. package/test/unit/spec/member/index.js +7 -0
  134. package/test/unit/spec/member/util.js +24 -0
  135. package/test/unit/spec/recording-controller/index.js +9 -8
  136. package/test/unit/spec/webinar/index.ts +141 -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);
@@ -679,8 +681,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
679
681
  * @returns {null}
680
682
  */
681
683
  (0, _defineProperty3.default)(_this, "handleLLMOnline", function () {
682
- // @ts-ignore
683
- _this.webex.internal.llm.off('online', _this.handleLLMOnline);
684
+ _this.restoreLLMSubscriptionsIfNeeded();
684
685
  _triggerProxy.default.trigger(_this, {
685
686
  file: 'meeting/index',
686
687
  function: 'handleLLMOnline'
@@ -688,6 +689,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
688
689
  });
689
690
  /**
690
691
  * Disconnects and cleans up the default LLM session listeners/timers.
692
+ *
693
+ * Ownership-aware: only calls `disconnectLLM` when this meeting is the
694
+ * current owner of the default LLM session (or when no owner is recorded).
695
+ * Event listeners belonging to this meeting instance are always detached
696
+ * so they do not receive another meeting's relay events.
697
+ *
691
698
  * @param {Object} options
692
699
  * @param {boolean} [options.removeOnlineListener=true] removes the one-time online listener
693
700
  * @param {boolean} [options.throwOnError=true] rethrows disconnect errors when true
@@ -699,13 +706,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
699
706
  removeOnlineListener,
700
707
  _ref3$throwOnError,
701
708
  throwOnError,
709
+ currentOwner,
710
+ isOwner,
711
+ _this$webex$internal$,
712
+ _this$webex$internal$2,
702
713
  _args = arguments,
703
714
  _t;
704
715
  return _regenerator.default.wrap(function (_context) {
705
716
  while (1) switch (_context.prev = _context.next) {
706
717
  case 0:
707
718
  _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;
719
+ // @ts-ignore - Fix type
720
+ currentOwner = _this.webex.internal.llm.getOwnerMeetingId();
721
+ isOwner = !currentOwner || currentOwner === _this.id;
708
722
  _context.prev = 1;
723
+ if (!isOwner) {
724
+ _context.next = 3;
725
+ break;
726
+ }
709
727
  _context.next = 2;
710
728
  return _this.webex.internal.llm.disconnectLLM({
711
729
  code: 3050,
@@ -715,31 +733,43 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
715
733
  _context.next = 4;
716
734
  break;
717
735
  case 3:
718
- _context.prev = 3;
736
+ _loggerProxy.default.logger.info("Meeting:index#cleanupLLMConneciton --> skipping disconnect; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
737
+ case 4:
738
+ _context.next = 6;
739
+ break;
740
+ case 5:
741
+ _context.prev = 5;
719
742
  _t = _context["catch"](1);
720
743
  _loggerProxy.default.logger.error('Meeting:index#cleanupLLMConneciton --> Failed to disconnect default LLM session', _t);
721
744
  if (!throwOnError) {
722
- _context.next = 4;
745
+ _context.next = 6;
723
746
  break;
724
747
  }
725
748
  throw _t;
726
- case 4:
727
- _context.prev = 4;
749
+ case 6:
750
+ _context.prev = 6;
728
751
  if (removeOnlineListener) {
729
752
  // @ts-ignore - Fix type
730
753
  _this.webex.internal.llm.off('online', _this.handleLLMOnline);
731
754
  }
732
- // @ts-ignore - fix types
733
- _this.webex.internal.llm.off('event:relay.event', _this.processRelayEvent);
734
- // @ts-ignore - Fix type
735
- _this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, _this.processLocusLLMEvent);
736
- _this.clearLLMHealthCheckTimer();
737
- return _context.finish(4);
738
- case 5:
755
+ _this.stopListeningForLLMEvents();
756
+
757
+ // If this meeting owned (or could have owned) the default LLM session,
758
+ // always release the owner tag here regardless of whether disconnectLLM
759
+ // resolved. `disconnectLLM` only clears the owner on its success path,
760
+ // so a failed disconnect would otherwise leave a stale owner pointing
761
+ // at a torn-down meeting and permanently block other meetings'
762
+ // `updateLLMConnection` calls via the ownership guard.
763
+ if (isOwner) {
764
+ // @ts-ignore - Fix type
765
+ (_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);
766
+ }
767
+ return _context.finish(6);
768
+ case 7:
739
769
  case "end":
740
770
  return _context.stop();
741
771
  }
742
- }, _callee, null, [[1, 3, 4, 5]]);
772
+ }, _callee, null, [[1, 5, 6, 7]]);
743
773
  })));
744
774
  /**
745
775
  * Handles ROAP_FAILURE event from the webrtc media connection
@@ -1322,6 +1352,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1322
1352
  }
1323
1353
  }
1324
1354
  });
1355
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.STATS_UPDATE, function (data) {
1356
+ // Extract srtpCipher from transport stats
1357
+ var srtpCipher;
1358
+ var _iterator = _createForOfIteratorHelper(data.stats.values()),
1359
+ _step;
1360
+ try {
1361
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1362
+ var stats = _step.value;
1363
+ if (stats.type === 'transport' && stats.srtpCipher) {
1364
+ srtpCipher = stats.srtpCipher;
1365
+ break;
1366
+ }
1367
+ }
1368
+
1369
+ // Only emit event if srtpCipher has changed
1370
+ } catch (err) {
1371
+ _iterator.e(err);
1372
+ } finally {
1373
+ _iterator.f();
1374
+ }
1375
+ if (srtpCipher && srtpCipher !== _this.mediaProperties.srtpCipher) {
1376
+ _loggerProxy.default.logger.info("Meeting:index#setupStatsAnalyzerEventHandlers --> SRTP cipher changed from ".concat(_this.mediaProperties.srtpCipher, " to ").concat(srtpCipher));
1377
+ _this.mediaProperties.srtpCipher = srtpCipher;
1378
+ _triggerProxy.default.trigger(_this, {
1379
+ file: 'meeting/index',
1380
+ function: 'setupStatsAnalyzerEventHandlers'
1381
+ }, _constants.EVENT_TRIGGERS.MEETING_SRTP_CIPHER_UPDATED, {
1382
+ srtpCipher: srtpCipher
1383
+ });
1384
+ }
1385
+ });
1325
1386
  });
1326
1387
  /**
1327
1388
  * media failed, so collect a stats report from webrtc using the wcme connection to grab the rtc stats report
@@ -1540,6 +1601,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1540
1601
  * @memberof Meeting
1541
1602
  */
1542
1603
  (0, _defineProperty3.default)(_this, "clearMeetingData", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
1604
+ var currentOwner, isOwner;
1543
1605
  return _regenerator.default.wrap(function (_context5) {
1544
1606
  while (1) switch (_context5.prev = _context5.next) {
1545
1607
  case 0:
@@ -1550,10 +1612,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1550
1612
  _this.shareStatus = _constants.SHARE_STATUS.NO_SHARE;
1551
1613
  }
1552
1614
  _this.queuedMediaUpdates = [];
1553
- _this.stopTranscription();
1554
- _this.transcription = undefined;
1555
- _this.annotation.deregisterEvents();
1556
- _this.clearDataChannelToken();
1615
+
1616
+ // Listener teardown (transcription, annotation, llm/mercury) runs in
1617
+ // stopListeningForMeetingEvents() before /leave and /end so events
1618
+ // received mid-teardown do not trigger Locus syncs. Calling it here
1619
+ // again would double-emit MEETING_STOPPED_RECEIVING_TRANSCRIPTION
1620
+ // because stopTranscription() always fires its trigger.
1621
+ //
1622
+ // Ownership-aware token clear: only clear the shared LLM data channel
1623
+ // tokens when this meeting owns (or no meeting owns) the default LLM
1624
+ // session. Otherwise we would wipe tokens still in use by another
1625
+ // meeting's active LLM connection.
1626
+ // @ts-ignore - Fix type
1627
+ currentOwner = _this.webex.internal.llm.getOwnerMeetingId();
1628
+ isOwner = !currentOwner || currentOwner === _this.id;
1629
+ if (isOwner) {
1630
+ _this.clearDataChannelToken();
1631
+ } else {
1632
+ _loggerProxy.default.logger.info("Meeting:index#clearMeetingData --> skipping clearDataChannelToken; LLM owned by meeting ".concat(currentOwner, ", not ").concat(_this.id));
1633
+ }
1557
1634
  _context5.next = 1;
1558
1635
  return _this.cleanupLLMConneciton({
1559
1636
  throwOnError: false
@@ -1728,7 +1805,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1728
1805
  });
1729
1806
 
1730
1807
  // @ts-ignore
1731
- _this.aiEnableRequest = new _aiEnableRequest.default({}, {
1808
+ _this.aiEnableRequest = new _aiEnableRequest.default({
1809
+ locusUrl: _this.locusUrl
1810
+ }, {
1732
1811
  parent: _this.webex
1733
1812
  });
1734
1813
 
@@ -3526,7 +3605,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3526
3605
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED, function (_ref10) {
3527
3606
  var state = _ref10.state,
3528
3607
  modifiedBy = _ref10.modifiedBy,
3529
- lastModified = _ref10.lastModified;
3608
+ lastModified = _ref10.lastModified,
3609
+ modifiedByServiceAppName = _ref10.modifiedByServiceAppName,
3610
+ modifiedByServiceAppId = _ref10.modifiedByServiceAppId;
3530
3611
  var event;
3531
3612
  switch (state) {
3532
3613
  case _constants.RECORDING_STATE.RECORDING:
@@ -3550,7 +3631,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3550
3631
  _this12.recording = {
3551
3632
  state: state === _constants.RECORDING_STATE.RESUMED ? _constants.RECORDING_STATE.RECORDING : state,
3552
3633
  modifiedBy: modifiedBy,
3553
- lastModified: lastModified
3634
+ lastModified: lastModified,
3635
+ modifiedByServiceAppName: modifiedByServiceAppName,
3636
+ modifiedByServiceAppId: modifiedByServiceAppId
3554
3637
  };
3555
3638
  _triggerProxy.default.trigger(_this12, {
3556
3639
  file: 'meeting/index',
@@ -4087,6 +4170,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4087
4170
  _this14.breakouts.locusUrlUpdate(url);
4088
4171
  _this14.simultaneousInterpretation.locusUrlUpdate(url);
4089
4172
  _this14.annotation.locusUrlUpdate(url);
4173
+ _this14.aiEnableRequest.locusUrlUpdate(url);
4090
4174
  _this14.locusUrl = url;
4091
4175
  _this14.locusId = (_this14$locusUrl = _this14.locusUrl) === null || _this14$locusUrl === void 0 ? void 0 : _this14$locusUrl.split('/').pop();
4092
4176
  _this14.recordingController.setLocusUrl(_this14.locusUrl);
@@ -4325,44 +4409,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4325
4409
  });
4326
4410
  _this19.updateLLMConnection();
4327
4411
  });
4328
- this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, /*#__PURE__*/function () {
4329
- var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4330
- var _this19$rtcMetrics;
4331
- return _regenerator.default.wrap(function (_context1) {
4332
- while (1) switch (_context1.prev = _context1.next) {
4333
- case 0:
4334
- _this19.stopKeepAlive();
4335
- if (payload) {
4336
- _triggerProxy.default.trigger(_this19, {
4337
- file: 'meeting/index',
4338
- function: 'setUpLocusInfoSelfListener'
4339
- }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4340
- payload: payload
4341
- });
4412
+ this.locusInfo.on(_constants.LOCUSINFO.EVENTS.SELF_ADMITTED_GUEST, function (payload) {
4413
+ var _this19$rtcMetrics;
4414
+ _this19.stopKeepAlive();
4415
+ if (payload) {
4416
+ _triggerProxy.default.trigger(_this19, {
4417
+ file: 'meeting/index',
4418
+ function: 'setUpLocusInfoSelfListener'
4419
+ }, _constants.EVENT_TRIGGERS.MEETING_SELF_GUEST_ADMITTED, {
4420
+ payload: payload
4421
+ });
4342
4422
 
4343
- // @ts-ignore
4344
- _this19.webex.internal.newMetrics.submitClientEvent({
4345
- name: 'client.lobby.exited',
4346
- options: {
4347
- meetingId: _this19.id
4348
- }
4349
- });
4350
- _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4351
- correlation_id: _this19.correlationId
4352
- });
4353
- }
4354
- (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4355
- _this19.updateLLMConnection();
4356
- case 1:
4357
- case "end":
4358
- return _context1.stop();
4423
+ // @ts-ignore
4424
+ _this19.webex.internal.newMetrics.submitClientEvent({
4425
+ name: 'client.lobby.exited',
4426
+ options: {
4427
+ meetingId: _this19.id
4359
4428
  }
4360
- }, _callee1);
4361
- }));
4362
- return function (_x9) {
4363
- return _ref37.apply(this, arguments);
4364
- };
4365
- }());
4429
+ });
4430
+ _metrics.default.sendBehavioralMetric(_constants2.default.GUEST_EXITED_LOBBY, {
4431
+ correlation_id: _this19.correlationId
4432
+ });
4433
+ }
4434
+ (_this19$rtcMetrics = _this19.rtcMetrics) === null || _this19$rtcMetrics === void 0 ? void 0 : _this19$rtcMetrics.sendNextMetrics();
4435
+ _this19.ensureDefaultDatachannelTokenAfterAdmit().catch(function (error) {
4436
+ _loggerProxy.default.logger.warn("Meeting:index#setUpLocusInfoSelfListener --> failed post-admit token prefetch flow: ".concat((error === null || error === void 0 ? void 0 : error.message) || String(error)));
4437
+ });
4438
+ _this19.updateLLMConnection();
4439
+ });
4366
4440
 
4367
4441
  // @ts-ignore - check if MEDIA_INACTIVITY exists
4368
4442
  this.locusInfo.on(_constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, function () {
@@ -4482,49 +4556,49 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4482
4556
  }
4483
4557
  });
4484
4558
  this.locusInfo.on(_constants.EVENTS.DESTROY_MEETING, /*#__PURE__*/function () {
4485
- var _ref38 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(payload) {
4559
+ var _ref37 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1(payload) {
4486
4560
  var _t9;
4487
- return _regenerator.default.wrap(function (_context10) {
4488
- while (1) switch (_context10.prev = _context10.next) {
4561
+ return _regenerator.default.wrap(function (_context1) {
4562
+ while (1) switch (_context1.prev = _context1.next) {
4489
4563
  case 0:
4490
4564
  if (!_this20.wirelessShare) {
4491
- _context10.next = 2;
4565
+ _context1.next = 2;
4492
4566
  break;
4493
4567
  }
4494
4568
  if (!_this20.mediaProperties.shareVideoStream) {
4495
- _context10.next = 1;
4569
+ _context1.next = 1;
4496
4570
  break;
4497
4571
  }
4498
- _context10.next = 1;
4572
+ _context1.next = 1;
4499
4573
  return _this20.setLocalShareVideoStream(undefined);
4500
4574
  case 1:
4501
4575
  if (!_this20.mediaProperties.shareAudioStream) {
4502
- _context10.next = 2;
4576
+ _context1.next = 2;
4503
4577
  break;
4504
4578
  }
4505
- _context10.next = 2;
4579
+ _context1.next = 2;
4506
4580
  return _this20.setLocalShareAudioStream(undefined);
4507
4581
  case 2:
4508
4582
  if (!payload.shouldLeave) {
4509
- _context10.next = 7;
4583
+ _context1.next = 7;
4510
4584
  break;
4511
4585
  }
4512
- _context10.prev = 3;
4513
- _context10.next = 4;
4586
+ _context1.prev = 3;
4587
+ _context1.next = 4;
4514
4588
  return _this20.leave({
4515
4589
  reason: payload.reason
4516
4590
  });
4517
4591
  case 4:
4518
4592
  _loggerProxy.default.logger.warn('Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. The meeting has been left, but has not been destroyed, you should see a later event for leave.');
4519
- _context10.next = 6;
4593
+ _context1.next = 6;
4520
4594
  break;
4521
4595
  case 5:
4522
- _context10.prev = 5;
4523
- _t9 = _context10["catch"](3);
4596
+ _context1.prev = 5;
4597
+ _t9 = _context1["catch"](3);
4524
4598
  // @ts-ignore
4525
4599
  _loggerProxy.default.logger.error("Meeting:index#setUpLocusInfoMeetingListener --> DESTROY_MEETING. Issue with leave for meeting, meeting still in collection: ".concat(_this20, ", error: ").concat(_t9));
4526
4600
  case 6:
4527
- _context10.next = 8;
4601
+ _context1.next = 8;
4528
4602
  break;
4529
4603
  case 7:
4530
4604
  _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoMeetingListener --> MEETING_REMOVED_REASON', payload.reason);
@@ -4538,12 +4612,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4538
4612
  });
4539
4613
  case 8:
4540
4614
  case "end":
4541
- return _context10.stop();
4615
+ return _context1.stop();
4542
4616
  }
4543
- }, _callee10, null, [[3, 5]]);
4617
+ }, _callee1, null, [[3, 5]]);
4544
4618
  }));
4545
- return function (_x0) {
4546
- return _ref38.apply(this, arguments);
4619
+ return function (_x9) {
4620
+ return _ref37.apply(this, arguments);
4547
4621
  };
4548
4622
  }());
4549
4623
  }
@@ -4661,31 +4735,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4661
4735
  }, {
4662
4736
  key: "beRightBack",
4663
4737
  value: (function () {
4664
- var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(enabled) {
4738
+ var _beRightBack = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(enabled) {
4665
4739
  var _this22 = this;
4666
4740
  var errorMessage, error, _errorMessage, _error;
4667
- return _regenerator.default.wrap(function (_context11) {
4668
- while (1) switch (_context11.prev = _context11.next) {
4741
+ return _regenerator.default.wrap(function (_context10) {
4742
+ while (1) switch (_context10.prev = _context10.next) {
4669
4743
  case 0:
4670
4744
  if (this.isMultistream) {
4671
- _context11.next = 1;
4745
+ _context10.next = 1;
4672
4746
  break;
4673
4747
  }
4674
4748
  errorMessage = 'Meeting:index#beRightBack --> Not a multistream meeting';
4675
4749
  error = new Error(errorMessage);
4676
4750
  _loggerProxy.default.logger.error(error);
4677
- return _context11.abrupt("return", _promise.default.reject(error));
4751
+ return _context10.abrupt("return", _promise.default.reject(error));
4678
4752
  case 1:
4679
4753
  if (this.mediaProperties.webrtcMediaConnection) {
4680
- _context11.next = 2;
4754
+ _context10.next = 2;
4681
4755
  break;
4682
4756
  }
4683
4757
  _errorMessage = 'Meeting:index#beRightBack --> WebRTC media connection is not defined';
4684
4758
  _error = new Error(_errorMessage);
4685
4759
  _loggerProxy.default.logger.error(_error);
4686
- return _context11.abrupt("return", _promise.default.reject(_error));
4760
+ return _context10.abrupt("return", _promise.default.reject(_error));
4687
4761
  case 2:
4688
- return _context11.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4762
+ return _context10.abrupt("return", this.brbState.enable(enabled, this.sendSlotManager).then(function () {
4689
4763
  if (_this22.audio && enabled) {
4690
4764
  // locus mutes the participant with brb enabled request,
4691
4765
  // so we need to explicitly update remote mute for correct logic flow
@@ -4696,11 +4770,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4696
4770
  }));
4697
4771
  case 3:
4698
4772
  case "end":
4699
- return _context11.stop();
4773
+ return _context10.stop();
4700
4774
  }
4701
- }, _callee11, this);
4775
+ }, _callee10, this);
4702
4776
  }));
4703
- function beRightBack(_x1) {
4777
+ function beRightBack(_x0) {
4704
4778
  return _beRightBack.apply(this, arguments);
4705
4779
  }
4706
4780
  return beRightBack;
@@ -5128,7 +5202,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5128
5202
  displayHints: this.userDisplayHints
5129
5203
  }),
5130
5204
  canAttendeeRequestAiAssistantEnabled: _util2.default.canAttendeeRequestAiAssistantEnabled(this.userDisplayHints, this.roles),
5131
- isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints)
5205
+ isAttendeeRequestAiAssistantDeclinedAll: _util2.default.attendeeRequestAiAssistantDeclinedAll(this.userDisplayHints),
5206
+ isAnonymizeDisplayNamesEnabled: _util2.default.isAnonymizeDisplayNamesEnabled(this.userDisplayHints)
5132
5207
  }) || changed;
5133
5208
  }
5134
5209
  if (changed) {
@@ -5179,6 +5254,51 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5179
5254
  this.sipUri = sipUri;
5180
5255
  }
5181
5256
 
5257
+ /**
5258
+ * After initial locus setup, refreshes destination with synced locus data and optionally
5259
+ * performs deferred meeting info fetch when initial locus was incomplete.
5260
+ * @param {LocusDTO} locus
5261
+ * @returns {void}
5262
+ */
5263
+ }, {
5264
+ key: "finalizeMeetingAfterInitialLocusSetup",
5265
+ value: (function () {
5266
+ var _finalizeMeetingAfterInitialLocusSetup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(locus) {
5267
+ var _this$destination;
5268
+ var _t0;
5269
+ return _regenerator.default.wrap(function (_context11) {
5270
+ while (1) switch (_context11.prev = _context11.next) {
5271
+ case 0:
5272
+ if (locus && (this === null || this === void 0 ? void 0 : this.destinationType) === _constants.DESTINATION_TYPE.LOCUS_ID) {
5273
+ // destination is initialized from the initial locus snapshot in constructor,
5274
+ // so refresh it after locus sync to avoid stale partial hash-tree data.
5275
+ this.destination = locus;
5276
+ }
5277
+ if (!((!this.meetingInfo || (0, _lodash.isEmpty)(this.meetingInfo)) && (_this$destination = this.destination) !== null && _this$destination !== void 0 && _this$destination.info && !this.fetchMeetingInfoTimeoutId)) {
5278
+ _context11.next = 4;
5279
+ break;
5280
+ }
5281
+ _context11.prev = 1;
5282
+ _context11.next = 2;
5283
+ return this.fetchMeetingInfo({});
5284
+ case 2:
5285
+ _context11.next = 4;
5286
+ break;
5287
+ case 3:
5288
+ _context11.prev = 3;
5289
+ _t0 = _context11["catch"](1);
5290
+ _loggerProxy.default.logger.info("Meeting:index#finalizeMeetingAfterInitialLocusSetup --> deferred fetchMeetingInfo failed: ".concat(_t0.message));
5291
+ case 4:
5292
+ case "end":
5293
+ return _context11.stop();
5294
+ }
5295
+ }, _callee11, this, [[1, 3]]);
5296
+ }));
5297
+ function finalizeMeetingAfterInitialLocusSetup(_x1) {
5298
+ return _finalizeMeetingAfterInitialLocusSetup.apply(this, arguments);
5299
+ }
5300
+ return finalizeMeetingAfterInitialLocusSetup;
5301
+ }()
5182
5302
  /**
5183
5303
  * Set the locus info the class instance. Should be called with the parsed locus
5184
5304
  * we got in the join response.
@@ -5194,6 +5314,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5194
5314
  * @private
5195
5315
  * @memberof Meeting
5196
5316
  */
5317
+ )
5197
5318
  }, {
5198
5319
  key: "setLocus",
5199
5320
  value: function setLocus(data) {
@@ -5653,8 +5774,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5653
5774
  var _this25 = this;
5654
5775
  // Client will have a socket manager and handle reconnecting to mercury, when we reconnect to mercury
5655
5776
  // if the meeting has active peer connections, it should try to reconnect.
5656
- // @ts-ignore
5657
- this.webex.internal.mercury.on(_constants.ONLINE, function () {
5777
+ this.mercuryOnlineHandler = function () {
5658
5778
  _loggerProxy.default.logger.info('Meeting:index#setMercuryListener --> Web socket online');
5659
5779
 
5660
5780
  // Only send restore event when it was disconnected before and for connected later
@@ -5664,15 +5784,48 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5664
5784
  });
5665
5785
  }
5666
5786
  _this25.hasWebsocketConnected = true;
5667
- });
5668
-
5669
- // @ts-ignore
5670
- this.webex.internal.mercury.on(_constants.OFFLINE, function () {
5787
+ };
5788
+ this.mercuryOfflineHandler = function () {
5671
5789
  _loggerProxy.default.logger.error('Meeting:index#setMercuryListener --> Web socket offline');
5672
5790
  _metrics.default.sendBehavioralMetric(_constants2.default.MERCURY_CONNECTION_FAILURE, {
5673
5791
  correlation_id: _this25.correlationId
5674
5792
  });
5675
- });
5793
+ };
5794
+
5795
+ // @ts-ignore
5796
+ this.webex.internal.mercury.on(_constants.ONLINE, this.mercuryOnlineHandler);
5797
+ // @ts-ignore
5798
+ this.webex.internal.mercury.on(_constants.OFFLINE, this.mercuryOfflineHandler);
5799
+ }
5800
+
5801
+ /**
5802
+ * Removes this meeting's Mercury ONLINE/OFFLINE event listeners registered
5803
+ * by setMercuryListener(). Must be called before Locus /leave to avoid
5804
+ * unnecessary syncs/metrics triggered by events received while leaving
5805
+ * (per Locus team recommendation).
5806
+ *
5807
+ * Mercury is a process-wide singleton shared with other plugins, so we
5808
+ * pass the bound handler refs to .off() to avoid clearing every listener
5809
+ * for ONLINE/OFFLINE on the shared emitter.
5810
+ *
5811
+ * Idempotent: subsequent calls are no-ops because the handler refs are
5812
+ * cleared after detaching.
5813
+ * @private
5814
+ * @returns {void}
5815
+ */
5816
+ }, {
5817
+ key: "stopListeningForMercuryEvents",
5818
+ value: function stopListeningForMercuryEvents() {
5819
+ if (this.mercuryOnlineHandler) {
5820
+ // @ts-ignore
5821
+ this.webex.internal.mercury.off(_constants.ONLINE, this.mercuryOnlineHandler);
5822
+ this.mercuryOnlineHandler = undefined;
5823
+ }
5824
+ if (this.mercuryOfflineHandler) {
5825
+ // @ts-ignore
5826
+ this.webex.internal.mercury.off(_constants.OFFLINE, this.mercuryOfflineHandler);
5827
+ this.mercuryOfflineHandler = undefined;
5828
+ }
5676
5829
  }
5677
5830
 
5678
5831
  /**
@@ -6007,8 +6160,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6007
6160
  _error2,
6008
6161
  _error3,
6009
6162
  _args16 = arguments,
6010
- _t0,
6011
- _t1;
6163
+ _t1,
6164
+ _t10;
6012
6165
  return _regenerator.default.wrap(function (_context16) {
6013
6166
  while (1) switch (_context16.prev = _context16.next) {
6014
6167
  case 0:
@@ -6097,26 +6250,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6097
6250
  });
6098
6251
  case 10:
6099
6252
  _context16.prev = 10;
6100
- _t0 = _context16["catch"](2);
6101
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t0);
6253
+ _t1 = _context16["catch"](2);
6254
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _t1);
6102
6255
  this.roap.abortTurnDiscovery();
6103
6256
 
6104
6257
  // if this was the first attempt, let's do a retry
6105
6258
  shouldRetry = !isRetry;
6106
- if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t0) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t0)) {
6259
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_t1) || _internalPluginMetrics.CallDiagnosticUtils.isWebrtcApiNotAvailableError(_t1)) {
6107
6260
  // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
6108
6261
  // so there is no point doing a retry
6109
6262
  shouldRetry = false;
6110
6263
  }
6111
- if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t0)) {
6264
+ if (_internalPluginMetrics.CallDiagnosticUtils.isBrowserMediaError(_t1)) {
6112
6265
  shouldRetry = false;
6113
6266
  // eslint-disable-next-line no-ex-assign
6114
- _t0 = (0, _lodash.merge)({
6267
+ _t1 = (0, _lodash.merge)({
6115
6268
  error: {
6116
6269
  body: {
6117
- errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t0),
6118
- message: (_error2 = _t0) === null || _error2 === void 0 ? void 0 : _error2.message,
6119
- name: (_error3 = _t0) === null || _error3 === void 0 ? void 0 : _error3.name
6270
+ errorCode: _internalPluginMetrics.CallDiagnosticUtils.getBrowserMediaErrorCode(_t1),
6271
+ message: (_error2 = _t1) === null || _error2 === void 0 ? void 0 : _error2.message,
6272
+ name: (_error3 = _t1) === null || _error3 === void 0 ? void 0 : _error3.name
6120
6273
  }
6121
6274
  }
6122
6275
  });
@@ -6138,20 +6291,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6138
6291
  break;
6139
6292
  case 13:
6140
6293
  _context16.prev = 13;
6141
- _t1 = _context16["catch"](11);
6142
- _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t1);
6143
- leaveError = _t1;
6294
+ _t10 = _context16["catch"](11);
6295
+ _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _t10);
6296
+ leaveError = _t10;
6144
6297
  case 14:
6145
6298
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
6146
6299
  correlation_id: this.correlationId,
6147
6300
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
6148
6301
  // if join fails, we may end up with no locusUrl
6149
- reason: _t0.message,
6150
- stack: _t0.stack,
6302
+ reason: _t1.message,
6303
+ stack: _t1.stack,
6151
6304
  leaveErrorReason: (_leaveError = leaveError) === null || _leaveError === void 0 ? void 0 : _leaveError.message,
6152
6305
  isRetry: isRetry
6153
6306
  }, {
6154
- type: _t0.name
6307
+ type: _t1.name
6155
6308
  });
6156
6309
  if (!shouldRetry) {
6157
6310
  _context16.next = 15;
@@ -6166,7 +6319,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6166
6319
  isRetry: false,
6167
6320
  prevJoinResponse: undefined
6168
6321
  };
6169
- throw _t0;
6322
+ throw _t1;
6170
6323
  case 16:
6171
6324
  case "end":
6172
6325
  return _context16.stop();
@@ -6356,7 +6509,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6356
6509
  key: "startTranscription",
6357
6510
  value: (function () {
6358
6511
  var _startTranscription = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(options) {
6359
- var _t10;
6512
+ var _t11;
6360
6513
  return _regenerator.default.wrap(function (_context18) {
6361
6514
  while (1) switch (_context18.prev = _context18.next) {
6362
6515
  case 0:
@@ -6378,12 +6531,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6378
6531
  break;
6379
6532
  case 3:
6380
6533
  _context18.prev = 3;
6381
- _t10 = _context18["catch"](1);
6382
- _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t10));
6534
+ _t11 = _context18["catch"](1);
6535
+ _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_t11));
6383
6536
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
6384
6537
  correlation_id: this.correlationId,
6385
- reason: _t10.message,
6386
- stack: _t10.stack
6538
+ reason: _t11.message,
6539
+ stack: _t11.stack
6387
6540
  });
6388
6541
  case 4:
6389
6542
  _context18.next = 6;
@@ -6443,6 +6596,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6443
6596
  function: 'triggerStopReceivingTranscriptionEvent'
6444
6597
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION);
6445
6598
  }
6599
+
6600
+ /**
6601
+ * Restores LLM subchannel subscriptions after reconnect when captions are active.
6602
+ * @returns {void}
6603
+ */
6604
+ }, {
6605
+ key: "restoreLLMSubscriptionsIfNeeded",
6606
+ value: function restoreLLMSubscriptionsIfNeeded() {
6607
+ try {
6608
+ var _this$webex$internal$3, _this$webex$internal$4;
6609
+ // @ts-ignore
6610
+ 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);
6611
+ if (!isCaptionBoxOn) {
6612
+ return;
6613
+ }
6614
+
6615
+ // @ts-ignore
6616
+ this.webex.internal.voicea.updateSubchannelSubscriptions({
6617
+ subscribe: ['transcription']
6618
+ });
6619
+ } catch (error) {
6620
+ var msg = (error === null || error === void 0 ? void 0 : error.message) || String(error);
6621
+ _loggerProxy.default.logger.warn("Meeting:index#restoreLLMSubscriptionsIfNeeded --> failed to restore subscriptions after LLM online: ".concat(msg));
6622
+ }
6623
+ }
6446
6624
  }, {
6447
6625
  key: "join",
6448
6626
  value: (
@@ -6471,7 +6649,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6471
6649
  _errorMessage3,
6472
6650
  _error5,
6473
6651
  _args19 = arguments,
6474
- _t11;
6652
+ _t12;
6475
6653
  return _regenerator.default.wrap(function (_context19) {
6476
6654
  while (1) switch (_context19.prev = _context19.next) {
6477
6655
  case 0:
@@ -6589,25 +6767,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6589
6767
  break;
6590
6768
  case 9:
6591
6769
  _context19.prev = 9;
6592
- _t11 = _context19["catch"](7);
6593
- _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t11);
6594
- if (!(_t11 instanceof _captchaError.default || _t11 instanceof _passwordError.default || _t11 instanceof _permission.default)) {
6770
+ _t12 = _context19["catch"](7);
6771
+ _loggerProxy.default.logger.error('Meeting:index#join --> Failed to refresh permission token:', _t12);
6772
+ if (!(_t12 instanceof _captchaError.default || _t12 instanceof _passwordError.default || _t12 instanceof _permission.default)) {
6595
6773
  _context19.next = 10;
6596
6774
  break;
6597
6775
  }
6598
- this.meetingFiniteStateMachine.fail(_t11);
6776
+ this.meetingFiniteStateMachine.fail(_t12);
6599
6777
 
6600
6778
  // Upload logs on refreshpermissionToken refresh Failure
6601
6779
  _triggerProxy.default.trigger(this, {
6602
6780
  file: 'meeting/index',
6603
6781
  function: 'join'
6604
6782
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
6605
- joinFailed(_t11);
6783
+ joinFailed(_t12);
6606
6784
  this.deferJoin = undefined;
6607
6785
 
6608
6786
  // if refresh permission token requires captcha, password or permission, we are throwing the errors
6609
6787
  // and bubble it up to client
6610
- return _context19.abrupt("return", _promise.default.reject(_t11));
6788
+ return _context19.abrupt("return", _promise.default.reject(_t12));
6611
6789
  case 10:
6612
6790
  return _context19.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
6613
6791
  _this34.meetingFiniteStateMachine.join();
@@ -6646,6 +6824,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6646
6824
  _this34.saveDataChannelToken(join);
6647
6825
  // @ts-ignore - config coming from registerPlugin
6648
6826
  if (_this34.config.enableAutomaticLLM) {
6827
+ // @ts-ignore
6828
+ _this34.webex.internal.llm.off('online', _this34.handleLLMOnline);
6649
6829
  // @ts-ignore
6650
6830
  _this34.webex.internal.llm.on('online', _this34.handleLLMOnline);
6651
6831
  _this34.updateLLMConnection().catch(function (error) {
@@ -6714,6 +6894,53 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6714
6894
  this.llmHealthCheckTimer = undefined;
6715
6895
  }
6716
6896
  }
6897
+
6898
+ /**
6899
+ * Removes LLM event listeners and clears the health check timer.
6900
+ * Must be called before Locus /leave to avoid unnecessary syncs triggered
6901
+ * by events received while leaving (per Locus team recommendation).
6902
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6903
+ * matching listener is registered.
6904
+ * @private
6905
+ * @returns {void}
6906
+ */
6907
+ }, {
6908
+ key: "stopListeningForLLMEvents",
6909
+ value: function stopListeningForLLMEvents() {
6910
+ // @ts-ignore - fix types
6911
+ this.webex.internal.llm.off('event:relay.event', this.processRelayEvent);
6912
+ // @ts-ignore - fix types
6913
+ this.webex.internal.llm.off(_constants.LOCUS_LLM_EVENT, this.processLocusLLMEvent);
6914
+ this.clearLLMHealthCheckTimer();
6915
+ }
6916
+
6917
+ /**
6918
+ * Stops listening on every event bus (LLM, Mercury, voicea/transcription,
6919
+ * annotation) that could otherwise deliver events to this meeting while
6920
+ * Locus is processing /leave or /end. Per the Locus team recommendation,
6921
+ * this must run before the Locus request is dispatched to avoid
6922
+ * unnecessary syncs triggered by in-flight events.
6923
+ *
6924
+ * Voicea (transcription) subscribes to llm 'event:relay.event' internally,
6925
+ * and the annotation plugin subscribes to both mercury and llm, so both
6926
+ * must be torn down alongside the direct LLM/Mercury listeners.
6927
+ *
6928
+ * Idempotent: safe to call multiple times; .off() is a no-op when no
6929
+ * matching listener is registered, and stopTranscription is guarded.
6930
+ * @private
6931
+ * @returns {void}
6932
+ */
6933
+ }, {
6934
+ key: "stopListeningForMeetingEvents",
6935
+ value: function stopListeningForMeetingEvents() {
6936
+ this.stopListeningForLLMEvents();
6937
+ this.stopListeningForMercuryEvents();
6938
+ if (this.transcription) {
6939
+ this.stopTranscription();
6940
+ this.transcription = undefined;
6941
+ }
6942
+ this.annotation.deregisterEvents();
6943
+ }
6717
6944
  }, {
6718
6945
  key: "clearDataChannelToken",
6719
6946
  value:
@@ -6749,51 +6976,143 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6749
6976
  }
6750
6977
  }
6751
6978
 
6979
+ /**
6980
+ * Ensures default-session data channel token exists after lobby admission.
6981
+ * Some lobby users do not receive a token until they are admitted.
6982
+ * @returns {Promise<boolean>} true when a new token is fetched and cached
6983
+ */
6984
+ }, {
6985
+ key: "ensureDefaultDatachannelTokenAfterAdmit",
6986
+ value: (function () {
6987
+ var _ensureDefaultDatachannelTokenAfterAdmit = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
6988
+ var _response$body, datachannelToken, isDataChannelTokenEnabled, response, fetchedDatachannelToken, msg, _t13;
6989
+ return _regenerator.default.wrap(function (_context20) {
6990
+ while (1) switch (_context20.prev = _context20.next) {
6991
+ case 0:
6992
+ _context20.prev = 0;
6993
+ // @ts-ignore
6994
+ datachannelToken = this.webex.internal.llm.getDatachannelToken(); // @ts-ignore
6995
+ _context20.next = 1;
6996
+ return this.webex.internal.llm.isDataChannelTokenEnabled();
6997
+ case 1:
6998
+ isDataChannelTokenEnabled = _context20.sent;
6999
+ if (!(!isDataChannelTokenEnabled || datachannelToken)) {
7000
+ _context20.next = 2;
7001
+ break;
7002
+ }
7003
+ return _context20.abrupt("return", false);
7004
+ case 2:
7005
+ _context20.next = 3;
7006
+ return this.meetingRequest.fetchDatachannelToken({
7007
+ locusUrl: this.locusUrl,
7008
+ requestingParticipantId: this.members.selfId,
7009
+ isPracticeSession: false
7010
+ });
7011
+ case 3:
7012
+ response = _context20.sent;
7013
+ fetchedDatachannelToken = response === null || response === void 0 ? void 0 : (_response$body = response.body) === null || _response$body === void 0 ? void 0 : _response$body.datachannelToken;
7014
+ if (fetchedDatachannelToken) {
7015
+ _context20.next = 4;
7016
+ break;
7017
+ }
7018
+ return _context20.abrupt("return", false);
7019
+ case 4:
7020
+ // @ts-ignore
7021
+ this.webex.internal.llm.setDatachannelToken(fetchedDatachannelToken, _internalPluginLlm.DataChannelTokenType.Default);
7022
+ return _context20.abrupt("return", true);
7023
+ case 5:
7024
+ _context20.prev = 5;
7025
+ _t13 = _context20["catch"](0);
7026
+ msg = (_t13 === null || _t13 === void 0 ? void 0 : _t13.message) || String(_t13);
7027
+ _loggerProxy.default.logger.warn("Meeting:index#ensureDefaultDatachannelTokenAfterAdmit --> failed to proactively fetch default data channel token after admit: ".concat(msg), {
7028
+ statusCode: _t13 === null || _t13 === void 0 ? void 0 : _t13.statusCode
7029
+ });
7030
+ return _context20.abrupt("return", false);
7031
+ case 6:
7032
+ case "end":
7033
+ return _context20.stop();
7034
+ }
7035
+ }, _callee20, this, [[0, 5]]);
7036
+ }));
7037
+ function ensureDefaultDatachannelTokenAfterAdmit() {
7038
+ return _ensureDefaultDatachannelTokenAfterAdmit.apply(this, arguments);
7039
+ }
7040
+ return ensureDefaultDatachannelTokenAfterAdmit;
7041
+ }()
6752
7042
  /**
6753
7043
  * Connects to low latency mercury and reconnects if the address has changed
6754
7044
  * It will also disconnect if called when the meeting has ended
6755
7045
  * @returns {Promise}
6756
7046
  */
7047
+ )
6757
7048
  }, {
6758
7049
  key: "updateLLMConnection",
6759
7050
  value: (function () {
6760
- var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
7051
+ var _updateLLMConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
6761
7052
  var _this36 = this;
6762
- var _ref40, _ref40$url, url, _ref40$info, _ref40$info2, _ref40$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl;
6763
- return _regenerator.default.wrap(function (_context20) {
6764
- while (1) switch (_context20.prev = _context20.next) {
7053
+ var _ref39, _ref39$url, url, _ref39$info, _ref39$info2, _ref39$info2$datachan, datachannelUrl, isJoined, datachannelToken, dataChannelUrl, currentOwner;
7054
+ return _regenerator.default.wrap(function (_context21) {
7055
+ while (1) switch (_context21.prev = _context21.next) {
6765
7056
  case 0:
6766
7057
  // @ts-ignore - Fix type
6767
- _ref40 = this.locusInfo || {}, _ref40$url = _ref40.url, url = _ref40$url === void 0 ? undefined : _ref40$url, _ref40$info = _ref40.info, _ref40$info2 = _ref40$info === void 0 ? {} : _ref40$info, _ref40$info2$datachan = _ref40$info2.datachannelUrl, datachannelUrl = _ref40$info2$datachan === void 0 ? undefined : _ref40$info2$datachan;
7058
+ _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;
6768
7059
  isJoined = this.isJoined(); // @ts-ignore
6769
7060
  datachannelToken = this.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.Default);
6770
- dataChannelUrl = datachannelUrl; // @ts-ignore - Fix type
7061
+ dataChannelUrl = datachannelUrl; // Ownership guard: when the default LLM session is already connected and
7062
+ // owned by a *different* Meeting instance, do not disconnect or reconfigure
7063
+ // it. Another meeting's `updateLLMConnection` must be ignored here to
7064
+ // avoid killing the socket it relies on. We only proceed to manage the
7065
+ // connection when this meeting is the current owner, or when no owner is
7066
+ // set yet (first claim).
7067
+ // @ts-ignore - Fix type
7068
+ currentOwner = this.webex.internal.llm.getOwnerMeetingId(); // @ts-ignore - Fix type
6771
7069
  if (!this.webex.internal.llm.isConnected()) {
6772
- _context20.next = 2;
7070
+ _context21.next = 3;
7071
+ break;
7072
+ }
7073
+ if (!(currentOwner && currentOwner !== this.id)) {
7074
+ _context21.next = 1;
6773
7075
  break;
6774
7076
  }
7077
+ // Another meeting owns the live LLM socket. We must not disconnect
7078
+ // or reconfigure it -- doing so would tear down a session the
7079
+ // owning meeting still relies on. Locus/datachannel URL mismatch is
7080
+ // expected here (each meeting has its own locus URL) and is NOT a
7081
+ // valid signal of staleness, so we never reclaim from this path.
7082
+ // The only safe reclaim mechanism is the `finally`-block owner-tag
7083
+ // release in `cleanupLLMConneciton`, which fires when this meeting
7084
+ // itself is being torn down.
7085
+ _loggerProxy.default.logger.info("Meeting:index#updateLLMConnection --> skipping; LLM owned by meeting ".concat(currentOwner, ", not ").concat(this.id));
7086
+ return _context21.abrupt("return", undefined);
7087
+ case 1:
6775
7088
  if (!(
6776
7089
  // @ts-ignore - Fix type
6777
7090
  url === this.webex.internal.llm.getLocusUrl() &&
6778
7091
  // @ts-ignore - Fix type
6779
7092
  dataChannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
6780
- _context20.next = 1;
7093
+ _context21.next = 2;
6781
7094
  break;
6782
7095
  }
6783
- return _context20.abrupt("return", undefined);
6784
- case 1:
6785
- _context20.next = 2;
7096
+ return _context21.abrupt("return", undefined);
7097
+ case 2:
7098
+ _context21.next = 3;
6786
7099
  return this.cleanupLLMConneciton({
6787
7100
  removeOnlineListener: false
6788
7101
  });
6789
- case 2:
7102
+ case 3:
6790
7103
  if (isJoined) {
6791
- _context20.next = 3;
7104
+ _context21.next = 4;
6792
7105
  break;
6793
7106
  }
6794
- return _context20.abrupt("return", undefined);
6795
- case 3:
6796
- return _context20.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7107
+ return _context21.abrupt("return", undefined);
7108
+ case 4:
7109
+ return _context21.abrupt("return", this.webex.internal.llm.registerAndConnect(url, dataChannelUrl, datachannelToken).then(function (registerAndConnectResult) {
7110
+ var _this36$webex$interna, _this36$webex$interna2;
7111
+ // Record ownership of the default LLM session for this meeting so
7112
+ // subsequent cross-meeting `updateLLMConnection` / `cleanupLLMConneciton`
7113
+ // calls can detect and skip work that doesn't belong to them.
7114
+ // @ts-ignore - Fix type
7115
+ (_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);
6797
7116
  // @ts-ignore - Fix type
6798
7117
  _this36.webex.internal.llm.off('event:relay.event', _this36.processRelayEvent);
6799
7118
  // @ts-ignore - Fix type
@@ -6806,11 +7125,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6806
7125
  _this36.startLLMHealthCheckTimer();
6807
7126
  return _promise.default.resolve(registerAndConnectResult);
6808
7127
  }));
6809
- case 4:
7128
+ case 5:
6810
7129
  case "end":
6811
- return _context20.stop();
7130
+ return _context21.stop();
6812
7131
  }
6813
- }, _callee20, this);
7132
+ }, _callee21, this);
6814
7133
  }));
6815
7134
  function updateLLMConnection() {
6816
7135
  return _updateLLMConnection.apply(this, arguments);
@@ -6996,17 +7315,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6996
7315
  meetingId: this.id
6997
7316
  }
6998
7317
  });
6999
- this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
7000
- var mediaSettings, _t12;
7001
- return _regenerator.default.wrap(function (_context21) {
7002
- while (1) switch (_context21.prev = _context21.next) {
7318
+ this.locusInfo.once(_constants.LOCUSINFO.EVENTS.SELF_OBSERVING, /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
7319
+ var mediaSettings, _t14;
7320
+ return _regenerator.default.wrap(function (_context22) {
7321
+ while (1) switch (_context22.prev = _context22.next) {
7003
7322
  case 0:
7004
- _context21.prev = 0;
7323
+ _context22.prev = 0;
7005
7324
  if (!(_this40.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
7006
- _context21.next = 1;
7325
+ _context22.next = 1;
7007
7326
  break;
7008
7327
  }
7009
- _context21.next = 1;
7328
+ _context22.next = 1;
7010
7329
  return _this40.releaseScreenShareFloor();
7011
7330
  case 1:
7012
7331
  mediaSettings = {
@@ -7025,23 +7344,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7025
7344
  // 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
7026
7345
  // once the device answers we close the old connection and create new media server connection with only share enabled
7027
7346
  if (!_this40.statsAnalyzer) {
7028
- _context21.next = 2;
7347
+ _context22.next = 2;
7029
7348
  break;
7030
7349
  }
7031
- _context21.next = 2;
7350
+ _context22.next = 2;
7032
7351
  return _this40.statsAnalyzer.stopAnalyzer();
7033
7352
  case 2:
7034
- _context21.next = 3;
7353
+ _context22.next = 3;
7035
7354
  return _this40.closeRemoteStreams();
7036
7355
  case 3:
7037
- _context21.next = 4;
7356
+ _context22.next = 4;
7038
7357
  return _this40.closePeerConnections();
7039
7358
  case 4:
7040
7359
  _this40.cleanupLocalStreams();
7041
7360
  _this40.unsetRemoteStreams();
7042
7361
  _this40.unsetPeerConnections();
7043
7362
  _this40.reconnectionManager.cleanUp();
7044
- _context21.next = 5;
7363
+ _context22.next = 5;
7045
7364
  return _this40.addMedia({
7046
7365
  audioEnabled: false,
7047
7366
  videoEnabled: false,
@@ -7050,24 +7369,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7050
7369
  case 5:
7051
7370
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
7052
7371
  _this40.isMoveToInProgress = false;
7053
- _context21.next = 7;
7372
+ _context22.next = 7;
7054
7373
  break;
7055
7374
  case 6:
7056
- _context21.prev = 6;
7057
- _t12 = _context21["catch"](0);
7058
- _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t12);
7375
+ _context22.prev = 6;
7376
+ _t14 = _context22["catch"](0);
7377
+ _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _t14);
7059
7378
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
7060
7379
  correlation_id: _this40.correlationId,
7061
7380
  locus_id: _this40.locusUrl.split('/').pop(),
7062
- reason: _t12.message,
7063
- stack: _t12.stack
7381
+ reason: _t14.message,
7382
+ stack: _t14.stack
7064
7383
  });
7065
7384
  _this40.isMoveToInProgress = false;
7066
7385
  case 7:
7067
7386
  case "end":
7068
- return _context21.stop();
7387
+ return _context22.stop();
7069
7388
  }
7070
- }, _callee21, null, [[0, 6]]);
7389
+ }, _callee22, null, [[0, 6]]);
7071
7390
  })));
7072
7391
  _loggerProxy.default.logger.info('Meeting:index#moveTo --> Initated moved to using resourceId', resourceId);
7073
7392
 
@@ -7155,10 +7474,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7155
7474
  }, {
7156
7475
  key: "createMediaConnection",
7157
7476
  value: (function () {
7158
- var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22(turnServerInfo, bundlePolicy) {
7477
+ var _createMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(turnServerInfo, bundlePolicy) {
7159
7478
  var mc, audioEnabled, videoEnabled, shareEnabled;
7160
- return _regenerator.default.wrap(function (_context22) {
7161
- while (1) switch (_context22.prev = _context22.next) {
7479
+ return _regenerator.default.wrap(function (_context23) {
7480
+ while (1) switch (_context23.prev = _context23.next) {
7162
7481
  case 0:
7163
7482
  this.rtcMetrics = this.isMultistream ?
7164
7483
  // @ts-ignore
@@ -7200,40 +7519,40 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7200
7519
 
7201
7520
  // publish the streams
7202
7521
  if (!this.mediaProperties.audioStream) {
7203
- _context22.next = 1;
7522
+ _context23.next = 1;
7204
7523
  break;
7205
7524
  }
7206
7525
  this.setSendNamedMediaGroup(_internalMediaCore.MediaType.AudioMain);
7207
- _context22.next = 1;
7526
+ _context23.next = 1;
7208
7527
  return this.publishStream(_internalMediaCore.MediaType.AudioMain, this.mediaProperties.audioStream);
7209
7528
  case 1:
7210
7529
  if (!this.mediaProperties.videoStream) {
7211
- _context22.next = 2;
7530
+ _context23.next = 2;
7212
7531
  break;
7213
7532
  }
7214
- _context22.next = 2;
7533
+ _context23.next = 2;
7215
7534
  return this.publishStream(_internalMediaCore.MediaType.VideoMain, this.mediaProperties.videoStream);
7216
7535
  case 2:
7217
7536
  if (!this.mediaProperties.shareVideoStream) {
7218
- _context22.next = 3;
7537
+ _context23.next = 3;
7219
7538
  break;
7220
7539
  }
7221
- _context22.next = 3;
7540
+ _context23.next = 3;
7222
7541
  return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
7223
7542
  case 3:
7224
7543
  if (!(this.isMultistream && this.mediaProperties.shareAudioStream)) {
7225
- _context22.next = 4;
7544
+ _context23.next = 4;
7226
7545
  break;
7227
7546
  }
7228
- _context22.next = 4;
7547
+ _context23.next = 4;
7229
7548
  return this.publishStream(_internalMediaCore.MediaType.AudioSlides, this.mediaProperties.shareAudioStream);
7230
7549
  case 4:
7231
- return _context22.abrupt("return", mc);
7550
+ return _context23.abrupt("return", mc);
7232
7551
  case 5:
7233
7552
  case "end":
7234
- return _context22.stop();
7553
+ return _context23.stop();
7235
7554
  }
7236
- }, _callee22, this);
7555
+ }, _callee23, this);
7237
7556
  }));
7238
7557
  function createMediaConnection(_x15, _x16) {
7239
7558
  return _createMediaConnection.apply(this, arguments);
@@ -7273,11 +7592,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7273
7592
  }, {
7274
7593
  key: "setUpLocalStreamReferences",
7275
7594
  value: (function () {
7276
- var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(localStreams) {
7595
+ var _setUpLocalStreamReferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(localStreams) {
7277
7596
  var _localStreams$microph, _localStreams$camera, _localStreams$screenS, _localStreams$screenS2, _localStreams$screenS3, _localStreams$screenS4, _localStreams$screenS5, _localStreams$screenS6;
7278
- var setUpStreamPromises, _t13;
7279
- return _regenerator.default.wrap(function (_context23) {
7280
- while (1) switch (_context23.prev = _context23.next) {
7597
+ var setUpStreamPromises, _t15;
7598
+ return _regenerator.default.wrap(function (_context24) {
7599
+ while (1) switch (_context24.prev = _context24.next) {
7281
7600
  case 0:
7282
7601
  setUpStreamPromises = [];
7283
7602
  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') {
@@ -7292,22 +7611,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7292
7611
  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') {
7293
7612
  setUpStreamPromises.push(this.setLocalShareAudioStream(localStreams.screenShare.audio));
7294
7613
  }
7295
- _context23.prev = 1;
7296
- _context23.next = 2;
7614
+ _context24.prev = 1;
7615
+ _context24.next = 2;
7297
7616
  return _promise.default.all(setUpStreamPromises);
7298
7617
  case 2:
7299
- _context23.next = 4;
7618
+ _context24.next = 4;
7300
7619
  break;
7301
7620
  case 3:
7302
- _context23.prev = 3;
7303
- _t13 = _context23["catch"](1);
7304
- _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t13);
7305
- throw _t13;
7621
+ _context24.prev = 3;
7622
+ _t15 = _context24["catch"](1);
7623
+ _loggerProxy.default.logger.error("Meeting:index#addMedia():setUpLocalStreamReferences --> Error , ", _t15);
7624
+ throw _t15;
7306
7625
  case 4:
7307
7626
  case "end":
7308
- return _context23.stop();
7627
+ return _context24.stop();
7309
7628
  }
7310
- }, _callee23, this, [[1, 3]]);
7629
+ }, _callee24, this, [[1, 3]]);
7311
7630
  }));
7312
7631
  function setUpLocalStreamReferences(_x17) {
7313
7632
  return _setUpLocalStreamReferences.apply(this, arguments);
@@ -7324,72 +7643,72 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7324
7643
  }, {
7325
7644
  key: "waitForMediaConnectionConnected",
7326
7645
  value: (function () {
7327
- var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
7328
- var iceConnected, _this$mediaProperties9, _this$mediaProperties0, _this$mediaProperties1, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, timedOutError, _t14, _t15, _t16, _t17, _t18, _t19, _t20, _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28;
7329
- return _regenerator.default.wrap(function (_context24) {
7330
- while (1) switch (_context24.prev = _context24.next) {
7646
+ var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7647
+ 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;
7648
+ return _regenerator.default.wrap(function (_context25) {
7649
+ while (1) switch (_context25.prev = _context25.next) {
7331
7650
  case 0:
7332
- _context24.prev = 0;
7333
- _context24.next = 1;
7651
+ _context25.prev = 0;
7652
+ _context25.next = 1;
7334
7653
  return this.mediaProperties.waitForMediaConnectionConnected(this.correlationId);
7335
7654
  case 1:
7336
- _context24.next = 5;
7655
+ _context25.next = 5;
7337
7656
  break;
7338
7657
  case 2:
7339
- _context24.prev = 2;
7340
- _t14 = _context24["catch"](0);
7341
- iceConnected = _t14.iceConnected;
7658
+ _context25.prev = 2;
7659
+ _t16 = _context25["catch"](0);
7660
+ iceConnected = _t16.iceConnected;
7342
7661
  if (this.hasMediaConnectionConnectedAtLeastOnce) {
7343
- _context24.next = 4;
7662
+ _context25.next = 4;
7344
7663
  break;
7345
7664
  }
7346
- _t15 = this.webex.internal.newMetrics;
7347
- _t16 = !this.turnServerUsed;
7348
- _t17 = this.addMediaData.icePhaseCallback();
7349
- _t18 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7350
- _t19 = _internalPluginMetrics.CallDiagnosticUtils;
7351
- _t20 = ((_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';
7352
- _t21 = iceConnected;
7353
- _t22 = this.turnServerUsed;
7354
- _context24.next = 3;
7665
+ _t17 = this.webex.internal.newMetrics;
7666
+ _t18 = !this.turnServerUsed;
7667
+ _t19 = this.addMediaData.icePhaseCallback();
7668
+ _t20 = this.webex.internal.newMetrics.callDiagnosticMetrics;
7669
+ _t21 = _internalPluginMetrics.CallDiagnosticUtils;
7670
+ _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';
7671
+ _t23 = iceConnected;
7672
+ _t24 = this.turnServerUsed;
7673
+ _context25.next = 3;
7355
7674
  return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
7356
7675
  return false;
7357
7676
  });
7358
7677
  case 3:
7359
- _t23 = _context24.sent;
7360
- _t24 = _t19.generateClientErrorCodeForIceFailure.call(_t19, {
7361
- signalingState: _t20,
7362
- iceConnected: _t21,
7363
- turnServerUsed: _t22,
7364
- unreachable: _t23
7678
+ _t25 = _context25.sent;
7679
+ _t26 = _t21.generateClientErrorCodeForIceFailure.call(_t21, {
7680
+ signalingState: _t22,
7681
+ iceConnected: _t23,
7682
+ turnServerUsed: _t24,
7683
+ unreachable: _t25
7365
7684
  });
7366
- _t25 = _t18.getErrorPayloadForClientErrorCode.call(_t18, {
7367
- clientErrorCode: _t24
7685
+ _t27 = _t20.getErrorPayloadForClientErrorCode.call(_t20, {
7686
+ clientErrorCode: _t26
7368
7687
  });
7369
- _t26 = [_t25];
7370
- _t27 = {
7371
- canProceed: _t16,
7372
- icePhase: _t17,
7373
- errors: _t26
7688
+ _t28 = [_t27];
7689
+ _t29 = {
7690
+ canProceed: _t18,
7691
+ icePhase: _t19,
7692
+ errors: _t28
7374
7693
  };
7375
- _t28 = {
7694
+ _t30 = {
7376
7695
  meetingId: this.id,
7377
- rawError: _t14
7696
+ rawError: _t16
7378
7697
  };
7379
- _t15.submitClientEvent.call(_t15, {
7698
+ _t17.submitClientEvent.call(_t17, {
7380
7699
  name: 'client.ice.end',
7381
- payload: _t27,
7382
- options: _t28
7700
+ payload: _t29,
7701
+ options: _t30
7383
7702
  });
7384
7703
  case 4:
7385
7704
  timedOutError = new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
7386
- timedOutError.cause = _t14;
7705
+ timedOutError.cause = _t16;
7387
7706
  throw timedOutError;
7388
7707
  case 5:
7389
7708
  case "end":
7390
- return _context24.stop();
7709
+ return _context25.stop();
7391
7710
  }
7392
- }, _callee24, this, [[0, 2]]);
7711
+ }, _callee25, this, [[0, 2]]);
7393
7712
  }));
7394
7713
  function waitForMediaConnectionConnected() {
7395
7714
  return _waitForMediaConnectionConnected.apply(this, arguments);
@@ -7456,19 +7775,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7456
7775
  }, {
7457
7776
  key: "waitForRemoteSDPAnswer",
7458
7777
  value: (function () {
7459
- var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
7778
+ var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
7460
7779
  var _this44 = this;
7461
7780
  var LOG_HEADER, deferSDPAnswer;
7462
- return _regenerator.default.wrap(function (_context25) {
7463
- while (1) switch (_context25.prev = _context25.next) {
7781
+ return _regenerator.default.wrap(function (_context26) {
7782
+ while (1) switch (_context26.prev = _context26.next) {
7464
7783
  case 0:
7465
7784
  LOG_HEADER = 'Meeting:index#addMedia():waitForRemoteSDPAnswer -->';
7466
7785
  if (this.deferSDPAnswer) {
7467
- _context25.next = 1;
7786
+ _context26.next = 1;
7468
7787
  break;
7469
7788
  }
7470
7789
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " offer not created yet"));
7471
- return _context25.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7790
+ return _context26.abrupt("return", _promise.default.reject(new Error('waitForRemoteSDPAnswer() called before local sdp offer created')));
7472
7791
  case 1:
7473
7792
  deferSDPAnswer = this.deferSDPAnswer;
7474
7793
  this.sdpResponseTimer = setTimeout(function () {
@@ -7494,12 +7813,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7494
7813
  deferSDPAnswer.reject(error);
7495
7814
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
7496
7815
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
7497
- return _context25.abrupt("return", deferSDPAnswer.promise);
7816
+ return _context26.abrupt("return", deferSDPAnswer.promise);
7498
7817
  case 2:
7499
7818
  case "end":
7500
- return _context25.stop();
7819
+ return _context26.stop();
7501
7820
  }
7502
- }, _callee25, this);
7821
+ }, _callee26, this);
7503
7822
  }));
7504
7823
  function waitForRemoteSDPAnswer() {
7505
7824
  return _waitForRemoteSDPAnswer.apply(this, arguments);
@@ -7518,28 +7837,28 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7518
7837
  }, {
7519
7838
  key: "retryEstablishMediaConnectionWithForcedTurnDiscovery",
7520
7839
  value: (function () {
7521
- var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(remoteMediaManagerConfig, bundlePolicy) {
7522
- var LOG_HEADER, _t29;
7523
- return _regenerator.default.wrap(function (_context26) {
7524
- while (1) switch (_context26.prev = _context26.next) {
7840
+ var _retryEstablishMediaConnectionWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7841
+ var LOG_HEADER, _t31;
7842
+ return _regenerator.default.wrap(function (_context27) {
7843
+ while (1) switch (_context27.prev = _context27.next) {
7525
7844
  case 0:
7526
7845
  LOG_HEADER = 'Meeting:index#addMedia():retryEstablishMediaConnectionWithForcedTurnDiscovery -->';
7527
- _context26.prev = 1;
7528
- _context26.next = 2;
7846
+ _context27.prev = 1;
7847
+ _context27.next = 2;
7529
7848
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true);
7530
7849
  case 2:
7531
- _context26.next = 4;
7850
+ _context27.next = 4;
7532
7851
  break;
7533
7852
  case 3:
7534
- _context26.prev = 3;
7535
- _t29 = _context26["catch"](1);
7536
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t29);
7537
- throw _t29;
7853
+ _context27.prev = 3;
7854
+ _t31 = _context27["catch"](1);
7855
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " retry with TURN-TLS failed, media connection unable to connect, "), _t31);
7856
+ throw _t31;
7538
7857
  case 4:
7539
7858
  case "end":
7540
- return _context26.stop();
7859
+ return _context27.stop();
7541
7860
  }
7542
- }, _callee26, this, [[1, 3]]);
7861
+ }, _callee27, this, [[1, 3]]);
7543
7862
  }));
7544
7863
  function retryEstablishMediaConnectionWithForcedTurnDiscovery(_x18, _x19) {
7545
7864
  return _retryEstablishMediaConnectionWithForcedTurnDiscovery.apply(this, arguments);
@@ -7559,14 +7878,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7559
7878
  }, {
7560
7879
  key: "retryWithForcedTurnDiscovery",
7561
7880
  value: (function () {
7562
- var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27(remoteMediaManagerConfig, bundlePolicy) {
7881
+ var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(remoteMediaManagerConfig, bundlePolicy) {
7563
7882
  var LOG_HEADER;
7564
- return _regenerator.default.wrap(function (_context27) {
7565
- while (1) switch (_context27.prev = _context27.next) {
7883
+ return _regenerator.default.wrap(function (_context28) {
7884
+ while (1) switch (_context28.prev = _context28.next) {
7566
7885
  case 0:
7567
7886
  this.addMediaData.retriedWithTurnServer = true;
7568
7887
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
7569
- _context27.next = 1;
7888
+ _context28.next = 1;
7570
7889
  return this.cleanUpBeforeRetryWithTurnServer();
7571
7890
  case 1:
7572
7891
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
@@ -7576,22 +7895,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7576
7895
  reason: 'forcingTurnTls'
7577
7896
  });
7578
7897
  if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
7579
- _context27.next = 2;
7898
+ _context28.next = 2;
7580
7899
  break;
7581
7900
  }
7582
7901
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
7583
- _context27.next = 2;
7902
+ _context28.next = 2;
7584
7903
  return this.join({
7585
7904
  rejoin: true
7586
7905
  });
7587
7906
  case 2:
7588
- _context27.next = 3;
7907
+ _context28.next = 3;
7589
7908
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7590
7909
  case 3:
7591
7910
  case "end":
7592
- return _context27.stop();
7911
+ return _context28.stop();
7593
7912
  }
7594
- }, _callee27, this);
7913
+ }, _callee28, this);
7595
7914
  }));
7596
7915
  function retryWithForcedTurnDiscovery(_x20, _x21) {
7597
7916
  return _retryWithForcedTurnDiscovery.apply(this, arguments);
@@ -7613,30 +7932,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7613
7932
  }, {
7614
7933
  key: "handleWaitForMediaConnectionConnectedError",
7615
7934
  value: (function () {
7616
- var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(error, remoteMediaManagerConfig, bundlePolicy) {
7935
+ var _handleWaitForMediaConnectionConnectedError = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(error, remoteMediaManagerConfig, bundlePolicy) {
7617
7936
  var LOG_HEADER;
7618
- return _regenerator.default.wrap(function (_context28) {
7619
- while (1) switch (_context28.prev = _context28.next) {
7937
+ return _regenerator.default.wrap(function (_context29) {
7938
+ while (1) switch (_context29.prev = _context29.next) {
7620
7939
  case 0:
7621
7940
  LOG_HEADER = 'Meeting:index#addMedia():handleWaitForMediaConnectionConnectedError -->'; // @ts-ignore - config coming from registerPlugin
7622
7941
  if (this.turnServerUsed) {
7623
- _context28.next = 2;
7942
+ _context29.next = 2;
7624
7943
  break;
7625
7944
  }
7626
7945
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " error waiting for media to connect on UDP, TCP, retrying using TURN-TLS, "), error);
7627
- _context28.next = 1;
7946
+ _context29.next = 1;
7628
7947
  return this.retryWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
7629
7948
  case 1:
7630
- _context28.next = 3;
7949
+ _context29.next = 3;
7631
7950
  break;
7632
7951
  case 2:
7633
7952
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error waiting for media to connect using UDP, TCP and TURN-TLS"), error);
7634
7953
  throw new _webexErrors.AddMediaFailed(error);
7635
7954
  case 3:
7636
7955
  case "end":
7637
- return _context28.stop();
7956
+ return _context29.stop();
7638
7957
  }
7639
- }, _callee28, this);
7958
+ }, _callee29, this);
7640
7959
  }));
7641
7960
  function handleWaitForMediaConnectionConnectedError(_x22, _x23, _x24) {
7642
7961
  return _handleWaitForMediaConnectionConnectedError.apply(this, arguments);
@@ -7654,20 +7973,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7654
7973
  }, {
7655
7974
  key: "doTurnDiscovery",
7656
7975
  value: (function () {
7657
- var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(isReconnecting, isForced) {
7976
+ var _doTurnDiscovery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(isReconnecting, isForced) {
7658
7977
  var cdl, turnDiscoveryResult;
7659
- return _regenerator.default.wrap(function (_context29) {
7660
- while (1) switch (_context29.prev = _context29.next) {
7978
+ return _regenerator.default.wrap(function (_context30) {
7979
+ while (1) switch (_context30.prev = _context30.next) {
7661
7980
  case 0:
7662
7981
  // @ts-ignore
7663
7982
  cdl = this.webex.internal.newMetrics.callDiagnosticLatencies; // @ts-ignore
7664
7983
  this.webex.internal.newMetrics.submitInternalEvent({
7665
7984
  name: 'internal.client.add-media.turn-discovery.start'
7666
7985
  });
7667
- _context29.next = 1;
7986
+ _context30.next = 1;
7668
7987
  return this.roap.doTurnDiscovery(this, isReconnecting, isForced);
7669
7988
  case 1:
7670
- turnDiscoveryResult = _context29.sent;
7989
+ turnDiscoveryResult = _context30.sent;
7671
7990
  this.turnDiscoverySkippedReason = turnDiscoveryResult === null || turnDiscoveryResult === void 0 ? void 0 : turnDiscoveryResult.turnDiscoverySkippedReason;
7672
7991
  this.turnServerUsed = !this.turnDiscoverySkippedReason;
7673
7992
 
@@ -7683,12 +8002,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7683
8002
  retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
7684
8003
  });
7685
8004
  }
7686
- return _context29.abrupt("return", turnDiscoveryResult);
8005
+ return _context30.abrupt("return", turnDiscoveryResult);
7687
8006
  case 2:
7688
8007
  case "end":
7689
- return _context29.stop();
8008
+ return _context30.stop();
7690
8009
  }
7691
- }, _callee29, this);
8010
+ }, _callee30, this);
7692
8011
  }));
7693
8012
  function doTurnDiscovery(_x25, _x26) {
7694
8013
  return _doTurnDiscovery.apply(this, arguments);
@@ -7709,35 +8028,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7709
8028
  }, {
7710
8029
  key: "establishMediaConnection",
7711
8030
  value: (function () {
7712
- var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
8031
+ var _establishMediaConnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
7713
8032
  var _this$locusMediaReque;
7714
- var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t30, _t31;
7715
- return _regenerator.default.wrap(function (_context30) {
7716
- while (1) switch (_context30.prev = _context30.next) {
8033
+ var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc, _t32, _t33;
8034
+ return _regenerator.default.wrap(function (_context31) {
8035
+ while (1) switch (_context31.prev = _context31.next) {
7717
8036
  case 0:
7718
8037
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
7719
8038
  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
7720
8039
  if (this.isMoveToInProgress && this.turnServerUsed) {
7721
8040
  isForced = true;
7722
8041
  }
7723
- _context30.prev = 1;
8042
+ _context31.prev = 1;
7724
8043
  if (turnServerInfo) {
7725
- _context30.next = 3;
8044
+ _context31.next = 3;
7726
8045
  break;
7727
8046
  }
7728
- _context30.next = 2;
8047
+ _context31.next = 2;
7729
8048
  return this.doTurnDiscovery(isReconnecting, isForced);
7730
8049
  case 2:
7731
- _yield$this$doTurnDis = _context30.sent;
8050
+ _yield$this$doTurnDis = _context31.sent;
7732
8051
  turnServerInfo = _yield$this$doTurnDis.turnServerInfo;
7733
8052
  case 3:
7734
- _context30.next = 4;
8053
+ _context31.next = 4;
7735
8054
  return this.createMediaConnection(turnServerInfo, bundlePolicy);
7736
8055
  case 4:
7737
- mc = _context30.sent;
8056
+ mc = _context31.sent;
7738
8057
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connection created this.isMultistream=").concat(this.isMultistream));
7739
8058
  if (!this.isMultistream) {
7740
- _context30.next = 5;
8059
+ _context31.next = 5;
7741
8060
  break;
7742
8061
  }
7743
8062
  this.remoteMediaManager = new _remoteMediaManager.RemoteMediaManager(this.receiveSlotManager, this.mediaRequestManagers, remoteMediaManagerConfig);
@@ -7745,40 +8064,40 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7745
8064
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.InterpretationAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_INTERPRETATION_AUDIO_CREATED);
7746
8065
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.ScreenShareAudioCreated, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_SCREEN_SHARE_AUDIO_CREATED);
7747
8066
  this.forwardEvent(this.remoteMediaManager, _remoteMediaManager.Event.VideoLayoutChanged, _constants.EVENT_TRIGGERS.REMOTE_MEDIA_VIDEO_LAYOUT_CHANGED);
7748
- _context30.next = 5;
8067
+ _context31.next = 5;
7749
8068
  return this.remoteMediaManager.start();
7750
8069
  case 5:
7751
- _context30.next = 6;
8070
+ _context31.next = 6;
7752
8071
  return mc.initiateOffer();
7753
8072
  case 6:
7754
- _context30.next = 7;
8073
+ _context31.next = 7;
7755
8074
  return this.waitForRemoteSDPAnswer();
7756
8075
  case 7:
7757
8076
  this.handleMediaLogging(this.mediaProperties);
7758
- _context30.next = 9;
8077
+ _context31.next = 9;
7759
8078
  break;
7760
8079
  case 8:
7761
- _context30.prev = 8;
7762
- _t30 = _context30["catch"](1);
7763
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t30);
7764
- throw _t30;
8080
+ _context31.prev = 8;
8081
+ _t32 = _context31["catch"](1);
8082
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " error establishing media connection, "), _t32);
8083
+ throw _t32;
7765
8084
  case 9:
7766
- _context30.prev = 9;
7767
- _context30.next = 10;
8085
+ _context31.prev = 9;
8086
+ _context31.next = 10;
7768
8087
  return this.waitForMediaConnectionConnected();
7769
8088
  case 10:
7770
- _context30.next = 12;
8089
+ _context31.next = 12;
7771
8090
  break;
7772
8091
  case 11:
7773
- _context30.prev = 11;
7774
- _t31 = _context30["catch"](9);
7775
- _context30.next = 12;
7776
- return this.handleWaitForMediaConnectionConnectedError(_t31, remoteMediaManagerConfig, bundlePolicy);
8092
+ _context31.prev = 11;
8093
+ _t33 = _context31["catch"](9);
8094
+ _context31.next = 12;
8095
+ return this.handleWaitForMediaConnectionConnectedError(_t33, remoteMediaManagerConfig, bundlePolicy);
7777
8096
  case 12:
7778
8097
  case "end":
7779
- return _context30.stop();
8098
+ return _context31.stop();
7780
8099
  }
7781
- }, _callee30, this, [[1, 8], [9, 11]]);
8100
+ }, _callee31, this, [[1, 8], [9, 11]]);
7782
8101
  }));
7783
8102
  function establishMediaConnection(_x27, _x28, _x29, _x30) {
7784
8103
  return _establishMediaConnection.apply(this, arguments);
@@ -7795,16 +8114,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7795
8114
  }, {
7796
8115
  key: "cleanUpOnAddMediaFailure",
7797
8116
  value: (function () {
7798
- var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
8117
+ var _cleanUpOnAddMediaFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
7799
8118
  var _this$networkQualityM, _this$statsMonitor;
7800
- return _regenerator.default.wrap(function (_context31) {
7801
- while (1) switch (_context31.prev = _context31.next) {
8119
+ return _regenerator.default.wrap(function (_context32) {
8120
+ while (1) switch (_context32.prev = _context32.next) {
7802
8121
  case 0:
7803
8122
  if (!this.statsAnalyzer) {
7804
- _context31.next = 1;
8123
+ _context32.next = 1;
7805
8124
  break;
7806
8125
  }
7807
- _context31.next = 1;
8126
+ _context32.next = 1;
7808
8127
  return this.statsAnalyzer.stopAnalyzer();
7809
8128
  case 1:
7810
8129
  this.statsAnalyzer = null;
@@ -7815,7 +8134,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7815
8134
 
7816
8135
  // when media fails, we want to upload a webrtc dump to see whats going on
7817
8136
  // this function is async, but returns once the stats have been gathered
7818
- _context31.next = 2;
8137
+ _context32.next = 2;
7819
8138
  return this.forceSendStatsReport({
7820
8139
  callFrom: 'addMedia'
7821
8140
  });
@@ -7826,9 +8145,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7826
8145
  }
7827
8146
  case 3:
7828
8147
  case "end":
7829
- return _context31.stop();
8148
+ return _context32.stop();
7830
8149
  }
7831
- }, _callee31, this);
8150
+ }, _callee32, this);
7832
8151
  }));
7833
8152
  function cleanUpOnAddMediaFailure() {
7834
8153
  return _cleanUpOnAddMediaFailure.apply(this, arguments);
@@ -7846,16 +8165,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7846
8165
  }, {
7847
8166
  key: "downgradeFromMultistreamToTranscoded",
7848
8167
  value: (function () {
7849
- var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
8168
+ var _downgradeFromMultistreamToTranscoded = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7850
8169
  var _this$networkQualityM2, _this$statsMonitor2, _this$locusMediaReque2;
7851
- return _regenerator.default.wrap(function (_context32) {
7852
- while (1) switch (_context32.prev = _context32.next) {
8170
+ return _regenerator.default.wrap(function (_context33) {
8171
+ while (1) switch (_context33.prev = _context33.next) {
7853
8172
  case 0:
7854
8173
  if (!this.statsAnalyzer) {
7855
- _context32.next = 1;
8174
+ _context33.next = 1;
7856
8175
  break;
7857
8176
  }
7858
- _context32.next = 1;
8177
+ _context33.next = 1;
7859
8178
  return this.statsAnalyzer.stopAnalyzer();
7860
8179
  case 1:
7861
8180
  this.statsAnalyzer = null;
@@ -7873,9 +8192,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7873
8192
  this.createStatsAnalyzer();
7874
8193
  case 2:
7875
8194
  case "end":
7876
- return _context32.stop();
8195
+ return _context33.stop();
7877
8196
  }
7878
- }, _callee32, this);
8197
+ }, _callee33, this);
7879
8198
  }));
7880
8199
  function downgradeFromMultistreamToTranscoded() {
7881
8200
  return _downgradeFromMultistreamToTranscoded.apply(this, arguments);
@@ -7893,11 +8212,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7893
8212
  }, {
7894
8213
  key: "cleanUpBeforeRetryWithTurnServer",
7895
8214
  value: (function () {
7896
- var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
7897
- return _regenerator.default.wrap(function (_context33) {
7898
- while (1) switch (_context33.prev = _context33.next) {
8215
+ var _cleanUpBeforeRetryWithTurnServer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
8216
+ return _regenerator.default.wrap(function (_context34) {
8217
+ while (1) switch (_context34.prev = _context34.next) {
7899
8218
  case 0:
7900
- _context33.next = 1;
8219
+ _context34.next = 1;
7901
8220
  return this.forceSendStatsReport({
7902
8221
  callFrom: 'cleanUpBeforeRetryWithTurnServer'
7903
8222
  });
@@ -7917,9 +8236,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7917
8236
  }
7918
8237
  case 2:
7919
8238
  case "end":
7920
- return _context33.stop();
8239
+ return _context34.stop();
7921
8240
  }
7922
- }, _callee33, this);
8241
+ }, _callee34, this);
7923
8242
  }));
7924
8243
  function cleanUpBeforeRetryWithTurnServer() {
7925
8244
  return _cleanUpBeforeRetryWithTurnServer.apply(this, arguments);
@@ -7929,35 +8248,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7929
8248
  }, {
7930
8249
  key: "cleanUpBeforeReconnection",
7931
8250
  value: function () {
7932
- var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee34() {
7933
- var _t32;
7934
- return _regenerator.default.wrap(function (_context34) {
7935
- while (1) switch (_context34.prev = _context34.next) {
8251
+ var _cleanUpBeforeReconnection = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35() {
8252
+ var _t34;
8253
+ return _regenerator.default.wrap(function (_context35) {
8254
+ while (1) switch (_context35.prev = _context35.next) {
7936
8255
  case 0:
7937
- _context34.prev = 0;
7938
- _context34.next = 1;
8256
+ _context35.prev = 0;
8257
+ _context35.next = 1;
7939
8258
  return this.forceSendStatsReport({
7940
8259
  callFrom: 'cleanUpBeforeReconnection'
7941
8260
  });
7942
8261
  case 1:
7943
8262
  if (!this.statsAnalyzer) {
7944
- _context34.next = 2;
8263
+ _context35.next = 2;
7945
8264
  break;
7946
8265
  }
7947
- _context34.next = 2;
8266
+ _context35.next = 2;
7948
8267
  return this.statsAnalyzer.stopAnalyzer();
7949
8268
  case 2:
7950
- _context34.next = 4;
8269
+ _context35.next = 4;
7951
8270
  break;
7952
8271
  case 3:
7953
- _context34.prev = 3;
7954
- _t32 = _context34["catch"](0);
7955
- _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t32);
8272
+ _context35.prev = 3;
8273
+ _t34 = _context35["catch"](0);
8274
+ _loggerProxy.default.logger.error('Meeting:index#cleanUpBeforeReconnection --> Error during cleanup: ', _t34);
7956
8275
  case 4:
7957
8276
  case "end":
7958
- return _context34.stop();
8277
+ return _context35.stop();
7959
8278
  }
7960
- }, _callee34, this, [[0, 3]]);
8279
+ }, _callee35, this, [[0, 3]]);
7961
8280
  }));
7962
8281
  function cleanUpBeforeReconnection() {
7963
8282
  return _cleanUpBeforeReconnection.apply(this, arguments);
@@ -8025,7 +8344,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8025
8344
  }, {
8026
8345
  key: "addMediaInternal",
8027
8346
  value: (function () {
8028
- var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee35(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8347
+ var _addMediaInternal = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
8029
8348
  var options,
8030
8349
  LOG_HEADER,
8031
8350
  localStreams,
@@ -8087,26 +8406,26 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8087
8406
  _selectedCandidatePairChanges,
8088
8407
  _numTransports,
8089
8408
  _iceCandidateErrors,
8090
- _args35 = arguments,
8091
- _t33,
8092
- _t34;
8093
- return _regenerator.default.wrap(function (_context35) {
8094
- while (1) switch (_context35.prev = _context35.next) {
8409
+ _args36 = arguments,
8410
+ _t35,
8411
+ _t36;
8412
+ return _regenerator.default.wrap(function (_context36) {
8413
+ while (1) switch (_context36.prev = _context36.next) {
8095
8414
  case 0:
8096
- options = _args35.length > 3 && _args35[3] !== undefined ? _args35[3] : {};
8415
+ options = _args36.length > 3 && _args36[3] !== undefined ? _args36[3] : {};
8097
8416
  this.addMediaData.retriedWithTurnServer = false;
8098
8417
  this.addMediaData.icePhaseCallback = icePhaseCallback;
8099
8418
  this.hasMediaConnectionConnectedAtLeastOnce = false;
8100
8419
  LOG_HEADER = 'Meeting:index#addMedia -->';
8101
8420
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
8102
8421
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
8103
- _context35.next = 1;
8422
+ _context36.next = 1;
8104
8423
  break;
8105
8424
  }
8106
8425
  throw new _webexErrors.MeetingNotActiveError();
8107
8426
  case 1:
8108
8427
  if (!_util2.default.isUserInLeftState(this.locusInfo)) {
8109
- _context35.next = 2;
8428
+ _context36.next = 2;
8110
8429
  break;
8111
8430
  }
8112
8431
  throw new _webexErrors.UserNotJoinedError();
@@ -8123,7 +8442,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8123
8442
  ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
8124
8443
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
8125
8444
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
8126
- _context35.next = 3;
8445
+ _context36.next = 3;
8127
8446
  break;
8128
8447
  }
8129
8448
  throw new _webexErrors.UserInLobbyError();
@@ -8167,62 +8486,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8167
8486
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
8168
8487
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
8169
8488
  this.brbState = (0, _brbState.createBrbState)(this, false);
8170
- _context35.prev = 4;
8489
+ _context36.prev = 4;
8171
8490
  if (!(allowPublishMediaInLobby || !this.isUserUnadmitted)) {
8172
- _context35.next = 5;
8491
+ _context36.next = 5;
8173
8492
  break;
8174
8493
  }
8175
- _context35.next = 5;
8494
+ _context36.next = 5;
8176
8495
  return this.setUpLocalStreamReferences(localStreams);
8177
8496
  case 5:
8178
8497
  this.setMercuryListener();
8179
8498
  this.createStatsAnalyzer();
8180
- _context35.prev = 6;
8181
- _context35.next = 7;
8499
+ _context36.prev = 6;
8500
+ _context36.next = 7;
8182
8501
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
8183
8502
  case 7:
8184
- _context35.next = 12;
8503
+ _context36.next = 12;
8185
8504
  break;
8186
8505
  case 8:
8187
- _context35.prev = 8;
8188
- _t33 = _context35["catch"](6);
8189
- if (!(_t33 instanceof _multistreamNotSupportedError.default)) {
8190
- _context35.next = 11;
8506
+ _context36.prev = 8;
8507
+ _t35 = _context36["catch"](6);
8508
+ if (!(_t35 instanceof _multistreamNotSupportedError.default)) {
8509
+ _context36.next = 11;
8191
8510
  break;
8192
8511
  }
8193
8512
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
8194
- _context35.next = 9;
8513
+ _context36.next = 9;
8195
8514
  return this.downgradeFromMultistreamToTranscoded();
8196
8515
  case 9:
8197
- _context35.next = 10;
8516
+ _context36.next = 10;
8198
8517
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
8199
8518
  case 10:
8200
- _context35.next = 12;
8519
+ _context36.next = 12;
8201
8520
  break;
8202
8521
  case 11:
8203
- throw _t33;
8522
+ throw _t35;
8204
8523
  case 12:
8205
8524
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
8206
8525
  if (!this.mediaProperties.hasLocalShareStream()) {
8207
- _context35.next = 13;
8526
+ _context36.next = 13;
8208
8527
  break;
8209
8528
  }
8210
- _context35.next = 13;
8529
+ _context36.next = 13;
8211
8530
  return this.enqueueScreenShareFloorRequest();
8212
8531
  case 13:
8213
- _context35.next = 14;
8532
+ _context36.next = 14;
8214
8533
  return this.mediaProperties.getCurrentConnectionInfo();
8215
8534
  case 14:
8216
- _yield$this$mediaProp = _context35.sent;
8535
+ _yield$this$mediaProp = _context36.sent;
8217
8536
  connectionType = _yield$this$mediaProp.connectionType;
8218
8537
  ipVersion = _yield$this$mediaProp.ipVersion;
8219
8538
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
8220
8539
  numTransports = _yield$this$mediaProp.numTransports;
8221
8540
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8222
- _context35.next = 15;
8541
+ _context36.next = 15;
8223
8542
  return this.getMediaReachabilityMetricFields();
8224
8543
  case 15:
8225
- reachabilityMetrics = _context35.sent;
8544
+ reachabilityMetrics = _context36.sent;
8226
8545
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
8227
8546
  correlation_id: this.correlationId,
8228
8547
  locus_id: this.locusUrl.split('/').pop(),
@@ -8252,31 +8571,31 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8252
8571
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
8253
8572
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
8254
8573
  this.startPeriodicLogUpload();
8255
- _context35.next = 20;
8574
+ _context36.next = 20;
8256
8575
  break;
8257
8576
  case 16:
8258
- _context35.prev = 16;
8259
- _t34 = _context35["catch"](4);
8260
- _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t34);
8577
+ _context36.prev = 16;
8578
+ _t36 = _context36["catch"](4);
8579
+ _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _t36);
8261
8580
 
8262
8581
  // @ts-ignore
8263
- _context35.next = 17;
8582
+ _context36.next = 17;
8264
8583
  return this.getMediaReachabilityMetricFields();
8265
8584
  case 17:
8266
- _reachabilityMetrics = _context35.sent;
8267
- _context35.next = 18;
8585
+ _reachabilityMetrics = _context36.sent;
8586
+ _context36.next = 18;
8268
8587
  return this.mediaProperties.getCurrentConnectionInfo();
8269
8588
  case 18:
8270
- _yield$this$mediaProp2 = _context35.sent;
8589
+ _yield$this$mediaProp2 = _context36.sent;
8271
8590
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
8272
8591
  _numTransports = _yield$this$mediaProp2.numTransports;
8273
8592
  _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
8274
8593
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
8275
8594
  correlation_id: this.correlationId,
8276
8595
  locus_id: this.locusUrl.split('/').pop(),
8277
- reason: _t34.message,
8278
- stack: _t34.stack,
8279
- code: _t34.code,
8596
+ reason: _t36.message,
8597
+ stack: _t36.stack,
8598
+ code: _t36.code,
8280
8599
  selectedCandidatePairChanges: _selectedCandidatePairChanges,
8281
8600
  numTransports: _numTransports,
8282
8601
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
@@ -8291,7 +8610,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8291
8610
  iceCandidatesCount: this.iceCandidatesCount,
8292
8611
  ipver: ipver
8293
8612
  }));
8294
- _context35.next = 19;
8613
+ _context36.next = 19;
8295
8614
  return this.cleanUpOnAddMediaFailure();
8296
8615
  case 19:
8297
8616
  // Upload logs on error while adding media
@@ -8299,21 +8618,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8299
8618
  file: 'meeting/index',
8300
8619
  function: 'addMedia'
8301
8620
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, this);
8302
- if (_t34 instanceof _internalMediaCore.Errors.SdpError) {
8621
+ if (_t36 instanceof _internalMediaCore.Errors.SdpError) {
8303
8622
  this.leave({
8304
8623
  reason: _constants.MEETING_REMOVED_REASON.MEETING_CONNECTION_FAILED
8305
8624
  });
8306
8625
  }
8307
- throw _t34;
8626
+ throw _t36;
8308
8627
  case 20:
8309
- _context35.prev = 20;
8628
+ _context36.prev = 20;
8310
8629
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
8311
- return _context35.finish(20);
8630
+ return _context36.finish(20);
8312
8631
  case 21:
8313
8632
  case "end":
8314
- return _context35.stop();
8633
+ return _context36.stop();
8315
8634
  }
8316
- }, _callee35, this, [[4, 16, 20, 21], [6, 8]]);
8635
+ }, _callee36, this, [[4, 16, 20, 21], [6, 8]]);
8317
8636
  }));
8318
8637
  function addMediaInternal(_x31, _x32, _x33) {
8319
8638
  return _addMediaInternal.apply(this, arguments);
@@ -8381,35 +8700,35 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8381
8700
  * @memberof Meeting
8382
8701
  */
8383
8702
  function () {
8384
- var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee36(options) {
8703
+ var _updateMedia = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(options) {
8385
8704
  var audioEnabled, videoEnabled, shareAudioEnabled, shareVideoEnabled, _this$audio3, _this$video3;
8386
- return _regenerator.default.wrap(function (_context36) {
8387
- while (1) switch (_context36.prev = _context36.next) {
8705
+ return _regenerator.default.wrap(function (_context37) {
8706
+ while (1) switch (_context37.prev = _context37.next) {
8388
8707
  case 0:
8389
8708
  this.checkMediaConnection();
8390
8709
  audioEnabled = options.audioEnabled, videoEnabled = options.videoEnabled, shareAudioEnabled = options.shareAudioEnabled, shareVideoEnabled = options.shareVideoEnabled;
8391
8710
  _loggerProxy.default.logger.log("Meeting:index#updateMedia --> called with options=".concat((0, _stringify.default)(options)));
8392
8711
  if (this.canUpdateMedia()) {
8393
- _context36.next = 1;
8712
+ _context37.next = 1;
8394
8713
  break;
8395
8714
  }
8396
- return _context36.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8715
+ return _context37.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.UPDATE_MEDIA, options));
8397
8716
  case 1:
8398
8717
  if (!this.isMultistream) {
8399
- _context36.next = 3;
8718
+ _context37.next = 3;
8400
8719
  break;
8401
8720
  }
8402
8721
  if (!(shareAudioEnabled !== undefined || shareVideoEnabled !== undefined)) {
8403
- _context36.next = 2;
8722
+ _context37.next = 2;
8404
8723
  break;
8405
8724
  }
8406
8725
  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');
8407
8726
  case 2:
8408
- _context36.next = 4;
8727
+ _context37.next = 4;
8409
8728
  break;
8410
8729
  case 3:
8411
8730
  if (!(shareAudioEnabled !== undefined)) {
8412
- _context36.next = 4;
8731
+ _context37.next = 4;
8413
8732
  break;
8414
8733
  }
8415
8734
  throw new Error('toggling shareAudioEnabled in a transcoded meeting is not supported as of now');
@@ -8434,18 +8753,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8434
8753
  this.mediaProperties.mediaDirection.receiveShare = !!(shareAudioEnabled || shareVideoEnabled);
8435
8754
  }
8436
8755
  if (this.isMultistream) {
8437
- _context36.next = 5;
8756
+ _context37.next = 5;
8438
8757
  break;
8439
8758
  }
8440
- _context36.next = 5;
8759
+ _context37.next = 5;
8441
8760
  return this.updateTranscodedMediaConnection();
8442
8761
  case 5:
8443
- return _context36.abrupt("return", undefined);
8762
+ return _context37.abrupt("return", undefined);
8444
8763
  case 6:
8445
8764
  case "end":
8446
- return _context36.stop();
8765
+ return _context37.stop();
8447
8766
  }
8448
- }, _callee36, this);
8767
+ }, _callee37, this);
8449
8768
  }));
8450
8769
  function updateMedia(_x34) {
8451
8770
  return _updateMedia.apply(this, arguments);
@@ -8587,15 +8906,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8587
8906
  );
8588
8907
  };
8589
8908
  _loggerProxy.default.logger.log('Meeting:index#leave --> Leaving a meeting');
8909
+ this.stopListeningForMeetingEvents();
8590
8910
  return _util2.default.leaveMeeting(this, options).then(/*#__PURE__*/function () {
8591
- var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee37(leave) {
8592
- return _regenerator.default.wrap(function (_context37) {
8593
- while (1) switch (_context37.prev = _context37.next) {
8911
+ var _ref41 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(leave) {
8912
+ return _regenerator.default.wrap(function (_context38) {
8913
+ while (1) switch (_context38.prev = _context38.next) {
8594
8914
  case 0:
8595
8915
  // CA team recommends submitting this *after* locus /leave
8596
8916
  submitLeaveMetric();
8597
8917
  _this49.meetingFiniteStateMachine.leave();
8598
- _context37.next = 1;
8918
+ _context38.next = 1;
8599
8919
  return _this49.clearMeetingData();
8600
8920
  case 1:
8601
8921
  // upload logs on leave irrespective of meeting delete
@@ -8616,15 +8936,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8616
8936
  });
8617
8937
  }
8618
8938
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
8619
- return _context37.abrupt("return", leave);
8939
+ return _context38.abrupt("return", leave);
8620
8940
  case 2:
8621
8941
  case "end":
8622
- return _context37.stop();
8942
+ return _context38.stop();
8623
8943
  }
8624
- }, _callee37);
8944
+ }, _callee38);
8625
8945
  }));
8626
8946
  return function (_x35) {
8627
- return _ref42.apply(this, arguments);
8947
+ return _ref41.apply(this, arguments);
8628
8948
  };
8629
8949
  }()).catch(function (error) {
8630
8950
  // CA team recommends submitting this *after* locus /leave
@@ -9288,13 +9608,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9288
9608
  correlation_id: this.correlationId,
9289
9609
  locus_id: this.locusId
9290
9610
  });
9611
+ this.stopListeningForMeetingEvents();
9291
9612
  return _util2.default.endMeetingForAll(this).then(/*#__PURE__*/function () {
9292
- var _ref43 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee38(end) {
9293
- return _regenerator.default.wrap(function (_context38) {
9294
- while (1) switch (_context38.prev = _context38.next) {
9613
+ var _ref42 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(end) {
9614
+ return _regenerator.default.wrap(function (_context39) {
9615
+ while (1) switch (_context39.prev = _context39.next) {
9295
9616
  case 0:
9296
9617
  _this56.meetingFiniteStateMachine.end();
9297
- _context38.next = 1;
9618
+ _context39.next = 1;
9298
9619
  return _this56.clearMeetingData();
9299
9620
  case 1:
9300
9621
  // upload logs on leave irrespective of meeting delete
@@ -9302,15 +9623,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9302
9623
  file: 'meeting/index',
9303
9624
  function: 'endMeetingForAll'
9304
9625
  }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this56);
9305
- return _context38.abrupt("return", end);
9626
+ return _context39.abrupt("return", end);
9306
9627
  case 2:
9307
9628
  case "end":
9308
- return _context38.stop();
9629
+ return _context39.stop();
9309
9630
  }
9310
- }, _callee38);
9631
+ }, _callee39);
9311
9632
  }));
9312
9633
  return function (_x36) {
9313
- return _ref43.apply(this, arguments);
9634
+ return _ref42.apply(this, arguments);
9314
9635
  };
9315
9636
  }()).catch(function (error) {
9316
9637
  _this56.meetingFiniteStateMachine.fail(error);
@@ -9374,12 +9695,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9374
9695
  */
9375
9696
  }, {
9376
9697
  key: "extendMeeting",
9377
- value: function extendMeeting(_ref44) {
9378
- var meetingPolicyUrl = _ref44.meetingPolicyUrl,
9379
- meetingInstanceId = _ref44.meetingInstanceId,
9380
- participantId = _ref44.participantId,
9381
- _ref44$extensionMinut = _ref44.extensionMinutes,
9382
- extensionMinutes = _ref44$extensionMinut === void 0 ? 30 : _ref44$extensionMinut;
9698
+ value: function extendMeeting(_ref43) {
9699
+ var meetingPolicyUrl = _ref43.meetingPolicyUrl,
9700
+ meetingInstanceId = _ref43.meetingInstanceId,
9701
+ participantId = _ref43.participantId,
9702
+ _ref43$extensionMinut = _ref43.extensionMinutes,
9703
+ extensionMinutes = _ref43$extensionMinut === void 0 ? 30 : _ref43$extensionMinut;
9383
9704
  if (!meetingInstanceId || !participantId) {
9384
9705
  return _promise.default.reject(new Error('Missing meetingInstanceId or participantId'));
9385
9706
  }
@@ -9460,37 +9781,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9460
9781
  }, {
9461
9782
  key: "enableMusicMode",
9462
9783
  value: (function () {
9463
- var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee39(shouldEnableMusicMode) {
9464
- return _regenerator.default.wrap(function (_context39) {
9465
- while (1) switch (_context39.prev = _context39.next) {
9784
+ var _enableMusicMode = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(shouldEnableMusicMode) {
9785
+ return _regenerator.default.wrap(function (_context40) {
9786
+ while (1) switch (_context40.prev = _context40.next) {
9466
9787
  case 0:
9467
9788
  this.checkMediaConnection();
9468
9789
  if (this.isMultistream) {
9469
- _context39.next = 1;
9790
+ _context40.next = 1;
9470
9791
  break;
9471
9792
  }
9472
9793
  throw new Error('enableMusicMode() only supported with multistream');
9473
9794
  case 1:
9474
9795
  if (!shouldEnableMusicMode) {
9475
- _context39.next = 3;
9796
+ _context40.next = 3;
9476
9797
  break;
9477
9798
  }
9478
- _context39.next = 2;
9799
+ _context40.next = 2;
9479
9800
  return this.sendSlotManager.setCustomCodecParameters(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, {
9480
9801
  maxaveragebitrate: '64000',
9481
9802
  maxplaybackrate: '48000'
9482
9803
  });
9483
9804
  case 2:
9484
- _context39.next = 4;
9805
+ _context40.next = 4;
9485
9806
  break;
9486
9807
  case 3:
9487
- _context39.next = 4;
9808
+ _context40.next = 4;
9488
9809
  return this.sendSlotManager.markCustomCodecParametersForDeletion(_internalMediaCore.MediaType.AudioMain, _internalMediaCore.MediaCodecMimeType.OPUS, ['maxaveragebitrate', 'maxplaybackrate']);
9489
9810
  case 4:
9490
9811
  case "end":
9491
- return _context39.stop();
9812
+ return _context40.stop();
9492
9813
  }
9493
- }, _callee39, this);
9814
+ }, _callee40, this);
9494
9815
  }));
9495
9816
  function enableMusicMode(_x37) {
9496
9817
  return _enableMusicMode.apply(this, arguments);
@@ -9583,25 +9904,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9583
9904
  }, {
9584
9905
  key: "publishStream",
9585
9906
  value: (function () {
9586
- var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee40(mediaType, stream) {
9587
- return _regenerator.default.wrap(function (_context40) {
9588
- while (1) switch (_context40.prev = _context40.next) {
9907
+ var _publishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9908
+ return _regenerator.default.wrap(function (_context41) {
9909
+ while (1) switch (_context41.prev = _context41.next) {
9589
9910
  case 0:
9590
9911
  if (stream) {
9591
- _context40.next = 1;
9912
+ _context41.next = 1;
9592
9913
  break;
9593
9914
  }
9594
- return _context40.abrupt("return");
9915
+ return _context41.abrupt("return");
9595
9916
  case 1:
9596
9917
  if (!this.mediaProperties.webrtcMediaConnection) {
9597
- _context40.next = 3;
9918
+ _context41.next = 3;
9598
9919
  break;
9599
9920
  }
9600
9921
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9601
- _context40.next = 2;
9922
+ _context41.next = 2;
9602
9923
  break;
9603
9924
  }
9604
- _context40.next = 2;
9925
+ _context41.next = 2;
9605
9926
  return this.sendSlotManager.publishStream(mediaType, stream);
9606
9927
  case 2:
9607
9928
  this.emitPublishStateChangeEvent({
@@ -9612,9 +9933,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9612
9933
  });
9613
9934
  case 3:
9614
9935
  case "end":
9615
- return _context40.stop();
9936
+ return _context41.stop();
9616
9937
  }
9617
- }, _callee40, this);
9938
+ }, _callee41, this);
9618
9939
  }));
9619
9940
  function publishStream(_x38, _x39) {
9620
9941
  return _publishStream.apply(this, arguments);
@@ -9632,21 +9953,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9632
9953
  }, {
9633
9954
  key: "unpublishStream",
9634
9955
  value: (function () {
9635
- var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee41(mediaType, stream) {
9636
- return _regenerator.default.wrap(function (_context41) {
9637
- while (1) switch (_context41.prev = _context41.next) {
9956
+ var _unpublishStream = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(mediaType, stream) {
9957
+ return _regenerator.default.wrap(function (_context42) {
9958
+ while (1) switch (_context42.prev = _context42.next) {
9638
9959
  case 0:
9639
9960
  if (stream) {
9640
- _context41.next = 1;
9961
+ _context42.next = 1;
9641
9962
  break;
9642
9963
  }
9643
- return _context41.abrupt("return");
9964
+ return _context42.abrupt("return");
9644
9965
  case 1:
9645
9966
  if (!(this.isMultistream && this.mediaProperties.webrtcMediaConnection)) {
9646
- _context41.next = 2;
9967
+ _context42.next = 2;
9647
9968
  break;
9648
9969
  }
9649
- _context41.next = 2;
9970
+ _context42.next = 2;
9650
9971
  return this.sendSlotManager.unpublishStream(mediaType);
9651
9972
  case 2:
9652
9973
  this.emitPublishStateChangeEvent({
@@ -9657,9 +9978,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9657
9978
  });
9658
9979
  case 3:
9659
9980
  case "end":
9660
- return _context41.stop();
9981
+ return _context42.stop();
9661
9982
  }
9662
- }, _callee41, this);
9983
+ }, _callee42, this);
9663
9984
  }));
9664
9985
  function unpublishStream(_x40, _x41) {
9665
9986
  return _unpublishStream.apply(this, arguments);
@@ -9676,19 +9997,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9676
9997
  }, {
9677
9998
  key: "publishStreams",
9678
9999
  value: (function () {
9679
- var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee42(streams) {
10000
+ var _publishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9680
10001
  var _streams$screenShare, _streams$screenShare2, _streams$screenShare3, _streams$screenShare4, _streams$screenShare5, _streams$screenShare6;
9681
10002
  var streamChecks, _i, _streamChecks, _streamChecks$_i, stream, name, floorRequestNeeded, _streams$screenShare7;
9682
- return _regenerator.default.wrap(function (_context42) {
9683
- while (1) switch (_context42.prev = _context42.next) {
10003
+ return _regenerator.default.wrap(function (_context43) {
10004
+ while (1) switch (_context43.prev = _context43.next) {
9684
10005
  case 0:
9685
10006
  _loggerProxy.default.logger.info("Meeting:index#publishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9686
10007
  this.checkMediaConnection();
9687
10008
  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))) {
9688
- _context42.next = 1;
10009
+ _context43.next = 1;
9689
10010
  break;
9690
10011
  }
9691
- return _context42.abrupt("return");
10012
+ return _context43.abrupt("return");
9692
10013
  case 1:
9693
10014
  streamChecks = [{
9694
10015
  stream: streams === null || streams === void 0 ? void 0 : streams.microphone,
@@ -9706,62 +10027,62 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9706
10027
  _i = 0, _streamChecks = streamChecks;
9707
10028
  case 2:
9708
10029
  if (!(_i < _streamChecks.length)) {
9709
- _context42.next = 4;
10030
+ _context43.next = 4;
9710
10031
  break;
9711
10032
  }
9712
10033
  _streamChecks$_i = _streamChecks[_i], stream = _streamChecks$_i.stream, name = _streamChecks$_i.name;
9713
10034
  if (!((stream === null || stream === void 0 ? void 0 : stream.readyState) === 'ended')) {
9714
- _context42.next = 3;
10035
+ _context43.next = 3;
9715
10036
  break;
9716
10037
  }
9717
10038
  throw new Error("Attempted to publish ".concat(name, " stream with ended readyState, correlationId=").concat(this.correlationId));
9718
10039
  case 3:
9719
10040
  _i++;
9720
- _context42.next = 2;
10041
+ _context43.next = 2;
9721
10042
  break;
9722
10043
  case 4:
9723
10044
  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
9724
10045
  if (!(this.isMultistream && (_streams$screenShare5 = streams.screenShare) !== null && _streams$screenShare5 !== void 0 && _streams$screenShare5.audio)) {
9725
- _context42.next = 6;
10046
+ _context43.next = 6;
9726
10047
  break;
9727
10048
  }
9728
- _context42.next = 5;
10049
+ _context43.next = 5;
9729
10050
  return this.setLocalShareAudioStream(streams.screenShare.audio);
9730
10051
  case 5:
9731
10052
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9732
10053
  case 6:
9733
10054
  if (!((_streams$screenShare6 = streams.screenShare) !== null && _streams$screenShare6 !== void 0 && _streams$screenShare6.video)) {
9734
- _context42.next = 8;
10055
+ _context43.next = 8;
9735
10056
  break;
9736
10057
  }
9737
- _context42.next = 7;
10058
+ _context43.next = 7;
9738
10059
  return this.setLocalShareVideoStream((_streams$screenShare7 = streams.screenShare) === null || _streams$screenShare7 === void 0 ? void 0 : _streams$screenShare7.video);
9739
10060
  case 7:
9740
10061
  floorRequestNeeded = this.screenShareFloorState === ScreenShareFloorStatus.RELEASED;
9741
10062
  case 8:
9742
10063
  if (!streams.microphone) {
9743
- _context42.next = 9;
10064
+ _context43.next = 9;
9744
10065
  break;
9745
10066
  }
9746
- _context42.next = 9;
10067
+ _context43.next = 9;
9747
10068
  return this.setLocalAudioStream(streams.microphone);
9748
10069
  case 9:
9749
10070
  if (!streams.camera) {
9750
- _context42.next = 10;
10071
+ _context43.next = 10;
9751
10072
  break;
9752
10073
  }
9753
- _context42.next = 10;
10074
+ _context43.next = 10;
9754
10075
  return this.setLocalVideoStream(streams.camera);
9755
10076
  case 10:
9756
10077
  if (this.isMultistream) {
9757
- _context42.next = 11;
10078
+ _context43.next = 11;
9758
10079
  break;
9759
10080
  }
9760
- _context42.next = 11;
10081
+ _context43.next = 11;
9761
10082
  return this.updateTranscodedMediaConnection();
9762
10083
  case 11:
9763
10084
  if (!floorRequestNeeded) {
9764
- _context42.next = 12;
10085
+ _context43.next = 12;
9765
10086
  break;
9766
10087
  }
9767
10088
  this.localShareInstanceId = _uuid.default.v4();
@@ -9792,13 +10113,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9792
10113
  // we're sending the http request to Locus to request the screen share floor
9793
10114
  // only after the SDP update, because that's how it's always been done for transcoded meetings
9794
10115
  // and also if sharing from the start, we need confluence to have been created
9795
- _context42.next = 12;
10116
+ _context43.next = 12;
9796
10117
  return this.enqueueScreenShareFloorRequest();
9797
10118
  case 12:
9798
10119
  case "end":
9799
- return _context42.stop();
10120
+ return _context43.stop();
9800
10121
  }
9801
- }, _callee42, this);
10122
+ }, _callee43, this);
9802
10123
  }));
9803
10124
  function publishStreams(_x42) {
9804
10125
  return _publishStreams.apply(this, arguments);
@@ -9815,20 +10136,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9815
10136
  }, {
9816
10137
  key: "unpublishStreams",
9817
10138
  value: (function () {
9818
- var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee43(streams) {
9819
- var promises, _iterator, _step, stream;
9820
- return _regenerator.default.wrap(function (_context43) {
9821
- while (1) switch (_context43.prev = _context43.next) {
10139
+ var _unpublishStreams = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44(streams) {
10140
+ var promises, _iterator2, _step2, stream;
10141
+ return _regenerator.default.wrap(function (_context44) {
10142
+ while (1) switch (_context44.prev = _context44.next) {
9822
10143
  case 0:
9823
10144
  _loggerProxy.default.logger.info("Meeting:index#unpublishStreams --> called with: ".concat((0, _stringify.default)(streams)));
9824
10145
  this.checkMediaConnection();
9825
10146
  promises = [];
9826
- _iterator = _createForOfIteratorHelper(streams.filter(function (t) {
10147
+ _iterator2 = _createForOfIteratorHelper(streams.filter(function (t) {
9827
10148
  return !!t;
9828
10149
  }));
9829
10150
  try {
9830
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
9831
- stream = _step.value;
10151
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
10152
+ stream = _step2.value;
9832
10153
  if (stream === this.mediaProperties.shareAudioStream) {
9833
10154
  promises.push(this.setLocalShareAudioStream(undefined));
9834
10155
  }
@@ -9843,14 +10164,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9843
10164
  }
9844
10165
  }
9845
10166
  } catch (err) {
9846
- _iterator.e(err);
10167
+ _iterator2.e(err);
9847
10168
  } finally {
9848
- _iterator.f();
10169
+ _iterator2.f();
9849
10170
  }
9850
10171
  if (!this.isMultistream) {
9851
10172
  promises.push(this.updateTranscodedMediaConnection());
9852
10173
  }
9853
- _context43.next = 1;
10174
+ _context44.next = 1;
9854
10175
  return _promise.default.all(promises);
9855
10176
  case 1:
9856
10177
  // we're allowing for the SDK to support just audio share as well
@@ -9871,9 +10192,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9871
10192
  }
9872
10193
  case 2:
9873
10194
  case "end":
9874
- return _context43.stop();
10195
+ return _context44.stop();
9875
10196
  }
9876
- }, _callee43, this);
10197
+ }, _callee44, this);
9877
10198
  }));
9878
10199
  function unpublishStreams(_x43) {
9879
10200
  return _unpublishStreams.apply(this, arguments);
@@ -9941,16 +10262,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9941
10262
  }, {
9942
10263
  key: "getMediaReachabilityMetricFields",
9943
10264
  value: (function () {
9944
- var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee44() {
10265
+ var _getMediaReachabilityMetricFields = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
9945
10266
  var _this$mediaServerIp, _this$mediaConnection, _this$mediaConnection2, _this$mediaConnection3;
9946
10267
  var reachabilityMetrics, successKeys, totalSuccessCases, selectedSubnetFirstOctet, isSubnetReachable, selectedCluster;
9947
- return _regenerator.default.wrap(function (_context44) {
9948
- while (1) switch (_context44.prev = _context44.next) {
10268
+ return _regenerator.default.wrap(function (_context45) {
10269
+ while (1) switch (_context45.prev = _context45.next) {
9949
10270
  case 0:
9950
- _context44.next = 1;
10271
+ _context45.next = 1;
9951
10272
  return this.webex.meetings.reachability.getReachabilityMetrics();
9952
10273
  case 1:
9953
- reachabilityMetrics = _context44.sent;
10274
+ reachabilityMetrics = _context45.sent;
9954
10275
  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'];
9955
10276
  totalSuccessCases = successKeys.reduce(function (total, key) {
9956
10277
  var value = reachabilityMetrics[key];
@@ -9967,16 +10288,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9967
10288
  this.webex.meetings.reachability.isSubnetReachable(selectedSubnetFirstOctet);
9968
10289
  }
9969
10290
  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;
9970
- return _context44.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
10291
+ return _context45.abrupt("return", _objectSpread(_objectSpread({}, reachabilityMetrics), {}, {
9971
10292
  subnet_reachable: isSubnetReachable,
9972
10293
  selected_cluster: selectedCluster,
9973
10294
  selected_subnet: selectedSubnetFirstOctet ? "".concat(selectedSubnetFirstOctet, ".X.X.X") : null
9974
10295
  }));
9975
10296
  case 2:
9976
10297
  case "end":
9977
- return _context44.stop();
10298
+ return _context45.stop();
9978
10299
  }
9979
- }, _callee44, this);
10300
+ }, _callee45, this);
9980
10301
  }));
9981
10302
  function getMediaReachabilityMetricFields() {
9982
10303
  return _getMediaReachabilityMetricFields.apply(this, arguments);
@@ -9993,17 +10314,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
9993
10314
  }, {
9994
10315
  key: "setStage",
9995
10316
  value: function setStage() {
9996
- var _ref45 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
9997
- _ref45$activeSpeakerP = _ref45.activeSpeakerProportion,
9998
- activeSpeakerProportion = _ref45$activeSpeakerP === void 0 ? 0.5 : _ref45$activeSpeakerP,
9999
- customBackground = _ref45.customBackground,
10000
- customLogo = _ref45.customLogo,
10001
- customNameLabel = _ref45.customNameLabel,
10002
- importantParticipants = _ref45.importantParticipants,
10003
- _ref45$lockAttendeeVi = _ref45.lockAttendeeViewOnStage,
10004
- lockAttendeeViewOnStage = _ref45$lockAttendeeVi === void 0 ? false : _ref45$lockAttendeeVi,
10005
- _ref45$showActiveSpea = _ref45.showActiveSpeaker,
10006
- showActiveSpeaker = _ref45$showActiveSpea === void 0 ? false : _ref45$showActiveSpea;
10317
+ var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
10318
+ _ref44$activeSpeakerP = _ref44.activeSpeakerProportion,
10319
+ activeSpeakerProportion = _ref44$activeSpeakerP === void 0 ? 0.5 : _ref44$activeSpeakerP,
10320
+ customBackground = _ref44.customBackground,
10321
+ customLogo = _ref44.customLogo,
10322
+ customNameLabel = _ref44.customNameLabel,
10323
+ importantParticipants = _ref44.importantParticipants,
10324
+ _ref44$lockAttendeeVi = _ref44.lockAttendeeViewOnStage,
10325
+ lockAttendeeViewOnStage = _ref44$lockAttendeeVi === void 0 ? false : _ref44$lockAttendeeVi,
10326
+ _ref44$showActiveSpea = _ref44.showActiveSpeaker,
10327
+ showActiveSpeaker = _ref44$showActiveSpea === void 0 ? false : _ref44$showActiveSpea;
10007
10328
  var videoLayout = {
10008
10329
  overrideDefault: true,
10009
10330
  lockAttendeeViewOnStageOnly: lockAttendeeViewOnStage,
@@ -10107,41 +10428,41 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
10107
10428
  }, {
10108
10429
  key: "refreshDataChannelToken",
10109
10430
  value: (function () {
10110
- var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee45() {
10111
- var isPracticeSession, dataChannelTokenType, res, msg, _t35;
10112
- return _regenerator.default.wrap(function (_context45) {
10113
- while (1) switch (_context45.prev = _context45.next) {
10431
+ var _refreshDataChannelToken = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee46() {
10432
+ var isPracticeSession, dataChannelTokenType, res, msg, _t37;
10433
+ return _regenerator.default.wrap(function (_context46) {
10434
+ while (1) switch (_context46.prev = _context46.next) {
10114
10435
  case 0:
10115
10436
  isPracticeSession = this.webinar.isJoinPracticeSessionDataChannel();
10116
10437
  dataChannelTokenType = this.getDataChannelTokenType();
10117
- _context45.prev = 1;
10118
- _context45.next = 2;
10438
+ _context46.prev = 1;
10439
+ _context46.next = 2;
10119
10440
  return this.meetingRequest.fetchDatachannelToken({
10120
10441
  locusUrl: this.locusUrl,
10121
10442
  requestingParticipantId: this.members.selfId,
10122
10443
  isPracticeSession: isPracticeSession
10123
10444
  });
10124
10445
  case 2:
10125
- res = _context45.sent;
10126
- return _context45.abrupt("return", {
10446
+ res = _context46.sent;
10447
+ return _context46.abrupt("return", {
10127
10448
  body: {
10128
10449
  datachannelToken: res.body.datachannelToken,
10129
10450
  dataChannelTokenType: dataChannelTokenType
10130
10451
  }
10131
10452
  });
10132
10453
  case 3:
10133
- _context45.prev = 3;
10134
- _t35 = _context45["catch"](1);
10135
- msg = (_t35 === null || _t35 === void 0 ? void 0 : _t35.message) || String(_t35);
10454
+ _context46.prev = 3;
10455
+ _t37 = _context46["catch"](1);
10456
+ msg = (_t37 === null || _t37 === void 0 ? void 0 : _t37.message) || String(_t37);
10136
10457
  _loggerProxy.default.logger.warn("Meeting:index#refreshDataChannelToken --> DataChannel token refresh failed (likely locus changed or participant left): ".concat(msg), {
10137
- statusCode: _t35 === null || _t35 === void 0 ? void 0 : _t35.statusCode
10458
+ statusCode: _t37 === null || _t37 === void 0 ? void 0 : _t37.statusCode
10138
10459
  });
10139
- return _context45.abrupt("return", null);
10460
+ return _context46.abrupt("return", null);
10140
10461
  case 4:
10141
10462
  case "end":
10142
- return _context45.stop();
10463
+ return _context46.stop();
10143
10464
  }
10144
- }, _callee45, this, [[1, 3]]);
10465
+ }, _callee46, this, [[1, 3]]);
10145
10466
  }));
10146
10467
  function refreshDataChannelToken() {
10147
10468
  return _refreshDataChannelToken.apply(this, arguments);