@webex/plugin-meetings 3.3.1 → 3.4.0-next.2

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 (131) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +7 -2
  3. package/dist/breakouts/index.js.map +1 -1
  4. package/dist/constants.js +11 -4
  5. package/dist/constants.js.map +1 -1
  6. package/dist/interpretation/index.js +1 -1
  7. package/dist/interpretation/siLanguage.js +1 -1
  8. package/dist/locus-info/selfUtils.js +0 -5
  9. package/dist/locus-info/selfUtils.js.map +1 -1
  10. package/dist/media/MediaConnectionAwaiter.js +70 -15
  11. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  12. package/dist/media/index.js +12 -0
  13. package/dist/media/index.js.map +1 -1
  14. package/dist/meeting/connectionStateHandler.js +67 -0
  15. package/dist/meeting/connectionStateHandler.js.map +1 -0
  16. package/dist/meeting/index.js +554 -358
  17. package/dist/meeting/index.js.map +1 -1
  18. package/dist/meeting/locusMediaRequest.js +7 -0
  19. package/dist/meeting/locusMediaRequest.js.map +1 -1
  20. package/dist/meeting/muteState.js +6 -1
  21. package/dist/meeting/muteState.js.map +1 -1
  22. package/dist/meeting/util.js +1 -0
  23. package/dist/meeting/util.js.map +1 -1
  24. package/dist/meeting-info/index.js +4 -4
  25. package/dist/meeting-info/index.js.map +1 -1
  26. package/dist/meeting-info/meeting-info-v2.js +2 -2
  27. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  28. package/dist/meeting-info/util.js +17 -17
  29. package/dist/meeting-info/util.js.map +1 -1
  30. package/dist/meeting-info/utilv2.js +16 -16
  31. package/dist/meeting-info/utilv2.js.map +1 -1
  32. package/dist/meetings/collection.js +1 -1
  33. package/dist/meetings/collection.js.map +1 -1
  34. package/dist/meetings/index.js +37 -33
  35. package/dist/meetings/index.js.map +1 -1
  36. package/dist/meetings/meetings.types.js +8 -0
  37. package/dist/meetings/meetings.types.js.map +1 -1
  38. package/dist/meetings/util.js +3 -2
  39. package/dist/meetings/util.js.map +1 -1
  40. package/dist/metrics/constants.js +2 -1
  41. package/dist/metrics/constants.js.map +1 -1
  42. package/dist/metrics/index.js +57 -0
  43. package/dist/metrics/index.js.map +1 -1
  44. package/dist/personal-meeting-room/index.js +1 -1
  45. package/dist/personal-meeting-room/index.js.map +1 -1
  46. package/dist/reachability/clusterReachability.js +108 -53
  47. package/dist/reachability/clusterReachability.js.map +1 -1
  48. package/dist/reachability/index.js +415 -56
  49. package/dist/reachability/index.js.map +1 -1
  50. package/dist/types/constants.d.ts +11 -3
  51. package/dist/types/media/MediaConnectionAwaiter.d.ts +24 -4
  52. package/dist/types/meeting/connectionStateHandler.d.ts +30 -0
  53. package/dist/types/meeting/index.d.ts +27 -8
  54. package/dist/types/meeting/locusMediaRequest.d.ts +2 -0
  55. package/dist/types/meeting-info/index.d.ts +3 -2
  56. package/dist/types/meeting-info/meeting-info-v2.d.ts +3 -2
  57. package/dist/types/meeting-info/util.d.ts +5 -4
  58. package/dist/types/meeting-info/utilv2.d.ts +3 -2
  59. package/dist/types/meetings/collection.d.ts +3 -2
  60. package/dist/types/meetings/index.d.ts +4 -3
  61. package/dist/types/meetings/meetings.types.d.ts +9 -0
  62. package/dist/types/metrics/constants.d.ts +1 -0
  63. package/dist/types/metrics/index.d.ts +15 -0
  64. package/dist/types/reachability/clusterReachability.d.ts +31 -3
  65. package/dist/types/reachability/index.d.ts +93 -2
  66. package/dist/webinar/index.js +1 -1
  67. package/package.json +23 -23
  68. package/src/breakouts/index.ts +7 -1
  69. package/src/constants.ts +13 -17
  70. package/src/locus-info/selfUtils.ts +0 -5
  71. package/src/media/MediaConnectionAwaiter.ts +89 -14
  72. package/src/media/index.ts +13 -0
  73. package/src/meeting/connectionStateHandler.ts +65 -0
  74. package/src/meeting/index.ts +532 -295
  75. package/src/meeting/locusMediaRequest.ts +5 -0
  76. package/src/meeting/muteState.ts +6 -1
  77. package/src/meeting/util.ts +1 -0
  78. package/src/meeting-info/index.ts +9 -6
  79. package/src/meeting-info/meeting-info-v2.ts +4 -4
  80. package/src/meeting-info/util.ts +23 -28
  81. package/src/meeting-info/utilv2.ts +18 -24
  82. package/src/meetings/collection.ts +3 -3
  83. package/src/meetings/index.ts +39 -40
  84. package/src/meetings/meetings.types.ts +11 -0
  85. package/src/meetings/util.ts +5 -4
  86. package/src/metrics/constants.ts +1 -0
  87. package/src/metrics/index.ts +44 -0
  88. package/src/personal-meeting-room/index.ts +2 -2
  89. package/src/reachability/clusterReachability.ts +86 -25
  90. package/src/reachability/index.ts +316 -27
  91. package/test/unit/spec/breakouts/index.ts +51 -32
  92. package/test/unit/spec/locus-info/selfUtils.js +25 -23
  93. package/test/unit/spec/media/MediaConnectionAwaiter.ts +131 -32
  94. package/test/unit/spec/media/index.ts +42 -27
  95. package/test/unit/spec/meeting/connectionStateHandler.ts +102 -0
  96. package/test/unit/spec/meeting/index.js +762 -179
  97. package/test/unit/spec/meeting/locusMediaRequest.ts +7 -0
  98. package/test/unit/spec/meeting/muteState.js +24 -0
  99. package/test/unit/spec/meeting-info/index.js +4 -4
  100. package/test/unit/spec/meeting-info/meetinginfov2.js +24 -28
  101. package/test/unit/spec/meeting-info/request.js +2 -2
  102. package/test/unit/spec/meeting-info/utilv2.js +41 -49
  103. package/test/unit/spec/meetings/index.js +14 -0
  104. package/test/unit/spec/metrics/index.js +126 -0
  105. package/test/unit/spec/multistream/mediaRequestManager.ts +2 -2
  106. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -2
  107. package/test/unit/spec/reachability/clusterReachability.ts +116 -22
  108. package/test/unit/spec/reachability/index.ts +1153 -84
  109. package/test/unit/spec/rtcMetrics/index.ts +1 -0
  110. package/dist/mediaQualityMetrics/config.js +0 -321
  111. package/dist/mediaQualityMetrics/config.js.map +0 -1
  112. package/dist/networkQualityMonitor/index.js +0 -227
  113. package/dist/networkQualityMonitor/index.js.map +0 -1
  114. package/dist/statsAnalyzer/global.js +0 -44
  115. package/dist/statsAnalyzer/global.js.map +0 -1
  116. package/dist/statsAnalyzer/index.js +0 -1072
  117. package/dist/statsAnalyzer/index.js.map +0 -1
  118. package/dist/statsAnalyzer/mqaUtil.js +0 -368
  119. package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
  120. package/dist/types/mediaQualityMetrics/config.d.ts +0 -247
  121. package/dist/types/networkQualityMonitor/index.d.ts +0 -70
  122. package/dist/types/statsAnalyzer/global.d.ts +0 -36
  123. package/dist/types/statsAnalyzer/index.d.ts +0 -217
  124. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
  125. package/src/mediaQualityMetrics/config.ts +0 -255
  126. package/src/networkQualityMonitor/index.ts +0 -211
  127. package/src/statsAnalyzer/global.ts +0 -37
  128. package/src/statsAnalyzer/index.ts +0 -1318
  129. package/src/statsAnalyzer/mqaUtil.ts +0 -463
  130. package/test/unit/spec/networkQualityMonitor/index.js +0 -99
  131. package/test/unit/spec/stats-analyzer/index.js +0 -1819
@@ -19,6 +19,7 @@ exports.default = exports.ScreenShareFloorStatus = exports.MEDIA_UPDATE_TYPE = v
19
19
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
20
20
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
21
21
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
22
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
22
23
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
23
24
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
24
25
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
@@ -41,8 +42,6 @@ var _mediaHelpers = require("@webex/media-helpers");
41
42
  var _internalPluginVoicea = require("@webex/internal-plugin-voicea");
42
43
  var _voiceaMeeting = require("./voicea-meeting");
43
44
  var _webexErrors = require("../common/errors/webex-errors");
44
- var _statsAnalyzer = require("../statsAnalyzer");
45
- var _networkQualityMonitor = _interopRequireDefault(require("../networkQualityMonitor"));
46
45
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
47
46
  var _util = _interopRequireDefault(require("../common/events/util"));
48
47
  var _triggerProxy = _interopRequireDefault(require("../common/events/trigger-proxy"));
@@ -83,6 +82,7 @@ var _recordingController = _interopRequireDefault(require("../recording-controll
83
82
  var _controlsOptionsManager = _interopRequireDefault(require("../controls-options-manager"));
84
83
  var _permission = _interopRequireDefault(require("../common/errors/permission"));
85
84
  var _locusMediaRequest = require("./locusMediaRequest");
85
+ var _connectionStateHandler = require("./connectionStateHandler");
86
86
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
87
87
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
88
88
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -91,6 +91,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
91
91
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
92
92
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // @ts-ignore - Fix this
93
93
  // @ts-ignore - Types not available for @webex/common
94
+ // default callback so we don't call an undefined function, but in practice it should never be used
95
+ var DEFAULT_ICE_PHASE_CALLBACK = function DEFAULT_ICE_PHASE_CALLBACK() {
96
+ return 'JOIN_MEETING_FINAL';
97
+ };
94
98
  var logRequest = function logRequest(request, _ref) {
95
99
  var _ref$logText = _ref.logText,
96
100
  logText = _ref$logText === void 0 ? '' : _ref$logText;
@@ -497,6 +501,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
497
501
  file: 'meeting/index',
498
502
  function: 'setUpVoiceaListeners'
499
503
  }), "event#").concat(_constants.EVENT_TRIGGERS.MEETING_STARTED_RECEIVING_TRANSCRIPTION));
504
+ if (_this.getCurUserType() !== 'host') {
505
+ delete payload.spokenLanguages;
506
+ }
500
507
 
501
508
  // @ts-ignore
502
509
  _this.trigger(_constants.EVENT_TRIGGERS.MEETING_STARTED_RECEIVING_TRANSCRIPTION, payload);
@@ -523,13 +530,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
523
530
  interimCaptions: _this.transcription.interimCaptions
524
531
  });
525
532
  }));
526
- (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "retriedWithTurnServer", void 0);
533
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "addMediaData", void 0);
527
534
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "sendSlotManager", new _sendSlotManager.default(_loggerProxy.default));
528
535
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "deferSDPAnswer", void 0);
529
536
  // used for waiting for a response
530
537
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "sdpResponseTimer", void 0);
531
538
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "hasMediaConnectionConnectedAtLeastOnce", void 0);
532
539
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "joinWithMediaRetryInfo", void 0);
540
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "connectionStateHandler", void 0);
541
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "iceCandidateErrors", void 0);
542
+ (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "iceCandidatesCount", void 0);
533
543
  /**
534
544
  * Callback called when a relay event is received from meeting LLM Connection
535
545
  * @param {RelayEvent} e Event object coming from LLM Connection
@@ -661,7 +671,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
661
671
  * @returns {undefined}
662
672
  */
663
673
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "setupSdpListeners", function () {
664
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.REMOTE_SDP_ANSWER_PROCESSED, function () {
674
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.REMOTE_SDP_ANSWER_PROCESSED, function () {
665
675
  // @ts-ignore
666
676
  var cdl = _this.webex.internal.newMetrics.callDiagnosticLatencies;
667
677
 
@@ -683,7 +693,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
683
693
  _this.sdpResponseTimer = undefined;
684
694
  }
685
695
  });
686
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.LOCAL_SDP_OFFER_GENERATED, function () {
696
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.LOCAL_SDP_OFFER_GENERATED, function () {
687
697
  // @ts-ignore
688
698
  _this.webex.internal.newMetrics.submitClientEvent({
689
699
  name: 'client.media-engine.local-sdp-generated',
@@ -695,7 +705,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
695
705
  // Instantiate Defer so that the SDP offer/answer exchange timeout can start, see waitForRemoteSDPAnswer()
696
706
  _this.deferSDPAnswer = new _common.Defer();
697
707
  });
698
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.LOCAL_SDP_ANSWER_GENERATED, function () {
708
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.LOCAL_SDP_ANSWER_GENERATED, function () {
699
709
  // we are sending "remote-sdp-received" only after we've generated the answer - this indicates that we've fully processed that incoming offer
700
710
  // @ts-ignore
701
711
  _this.webex.internal.newMetrics.submitClientEvent({
@@ -708,16 +718,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
708
718
  });
709
719
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "setupMediaConnectionListeners", function () {
710
720
  _this.setupSdpListeners();
711
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.ROAP_STARTED, function () {
721
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_STARTED, function () {
712
722
  _this.isRoapInProgress = true;
713
723
  });
714
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.ROAP_DONE, function () {
724
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_DONE, function () {
715
725
  _this.mediaNegotiatedEvent();
716
726
  _this.isRoapInProgress = false;
717
727
  _this.processNextQueuedMediaUpdate();
718
728
  });
719
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.ROAP_FAILURE, _this.handleRoapFailure);
720
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.ROAP_MESSAGE_TO_SEND, function (event) {
729
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_FAILURE, _this.handleRoapFailure);
730
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, function (event) {
721
731
  var LOG_HEADER = "Meeting:index#setupMediaConnectionListeners.ROAP_MESSAGE_TO_SEND --> correlationId=".concat(_this.correlationId);
722
732
  switch (event.roapMessage.messageType) {
723
733
  case 'OK':
@@ -743,7 +753,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
743
753
  }
744
754
  }), {
745
755
  logText: "".concat(LOG_HEADER, " Roap Offer")
746
- }).catch(function () {
756
+ }).catch(function (error) {
757
+ // @ts-ignore
758
+ _this.webex.internal.newMetrics.submitClientEvent({
759
+ name: 'client.media-engine.remote-sdp-received',
760
+ payload: {
761
+ canProceed: false,
762
+ errors: [
763
+ // @ts-ignore
764
+ _this.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
765
+ clientErrorCode: _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.MISSING_ROAP_ANSWER_CLIENT_CODE
766
+ })]
767
+ },
768
+ options: {
769
+ meetingId: _this.id,
770
+ rawError: error
771
+ }
772
+ });
747
773
  _this.deferSDPAnswer.reject(new Error('failed to send ROAP SDP offer'));
748
774
  clearTimeout(_this.sdpResponseTimer);
749
775
  _this.sdpResponseTimer = undefined;
@@ -795,7 +821,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
795
821
  });
796
822
 
797
823
  // eslint-disable-next-line no-param-reassign
798
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.REMOTE_TRACK_ADDED, function (event) {
824
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.REMOTE_TRACK_ADDED, function (event) {
799
825
  _loggerProxy.default.logger.log("Meeting:index#setupMediaConnectionListeners --> REMOTE_TRACK_ADDED event received for webrtcMediaConnection: ".concat((0, _stringify.default)(event)));
800
826
  if (event.track) {
801
827
  var mediaTrack = event.track;
@@ -824,7 +850,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
824
850
  if (eventType && mediaTrack) {
825
851
  _triggerProxy.default.trigger((0, _assertThisInitialized2.default)(_this), {
826
852
  file: 'meeting/index',
827
- function: 'setupRemoteTrackListener:Event.REMOTE_TRACK_ADDED'
853
+ function: 'setupRemoteTrackListener:MediaConnectionEventNames.REMOTE_TRACK_ADDED'
828
854
  }, _constants.EVENT_TRIGGERS.MEDIA_READY, {
829
855
  type: eventType,
830
856
  stream: remoteStream.outputStream
@@ -832,7 +858,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
832
858
  }
833
859
  }
834
860
  });
835
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.CONNECTION_STATE_CHANGED, function (event) {
861
+ _this.connectionStateHandler = new _connectionStateHandler.ConnectionStateHandler(_this.mediaProperties.webrtcMediaConnection);
862
+ _this.connectionStateHandler.on(_connectionStateHandler.ConnectionStateEvent.stateChanged, function (event) {
836
863
  var connectionFailed = function connectionFailed() {
837
864
  _metrics.default.sendBehavioralMetric(_constants2.default.CONNECTION_FAILURE, {
838
865
  correlation_id: _this.correlationId,
@@ -909,7 +936,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
909
936
  break;
910
937
  }
911
938
  });
912
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.ACTIVE_SPEAKERS_CHANGED, function (csis) {
939
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ACTIVE_SPEAKERS_CHANGED, function (csis) {
913
940
  _triggerProxy.default.trigger((0, _assertThisInitialized2.default)(_this), {
914
941
  file: 'meeting/index',
915
942
  function: 'setupMediaConnectionListeners'
@@ -924,7 +951,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
924
951
  })
925
952
  });
926
953
  });
927
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.VIDEO_SOURCES_COUNT_CHANGED, function (numTotalSources, numLiveSources, mediaContent) {
954
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.VIDEO_SOURCES_COUNT_CHANGED, function (numTotalSources, numLiveSources, mediaContent) {
928
955
  _triggerProxy.default.trigger((0, _assertThisInitialized2.default)(_this), {
929
956
  file: 'meeting/index',
930
957
  function: 'setupMediaConnectionListeners'
@@ -937,7 +964,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
937
964
  _this.mediaRequestManagers.video.setNumCurrentSources(numTotalSources, numLiveSources);
938
965
  }
939
966
  });
940
- _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.AUDIO_SOURCES_COUNT_CHANGED, function (numTotalSources, numLiveSources, mediaContent) {
967
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.AUDIO_SOURCES_COUNT_CHANGED, function (numTotalSources, numLiveSources, mediaContent) {
941
968
  _triggerProxy.default.trigger((0, _assertThisInitialized2.default)(_this), {
942
969
  file: 'meeting/index',
943
970
  function: 'setupMediaConnectionListeners'
@@ -947,6 +974,28 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
947
974
  mediaContent: mediaContent
948
975
  });
949
976
  });
977
+ _this.iceCandidateErrors.clear();
978
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ICE_CANDIDATE_ERROR, function (event) {
979
+ var errorCode = event.error.errorCode;
980
+ var errorText = event.error.errorText;
981
+ if (errorCode === 600 && errorText === 'Address not associated with the desired network interface.') {
982
+ return;
983
+ }
984
+ if (errorText.endsWith('.')) {
985
+ errorText = errorText.slice(0, -1);
986
+ }
987
+ errorText = errorText.toLowerCase();
988
+ errorText = errorText.replace(/ /g, '_');
989
+ var error = "".concat(errorCode, "_").concat(errorText);
990
+ var count = _this.iceCandidateErrors.get(error) || 0;
991
+ _this.iceCandidateErrors.set(error, count + 1);
992
+ });
993
+ _this.iceCandidatesCount = 0;
994
+ _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.MediaConnectionEventNames.ICE_CANDIDATE, function (event) {
995
+ if (event.candidate) {
996
+ _this.iceCandidatesCount += 1;
997
+ }
998
+ });
950
999
  });
951
1000
  /**
952
1001
  * Registers for all required StatsAnalyzer events
@@ -955,7 +1004,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
955
1004
  * @memberof Meetings
956
1005
  */
957
1006
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "setupStatsAnalyzerEventHandlers", function () {
958
- _this.statsAnalyzer.on(_statsAnalyzer.EVENTS.MEDIA_QUALITY, function (options) {
1007
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.MEDIA_QUALITY, function (options) {
959
1008
  var _this$webex$meetings$;
960
1009
  // TODO: might have to send the same event to the developer
961
1010
  // Add ip address info if geo hint is present
@@ -968,14 +1017,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
968
1017
  name: 'client.mediaquality.event',
969
1018
  options: {
970
1019
  meetingId: _this.id,
971
- networkType: options.networkType
1020
+ networkType: options.data.networkType
972
1021
  },
973
1022
  payload: {
974
1023
  intervals: [options.data]
975
1024
  }
976
1025
  });
977
1026
  });
978
- _this.statsAnalyzer.on(_statsAnalyzer.EVENTS.LOCAL_MEDIA_STARTED, function (data) {
1027
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.LOCAL_MEDIA_STARTED, function (data) {
979
1028
  _triggerProxy.default.trigger((0, _assertThisInitialized2.default)(_this), {
980
1029
  file: 'meeting/index',
981
1030
  function: 'addMedia'
@@ -984,28 +1033,28 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
984
1033
  _this.webex.internal.newMetrics.submitClientEvent({
985
1034
  name: 'client.media.tx.start',
986
1035
  payload: {
987
- mediaType: data.type,
988
- shareInstanceId: data.type === 'share' ? _this.localShareInstanceId : undefined
1036
+ mediaType: data.mediaType,
1037
+ shareInstanceId: data.mediaType === 'share' ? _this.localShareInstanceId : undefined
989
1038
  },
990
1039
  options: {
991
1040
  meetingId: _this.id
992
1041
  }
993
1042
  });
994
1043
  });
995
- _this.statsAnalyzer.on(_statsAnalyzer.EVENTS.LOCAL_MEDIA_STOPPED, function (data) {
1044
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.LOCAL_MEDIA_STOPPED, function (data) {
996
1045
  // @ts-ignore
997
1046
  _this.webex.internal.newMetrics.submitClientEvent({
998
1047
  name: 'client.media.tx.stop',
999
1048
  payload: {
1000
- mediaType: data.type,
1001
- shareInstanceId: data.type === 'share' ? _this.localShareInstanceId : undefined
1049
+ mediaType: data.mediaType,
1050
+ shareInstanceId: data.mediaType === 'share' ? _this.localShareInstanceId : undefined
1002
1051
  },
1003
1052
  options: {
1004
1053
  meetingId: _this.id
1005
1054
  }
1006
1055
  });
1007
1056
  });
1008
- _this.statsAnalyzer.on(_statsAnalyzer.EVENTS.REMOTE_MEDIA_STARTED, function (data) {
1057
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.REMOTE_MEDIA_STARTED, function (data) {
1009
1058
  _triggerProxy.default.trigger((0, _assertThisInitialized2.default)(_this), {
1010
1059
  file: 'meeting/index',
1011
1060
  function: 'addMedia'
@@ -1014,14 +1063,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1014
1063
  _this.webex.internal.newMetrics.submitClientEvent({
1015
1064
  name: 'client.media.rx.start',
1016
1065
  payload: {
1017
- mediaType: data.type,
1018
- shareInstanceId: data.type === 'share' ? _this.remoteShareInstanceId : undefined
1066
+ mediaType: data.mediaType,
1067
+ shareInstanceId: data.mediaType === 'share' ? _this.remoteShareInstanceId : undefined
1019
1068
  },
1020
1069
  options: {
1021
1070
  meetingId: _this.id
1022
1071
  }
1023
1072
  });
1024
- if (data.type === 'share') {
1073
+ if (data.mediaType === 'share') {
1025
1074
  // @ts-ignore
1026
1075
  _this.webex.internal.newMetrics.submitClientEvent({
1027
1076
  name: 'client.media.render.start',
@@ -1035,19 +1084,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1035
1084
  });
1036
1085
  }
1037
1086
  });
1038
- _this.statsAnalyzer.on(_statsAnalyzer.EVENTS.REMOTE_MEDIA_STOPPED, function (data) {
1087
+ _this.statsAnalyzer.on(_internalMediaCore.StatsAnalyzerEventNames.REMOTE_MEDIA_STOPPED, function (data) {
1039
1088
  // @ts-ignore
1040
1089
  _this.webex.internal.newMetrics.submitClientEvent({
1041
1090
  name: 'client.media.rx.stop',
1042
1091
  payload: {
1043
- mediaType: data.type,
1044
- shareInstanceId: data.type === 'share' ? _this.remoteShareInstanceId : undefined
1092
+ mediaType: data.mediaType,
1093
+ shareInstanceId: data.mediaType === 'share' ? _this.remoteShareInstanceId : undefined
1045
1094
  },
1046
1095
  options: {
1047
1096
  meetingId: _this.id
1048
1097
  }
1049
1098
  });
1050
- if (data.type === 'share') {
1099
+ if (data.mediaType === 'share') {
1051
1100
  // @ts-ignore
1052
1101
  _this.webex.internal.newMetrics.submitClientEvent({
1053
1102
  name: 'client.media.render.stop',
@@ -1192,10 +1241,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1192
1241
  * @returns {undefined}
1193
1242
  */
1194
1243
  (0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "handleShareVideoStreamMuteStateChange", function (muted) {
1244
+ var _this$statsAnalyzer;
1195
1245
  _loggerProxy.default.logger.log("Meeting:index#handleShareVideoStreamMuteStateChange --> Share video stream mute state changed to muted ".concat(muted));
1196
1246
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_VIDEO_MUTE_STATE_CHANGE, {
1197
1247
  correlationId: _this.correlationId,
1198
- muted: muted
1248
+ muted: muted,
1249
+ encoderImplementation: (_this$statsAnalyzer = _this.statsAnalyzer) === null || _this$statsAnalyzer === void 0 ? void 0 : _this$statsAnalyzer.shareVideoEncoderImplementation
1199
1250
  });
1200
1251
  });
1201
1252
  /**
@@ -2043,13 +2094,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2043
2094
  _this.turnServerUsed = false;
2044
2095
 
2045
2096
  /**
2046
- * Whether retry was done using TURN Discovery.
2097
+ * Contains information used during the addMedia() operation:
2098
+ * retriedWithTurnServer - whether retry was done using TURN Discovery
2099
+ * icePhaseCallback - callback for determining the value for icePhase when sending failure event to CA
2100
+ *
2047
2101
  * @instance
2048
- * @type {boolean}
2102
+ * @type {Object}
2049
2103
  * @private
2050
2104
  * @memberof Meeting
2051
2105
  */
2052
- _this.retriedWithTurnServer = false;
2106
+ _this.addMediaData = {
2107
+ retriedWithTurnServer: false,
2108
+ icePhaseCallback: DEFAULT_ICE_PHASE_CALLBACK
2109
+ };
2053
2110
 
2054
2111
  /**
2055
2112
  * Whether or not the media connection has ever successfully connected.
@@ -2071,6 +2128,33 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2071
2128
  isRetry: false,
2072
2129
  prevJoinResponse: undefined
2073
2130
  };
2131
+
2132
+ /**
2133
+ * Connection state handler
2134
+ * @instance
2135
+ * @type {ConnectionStateHandler}
2136
+ * @private
2137
+ * @memberof Meeting
2138
+ */
2139
+ _this.connectionStateHandler = undefined;
2140
+
2141
+ /**
2142
+ * ICE Candidates errors map
2143
+ * @instance
2144
+ * @type {Map<[number, string], number>}
2145
+ * @private
2146
+ * @memberof Meeting
2147
+ */
2148
+ _this.iceCandidateErrors = new _map.default();
2149
+
2150
+ /**
2151
+ * Gathered ICE Candidates count
2152
+ * @instance
2153
+ * @type {number}
2154
+ * @private
2155
+ * @memberof Meeting
2156
+ */
2157
+ _this.iceCandidatesCount = 0;
2074
2158
  return _this;
2075
2159
  }
2076
2160
 
@@ -2342,13 +2426,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2342
2426
  _loggerProxy.default.logger.info("Meeting:index#refreshPermissionToken --> cannot refresh the permission token, because we don't have it (reason=".concat(reason, ")"));
2343
2427
  return _context6.abrupt("return");
2344
2428
  case 3:
2345
- isStartingSpaceInstantV2Meeting = this.destinationType === _constants._CONVERSATION_URL_ &&
2429
+ isStartingSpaceInstantV2Meeting = this.destinationType === _constants.DESTINATION_TYPE.CONVERSATION_URL &&
2346
2430
  // @ts-ignore - config coming from registerPlugin
2347
2431
  this.config.experimental.enableAdhocMeetings &&
2348
2432
  // @ts-ignore
2349
2433
  this.webex.meetings.preferredWebexSite;
2350
2434
  destination = isStartingSpaceInstantV2Meeting ? this.meetingInfo.meetingJoinUrl : this.destination;
2351
- destinationType = isStartingSpaceInstantV2Meeting ? _constants._MEETING_LINK_ : this.destinationType;
2435
+ destinationType = isStartingSpaceInstantV2Meeting ? _constants.DESTINATION_TYPE.MEETING_LINK : this.destinationType;
2352
2436
  permissionTokenExpiryInfo = this.getPermissionTokenExpiryInfo();
2353
2437
  timeLeft = permissionTokenExpiryInfo === null || permissionTokenExpiryInfo === void 0 ? void 0 : permissionTokenExpiryInfo.timeLeft;
2354
2438
  expiryTime = permissionTokenExpiryInfo === null || permissionTokenExpiryInfo === void 0 ? void 0 : permissionTokenExpiryInfo.expiryTime;
@@ -3564,6 +3648,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3564
3648
  correlation_id: _this19.correlationId,
3565
3649
  locus_id: _this19.locusId
3566
3650
  });
3651
+ _loggerProxy.default.logger.info('Meeting:index#setUpLocusInfoSelfListener --> MEDIA_INACTIVITY received, reconnecting...');
3567
3652
  _this19.reconnect();
3568
3653
  });
3569
3654
 
@@ -4633,7 +4718,6 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4633
4718
  }, {
4634
4719
  key: "closePeerConnections",
4635
4720
  value: function closePeerConnections() {
4636
- this.locusMediaRequest = undefined;
4637
4721
  if (this.mediaProperties.webrtcMediaConnection) {
4638
4722
  if (this.remoteMediaManager) {
4639
4723
  this.remoteMediaManager.stop();
@@ -4927,6 +5011,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4927
5011
  key: "joinWithMedia",
4928
5012
  value: (function () {
4929
5013
  var _joinWithMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
5014
+ var _this28 = this;
4930
5015
  var options,
4931
5016
  mediaOptions,
4932
5017
  _options$joinOptions,
@@ -4938,12 +5023,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4938
5023
  joinResponse,
4939
5024
  turnServerInfo,
4940
5025
  turnDiscoverySkippedReason,
5026
+ forceTurnDiscovery,
4941
5027
  turnDiscoveryRequest,
4942
5028
  _yield$this$roap$hand,
4943
5029
  mediaResponse,
4944
5030
  _this$locusUrl,
4945
5031
  _leaveError,
4946
5032
  leaveError,
5033
+ shouldRetry,
4947
5034
  _args15 = arguments;
4948
5035
  return _regenerator.default.wrap(function _callee15$(_context15) {
4949
5036
  while (1) switch (_context15.prev = _context15.next) {
@@ -4962,34 +5049,36 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4962
5049
  joined = false;
4963
5050
  joinResponse = prevJoinResponse;
4964
5051
  _context15.prev = 9;
4965
- _context15.next = 12;
5052
+ forceTurnDiscovery = false;
5053
+ if (joinResponse) {
5054
+ _context15.next = 36;
5055
+ break;
5056
+ }
5057
+ _context15.next = 14;
4966
5058
  return this.webex.meetings.reachability.getReachabilityResults();
4967
- case 12:
5059
+ case 14:
4968
5060
  joinOptions.reachability = _context15.sent;
4969
- _context15.next = 15;
5061
+ _context15.next = 17;
4970
5062
  return this.roap.generateTurnDiscoveryRequestMessage(this, true);
4971
- case 15:
5063
+ case 17:
4972
5064
  turnDiscoveryRequest = _context15.sent;
4973
5065
  turnDiscoverySkippedReason = turnDiscoveryRequest.turnDiscoverySkippedReason;
4974
5066
  joinOptions.roapMessage = turnDiscoveryRequest.roapMessage;
4975
- if (joinResponse) {
4976
- _context15.next = 23;
4977
- break;
4978
- }
4979
5067
  _loggerProxy.default.logger.info('Meeting:index#joinWithMedia ---> calling join with joinOptions, ', joinOptions);
4980
- _context15.next = 22;
5068
+ _context15.next = 23;
4981
5069
  return this.join(joinOptions);
4982
- case 22:
4983
- joinResponse = _context15.sent;
4984
5070
  case 23:
5071
+ joinResponse = _context15.sent;
4985
5072
  joined = true;
5073
+
5074
+ // if we sent out TURN discovery Roap message with join, process the TURN discovery response
4986
5075
  if (!joinOptions.roapMessage) {
4987
- _context15.next = 33;
5076
+ _context15.next = 34;
4988
5077
  break;
4989
5078
  }
4990
- _context15.next = 27;
5079
+ _context15.next = 28;
4991
5080
  return this.roap.handleTurnDiscoveryHttpResponse(this, joinResponse);
4992
- case 27:
5081
+ case 28:
4993
5082
  _yield$this$roap$hand = _context15.sent;
4994
5083
  turnServerInfo = _yield$this$roap$hand.turnServerInfo;
4995
5084
  turnDiscoverySkippedReason = _yield$this$roap$hand.turnDiscoverySkippedReason;
@@ -4998,10 +5087,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4998
5087
  if (turnServerInfo === undefined) {
4999
5088
  this.roap.abortTurnDiscovery();
5000
5089
  }
5001
- case 33:
5002
- _context15.next = 35;
5003
- return this.addMedia(mediaOptions, turnServerInfo);
5004
- case 35:
5090
+ case 34:
5091
+ _context15.next = 38;
5092
+ break;
5093
+ case 36:
5094
+ // This is a retry, when join succeeded but addMedia failed, so we'll just call addMedia() again,
5095
+ // but we need to ensure that it also does a new TURN discovery
5096
+ forceTurnDiscovery = true;
5097
+ joined = true;
5098
+ case 38:
5099
+ _context15.next = 40;
5100
+ return this.addMediaInternal(function () {
5101
+ return _this28.joinWithMediaRetryInfo.isRetry ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
5102
+ }, turnServerInfo, forceTurnDiscovery, mediaOptions);
5103
+ case 40:
5005
5104
  mediaResponse = _context15.sent;
5006
5105
  this.joinWithMediaRetryInfo = {
5007
5106
  isRetry: false,
@@ -5011,30 +5110,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5011
5110
  join: joinResponse,
5012
5111
  media: mediaResponse
5013
5112
  });
5014
- case 40:
5015
- _context15.prev = 40;
5113
+ case 45:
5114
+ _context15.prev = 45;
5016
5115
  _context15.t0 = _context15["catch"](9);
5017
5116
  _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> ', _context15.t0);
5018
5117
  this.roap.abortTurnDiscovery();
5019
5118
  if (!(joined && isRetry)) {
5020
- _context15.next = 54;
5119
+ _context15.next = 59;
5021
5120
  break;
5022
5121
  }
5023
- _context15.prev = 45;
5024
- _context15.next = 48;
5122
+ _context15.prev = 50;
5123
+ _context15.next = 53;
5025
5124
  return this.leave({
5026
5125
  resourceId: joinOptions === null || joinOptions === void 0 ? void 0 : joinOptions.resourceId,
5027
5126
  reason: 'joinWithMedia failure'
5028
5127
  });
5029
- case 48:
5030
- _context15.next = 54;
5128
+ case 53:
5129
+ _context15.next = 59;
5031
5130
  break;
5032
- case 50:
5033
- _context15.prev = 50;
5034
- _context15.t1 = _context15["catch"](45);
5131
+ case 55:
5132
+ _context15.prev = 55;
5133
+ _context15.t1 = _context15["catch"](50);
5035
5134
  _loggerProxy.default.logger.error('Meeting:index#joinWithMedia --> leave error', _context15.t1);
5036
5135
  leaveError = _context15.t1;
5037
- case 54:
5136
+ case 59:
5038
5137
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_WITH_MEDIA_FAILURE, {
5039
5138
  correlation_id: this.correlationId,
5040
5139
  locus_id: (_this$locusUrl = this.locusUrl) === null || _this$locusUrl === void 0 ? void 0 : _this$locusUrl.split('/').pop(),
@@ -5046,25 +5145,33 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5046
5145
  }, {
5047
5146
  type: _context15.t0.name
5048
5147
  });
5049
- if (isRetry) {
5050
- _context15.next = 60;
5148
+
5149
+ // if this was the first attempt, let's do a retry
5150
+ shouldRetry = !isRetry;
5151
+ if (_internalPluginMetrics.CallDiagnosticUtils.isSdpOfferCreationError(_context15.t0)) {
5152
+ // errors related to offer creation (for example missing H264 codec) will happen again no matter how many times we try,
5153
+ // so there is no point doing a retry
5154
+ shouldRetry = false;
5155
+ }
5156
+ if (!shouldRetry) {
5157
+ _context15.next = 67;
5051
5158
  break;
5052
5159
  }
5053
5160
  _loggerProxy.default.logger.warn('Meeting:index#joinWithMedia --> retrying call to joinWithMedia');
5054
5161
  this.joinWithMediaRetryInfo.isRetry = true;
5055
5162
  this.joinWithMediaRetryInfo.prevJoinResponse = joinResponse;
5056
5163
  return _context15.abrupt("return", this.joinWithMedia(options));
5057
- case 60:
5164
+ case 67:
5058
5165
  this.joinWithMediaRetryInfo = {
5059
5166
  isRetry: false,
5060
5167
  prevJoinResponse: undefined
5061
5168
  };
5062
5169
  throw _context15.t0;
5063
- case 62:
5170
+ case 69:
5064
5171
  case "end":
5065
5172
  return _context15.stop();
5066
5173
  }
5067
- }, _callee15, this, [[9, 40], [45, 50]]);
5174
+ }, _callee15, this, [[9, 45], [50, 55]]);
5068
5175
  }));
5069
5176
  function joinWithMedia() {
5070
5177
  return _joinWithMedia.apply(this, arguments);
@@ -5083,7 +5190,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5083
5190
  }, {
5084
5191
  key: "reconnect",
5085
5192
  value: function reconnect(options) {
5086
- var _this28 = this;
5193
+ var _this29 = this;
5087
5194
  _loggerProxy.default.logger.log("Meeting:index#reconnect --> attempting to reconnect meeting ".concat(this.id));
5088
5195
  if (!this.reconnectionManager || !this.reconnectionManager.reconnect) {
5089
5196
  return _promise.default.reject(new _parameter.default('Cannot reconnect, ReconnectionManager must first be defined.'));
@@ -5098,10 +5205,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5098
5205
  while (1) switch (_context16.prev = _context16.next) {
5099
5206
  case 0:
5100
5207
  _context16.next = 2;
5101
- return _this28.waitForRemoteSDPAnswer();
5208
+ return _this29.waitForRemoteSDPAnswer();
5102
5209
  case 2:
5103
5210
  _context16.next = 4;
5104
- return _this28.waitForMediaConnectionConnected();
5211
+ return _this29.waitForMediaConnectionConnected();
5105
5212
  case 4:
5106
5213
  case "end":
5107
5214
  return _context16.stop();
@@ -5115,7 +5222,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5115
5222
  return _promise.default.resolve();
5116
5223
  }
5117
5224
  _loggerProxy.default.logger.error('Meeting:index#reconnect --> Meeting reconnect failed', error);
5118
- _this28.uploadLogs({
5225
+ _this29.uploadLogs({
5119
5226
  file: 'meeting/index',
5120
5227
  function: 'reconnect'
5121
5228
  });
@@ -5162,19 +5269,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5162
5269
  }, {
5163
5270
  key: "setCaptionLanguage",
5164
5271
  value: function setCaptionLanguage(language) {
5165
- var _this29 = this;
5272
+ var _this30 = this;
5166
5273
  return new _promise.default(function (resolve, reject) {
5167
- if (!_this29.isTranscriptionSupported()) {
5274
+ if (!_this30.isTranscriptionSupported()) {
5168
5275
  _loggerProxy.default.logger.error('Meeting:index#setCaptionLanguage --> Webex Assistant is not enabled/supported');
5169
5276
  reject(new Error('Webex Assistant is not enabled/supported'));
5170
5277
  }
5171
5278
  try {
5172
5279
  var voiceaListenerCaptionUpdate = function voiceaListenerCaptionUpdate(payload) {
5173
5280
  // @ts-ignore
5174
- _this29.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5281
+ _this30.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5175
5282
  var statusCode = payload.statusCode;
5176
5283
  if (statusCode === 200) {
5177
- _this29.transcription.languageOptions = _objectSpread(_objectSpread({}, _this29.transcription.languageOptions), {}, {
5284
+ _this30.transcription.languageOptions = _objectSpread(_objectSpread({}, _this30.transcription.languageOptions), {}, {
5178
5285
  currentCaptionLanguage: language
5179
5286
  });
5180
5287
  resolve(language);
@@ -5183,9 +5290,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5183
5290
  }
5184
5291
  };
5185
5292
  // @ts-ignore
5186
- _this29.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5293
+ _this30.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, voiceaListenerCaptionUpdate);
5187
5294
  // @ts-ignore
5188
- _this29.webex.internal.voicea.requestLanguage(language);
5295
+ _this30.webex.internal.voicea.requestLanguage(language);
5189
5296
  } catch (error) {
5190
5297
  _loggerProxy.default.logger.error("Meeting:index#setCaptionLanguage --> ".concat(error));
5191
5298
  reject(error);
@@ -5201,19 +5308,23 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5201
5308
  }, {
5202
5309
  key: "setSpokenLanguage",
5203
5310
  value: function setSpokenLanguage(language) {
5204
- var _this30 = this;
5311
+ var _this31 = this;
5205
5312
  return new _promise.default(function (resolve, reject) {
5206
- if (!_this30.isTranscriptionSupported()) {
5313
+ if (!_this31.isTranscriptionSupported()) {
5207
5314
  _loggerProxy.default.logger.error('Meeting:index#setCaptionLanguage --> Webex Assistant is not enabled/supported');
5208
5315
  reject(new Error('Webex Assistant is not enabled/supported'));
5209
5316
  }
5317
+ if (_this31.getCurUserType() !== 'host') {
5318
+ _loggerProxy.default.logger.error('Meeting:index#setSpokenLanguage --> Only host can set spoken language');
5319
+ reject(new Error('Only host can set spoken language'));
5320
+ }
5210
5321
  try {
5211
5322
  var voiceaListenerLanguageUpdate = function voiceaListenerLanguageUpdate(payload) {
5212
5323
  // @ts-ignore
5213
- _this30.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5324
+ _this31.webex.internal.voicea.off(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5214
5325
  var languageCode = payload.languageCode;
5215
5326
  if (languageCode) {
5216
- _this30.transcription.languageOptions = _objectSpread(_objectSpread({}, _this30.transcription.languageOptions), {}, {
5327
+ _this31.transcription.languageOptions = _objectSpread(_objectSpread({}, _this31.transcription.languageOptions), {}, {
5217
5328
  currentSpokenLanguage: languageCode
5218
5329
  });
5219
5330
  resolve(languageCode);
@@ -5223,10 +5334,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5223
5334
  };
5224
5335
 
5225
5336
  // @ts-ignore
5226
- _this30.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5337
+ _this31.webex.internal.voicea.on(_internalPluginVoicea.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, voiceaListenerLanguageUpdate);
5227
5338
 
5228
5339
  // @ts-ignore
5229
- _this30.webex.internal.voicea.setSpokenLanguage(language);
5340
+ _this31.webex.internal.voicea.setSpokenLanguage(language);
5230
5341
  } catch (error) {
5231
5342
  _loggerProxy.default.logger.error("Meeting:index#setSpokenLanguage --> ".concat(error));
5232
5343
  reject(error);
@@ -5248,7 +5359,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5248
5359
  while (1) switch (_context17.prev = _context17.next) {
5249
5360
  case 0:
5250
5361
  if (!this.isJoined()) {
5251
- _context17.next = 15;
5362
+ _context17.next = 14;
5252
5363
  break;
5253
5364
  }
5254
5365
  _loggerProxy.default.logger.info('Meeting:index#startTranscription --> Attempting to enable transcription!');
@@ -5256,17 +5367,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5256
5367
  if (!this.areVoiceaEventsSetup) {
5257
5368
  this.setUpVoiceaListeners();
5258
5369
  }
5259
- if (!(this.getCurUserType() === 'host')) {
5260
- _context17.next = 7;
5261
- break;
5262
- }
5263
- _context17.next = 7;
5370
+
5371
+ // @ts-ignore
5372
+ _context17.next = 6;
5264
5373
  return this.webex.internal.voicea.turnOnCaptions(options === null || options === void 0 ? void 0 : options.spokenLanguage);
5265
- case 7:
5266
- _context17.next = 13;
5374
+ case 6:
5375
+ _context17.next = 12;
5267
5376
  break;
5268
- case 9:
5269
- _context17.prev = 9;
5377
+ case 8:
5378
+ _context17.prev = 8;
5270
5379
  _context17.t0 = _context17["catch"](2);
5271
5380
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> ".concat(_context17.t0));
5272
5381
  _metrics.default.sendBehavioralMetric(_constants2.default.RECEIVE_TRANSCRIPTION_FAILURE, {
@@ -5274,17 +5383,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5274
5383
  reason: _context17.t0.message,
5275
5384
  stack: _context17.t0.stack
5276
5385
  });
5277
- case 13:
5278
- _context17.next = 17;
5386
+ case 12:
5387
+ _context17.next = 16;
5279
5388
  break;
5280
- case 15:
5389
+ case 14:
5281
5390
  _loggerProxy.default.logger.error("Meeting:index#startTranscription --> meeting joined : ".concat(this.isJoined()));
5282
5391
  throw new Error('Meeting is not joined');
5283
- case 17:
5392
+ case 16:
5284
5393
  case "end":
5285
5394
  return _context17.stop();
5286
5395
  }
5287
- }, _callee17, this, [[2, 9]]);
5396
+ }, _callee17, this, [[2, 8]]);
5288
5397
  }));
5289
5398
  function startTranscription(_x15) {
5290
5399
  return _startTranscription.apply(this, arguments);
@@ -5348,7 +5457,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5348
5457
  */
5349
5458
  function () {
5350
5459
  var _join = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
5351
- var _this31 = this;
5460
+ var _this32 = this;
5352
5461
  var options,
5353
5462
  errorMessage,
5354
5463
  error,
@@ -5494,57 +5603,58 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5494
5603
  return _context18.abrupt("return", _promise.default.reject(_context18.t0));
5495
5604
  case 51:
5496
5605
  return _context18.abrupt("return", _util2.default.joinMeetingOptions(this, options).then(function (join) {
5497
- _this31.meetingFiniteStateMachine.join();
5606
+ _this32.meetingFiniteStateMachine.join();
5607
+ _this32.setupLocusMediaRequest();
5498
5608
  _loggerProxy.default.logger.log('Meeting:index#join --> Success');
5499
5609
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_SUCCESS, {
5500
- correlation_id: _this31.correlationId
5610
+ correlation_id: _this32.correlationId
5501
5611
  });
5502
5612
  joinSuccess(join);
5503
- _this31.deferJoin = undefined;
5613
+ _this32.deferJoin = undefined;
5504
5614
  return join;
5505
5615
  }).catch(function (error) {
5506
- var _this31$meetingInfo, _error$error;
5507
- _this31.meetingFiniteStateMachine.fail(error);
5616
+ var _this32$meetingInfo, _error$error;
5617
+ _this32.meetingFiniteStateMachine.fail(error);
5508
5618
  _loggerProxy.default.logger.error('Meeting:index#join --> Failed', error);
5509
5619
 
5510
5620
  // @ts-ignore
5511
- _this31.webex.internal.newMetrics.submitClientEvent({
5621
+ _this32.webex.internal.newMetrics.submitClientEvent({
5512
5622
  name: 'client.locus.join.response',
5513
5623
  payload: {
5514
5624
  identifiers: {
5515
- meetingLookupUrl: (_this31$meetingInfo = _this31.meetingInfo) === null || _this31$meetingInfo === void 0 ? void 0 : _this31$meetingInfo.meetingLookupUrl
5625
+ meetingLookupUrl: (_this32$meetingInfo = _this32.meetingInfo) === null || _this32$meetingInfo === void 0 ? void 0 : _this32$meetingInfo.meetingLookupUrl
5516
5626
  }
5517
5627
  },
5518
5628
  options: {
5519
- meetingId: _this31.id,
5629
+ meetingId: _this32.id,
5520
5630
  rawError: error
5521
5631
  }
5522
5632
  });
5523
5633
 
5524
5634
  // TODO: change this to error codes and pre defined dictionary
5525
5635
  _metrics.default.sendBehavioralMetric(_constants2.default.JOIN_FAILURE, {
5526
- correlation_id: _this31.correlationId,
5636
+ correlation_id: _this32.correlationId,
5527
5637
  reason: (_error$error = error.error) === null || _error$error === void 0 ? void 0 : _error$error.message,
5528
5638
  stack: error.stack
5529
5639
  });
5530
5640
 
5531
5641
  // Upload logs on join Failure
5532
- _triggerProxy.default.trigger(_this31, {
5642
+ _triggerProxy.default.trigger(_this32, {
5533
5643
  file: 'meeting/index',
5534
5644
  function: 'join'
5535
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this31);
5645
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this32);
5536
5646
  joinFailed(error);
5537
- _this31.deferJoin = undefined;
5647
+ _this32.deferJoin = undefined;
5538
5648
  return _promise.default.reject(error);
5539
5649
  }).then(function (join) {
5540
5650
  // @ts-ignore - config coming from registerPlugin
5541
- if (_this31.config.enableAutomaticLLM) {
5651
+ if (_this32.config.enableAutomaticLLM) {
5542
5652
  // @ts-ignore
5543
- _this31.webex.internal.llm.on('online', _this31.handleLLMOnline);
5544
- _this31.updateLLMConnection().catch(function (error) {
5653
+ _this32.webex.internal.llm.on('online', _this32.handleLLMOnline);
5654
+ _this32.updateLLMConnection().catch(function (error) {
5545
5655
  _loggerProxy.default.logger.error('Meeting:index#join --> Transcription Socket Connection Failed', error);
5546
5656
  _metrics.default.sendBehavioralMetric(_constants2.default.LLM_CONNECTION_AFTER_JOIN_FAILURE, {
5547
- correlation_id: _this31.correlationId,
5657
+ correlation_id: _this32.correlationId,
5548
5658
  reason: error === null || error === void 0 ? void 0 : error.message,
5549
5659
  stack: error.stack
5550
5660
  });
@@ -5576,7 +5686,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5576
5686
  key: "updateLLMConnection",
5577
5687
  value: (function () {
5578
5688
  var _updateLLMConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
5579
- var _this32 = this;
5689
+ var _this33 = this;
5580
5690
  var _this$locusInfo6, url, _this$locusInfo6$info, _this$locusInfo6$info2, datachannelUrl, isJoined;
5581
5691
  return _regenerator.default.wrap(function _callee19$(_context19) {
5582
5692
  while (1) switch (_context19.prev = _context19.next) {
@@ -5588,7 +5698,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5588
5698
  _context19.next = 8;
5589
5699
  break;
5590
5700
  }
5591
- if (!(url === this.webex.internal.llm.getLocusUrl() && isJoined)) {
5701
+ if (!(
5702
+ // @ts-ignore - Fix type
5703
+ url === this.webex.internal.llm.getLocusUrl() &&
5704
+ // @ts-ignore - Fix type
5705
+ datachannelUrl === this.webex.internal.llm.getDatachannelUrl() && isJoined)) {
5592
5706
  _context19.next = 5;
5593
5707
  break;
5594
5708
  }
@@ -5608,9 +5722,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5608
5722
  case 10:
5609
5723
  return _context19.abrupt("return", this.webex.internal.llm.registerAndConnect(url, datachannelUrl).then(function (registerAndConnectResult) {
5610
5724
  // @ts-ignore - Fix type
5611
- _this32.webex.internal.llm.off('event:relay.event', _this32.processRelayEvent);
5725
+ _this33.webex.internal.llm.off('event:relay.event', _this33.processRelayEvent);
5612
5726
  // @ts-ignore - Fix type
5613
- _this32.webex.internal.llm.on('event:relay.event', _this32.processRelayEvent);
5727
+ _this33.webex.internal.llm.on('event:relay.event', _this33.processRelayEvent);
5614
5728
  _loggerProxy.default.logger.info('Meeting:index#updateLLMConnection --> enabled to receive relay events!');
5615
5729
  return _promise.default.resolve(registerAndConnectResult);
5616
5730
  }));
@@ -5664,7 +5778,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5664
5778
  }, {
5665
5779
  key: "dialInPstn",
5666
5780
  value: function dialInPstn() {
5667
- var _this33 = this;
5781
+ var _this34 = this;
5668
5782
  if (this.isPhoneProvisioned(this.dialInDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial in devices from being provisioned
5669
5783
 
5670
5784
  var correlationId = this.correlationId,
@@ -5680,10 +5794,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5680
5794
  }).catch(function (error) {
5681
5795
  var _error$error2;
5682
5796
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_DIAL_IN_FAILURE, {
5683
- correlation_id: _this33.correlationId,
5684
- dial_in_url: _this33.dialInUrl,
5797
+ correlation_id: _this34.correlationId,
5798
+ dial_in_url: _this34.dialInUrl,
5685
5799
  locus_id: locusUrl.split('/').pop(),
5686
- client_url: _this33.deviceUrl,
5800
+ client_url: _this34.deviceUrl,
5687
5801
  reason: (_error$error2 = error.error) === null || _error$error2 === void 0 ? void 0 : _error$error2.message,
5688
5802
  stack: error.stack
5689
5803
  });
@@ -5701,7 +5815,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5701
5815
  }, {
5702
5816
  key: "dialOutPstn",
5703
5817
  value: function dialOutPstn(phoneNumber) {
5704
- var _this34 = this;
5818
+ var _this35 = this;
5705
5819
  if (this.isPhoneProvisioned(this.dialOutDeviceStatus)) return _promise.default.resolve(); // prevent multiple dial out devices from being provisioned
5706
5820
 
5707
5821
  var correlationId = this.correlationId,
@@ -5718,10 +5832,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5718
5832
  }).catch(function (error) {
5719
5833
  var _error$error3;
5720
5834
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_DIAL_OUT_FAILURE, {
5721
- correlation_id: _this34.correlationId,
5722
- dial_out_url: _this34.dialOutUrl,
5835
+ correlation_id: _this35.correlationId,
5836
+ dial_out_url: _this35.dialOutUrl,
5723
5837
  locus_id: locusUrl.split('/').pop(),
5724
- client_url: _this34.deviceUrl,
5838
+ client_url: _this35.deviceUrl,
5725
5839
  reason: (_error$error3 = error.error) === null || _error$error3 === void 0 ? void 0 : _error$error3.message,
5726
5840
  stack: error.stack
5727
5841
  });
@@ -5752,7 +5866,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5752
5866
  }, {
5753
5867
  key: "moveTo",
5754
5868
  value: function moveTo(resourceId) {
5755
- var _this35 = this;
5869
+ var _this36 = this;
5756
5870
  if (!resourceId) {
5757
5871
  throw new _parameter.default('Cannot move call without a resourceId.');
5758
5872
  }
@@ -5796,12 +5910,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5796
5910
  while (1) switch (_context20.prev = _context20.next) {
5797
5911
  case 0:
5798
5912
  _context20.prev = 0;
5799
- if (!(_this35.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
5913
+ if (!(_this36.screenShareFloorState === ScreenShareFloorStatus.GRANTED)) {
5800
5914
  _context20.next = 4;
5801
5915
  break;
5802
5916
  }
5803
5917
  _context20.next = 4;
5804
- return _this35.releaseScreenShareFloor();
5918
+ return _this36.releaseScreenShareFloor();
5805
5919
  case 4:
5806
5920
  mediaSettings = {
5807
5921
  mediaDirection: {
@@ -5813,37 +5927,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5813
5927
  receiveShare: true
5814
5928
  }
5815
5929
  };
5816
- _this35.mediaProperties.setMediaDirection(mediaSettings.mediaDirection);
5817
- _this35.mediaProperties.unsetRemoteMedia();
5930
+ _this36.mediaProperties.setMediaDirection(mediaSettings.mediaDirection);
5931
+ _this36.mediaProperties.unsetRemoteMedia();
5818
5932
 
5819
5933
  // 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
5820
5934
  // once the device answers we close the old connection and create new media server connection with only share enabled
5821
- if (!_this35.statsAnalyzer) {
5935
+ if (!_this36.statsAnalyzer) {
5822
5936
  _context20.next = 10;
5823
5937
  break;
5824
5938
  }
5825
5939
  _context20.next = 10;
5826
- return _this35.statsAnalyzer.stopAnalyzer();
5940
+ return _this36.statsAnalyzer.stopAnalyzer();
5827
5941
  case 10:
5828
5942
  _context20.next = 12;
5829
- return _this35.closeRemoteStreams();
5943
+ return _this36.closeRemoteStreams();
5830
5944
  case 12:
5831
5945
  _context20.next = 14;
5832
- return _this35.closePeerConnections();
5946
+ return _this36.closePeerConnections();
5833
5947
  case 14:
5834
- _this35.cleanupLocalStreams();
5835
- _this35.unsetRemoteStreams();
5836
- _this35.unsetPeerConnections();
5837
- _this35.reconnectionManager.cleanUp();
5948
+ _this36.cleanupLocalStreams();
5949
+ _this36.unsetRemoteStreams();
5950
+ _this36.unsetPeerConnections();
5951
+ _this36.reconnectionManager.cleanUp();
5838
5952
  _context20.next = 20;
5839
- return _this35.addMedia({
5953
+ return _this36.addMedia({
5840
5954
  audioEnabled: false,
5841
5955
  videoEnabled: false,
5842
5956
  shareVideoEnabled: true
5843
5957
  });
5844
5958
  case 20:
5845
5959
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_SUCCESS);
5846
- _this35.isMoveToInProgress = false;
5960
+ _this36.isMoveToInProgress = false;
5847
5961
  _context20.next = 29;
5848
5962
  break;
5849
5963
  case 24:
@@ -5851,12 +5965,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5851
5965
  _context20.t0 = _context20["catch"](0);
5852
5966
  _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', _context20.t0);
5853
5967
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
5854
- correlation_id: _this35.correlationId,
5855
- locus_id: _this35.locusUrl.split('/').pop(),
5968
+ correlation_id: _this36.correlationId,
5969
+ locus_id: _this36.locusUrl.split('/').pop(),
5856
5970
  reason: _context20.t0.message,
5857
5971
  stack: _context20.t0.stack
5858
5972
  });
5859
- _this35.isMoveToInProgress = false;
5973
+ _this36.isMoveToInProgress = false;
5860
5974
  case 29:
5861
5975
  case "end":
5862
5976
  return _context20.stop();
@@ -5872,17 +5986,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5872
5986
  resourceId: resourceId,
5873
5987
  moveToResource: true
5874
5988
  }).then(function () {
5875
- _this35.meetingFiniteStateMachine.join();
5989
+ _this36.meetingFiniteStateMachine.join();
5876
5990
  }).catch(function (error) {
5877
- _this35.meetingFiniteStateMachine.fail(error);
5991
+ _this36.meetingFiniteStateMachine.fail(error);
5878
5992
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_TO_FAILURE, {
5879
- correlation_id: _this35.correlationId,
5880
- locus_id: _this35.locusUrl.split('/').pop(),
5993
+ correlation_id: _this36.correlationId,
5994
+ locus_id: _this36.locusUrl.split('/').pop(),
5881
5995
  reason: error.message,
5882
5996
  stack: error.stack
5883
5997
  });
5884
5998
  _loggerProxy.default.logger.error('Meeting:index#moveTo --> Failed to moveTo resourceId', error);
5885
- _this35.isMoveToInProgress = false;
5999
+ _this36.isMoveToInProgress = false;
5886
6000
  return _promise.default.reject(error);
5887
6001
  });
5888
6002
  }
@@ -5897,7 +6011,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5897
6011
  }, {
5898
6012
  key: "moveFrom",
5899
6013
  value: function moveFrom(resourceId) {
5900
- var _this36 = this;
6014
+ var _this37 = this;
5901
6015
  // On moveFrom ask the developer to re capture it moveFrom then updateMedia
5902
6016
  if (!resourceId) {
5903
6017
  throw new _parameter.default('Cannot move call without a resourceId.');
@@ -5912,19 +6026,19 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5912
6026
  }
5913
6027
  });
5914
6028
  return _util2.default.joinMeetingOptions(this).then(function () {
5915
- return _util2.default.leaveMeeting(_this36, {
6029
+ return _util2.default.leaveMeeting(_this37, {
5916
6030
  resourceId: resourceId,
5917
6031
  correlationId: oldCorrelationId,
5918
6032
  moveMeeting: true
5919
6033
  }).then(function () {
5920
- _this36.resourceId = '';
6034
+ _this37.resourceId = '';
5921
6035
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_SUCCESS);
5922
6036
  });
5923
6037
  }).catch(function (error) {
5924
- _this36.meetingFiniteStateMachine.fail(error);
6038
+ _this37.meetingFiniteStateMachine.fail(error);
5925
6039
  _metrics.default.sendBehavioralMetric(_constants2.default.MOVE_FROM_FAILURE, {
5926
- correlation_id: _this36.correlationId,
5927
- locus_id: _this36.locusUrl.split('/').pop(),
6040
+ correlation_id: _this37.correlationId,
6041
+ locus_id: _this37.locusUrl.split('/').pop(),
5928
6042
  reason: error.message,
5929
6043
  stack: error.stack
5930
6044
  });
@@ -6031,9 +6145,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6031
6145
  }, {
6032
6146
  key: "forwardEvent",
6033
6147
  value: function forwardEvent(eventEmitter, eventTypeToForward, meetingEventType) {
6034
- var _this37 = this;
6148
+ var _this38 = this;
6035
6149
  eventEmitter.on(eventTypeToForward, function (data) {
6036
- return _triggerProxy.default.trigger(_this37, {
6150
+ return _triggerProxy.default.trigger(_this38, {
6037
6151
  file: 'meetings',
6038
6152
  function: 'addMedia'
6039
6153
  }, meetingEventType, data);
@@ -6103,7 +6217,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6103
6217
  key: "waitForMediaConnectionConnected",
6104
6218
  value: (function () {
6105
6219
  var _waitForMediaConnectionConnected = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
6106
- var _this$mediaProperties6, _this$mediaProperties7, _this$mediaProperties8, _this$mediaProperties9, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12, _this$mediaProperties13, _this$mediaProperties14, _this$mediaProperties15, _this$mediaProperties16, _this$mediaProperties17, _this$mediaProperties18, _this$mediaProperties19;
6220
+ var iceConnected, _this$mediaProperties6, _this$mediaProperties7, _this$mediaProperties8, _this$mediaProperties9, _this$mediaProperties10, _this$mediaProperties11, _this$mediaProperties12;
6107
6221
  return _regenerator.default.wrap(function _callee23$(_context23) {
6108
6222
  while (1) switch (_context23.prev = _context23.next) {
6109
6223
  case 0:
@@ -6111,37 +6225,59 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6111
6225
  _context23.next = 3;
6112
6226
  return this.mediaProperties.waitForMediaConnectionConnected();
6113
6227
  case 3:
6114
- _context23.next = 9;
6228
+ _context23.next = 30;
6115
6229
  break;
6116
6230
  case 5:
6117
6231
  _context23.prev = 5;
6118
6232
  _context23.t0 = _context23["catch"](0);
6119
- if (!this.hasMediaConnectionConnectedAtLeastOnce) {
6120
- // Only send CA event for join flow if we haven't successfully connected media yet
6121
- // @ts-ignore
6122
- this.webex.internal.newMetrics.submitClientEvent({
6123
- name: 'client.ice.end',
6124
- payload: {
6125
- canProceed: !this.turnServerUsed,
6126
- // If we haven't done turn tls retry yet we will proceed with join attempt
6127
- icePhase: this.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY',
6128
- errors: [
6129
- // @ts-ignore
6130
- this.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
6131
- clientErrorCode: _internalPluginMetrics.CallDiagnosticUtils.generateClientErrorCodeForIceFailure({
6132
- signalingState: ((_this$mediaProperties6 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties6 === void 0 ? void 0 : (_this$mediaProperties7 = _this$mediaProperties6.multistreamConnection) === null || _this$mediaProperties7 === void 0 ? void 0 : (_this$mediaProperties8 = _this$mediaProperties7.pc) === null || _this$mediaProperties8 === void 0 ? void 0 : (_this$mediaProperties9 = _this$mediaProperties8.pc) === null || _this$mediaProperties9 === void 0 ? void 0 : _this$mediaProperties9.signalingState) || ((_this$mediaProperties10 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties10 === void 0 ? void 0 : (_this$mediaProperties11 = _this$mediaProperties10.mediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.pc) === null || _this$mediaProperties12 === void 0 ? void 0 : _this$mediaProperties12.signalingState) || 'unknown',
6133
- iceConnectionState: ((_this$mediaProperties13 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties13 === void 0 ? void 0 : (_this$mediaProperties14 = _this$mediaProperties13.multistreamConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.pc) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : _this$mediaProperties16.iceConnectionState) || ((_this$mediaProperties17 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties17 === void 0 ? void 0 : (_this$mediaProperties18 = _this$mediaProperties17.mediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.pc) === null || _this$mediaProperties19 === void 0 ? void 0 : _this$mediaProperties19.iceConnectionState) || 'unknown',
6134
- turnServerUsed: this.turnServerUsed
6135
- })
6136
- })]
6137
- },
6138
- options: {
6139
- meetingId: this.id
6140
- }
6141
- });
6233
+ iceConnected = _context23.t0.iceConnected;
6234
+ if (this.hasMediaConnectionConnectedAtLeastOnce) {
6235
+ _context23.next = 29;
6236
+ break;
6142
6237
  }
6238
+ _context23.t1 = this.webex.internal.newMetrics;
6239
+ _context23.t2 = !this.turnServerUsed;
6240
+ _context23.t3 = this.addMediaData.icePhaseCallback();
6241
+ _context23.t4 = this.webex.internal.newMetrics.callDiagnosticMetrics;
6242
+ _context23.t5 = _internalPluginMetrics.CallDiagnosticUtils;
6243
+ _context23.t6 = ((_this$mediaProperties6 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties6 === void 0 ? void 0 : (_this$mediaProperties7 = _this$mediaProperties6.multistreamConnection) === null || _this$mediaProperties7 === void 0 ? void 0 : (_this$mediaProperties8 = _this$mediaProperties7.pc) === null || _this$mediaProperties8 === void 0 ? void 0 : (_this$mediaProperties9 = _this$mediaProperties8.pc) === null || _this$mediaProperties9 === void 0 ? void 0 : _this$mediaProperties9.signalingState) || ((_this$mediaProperties10 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties10 === void 0 ? void 0 : (_this$mediaProperties11 = _this$mediaProperties10.mediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.pc) === null || _this$mediaProperties12 === void 0 ? void 0 : _this$mediaProperties12.signalingState) || 'unknown';
6244
+ _context23.t7 = iceConnected;
6245
+ _context23.t8 = this.turnServerUsed;
6246
+ _context23.next = 19;
6247
+ return this.webex.meetings.reachability.isWebexMediaBackendUnreachable().catch(function () {
6248
+ return false;
6249
+ });
6250
+ case 19:
6251
+ _context23.t9 = _context23.sent;
6252
+ _context23.t10 = {
6253
+ signalingState: _context23.t6,
6254
+ iceConnected: _context23.t7,
6255
+ turnServerUsed: _context23.t8,
6256
+ unreachable: _context23.t9
6257
+ };
6258
+ _context23.t11 = _context23.t5.generateClientErrorCodeForIceFailure.call(_context23.t5, _context23.t10);
6259
+ _context23.t12 = {
6260
+ clientErrorCode: _context23.t11
6261
+ };
6262
+ _context23.t13 = _context23.t4.getErrorPayloadForClientErrorCode.call(_context23.t4, _context23.t12);
6263
+ _context23.t14 = [_context23.t13];
6264
+ _context23.t15 = {
6265
+ canProceed: _context23.t2,
6266
+ icePhase: _context23.t3,
6267
+ errors: _context23.t14
6268
+ };
6269
+ _context23.t16 = {
6270
+ meetingId: this.id
6271
+ };
6272
+ _context23.t17 = {
6273
+ name: 'client.ice.end',
6274
+ payload: _context23.t15,
6275
+ options: _context23.t16
6276
+ };
6277
+ _context23.t1.submitClientEvent.call(_context23.t1, _context23.t17);
6278
+ case 29:
6143
6279
  throw new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
6144
- case 9:
6280
+ case 30:
6145
6281
  case "end":
6146
6282
  return _context23.stop();
6147
6283
  }
@@ -6162,18 +6298,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6162
6298
  }, {
6163
6299
  key: "createStatsAnalyzer",
6164
6300
  value: function createStatsAnalyzer() {
6165
- var _this38 = this;
6166
6301
  // @ts-ignore - config coming from registerPlugin
6167
6302
  if (this.config.stats.enableStatsAnalyzer) {
6168
6303
  // @ts-ignore - config coming from registerPlugin
6169
- this.networkQualityMonitor = new _networkQualityMonitor.default(this.config.stats);
6170
- this.statsAnalyzer = new _statsAnalyzer.StatsAnalyzer(
6171
- // @ts-ignore - config coming from registerPlugin
6172
- this.config.stats, function (ssrc) {
6173
- return _this38.receiveSlotManager.findReceiveSlotBySsrc(ssrc);
6174
- }, this.networkQualityMonitor);
6304
+ this.networkQualityMonitor = new _internalMediaCore.NetworkQualityMonitor(this.config.stats);
6305
+ this.statsAnalyzer = new _internalMediaCore.StatsAnalyzer({
6306
+ // @ts-ignore - config coming from registerPlugin
6307
+ config: this.config.stats,
6308
+ networkQualityMonitor: this.networkQualityMonitor,
6309
+ isMultistream: this.isMultistream
6310
+ });
6175
6311
  this.setupStatsAnalyzerEventHandlers();
6176
- this.networkQualityMonitor.on(_constants.EVENT_TRIGGERS.NETWORK_QUALITY, this.sendNetworkQualityEvent.bind(this));
6312
+ this.networkQualityMonitor.on(_internalMediaCore.NetworkQualityEventNames.NETWORK_QUALITY, this.sendNetworkQualityEvent.bind(this));
6177
6313
  }
6178
6314
  }
6179
6315
 
@@ -6196,6 +6332,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6196
6332
  */
6197
6333
  function () {
6198
6334
  var _waitForRemoteSDPAnswer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
6335
+ var _this39 = this;
6199
6336
  var LOG_HEADER, deferSDPAnswer;
6200
6337
  return _regenerator.default.wrap(function _callee24$(_context24) {
6201
6338
  while (1) switch (_context24.prev = _context24.next) {
@@ -6211,6 +6348,22 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6211
6348
  deferSDPAnswer = this.deferSDPAnswer;
6212
6349
  this.sdpResponseTimer = setTimeout(function () {
6213
6350
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " timeout! no REMOTE SDP ANSWER received within ").concat(_constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT / 1000, " seconds"));
6351
+ // @ts-ignore
6352
+ _this39.webex.internal.newMetrics.submitClientEvent({
6353
+ name: 'client.media-engine.remote-sdp-received',
6354
+ payload: {
6355
+ canProceed: false,
6356
+ errors: [
6357
+ // @ts-ignore
6358
+ _this39.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
6359
+ clientErrorCode: _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.MISSING_ROAP_ANSWER_CLIENT_CODE
6360
+ })]
6361
+ },
6362
+ options: {
6363
+ meetingId: _this39.id,
6364
+ rawError: new Error('Timeout waiting for SDP answer')
6365
+ }
6366
+ });
6214
6367
  deferSDPAnswer.reject(new Error('Timed out waiting for REMOTE SDP ANSWER'));
6215
6368
  }, _constants.ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT);
6216
6369
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " waiting for REMOTE SDP ANSWER..."));
@@ -6284,7 +6437,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6284
6437
  return _regenerator.default.wrap(function _callee26$(_context26) {
6285
6438
  while (1) switch (_context26.prev = _context26.next) {
6286
6439
  case 0:
6287
- this.retriedWithTurnServer = true;
6440
+ this.addMediaData.retriedWithTurnServer = true;
6288
6441
  LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
6289
6442
  _context26.next = 4;
6290
6443
  return this.cleanUpBeforeRetryWithTurnServer();
@@ -6400,7 +6553,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6400
6553
  correlation_id: this.correlationId,
6401
6554
  latency: cdl.getTurnDiscoveryTime(),
6402
6555
  turnServerUsed: this.turnServerUsed,
6403
- retriedWithTurnServer: this.retriedWithTurnServer
6556
+ retriedWithTurnServer: this.addMediaData.retriedWithTurnServer
6404
6557
  });
6405
6558
  }
6406
6559
  return _context28.abrupt("return", turnDiscoveryResult);
@@ -6430,12 +6583,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6430
6583
  key: "establishMediaConnection",
6431
6584
  value: (function () {
6432
6585
  var _establishMediaConnection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(remoteMediaManagerConfig, bundlePolicy, isForced, turnServerInfo) {
6586
+ var _this$locusMediaReque;
6433
6587
  var LOG_HEADER, isReconnecting, _yield$this$doTurnDis, mc;
6434
6588
  return _regenerator.default.wrap(function _callee29$(_context29) {
6435
6589
  while (1) switch (_context29.prev = _context29.next) {
6436
6590
  case 0:
6437
6591
  LOG_HEADER = 'Meeting:index#addMedia():establishMediaConnection -->';
6438
- isReconnecting = this.isMoveToInProgress || this.retriedWithTurnServer; // We are forcing turn discovery if the case is moveTo and a turn server was used already
6592
+ 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
6439
6593
  if (this.isMoveToInProgress && this.turnServerUsed) {
6440
6594
  isForced = true;
6441
6595
  }
@@ -6593,23 +6747,70 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6593
6747
  }
6594
6748
  return cleanUpBeforeRetryWithTurnServer;
6595
6749
  }()
6750
+ /**
6751
+ * Creates an instance of LocusMediaRequest for this meeting - it is needed for doing any calls
6752
+ * to Locus /media API (these are used for sending Roap messages and updating audio/video mute status).
6753
+ *
6754
+ * @returns {void}
6755
+ */
6756
+ )
6757
+ }, {
6758
+ key: "setupLocusMediaRequest",
6759
+ value: function setupLocusMediaRequest() {
6760
+ var _this$webex$meetings$2, _this$webex$meetings$3;
6761
+ this.locusMediaRequest = new _locusMediaRequest.LocusMediaRequest({
6762
+ correlationId: this.correlationId,
6763
+ meetingId: this.id,
6764
+ device: {
6765
+ url: this.deviceUrl,
6766
+ // @ts-ignore
6767
+ deviceType: this.config.deviceType,
6768
+ // @ts-ignore
6769
+ countryCode: (_this$webex$meetings$2 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$2 === void 0 ? void 0 : _this$webex$meetings$2.countryCode,
6770
+ // @ts-ignore
6771
+ regionCode: (_this$webex$meetings$3 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$3 === void 0 ? void 0 : _this$webex$meetings$3.regionCode
6772
+ },
6773
+ preferTranscoding: !this.isMultistream
6774
+ }, {
6775
+ // @ts-ignore
6776
+ parent: this.webex
6777
+ });
6778
+ }
6779
+
6596
6780
  /**
6597
6781
  * Creates a media connection to the server. Media connection is required for sending or receiving any audio/video.
6598
6782
  *
6599
6783
  * @param {AddMediaOptions} options
6600
- * @param {TurnServerInfo} turnServerInfo - TURN server information (used only internally by the SDK)
6601
6784
  * @returns {Promise<void>}
6602
6785
  * @public
6603
6786
  * @memberof Meeting
6604
6787
  */
6605
- )
6606
6788
  }, {
6607
6789
  key: "addMedia",
6790
+ value: function addMedia() {
6791
+ var _this40 = this;
6792
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6793
+ return this.addMediaInternal(function () {
6794
+ return _this40.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY';
6795
+ }, undefined, false, options);
6796
+ }
6797
+
6798
+ /**
6799
+ * Internal version of addMedia() with some more arguments for finer control of its behavior
6800
+ *
6801
+ * @param {Function} icePhaseCallback - callback to determine the icePhase for CA "client.ice.end" failure events
6802
+ * @param {TurnServerInfo} turnServerInfo - TURN server information
6803
+ * @param {boolean} forceTurnDiscovery - if true, TURN discovery will be done
6804
+ * @param {AddMediaOptions} options - same as options of the public addMedia() method
6805
+ * @returns {Promise<void>}
6806
+ * @protected
6807
+ * @memberof Meeting
6808
+ */
6809
+ }, {
6810
+ key: "addMediaInternal",
6608
6811
  value: (function () {
6609
- var _addMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32() {
6610
- var _this$webex$meetings$2, _this$webex$meetings$3;
6812
+ var _addMediaInternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(icePhaseCallback, turnServerInfo, forceTurnDiscovery) {
6611
6813
  var options,
6612
- turnServerInfo,
6613
6814
  LOG_HEADER,
6614
6815
  localStreams,
6615
6816
  _options$audioEnabled,
@@ -6628,6 +6829,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6628
6829
  selectedCandidatePairChanges,
6629
6830
  numTransports,
6630
6831
  reachabilityStats,
6832
+ iceCandidateErrors,
6833
+ _this$mediaProperties13,
6834
+ _this$mediaProperties14,
6835
+ _this$mediaProperties15,
6836
+ _this$mediaProperties16,
6837
+ _this$mediaProperties17,
6838
+ _this$mediaProperties18,
6839
+ _this$mediaProperties19,
6631
6840
  _this$mediaProperties20,
6632
6841
  _this$mediaProperties21,
6633
6842
  _this$mediaProperties22,
@@ -6642,27 +6851,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6642
6851
  _this$mediaProperties31,
6643
6852
  _this$mediaProperties32,
6644
6853
  _this$mediaProperties33,
6645
- _this$mediaProperties34,
6646
- _this$mediaProperties35,
6647
- _this$mediaProperties36,
6648
- _this$mediaProperties37,
6649
- _this$mediaProperties38,
6650
- _this$mediaProperties39,
6651
- _this$mediaProperties40,
6652
6854
  reachabilityMetrics,
6653
6855
  _yield$this$mediaProp2,
6654
6856
  _selectedCandidatePairChanges,
6655
6857
  _numTransports,
6858
+ _iceCandidateErrors,
6656
6859
  _args32 = arguments;
6657
6860
  return _regenerator.default.wrap(function _callee32$(_context32) {
6658
6861
  while (1) switch (_context32.prev = _context32.next) {
6659
6862
  case 0:
6660
- options = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : {};
6661
- turnServerInfo = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : undefined;
6662
- this.retriedWithTurnServer = false;
6863
+ options = _args32.length > 3 && _args32[3] !== undefined ? _args32[3] : {};
6864
+ this.addMediaData.retriedWithTurnServer = false;
6865
+ this.addMediaData.icePhaseCallback = icePhaseCallback;
6663
6866
  this.hasMediaConnectionConnectedAtLeastOnce = false;
6664
6867
  LOG_HEADER = 'Meeting:index#addMedia -->';
6665
- _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: ").concat((0, _stringify.default)(options), ", ").concat((0, _stringify.default)(turnServerInfo)));
6868
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: options=").concat((0, _stringify.default)(options), ", turnServerInfo=").concat((0, _stringify.default)(turnServerInfo), ", forceTurnDiscovery=").concat(forceTurnDiscovery));
6666
6869
  if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
6667
6870
  _context32.next = 8;
6668
6871
  break;
@@ -6722,74 +6925,60 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6722
6925
  receiveVideo: videoEnabled,
6723
6926
  receiveShare: shareAudioEnabled || shareVideoEnabled
6724
6927
  });
6725
- this.locusMediaRequest = new _locusMediaRequest.LocusMediaRequest({
6726
- correlationId: this.correlationId,
6727
- meetingId: this.id,
6728
- device: {
6729
- url: this.deviceUrl,
6730
- // @ts-ignore
6731
- deviceType: this.config.deviceType,
6732
- // @ts-ignore
6733
- countryCode: (_this$webex$meetings$2 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$2 === void 0 ? void 0 : _this$webex$meetings$2.countryCode,
6734
- // @ts-ignore
6735
- regionCode: (_this$webex$meetings$3 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$3 === void 0 ? void 0 : _this$webex$meetings$3.regionCode
6736
- },
6737
- preferTranscoding: !this.isMultistream
6738
- }, {
6739
- // @ts-ignore
6740
- parent: this.webex
6741
- });
6742
6928
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
6743
6929
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
6744
- _context32.prev = 19;
6745
- _context32.next = 22;
6930
+ _context32.prev = 18;
6931
+ _context32.next = 21;
6746
6932
  return this.setUpLocalStreamReferences(localStreams);
6747
- case 22:
6933
+ case 21:
6748
6934
  this.setMercuryListener();
6749
6935
  this.createStatsAnalyzer();
6750
- _context32.next = 26;
6751
- return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, false, turnServerInfo);
6752
- case 26:
6936
+ _context32.next = 25;
6937
+ return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
6938
+ case 25:
6753
6939
  if (!(audioEnabled || videoEnabled)) {
6754
- _context32.next = 31;
6940
+ _context32.next = 30;
6755
6941
  break;
6756
6942
  }
6757
- _context32.next = 29;
6943
+ _context32.next = 28;
6758
6944
  return Meeting.handleDeviceLogging();
6759
- case 29:
6760
- _context32.next = 32;
6945
+ case 28:
6946
+ _context32.next = 31;
6761
6947
  break;
6762
- case 31:
6948
+ case 30:
6763
6949
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " device logging not required"));
6764
- case 32:
6950
+ case 31:
6765
6951
  if (!this.mediaProperties.hasLocalShareStream()) {
6766
- _context32.next = 35;
6952
+ _context32.next = 34;
6767
6953
  break;
6768
6954
  }
6769
- _context32.next = 35;
6955
+ _context32.next = 34;
6770
6956
  return this.enqueueScreenShareFloorRequest();
6771
- case 35:
6772
- _context32.next = 37;
6957
+ case 34:
6958
+ _context32.next = 36;
6773
6959
  return this.mediaProperties.getCurrentConnectionInfo();
6774
- case 37:
6960
+ case 36:
6775
6961
  _yield$this$mediaProp = _context32.sent;
6776
6962
  connectionType = _yield$this$mediaProp.connectionType;
6777
6963
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
6778
6964
  numTransports = _yield$this$mediaProp.numTransports;
6779
- _context32.next = 43;
6965
+ _context32.next = 42;
6780
6966
  return this.webex.meetings.reachability.getReachabilityMetrics();
6781
- case 43:
6967
+ case 42:
6782
6968
  reachabilityStats = _context32.sent;
6783
- _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread({
6969
+ iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
6970
+ _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
6784
6971
  correlation_id: this.correlationId,
6785
6972
  locus_id: this.locusUrl.split('/').pop(),
6786
6973
  connectionType: connectionType,
6787
6974
  selectedCandidatePairChanges: selectedCandidatePairChanges,
6788
6975
  numTransports: numTransports,
6789
6976
  isMultistream: this.isMultistream,
6790
- retriedWithTurnServer: this.retriedWithTurnServer,
6977
+ retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
6791
6978
  isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry
6792
- }, reachabilityStats));
6979
+ }, reachabilityStats), iceCandidateErrors), {}, {
6980
+ iceCandidatesCount: this.iceCandidatesCount
6981
+ }));
6793
6982
  // @ts-ignore
6794
6983
  this.webex.internal.newMetrics.submitClientEvent({
6795
6984
  name: 'client.media-engine.ready',
@@ -6801,11 +6990,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6801
6990
 
6802
6991
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
6803
6992
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
6804
- _context32.next = 67;
6993
+ _context32.next = 68;
6805
6994
  break;
6806
6995
  case 50:
6807
6996
  _context32.prev = 50;
6808
- _context32.t0 = _context32["catch"](19);
6997
+ _context32.t0 = _context32["catch"](18);
6809
6998
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context32.t0);
6810
6999
 
6811
7000
  // @ts-ignore
@@ -6819,7 +7008,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6819
7008
  _yield$this$mediaProp2 = _context32.sent;
6820
7009
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
6821
7010
  _numTransports = _yield$this$mediaProp2.numTransports;
6822
- _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread({
7011
+ _iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
7012
+ _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread(_objectSpread(_objectSpread({
6823
7013
  correlation_id: this.correlationId,
6824
7014
  locus_id: this.locusUrl.split('/').pop(),
6825
7015
  reason: _context32.t0.message,
@@ -6829,16 +7019,18 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6829
7019
  numTransports: _numTransports,
6830
7020
  turnDiscoverySkippedReason: this.turnDiscoverySkippedReason,
6831
7021
  turnServerUsed: this.turnServerUsed,
6832
- retriedWithTurnServer: this.retriedWithTurnServer,
7022
+ retriedWithTurnServer: this.addMediaData.retriedWithTurnServer,
6833
7023
  isMultistream: this.isMultistream,
6834
7024
  isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry,
6835
- signalingState: ((_this$mediaProperties20 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties20 === void 0 ? void 0 : (_this$mediaProperties21 = _this$mediaProperties20.multistreamConnection) === null || _this$mediaProperties21 === void 0 ? void 0 : (_this$mediaProperties22 = _this$mediaProperties21.pc) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.pc) === null || _this$mediaProperties23 === void 0 ? void 0 : _this$mediaProperties23.signalingState) || ((_this$mediaProperties24 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties24 === void 0 ? void 0 : (_this$mediaProperties25 = _this$mediaProperties24.mediaConnection) === null || _this$mediaProperties25 === void 0 ? void 0 : (_this$mediaProperties26 = _this$mediaProperties25.pc) === null || _this$mediaProperties26 === void 0 ? void 0 : _this$mediaProperties26.signalingState) || 'unknown',
6836
- connectionState: ((_this$mediaProperties27 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.multistreamConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.pc) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : _this$mediaProperties30.connectionState) || ((_this$mediaProperties31 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.mediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.pc) === null || _this$mediaProperties33 === void 0 ? void 0 : _this$mediaProperties33.connectionState) || 'unknown',
6837
- iceConnectionState: ((_this$mediaProperties34 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties34 === void 0 ? void 0 : (_this$mediaProperties35 = _this$mediaProperties34.multistreamConnection) === null || _this$mediaProperties35 === void 0 ? void 0 : (_this$mediaProperties36 = _this$mediaProperties35.pc) === null || _this$mediaProperties36 === void 0 ? void 0 : (_this$mediaProperties37 = _this$mediaProperties36.pc) === null || _this$mediaProperties37 === void 0 ? void 0 : _this$mediaProperties37.iceConnectionState) || ((_this$mediaProperties38 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.mediaConnection) === null || _this$mediaProperties39 === void 0 ? void 0 : (_this$mediaProperties40 = _this$mediaProperties39.pc) === null || _this$mediaProperties40 === void 0 ? void 0 : _this$mediaProperties40.iceConnectionState) || 'unknown'
6838
- }, reachabilityMetrics));
6839
- _context32.next = 64;
7025
+ signalingState: ((_this$mediaProperties13 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties13 === void 0 ? void 0 : (_this$mediaProperties14 = _this$mediaProperties13.multistreamConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.pc) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : _this$mediaProperties16.signalingState) || ((_this$mediaProperties17 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties17 === void 0 ? void 0 : (_this$mediaProperties18 = _this$mediaProperties17.mediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.pc) === null || _this$mediaProperties19 === void 0 ? void 0 : _this$mediaProperties19.signalingState) || 'unknown',
7026
+ connectionState: ((_this$mediaProperties20 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties20 === void 0 ? void 0 : (_this$mediaProperties21 = _this$mediaProperties20.multistreamConnection) === null || _this$mediaProperties21 === void 0 ? void 0 : (_this$mediaProperties22 = _this$mediaProperties21.pc) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.pc) === null || _this$mediaProperties23 === void 0 ? void 0 : _this$mediaProperties23.connectionState) || ((_this$mediaProperties24 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties24 === void 0 ? void 0 : (_this$mediaProperties25 = _this$mediaProperties24.mediaConnection) === null || _this$mediaProperties25 === void 0 ? void 0 : (_this$mediaProperties26 = _this$mediaProperties25.pc) === null || _this$mediaProperties26 === void 0 ? void 0 : _this$mediaProperties26.connectionState) || 'unknown',
7027
+ iceConnectionState: ((_this$mediaProperties27 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.multistreamConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.pc) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : _this$mediaProperties30.iceConnectionState) || ((_this$mediaProperties31 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.mediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.pc) === null || _this$mediaProperties33 === void 0 ? void 0 : _this$mediaProperties33.iceConnectionState) || 'unknown'
7028
+ }, reachabilityMetrics), _iceCandidateErrors), {}, {
7029
+ iceCandidatesCount: this.iceCandidatesCount
7030
+ }));
7031
+ _context32.next = 65;
6840
7032
  return this.cleanUpOnAddMediaFailure();
6841
- case 64:
7033
+ case 65:
6842
7034
  // Upload logs on error while adding media
6843
7035
  _triggerProxy.default.trigger(this, {
6844
7036
  file: 'meeting/index',
@@ -6850,16 +7042,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6850
7042
  });
6851
7043
  }
6852
7044
  throw _context32.t0;
6853
- case 67:
7045
+ case 68:
7046
+ _context32.prev = 68;
7047
+ this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
7048
+ return _context32.finish(68);
7049
+ case 71:
6854
7050
  case "end":
6855
7051
  return _context32.stop();
6856
7052
  }
6857
- }, _callee32, this, [[19, 50]]);
7053
+ }, _callee32, this, [[18, 50, 68, 71]]);
6858
7054
  }));
6859
- function addMedia() {
6860
- return _addMedia.apply(this, arguments);
7055
+ function addMediaInternal(_x32, _x33, _x34) {
7056
+ return _addMediaInternal.apply(this, arguments);
6861
7057
  }
6862
- return addMedia;
7058
+ return addMediaInternal;
6863
7059
  }()
6864
7060
  /**
6865
7061
  * Informs if the peer connection is in a state that can be updated with updateMedia (audio/video/share)
@@ -6886,7 +7082,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6886
7082
  * @memberof Meeting
6887
7083
  */
6888
7084
  function enqueueMediaUpdate(mediaUpdateType) {
6889
- var _this39 = this;
7085
+ var _this41 = this;
6890
7086
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6891
7087
  var canUpdateMediaNow = this.canUpdateMedia();
6892
7088
  return new _promise.default(function (resolve, reject) {
@@ -6897,9 +7093,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6897
7093
  options: options
6898
7094
  };
6899
7095
  _loggerProxy.default.logger.log("Meeting:index#enqueueMediaUpdate --> enqueuing media update type=".concat(mediaUpdateType));
6900
- _this39.queuedMediaUpdates.push(queueItem);
7096
+ _this41.queuedMediaUpdates.push(queueItem);
6901
7097
  if (canUpdateMediaNow) {
6902
- _this39.processNextQueuedMediaUpdate();
7098
+ _this41.processNextQueuedMediaUpdate();
6903
7099
  }
6904
7100
  });
6905
7101
  }
@@ -6988,7 +7184,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6988
7184
  }
6989
7185
  }, _callee33, this);
6990
7186
  }));
6991
- function updateMedia(_x32) {
7187
+ function updateMedia(_x35) {
6992
7188
  return _updateMedia.apply(this, arguments);
6993
7189
  }
6994
7190
  return updateMedia;
@@ -7004,7 +7200,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7004
7200
  }, {
7005
7201
  key: "acknowledge",
7006
7202
  value: function acknowledge(type) {
7007
- var _this40 = this;
7203
+ var _this42 = this;
7008
7204
  if (!type) {
7009
7205
  return _promise.default.reject(new _parameter.default('Type must be set to acknowledge the meeting.'));
7010
7206
  }
@@ -7016,12 +7212,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7016
7212
  }).then(function (response) {
7017
7213
  return _promise.default.resolve(response);
7018
7214
  }).then(function (response) {
7019
- _this40.meetingFiniteStateMachine.ring(type);
7215
+ _this42.meetingFiniteStateMachine.ring(type);
7020
7216
  // @ts-ignore
7021
- _this40.webex.internal.newMetrics.submitClientEvent({
7217
+ _this42.webex.internal.newMetrics.submitClientEvent({
7022
7218
  name: 'client.alert.displayed',
7023
7219
  options: {
7024
- meetingId: _this40.id
7220
+ meetingId: _this42.id
7025
7221
  }
7026
7222
  });
7027
7223
  return _promise.default.resolve({
@@ -7046,12 +7242,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7046
7242
  }, {
7047
7243
  key: "decline",
7048
7244
  value: function decline(reason) {
7049
- var _this41 = this;
7245
+ var _this43 = this;
7050
7246
  return _util2.default.declineMeeting(this, reason).then(function (decline) {
7051
- _this41.meetingFiniteStateMachine.decline();
7247
+ _this43.meetingFiniteStateMachine.decline();
7052
7248
  return _promise.default.resolve(decline);
7053
7249
  }).catch(function (error) {
7054
- _this41.meetingFiniteStateMachine.fail(error);
7250
+ _this43.meetingFiniteStateMachine.fail(error);
7055
7251
  return _promise.default.reject(error);
7056
7252
  });
7057
7253
  }
@@ -7102,7 +7298,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7102
7298
  }, {
7103
7299
  key: "leave",
7104
7300
  value: function leave() {
7105
- var _this42 = this;
7301
+ var _this44 = this;
7106
7302
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7107
7303
  var leaveReason = options.reason || _constants.MEETING_REMOVED_REASON.CLIENT_LEAVE_REQUEST;
7108
7304
 
@@ -7114,7 +7310,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7114
7310
  var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7115
7311
  return (
7116
7312
  // @ts-ignore
7117
- _this42.webex.internal.newMetrics.submitClientEvent({
7313
+ _this44.webex.internal.newMetrics.submitClientEvent({
7118
7314
  name: 'client.call.leave',
7119
7315
  payload: _objectSpread({
7120
7316
  trigger: 'user-interaction',
@@ -7122,7 +7318,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7122
7318
  leaveReason: options.clientEventLeaveReason
7123
7319
  }, payload),
7124
7320
  options: {
7125
- meetingId: _this42.id
7321
+ meetingId: _this44.id
7126
7322
  }
7127
7323
  })
7128
7324
  );
@@ -7131,24 +7327,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7131
7327
  return _util2.default.leaveMeeting(this, options).then(function (leave) {
7132
7328
  // CA team recommends submitting this *after* locus /leave
7133
7329
  submitLeaveMetric();
7134
- _this42.meetingFiniteStateMachine.leave();
7135
- _this42.clearMeetingData();
7330
+ _this44.meetingFiniteStateMachine.leave();
7331
+ _this44.clearMeetingData();
7136
7332
 
7137
7333
  // upload logs on leave irrespective of meeting delete
7138
- _triggerProxy.default.trigger(_this42, {
7334
+ _triggerProxy.default.trigger(_this44, {
7139
7335
  file: 'meeting/index',
7140
7336
  function: 'leave'
7141
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this42);
7337
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this44);
7142
7338
 
7143
7339
  // TODO: more testing before we remove this code, we are not sure the scenarios for destroy here
7144
- if (_this42.wirelessShare || _this42.guest) {
7340
+ if (_this44.wirelessShare || _this44.guest) {
7145
7341
  // If screen sharing clean the meeting object
7146
- _triggerProxy.default.trigger(_this42, {
7342
+ _triggerProxy.default.trigger(_this44, {
7147
7343
  file: 'meeting/index',
7148
7344
  function: 'leave'
7149
7345
  }, _constants.EVENTS.DESTROY_MEETING, {
7150
7346
  reason: options.reason,
7151
- meetingId: _this42.id
7347
+ meetingId: _this44.id
7152
7348
  });
7153
7349
  }
7154
7350
  _loggerProxy.default.logger.log('Meeting:index#leave --> LEAVE REASON ', leaveReason);
@@ -7165,16 +7361,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7165
7361
  shownToUser: false
7166
7362
  }]
7167
7363
  });
7168
- _this42.meetingFiniteStateMachine.fail(error);
7364
+ _this44.meetingFiniteStateMachine.fail(error);
7169
7365
  _loggerProxy.default.logger.error('Meeting:index#leave --> Failed to leave ', error);
7170
7366
  // upload logs on leave irrespective of meeting delete
7171
- _triggerProxy.default.trigger(_this42, {
7367
+ _triggerProxy.default.trigger(_this44, {
7172
7368
  file: 'meeting/index',
7173
7369
  function: 'leave'
7174
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this42);
7370
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this44);
7175
7371
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_LEAVE_FAILURE, {
7176
- correlation_id: _this42.correlationId,
7177
- locus_id: _this42.locusUrl.split('/').pop(),
7372
+ correlation_id: _this44.correlationId,
7373
+ locus_id: _this44.locusUrl.split('/').pop(),
7178
7374
  reason: error.message,
7179
7375
  stack: error.stack,
7180
7376
  code: error.code
@@ -7194,7 +7390,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7194
7390
  }, {
7195
7391
  key: "startWhiteboardShare",
7196
7392
  value: function startWhiteboardShare(channelUrl, resourceToken) {
7197
- var _this43 = this;
7393
+ var _this45 = this;
7198
7394
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
7199
7395
  return element.name === 'whiteboard';
7200
7396
  });
@@ -7223,13 +7419,13 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7223
7419
  body.resourceToken = resourceToken;
7224
7420
  }
7225
7421
  return this.meetingRequest.changeMeetingFloor(body).then(function () {
7226
- _this43.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7422
+ _this45.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7227
7423
  return _promise.default.resolve();
7228
7424
  }).catch(function (error) {
7229
7425
  _loggerProxy.default.logger.error('Meeting:index#startWhiteboardShare --> Error ', error);
7230
7426
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_START_WHITEBOARD_SHARE_FAILURE, {
7231
- correlation_id: _this43.correlationId,
7232
- locus_id: _this43.locusUrl.split('/').pop(),
7427
+ correlation_id: _this45.correlationId,
7428
+ locus_id: _this45.locusUrl.split('/').pop(),
7233
7429
  reason: error.message,
7234
7430
  stack: error.stack,
7235
7431
  board: {
@@ -7252,7 +7448,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7252
7448
  }, {
7253
7449
  key: "stopWhiteboardShare",
7254
7450
  value: function stopWhiteboardShare(channelUrl) {
7255
- var _this44 = this;
7451
+ var _this46 = this;
7256
7452
  var whiteboard = this.locusInfo.mediaShares.find(function (element) {
7257
7453
  return element.name === 'whiteboard';
7258
7454
  });
@@ -7275,8 +7471,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7275
7471
  }).catch(function (error) {
7276
7472
  _loggerProxy.default.logger.error('Meeting:index#stopWhiteboardShare --> Error ', error);
7277
7473
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_STOP_WHITEBOARD_SHARE_FAILURE, {
7278
- correlation_id: _this44.correlationId,
7279
- locus_id: _this44.locusUrl.split('/').pop(),
7474
+ correlation_id: _this46.correlationId,
7475
+ locus_id: _this46.locusUrl.split('/').pop(),
7280
7476
  reason: error.message,
7281
7477
  stack: error.stack,
7282
7478
  board: {
@@ -7298,7 +7494,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7298
7494
  }, {
7299
7495
  key: "requestScreenShareFloor",
7300
7496
  value: function requestScreenShareFloor() {
7301
- var _this45 = this;
7497
+ var _this47 = this;
7302
7498
  if (!this.mediaProperties.hasLocalShareStream() || !this.mediaProperties.mediaDirection.sendShare) {
7303
7499
  _loggerProxy.default.logger.log("Meeting:index#requestScreenShareFloor --> NOT requesting floor, because we don't have the share stream anymore (shareStream=".concat(this.mediaProperties.shareVideoStream ? 'yes' : 'no', ", sendShare=").concat(this.mediaProperties.mediaDirection.sendShare, ")"));
7304
7500
  this.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
@@ -7329,34 +7525,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7329
7525
  resourceUrl: this.resourceUrl,
7330
7526
  shareInstanceId: this.localShareInstanceId
7331
7527
  }).then(function () {
7332
- _this45.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
7528
+ _this47.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
7333
7529
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
7334
- correlation_id: _this45.correlationId,
7335
- locus_id: _this45.locusUrl.split('/').pop()
7530
+ correlation_id: _this47.correlationId,
7531
+ locus_id: _this47.locusUrl.split('/').pop()
7336
7532
  });
7337
7533
  return _promise.default.resolve();
7338
7534
  }).catch(function (error) {
7339
7535
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
7340
7536
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_FAILURE, {
7341
- correlation_id: _this45.correlationId,
7342
- locus_id: _this45.locusUrl.split('/').pop(),
7537
+ correlation_id: _this47.correlationId,
7538
+ locus_id: _this47.locusUrl.split('/').pop(),
7343
7539
  reason: error.message,
7344
7540
  stack: error.stack
7345
7541
  });
7346
7542
 
7347
7543
  // @ts-ignore
7348
- _this45.webex.internal.newMetrics.submitClientEvent({
7544
+ _this47.webex.internal.newMetrics.submitClientEvent({
7349
7545
  name: 'client.share.floor-granted.local',
7350
7546
  payload: {
7351
7547
  mediaType: 'share',
7352
7548
  errors: _util2.default.getChangeMeetingFloorErrorPayload(error.message),
7353
- shareInstanceId: _this45.localShareInstanceId
7549
+ shareInstanceId: _this47.localShareInstanceId
7354
7550
  },
7355
7551
  options: {
7356
- meetingId: _this45.id
7552
+ meetingId: _this47.id
7357
7553
  }
7358
7554
  });
7359
- _this45.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7555
+ _this47.screenShareFloorState = ScreenShareFloorStatus.RELEASED;
7360
7556
  return _promise.default.reject(error);
7361
7557
  });
7362
7558
  }
@@ -7379,10 +7575,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7379
7575
  }, {
7380
7576
  key: "requestScreenShareFloorIfPending",
7381
7577
  value: function requestScreenShareFloorIfPending() {
7382
- var _this46 = this;
7578
+ var _this48 = this;
7383
7579
  if (this.floorGrantPending && this.state === _constants.MEETING_STATE.STATES.JOINED) {
7384
7580
  this.requestScreenShareFloor().then(function () {
7385
- _this46.floorGrantPending = false;
7581
+ _this48.floorGrantPending = false;
7386
7582
  });
7387
7583
  }
7388
7584
  }
@@ -7396,7 +7592,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7396
7592
  }, {
7397
7593
  key: "releaseScreenShareFloor",
7398
7594
  value: function releaseScreenShareFloor() {
7399
- var _this47 = this;
7595
+ var _this49 = this;
7400
7596
  var content = this.locusInfo.mediaShares.find(function (element) {
7401
7597
  return element.name === _constants.CONTENT;
7402
7598
  });
@@ -7431,8 +7627,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7431
7627
  }).catch(function (error) {
7432
7628
  _loggerProxy.default.logger.error('Meeting:index#releaseScreenShareFloor --> Error ', error);
7433
7629
  _metrics.default.sendBehavioralMetric(_constants2.default.STOP_FLOOR_REQUEST_FAILURE, {
7434
- correlation_id: _this47.correlationId,
7435
- locus_id: _this47.locusUrl.split('/').pop(),
7630
+ correlation_id: _this49.correlationId,
7631
+ locus_id: _this49.locusUrl.split('/').pop(),
7436
7632
  reason: error.message,
7437
7633
  stack: error.stack
7438
7634
  });
@@ -7611,14 +7807,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7611
7807
  }, {
7612
7808
  key: "changeVideoLayout",
7613
7809
  value: function changeVideoLayout(layoutType) {
7614
- var _this48 = this;
7810
+ var _this50 = this;
7615
7811
  var renderInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7616
7812
  var main = renderInfo.main,
7617
7813
  content = renderInfo.content;
7618
- var _this$mediaProperties41 = this.mediaProperties,
7619
- mediaDirection = _this$mediaProperties41.mediaDirection,
7620
- remoteShareStream = _this$mediaProperties41.remoteShareStream,
7621
- remoteVideoStream = _this$mediaProperties41.remoteVideoStream;
7814
+ var _this$mediaProperties34 = this.mediaProperties,
7815
+ mediaDirection = _this$mediaProperties34.mediaDirection,
7816
+ remoteShareStream = _this$mediaProperties34.remoteShareStream,
7817
+ remoteVideoStream = _this$mediaProperties34.remoteVideoStream;
7622
7818
  var layoutInfo = (0, _lodash.cloneDeep)(this.lastVideoLayoutInfo);
7623
7819
 
7624
7820
  // TODO: We need a real time value for Audio, Video and Share send indicator
@@ -7665,7 +7861,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7665
7861
  }
7666
7862
  this.lastVideoLayoutInfo = (0, _lodash.cloneDeep)(layoutInfo);
7667
7863
  this.locusInfo.once(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_LAYOUT_UPDATED, function (envelope) {
7668
- _triggerProxy.default.trigger(_this48, {
7864
+ _triggerProxy.default.trigger(_this50, {
7669
7865
  file: 'meeting/index',
7670
7866
  function: 'changeVideoLayout'
7671
7867
  }, _constants.EVENT_TRIGGERS.MEETING_CONTROLS_LAYOUT_UPDATE, {
@@ -7781,7 +7977,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7781
7977
  }, {
7782
7978
  key: "endMeetingForAll",
7783
7979
  value: function endMeetingForAll() {
7784
- var _this49 = this;
7980
+ var _this51 = this;
7785
7981
  // @ts-ignore
7786
7982
  this.webex.internal.newMetrics.submitClientEvent({
7787
7983
  name: 'client.call.leave',
@@ -7799,25 +7995,25 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7799
7995
  locus_id: this.locusId
7800
7996
  });
7801
7997
  return _util2.default.endMeetingForAll(this).then(function (end) {
7802
- _this49.meetingFiniteStateMachine.end();
7803
- _this49.clearMeetingData();
7998
+ _this51.meetingFiniteStateMachine.end();
7999
+ _this51.clearMeetingData();
7804
8000
  // upload logs on leave irrespective of meeting delete
7805
- _triggerProxy.default.trigger(_this49, {
8001
+ _triggerProxy.default.trigger(_this51, {
7806
8002
  file: 'meeting/index',
7807
8003
  function: 'endMeetingForAll'
7808
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
8004
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this51);
7809
8005
  return end;
7810
8006
  }).catch(function (error) {
7811
- _this49.meetingFiniteStateMachine.fail(error);
8007
+ _this51.meetingFiniteStateMachine.fail(error);
7812
8008
  _loggerProxy.default.logger.error('Meeting:index#endMeetingForAll --> Failed to end meeting ', error);
7813
8009
  // upload logs on leave irrespective of meeting delete
7814
- _triggerProxy.default.trigger(_this49, {
8010
+ _triggerProxy.default.trigger(_this51, {
7815
8011
  file: 'meeting/index',
7816
8012
  function: 'endMeetingForAll'
7817
- }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this49);
8013
+ }, _constants.EVENTS.REQUEST_UPLOAD_LOGS, _this51);
7818
8014
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_END_ALL_FAILURE, {
7819
- correlation_id: _this49.correlationId,
7820
- locus_id: _this49.locusUrl.split('/').pop(),
8015
+ correlation_id: _this51.correlationId,
8016
+ locus_id: _this51.locusUrl.split('/').pop(),
7821
8017
  reason: error.message,
7822
8018
  stack: error.stack,
7823
8019
  code: error.code
@@ -7890,8 +8086,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7890
8086
  }, {
7891
8087
  key: "checkMediaConnection",
7892
8088
  value: function checkMediaConnection() {
7893
- var _this$mediaProperties42;
7894
- if ((_this$mediaProperties42 = this.mediaProperties) !== null && _this$mediaProperties42 !== void 0 && _this$mediaProperties42.webrtcMediaConnection) {
8089
+ var _this$mediaProperties35;
8090
+ if ((_this$mediaProperties35 = this.mediaProperties) !== null && _this$mediaProperties35 !== void 0 && _this$mediaProperties35.webrtcMediaConnection) {
7895
8091
  return;
7896
8092
  }
7897
8093
  throw new _webexErrors.NoMediaEstablishedYetError();
@@ -7938,7 +8134,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7938
8134
  }
7939
8135
  }, _callee34, this);
7940
8136
  }));
7941
- function enableMusicMode(_x33) {
8137
+ function enableMusicMode(_x36) {
7942
8138
  return _enableMusicMode.apply(this, arguments);
7943
8139
  }
7944
8140
  return enableMusicMode;
@@ -7951,15 +8147,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7951
8147
  }, {
7952
8148
  key: "updateTranscodedMediaConnection",
7953
8149
  value: function updateTranscodedMediaConnection() {
7954
- var _this$mediaProperties43,
7955
- _this$mediaProperties44,
7956
- _this$mediaProperties45,
7957
- _this$mediaProperties46,
7958
- _this$mediaProperties47,
7959
- _this$mediaProperties48,
7960
- _this$mediaProperties49,
7961
- _this$mediaProperties50,
7962
- _this50 = this;
8150
+ var _this$mediaProperties36,
8151
+ _this$mediaProperties37,
8152
+ _this$mediaProperties38,
8153
+ _this$mediaProperties39,
8154
+ _this$mediaProperties40,
8155
+ _this$mediaProperties41,
8156
+ _this$mediaProperties42,
8157
+ _this$mediaProperties43,
8158
+ _this52 = this;
7963
8159
  var LOG_HEADER = 'Meeting:index#updateTranscodedMediaConnection -->';
7964
8160
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " starting"));
7965
8161
  if (!this.canUpdateMedia()) {
@@ -7968,10 +8164,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7968
8164
  return this.mediaProperties.webrtcMediaConnection.update({
7969
8165
  // TODO: RoapMediaConnection is not ready to use stream classes yet, so we pass the raw MediaStreamTrack for now
7970
8166
  localTracks: {
7971
- audio: ((_this$mediaProperties43 = this.mediaProperties.audioStream) === null || _this$mediaProperties43 === void 0 ? void 0 : (_this$mediaProperties44 = _this$mediaProperties43.outputStream) === null || _this$mediaProperties44 === void 0 ? void 0 : _this$mediaProperties44.getTracks()[0]) || null,
7972
- video: ((_this$mediaProperties45 = this.mediaProperties.videoStream) === null || _this$mediaProperties45 === void 0 ? void 0 : (_this$mediaProperties46 = _this$mediaProperties45.outputStream) === null || _this$mediaProperties46 === void 0 ? void 0 : _this$mediaProperties46.getTracks()[0]) || null,
7973
- screenShareVideo: ((_this$mediaProperties47 = this.mediaProperties.shareVideoStream) === null || _this$mediaProperties47 === void 0 ? void 0 : (_this$mediaProperties48 = _this$mediaProperties47.outputStream) === null || _this$mediaProperties48 === void 0 ? void 0 : _this$mediaProperties48.getTracks()[0]) || null,
7974
- screenShareAudio: ((_this$mediaProperties49 = this.mediaProperties.shareAudioStream) === null || _this$mediaProperties49 === void 0 ? void 0 : (_this$mediaProperties50 = _this$mediaProperties49.outputStream) === null || _this$mediaProperties50 === void 0 ? void 0 : _this$mediaProperties50.getTracks()[0]) || null
8167
+ audio: ((_this$mediaProperties36 = this.mediaProperties.audioStream) === null || _this$mediaProperties36 === void 0 ? void 0 : (_this$mediaProperties37 = _this$mediaProperties36.outputStream) === null || _this$mediaProperties37 === void 0 ? void 0 : _this$mediaProperties37.getTracks()[0]) || null,
8168
+ video: ((_this$mediaProperties38 = this.mediaProperties.videoStream) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.outputStream) === null || _this$mediaProperties39 === void 0 ? void 0 : _this$mediaProperties39.getTracks()[0]) || null,
8169
+ screenShareVideo: ((_this$mediaProperties40 = this.mediaProperties.shareVideoStream) === null || _this$mediaProperties40 === void 0 ? void 0 : (_this$mediaProperties41 = _this$mediaProperties40.outputStream) === null || _this$mediaProperties41 === void 0 ? void 0 : _this$mediaProperties41.getTracks()[0]) || null,
8170
+ screenShareAudio: ((_this$mediaProperties42 = this.mediaProperties.shareAudioStream) === null || _this$mediaProperties42 === void 0 ? void 0 : (_this$mediaProperties43 = _this$mediaProperties42.outputStream) === null || _this$mediaProperties43 === void 0 ? void 0 : _this$mediaProperties43.getTracks()[0]) || null
7975
8171
  },
7976
8172
  direction: {
7977
8173
  audio: _media.default.getDirection(true, this.mediaProperties.mediaDirection.receiveAudio, this.mediaProperties.mediaDirection.sendAudio),
@@ -7984,8 +8180,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7984
8180
  }).catch(function (error) {
7985
8181
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " Error: "), error);
7986
8182
  _metrics.default.sendBehavioralMetric(_constants2.default.UPDATE_MEDIA_FAILURE, {
7987
- correlation_id: _this50.correlationId,
7988
- locus_id: _this50.locusUrl.split('/').pop(),
8183
+ correlation_id: _this52.correlationId,
8184
+ locus_id: _this52.locusUrl.split('/').pop(),
7989
8185
  reason: error.message,
7990
8186
  stack: error.stack
7991
8187
  });
@@ -8062,7 +8258,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8062
8258
  }
8063
8259
  }, _callee35, this);
8064
8260
  }));
8065
- function publishStream(_x34, _x35) {
8261
+ function publishStream(_x37, _x38) {
8066
8262
  return _publishStream.apply(this, arguments);
8067
8263
  }
8068
8264
  return publishStream;
@@ -8107,7 +8303,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8107
8303
  }
8108
8304
  }, _callee36, this);
8109
8305
  }));
8110
- function unpublishStream(_x36, _x37) {
8306
+ function unpublishStream(_x39, _x40) {
8111
8307
  return _unpublishStream.apply(this, arguments);
8112
8308
  }
8113
8309
  return unpublishStream;
@@ -8214,7 +8410,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8214
8410
  }
8215
8411
  }, _callee37, this);
8216
8412
  }));
8217
- function publishStreams(_x38) {
8413
+ function publishStreams(_x41) {
8218
8414
  return _publishStreams.apply(this, arguments);
8219
8415
  }
8220
8416
  return publishStreams;
@@ -8288,7 +8484,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
8288
8484
  }
8289
8485
  }, _callee38, this);
8290
8486
  }));
8291
- function unpublishStreams(_x39) {
8487
+ function unpublishStreams(_x42) {
8292
8488
  return _unpublishStreams.apply(this, arguments);
8293
8489
  }
8294
8490
  return unpublishStreams;