@webex/plugin-meetings 3.0.0-beta.0 → 3.0.0-beta.10
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.
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +5 -29
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +15 -74
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +4 -0
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +71 -210
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js +22 -0
- package/dist/media/internal-media-core-wrapper.js.map +1 -0
- package/dist/media/properties.js +32 -25
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +0 -27
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +1130 -647
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +5 -44
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +136 -25
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +24 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +82 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +133 -0
- package/dist/multistream/mediaRequestManager.js.map +1 -0
- package/dist/multistream/multistreamMedia.js +116 -0
- package/dist/multistream/multistreamMedia.js.map +1 -0
- package/dist/multistream/receiveSlot.js +209 -0
- package/dist/multistream/receiveSlot.js.map +1 -0
- package/dist/multistream/receiveSlotManager.js +195 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -0
- package/dist/multistream/remoteMedia.js +289 -0
- package/dist/multistream/remoteMedia.js.map +1 -0
- package/dist/multistream/remoteMediaGroup.js +243 -0
- package/dist/multistream/remoteMediaGroup.js.map +1 -0
- package/dist/multistream/remoteMediaManager.js +1113 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -0
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +130 -132
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +58 -231
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -116
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +20 -6
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +2 -0
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +58 -37
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +21 -20
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -20
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +2 -0
- package/src/constants.ts +139 -179
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +7 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +130 -205
- package/src/media/internal-media-core-wrapper.ts +9 -0
- package/src/media/{properties.js → properties.ts} +35 -29
- package/src/media/util.ts +16 -0
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +1016 -550
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +125 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +9 -51
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +118 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +28 -5
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +94 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/multistream/mediaRequestManager.ts +166 -0
- package/src/multistream/multistreamMedia.ts +92 -0
- package/src/multistream/receiveSlot.ts +141 -0
- package/src/multistream/receiveSlotManager.ts +142 -0
- package/src/multistream/remoteMedia.ts +228 -0
- package/src/multistream/remoteMediaGroup.ts +224 -0
- package/src/multistream/remoteMediaManager.ts +911 -0
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reconnection-manager/{index.js → index.ts} +81 -65
- package/src/roap/index.ts +229 -0
- package/src/roap/{request.js → request.ts} +15 -74
- package/src/roap/turnDiscovery.ts +26 -11
- package/src/statsAnalyzer/{global.js → global.ts} +2 -0
- package/src/statsAnalyzer/{index.js → index.ts} +66 -61
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/journey.js +1 -1
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +17 -1
- package/test/unit/spec/media/index.ts +207 -0
- package/test/unit/spec/media/properties.ts +73 -82
- package/test/unit/spec/meeting/effectsState.js +1 -3
- package/test/unit/spec/meeting/index.js +585 -245
- package/test/unit/spec/meeting/muteState.js +7 -0
- package/test/unit/spec/meeting/utils.js +63 -2
- package/test/unit/spec/meetings/index.js +0 -4
- package/test/unit/spec/members/index.js +164 -2
- package/test/unit/spec/multistream/mediaRequestManager.ts +515 -0
- package/test/unit/spec/multistream/receiveSlot.ts +104 -0
- package/test/unit/spec/multistream/receiveSlotManager.ts +173 -0
- package/test/unit/spec/multistream/remoteMedia.ts +225 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +396 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +1309 -0
- package/test/unit/spec/reconnection-manager/index.js +68 -2
- package/test/unit/spec/roap/index.ts +63 -35
- package/test/unit/spec/stats-analyzer/index.js +19 -22
- package/dist/peer-connection-manager/index.js +0 -794
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -124
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/roap/collection.js +0 -73
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -337
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/state.js +0 -164
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/util.js +0 -102
- package/dist/roap/util.js.map +0 -1
- package/src/media/util.js +0 -38
- package/src/peer-connection-manager/index.js +0 -723
- package/src/peer-connection-manager/util.ts +0 -117
- package/src/roap/collection.js +0 -63
- package/src/roap/handler.js +0 -252
- package/src/roap/index.js +0 -380
- package/src/roap/state.js +0 -149
- package/src/roap/util.js +0 -93
- package/test/unit/spec/peerconnection-manager/index.js +0 -188
- package/test/unit/spec/peerconnection-manager/utils.js +0 -48
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
- package/test/unit/spec/roap/util.js +0 -30
package/dist/roap/index.js
CHANGED
|
@@ -12,12 +12,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
12
12
|
|
|
13
13
|
exports.default = void 0;
|
|
14
14
|
|
|
15
|
-
var _isNan = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/number/is-nan"));
|
|
16
|
-
|
|
17
|
-
var _parseFloat2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-float"));
|
|
18
|
-
|
|
19
|
-
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
|
|
20
|
-
|
|
21
15
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
|
|
22
16
|
|
|
23
17
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
@@ -40,14 +34,8 @@ var _constants = require("../constants");
|
|
|
40
34
|
|
|
41
35
|
var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
|
|
42
36
|
|
|
43
|
-
var _util = _interopRequireDefault(require("../meeting/util"));
|
|
44
|
-
|
|
45
|
-
var _handler = _interopRequireDefault(require("./handler"));
|
|
46
|
-
|
|
47
37
|
var _request = _interopRequireDefault(require("./request"));
|
|
48
38
|
|
|
49
|
-
var _collection = _interopRequireDefault(require("./collection"));
|
|
50
|
-
|
|
51
39
|
var _turnDiscovery = _interopRequireDefault(require("./turnDiscovery"));
|
|
52
40
|
|
|
53
41
|
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); }; }
|
|
@@ -59,8 +47,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_R
|
|
|
59
47
|
* @typedef {Object} RoapOptions
|
|
60
48
|
* @property {String} sdp
|
|
61
49
|
* @property {Meeting} meeting
|
|
62
|
-
* @property {Number}
|
|
63
|
-
* @property {
|
|
50
|
+
* @property {Number} seq
|
|
51
|
+
* @property {Number} tieBreaker
|
|
52
|
+
* @property {Boolean} reconnect
|
|
64
53
|
*/
|
|
65
54
|
|
|
66
55
|
/**
|
|
@@ -85,11 +74,11 @@ var Roap = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
85
74
|
* @param {Object} attrs
|
|
86
75
|
* @param {Object} options
|
|
87
76
|
*/
|
|
88
|
-
function Roap(attrs,
|
|
77
|
+
function Roap(attrs, options) {
|
|
89
78
|
var _this;
|
|
90
79
|
|
|
91
80
|
(0, _classCallCheck2.default)(this, Roap);
|
|
92
|
-
_this = _super.call(this, {},
|
|
81
|
+
_this = _super.call(this, {}, options);
|
|
93
82
|
/**
|
|
94
83
|
* @instance
|
|
95
84
|
* @type {Object}
|
|
@@ -97,51 +86,12 @@ var Roap = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
97
86
|
* @memberof Roap
|
|
98
87
|
*/
|
|
99
88
|
|
|
100
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
seq: typeof options.roapSeq !== 'number' && (0, _isNan.default)((0, _parseFloat2.default)(options.roapSeq)) ? 0 : options.roapSeq + 1,
|
|
107
|
-
tieBreaker: 4294967294 // Math.floor(Math.random() * (2 ** 32) - 1) // TODO: Handle the roap conflict scenario
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
_this.roapHandler.submit({
|
|
112
|
-
type: _constants.ROAP.SEND_ROAP_MSG,
|
|
113
|
-
msg: roapMessage,
|
|
114
|
-
correlationId: meeting.correlationId
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
var roapBody = {
|
|
118
|
-
localMedias: [{
|
|
119
|
-
localSdp: (0, _stringify.default)(_this.roapRequest.attachRechabilityData({
|
|
120
|
-
roapMessage: roapMessage,
|
|
121
|
-
// eslint-disable-next-line no-warning-comments
|
|
122
|
-
// TODO: check whats the need for video and audiomute
|
|
123
|
-
audioMuted: !!meeting.isAudioMuted(),
|
|
124
|
-
videoMuted: !!meeting.isVideoMuted()
|
|
125
|
-
})) // mediaId: meeting.mediaId
|
|
126
|
-
|
|
127
|
-
}]
|
|
128
|
-
};
|
|
129
|
-
return _util.default.joinMeetingOptions(meeting, {
|
|
130
|
-
roapMessage: roapBody
|
|
131
|
-
}).then(function (locus) {
|
|
132
|
-
_this.roapHandler.submit({
|
|
133
|
-
type: _constants.ROAP.SEND_ROAP_MSG_SUCCESS,
|
|
134
|
-
seq: roapMessage.seq,
|
|
135
|
-
correlationId: meeting.correlationId
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
meeting.setRoapSeq(roapMessage.seq); // eslint-disable-next-line no-warning-comments
|
|
139
|
-
// TODO: we need to attach peerconenction to locus not sure if we need to pass everything here
|
|
140
|
-
|
|
141
|
-
return locus; // eslint-disable-next-line no-warning-comments
|
|
142
|
-
// TODO: check where to update the sequence number
|
|
143
|
-
});
|
|
144
|
-
});
|
|
89
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "attrs", void 0);
|
|
90
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "lastRoapOffer", void 0);
|
|
91
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "options", void 0);
|
|
92
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roapHandler", void 0);
|
|
93
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "roapRequest", void 0);
|
|
94
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "turnDiscovery", void 0);
|
|
145
95
|
_this.attrs = attrs;
|
|
146
96
|
/**
|
|
147
97
|
* @instance
|
|
@@ -150,16 +100,7 @@ var Roap = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
150
100
|
* @memberof Roap
|
|
151
101
|
*/
|
|
152
102
|
|
|
153
|
-
_this.options =
|
|
154
|
-
/**
|
|
155
|
-
* The Roap Process State Handler
|
|
156
|
-
* @instance
|
|
157
|
-
* @type {RoapHandler}
|
|
158
|
-
* @private
|
|
159
|
-
* @memberof Roap
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
_this.roapHandler = new _handler.default(_this.attrs, _this.options, _this.sendRoapOK.bind((0, _assertThisInitialized2.default)(_this)), _this.sendRoapAnswer.bind((0, _assertThisInitialized2.default)(_this)), _this.roapFinished.bind((0, _assertThisInitialized2.default)(_this)));
|
|
103
|
+
_this.options = options;
|
|
163
104
|
/**
|
|
164
105
|
* The Roap Request Server Proxy Object
|
|
165
106
|
* @instance
|
|
@@ -167,82 +108,27 @@ var Roap = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
167
108
|
* @private
|
|
168
109
|
* @memberof Roap
|
|
169
110
|
*/
|
|
111
|
+
// @ts-ignore
|
|
170
112
|
|
|
171
|
-
_this.roapRequest = new _request.default({},
|
|
172
|
-
/**
|
|
173
|
-
* The last roap offer sent to server and acked
|
|
174
|
-
* @instance
|
|
175
|
-
* @type {Object}
|
|
176
|
-
* @private
|
|
177
|
-
* @memberof Roap
|
|
178
|
-
*/
|
|
179
|
-
|
|
180
|
-
_this.lastRoapOffer = {};
|
|
113
|
+
_this.roapRequest = new _request.default({}, options);
|
|
181
114
|
_this.turnDiscovery = new _turnDiscovery.default(_this.roapRequest);
|
|
182
115
|
return _this;
|
|
183
116
|
}
|
|
184
117
|
/**
|
|
185
|
-
*
|
|
186
|
-
* @param {
|
|
187
|
-
* @returns {
|
|
188
|
-
* @private
|
|
118
|
+
*
|
|
119
|
+
* @param {SeqOptions} options
|
|
120
|
+
* @returns {null}
|
|
189
121
|
* @memberof Roap
|
|
190
122
|
*/
|
|
191
123
|
|
|
192
124
|
|
|
193
125
|
(0, _createClass2.default)(Roap, [{
|
|
194
|
-
key: "roapEvent",
|
|
195
|
-
value: function roapEvent(data) {
|
|
196
|
-
var msg = data.message;
|
|
197
|
-
var correlationId = data.correlationId;
|
|
198
|
-
|
|
199
|
-
_loggerProxy.default.logger.log("Roap:index#roapEvent --> Received Roap Message [".concat((0, _stringify.default)(msg, null, 2), "]"));
|
|
200
|
-
|
|
201
|
-
if (msg.messageType === _constants.ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {
|
|
202
|
-
// turn discovery is not part of normal roap protocol and so we are not handling it
|
|
203
|
-
// through the usual roap state machine
|
|
204
|
-
this.turnDiscovery.handleTurnDiscoveryResponse(msg);
|
|
205
|
-
} else {
|
|
206
|
-
this.roapHandler.submit({
|
|
207
|
-
type: _constants.ROAP.RECEIVE_ROAP_MSG,
|
|
208
|
-
msg: msg,
|
|
209
|
-
correlationId: correlationId
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
*
|
|
215
|
-
* @param {String} correlationId correlation id of a meeting
|
|
216
|
-
* @param {Number} seq ROAP sequence number
|
|
217
|
-
* @returns {Promise}
|
|
218
|
-
* @private
|
|
219
|
-
* @memberof Roap
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
}, {
|
|
223
|
-
key: "stop",
|
|
224
|
-
value: function stop(correlationId, seq) {
|
|
225
|
-
this.roapHandler.submit({
|
|
226
|
-
type: _constants.ROAP.RECEIVE_CALL_LEAVE,
|
|
227
|
-
seq: seq,
|
|
228
|
-
correlationId: correlationId
|
|
229
|
-
});
|
|
230
|
-
return _promise.default.resolve();
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
*
|
|
234
|
-
* @param {SeqOptions} options
|
|
235
|
-
* @returns {null}
|
|
236
|
-
* @private
|
|
237
|
-
* @memberof Roap
|
|
238
|
-
*/
|
|
239
|
-
|
|
240
|
-
}, {
|
|
241
126
|
key: "sendRoapOK",
|
|
242
127
|
value: function sendRoapOK(options) {
|
|
243
128
|
var _this2 = this;
|
|
244
129
|
|
|
245
130
|
return _promise.default.resolve().then(function () {
|
|
131
|
+
// @ts-ignore
|
|
246
132
|
var meeting = _this2.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
247
133
|
|
|
248
134
|
var roapMessage = {
|
|
@@ -260,117 +146,97 @@ var Roap = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
260
146
|
correlationId: options.correlationId,
|
|
261
147
|
audioMuted: meeting.isAudioMuted(),
|
|
262
148
|
videoMuted: meeting.isVideoMuted(),
|
|
263
|
-
meetingId: meeting.id
|
|
149
|
+
meetingId: meeting.id,
|
|
150
|
+
preferTranscoding: !meeting.isMultistream
|
|
264
151
|
}).then(function () {
|
|
265
|
-
_this2.roapHandler.submit({
|
|
266
|
-
type: _constants.ROAP.SEND_ROAP_MSG,
|
|
267
|
-
msg: roapMessage,
|
|
268
|
-
correlationId: options.correlationId
|
|
269
|
-
});
|
|
270
|
-
|
|
271
152
|
_loggerProxy.default.logger.log("Roap:index#sendRoapOK --> ROAP OK sent with seq ".concat(options.seq));
|
|
272
|
-
|
|
273
|
-
meeting.setRoapSeq(options.seq);
|
|
274
153
|
});
|
|
275
154
|
});
|
|
276
|
-
}
|
|
277
|
-
// TODO: try to merge sendRoapOk and roapAnswer
|
|
278
|
-
|
|
155
|
+
}
|
|
279
156
|
/**
|
|
280
157
|
* Sends a ROAP answer...
|
|
281
158
|
* @param {SeqOptions} options
|
|
282
159
|
* @param {Boolean} options.audioMuted
|
|
283
160
|
* @param {Boolean} options.videoMuted
|
|
284
161
|
* @returns {Promise}
|
|
285
|
-
* @private
|
|
286
162
|
* @memberof Roap
|
|
287
163
|
*/
|
|
288
164
|
|
|
289
165
|
}, {
|
|
290
166
|
key: "sendRoapAnswer",
|
|
291
167
|
value: function sendRoapAnswer(options) {
|
|
292
|
-
|
|
293
|
-
|
|
168
|
+
// @ts-ignore
|
|
294
169
|
var meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
295
170
|
var roapMessage = {
|
|
296
171
|
messageType: _constants.ROAP.ROAP_TYPES.ANSWER,
|
|
297
|
-
sdps: options.
|
|
172
|
+
sdps: [options.sdp],
|
|
298
173
|
version: _constants.ROAP.ROAP_VERSION,
|
|
299
174
|
seq: options.seq
|
|
300
175
|
};
|
|
301
|
-
this.roapHandler.submit({
|
|
302
|
-
type: _constants.ROAP.SEND_ROAP_MSG,
|
|
303
|
-
msg: roapMessage,
|
|
304
|
-
correlationId: options.correlationId
|
|
305
|
-
});
|
|
306
176
|
return this.roapRequest.sendRoap({
|
|
307
177
|
roapMessage: roapMessage,
|
|
308
178
|
locusSelfUrl: meeting.selfUrl,
|
|
309
179
|
mediaId: options.mediaId,
|
|
310
180
|
correlationId: options.correlationId,
|
|
311
|
-
audioMuted:
|
|
312
|
-
videoMuted:
|
|
313
|
-
meetingId: meeting.id
|
|
314
|
-
|
|
315
|
-
meeting.setRoapSeq(options.seq);
|
|
316
|
-
|
|
317
|
-
_this3.roapHandler.submit({
|
|
318
|
-
type: _constants.ROAP.SEND_ROAP_MSG_SUCCESS,
|
|
319
|
-
seq: roapMessage.seq,
|
|
320
|
-
correlationId: meeting.correlationId
|
|
321
|
-
});
|
|
181
|
+
audioMuted: meeting.isAudioMuted(),
|
|
182
|
+
videoMuted: meeting.isVideoMuted(),
|
|
183
|
+
meetingId: meeting.id,
|
|
184
|
+
preferTranscoding: !meeting.isMultistream
|
|
322
185
|
});
|
|
323
186
|
}
|
|
324
187
|
/**
|
|
325
188
|
* Sends a ROAP error...
|
|
326
|
-
* @param {Object}
|
|
327
|
-
* @param {Object} locus
|
|
328
|
-
* @param {String} errorType
|
|
189
|
+
* @param {Object} options
|
|
329
190
|
* @returns {Promise}
|
|
330
|
-
* @private
|
|
331
191
|
* @memberof Roap
|
|
332
192
|
*/
|
|
333
193
|
|
|
334
194
|
}, {
|
|
335
195
|
key: "sendRoapError",
|
|
336
|
-
value: function sendRoapError(
|
|
337
|
-
|
|
196
|
+
value: function sendRoapError(options) {
|
|
197
|
+
// @ts-ignore
|
|
198
|
+
var meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
199
|
+
var roapMessage = {
|
|
338
200
|
messageType: _constants.ROAP.ROAP_TYPES.ERROR,
|
|
339
201
|
version: _constants.ROAP.ROAP_VERSION,
|
|
340
|
-
errorType: errorType,
|
|
341
|
-
seq:
|
|
202
|
+
errorType: options.errorType,
|
|
203
|
+
seq: options.seq
|
|
342
204
|
};
|
|
343
|
-
return this.roapRequest.sendRoap(
|
|
205
|
+
return this.roapRequest.sendRoap({
|
|
206
|
+
roapMessage: roapMessage,
|
|
207
|
+
locusSelfUrl: meeting.selfUrl,
|
|
208
|
+
mediaId: options.mediaId,
|
|
209
|
+
correlationId: options.correlationId,
|
|
210
|
+
audioMuted: meeting.isAudioMuted(),
|
|
211
|
+
videoMuted: meeting.isVideoMuted(),
|
|
212
|
+
meetingId: meeting.id,
|
|
213
|
+
preferTranscoding: !meeting.isMultistream
|
|
214
|
+
}).then(function () {
|
|
215
|
+
_loggerProxy.default.logger.log("Roap:index#sendRoapError --> ROAP ERROR sent with seq ".concat(options.seq));
|
|
216
|
+
});
|
|
344
217
|
}
|
|
345
218
|
/**
|
|
346
219
|
* sends a roap media request
|
|
347
220
|
* @param {RoapOptions} options
|
|
348
221
|
* @returns {Promise}
|
|
349
|
-
* @private
|
|
350
222
|
* @memberof Roap
|
|
351
223
|
*/
|
|
352
224
|
|
|
353
225
|
}, {
|
|
354
226
|
key: "sendRoapMediaRequest",
|
|
355
227
|
value: function sendRoapMediaRequest(options) {
|
|
356
|
-
var _this4 = this;
|
|
357
|
-
|
|
358
228
|
var meeting = options.meeting,
|
|
359
|
-
|
|
229
|
+
seq = options.seq,
|
|
230
|
+
sdp = options.sdp,
|
|
231
|
+
reconnect = options.reconnect,
|
|
232
|
+
tieBreaker = options.tieBreaker;
|
|
360
233
|
var roapMessage = {
|
|
361
234
|
messageType: _constants.ROAP.ROAP_TYPES.OFFER,
|
|
362
|
-
sdps: [
|
|
363
|
-
// sdps: [options.sdp],
|
|
235
|
+
sdps: [sdp],
|
|
364
236
|
version: _constants.ROAP.ROAP_VERSION,
|
|
365
|
-
seq:
|
|
366
|
-
tieBreaker:
|
|
367
|
-
|
|
368
|
-
};
|
|
369
|
-
this.roapHandler.submit({
|
|
370
|
-
type: _constants.ROAP.SEND_ROAP_MSG,
|
|
371
|
-
msg: roapMessage,
|
|
372
|
-
correlationId: meeting.correlationId
|
|
373
|
-
}); // When reconnecting, it's important that the first roap message being sent out has empty media id.
|
|
237
|
+
seq: seq,
|
|
238
|
+
tieBreaker: tieBreaker
|
|
239
|
+
}; // When reconnecting, it's important that the first roap message being sent out has empty media id.
|
|
374
240
|
// Normally this is the roap offer, but when TURN discovery is enabled,
|
|
375
241
|
// then this is the TURN discovery request message
|
|
376
242
|
|
|
@@ -382,58 +248,19 @@ var Roap = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
382
248
|
mediaId: sendEmptyMediaId ? '' : meeting.mediaId,
|
|
383
249
|
audioMuted: meeting.isAudioMuted(),
|
|
384
250
|
videoMuted: meeting.isVideoMuted(),
|
|
385
|
-
meetingId: meeting.id
|
|
251
|
+
meetingId: meeting.id,
|
|
252
|
+
preferTranscoding: !meeting.isMultistream
|
|
386
253
|
}).then(function (_ref) {
|
|
387
254
|
var locus = _ref.locus,
|
|
388
255
|
mediaConnections = _ref.mediaConnections;
|
|
389
256
|
|
|
390
|
-
_this4.roapHandler.submit({
|
|
391
|
-
type: _constants.ROAP.SEND_ROAP_MSG_SUCCESS,
|
|
392
|
-
seq: roapMessage.seq,
|
|
393
|
-
correlationId: meeting.correlationId
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
meeting.setRoapSeq(roapMessage.seq);
|
|
397
|
-
|
|
398
257
|
if (mediaConnections) {
|
|
399
258
|
meeting.updateMediaConnections(mediaConnections);
|
|
400
|
-
}
|
|
401
|
-
// TODO: we need to attach peerconenction to locus not sure if we need to pass everything here
|
|
259
|
+
}
|
|
402
260
|
|
|
403
|
-
|
|
404
|
-
return locus; // eslint-disable-next-line no-warning-comments
|
|
405
|
-
// TODO: check where to update the sequence number
|
|
261
|
+
return locus;
|
|
406
262
|
});
|
|
407
263
|
}
|
|
408
|
-
/**
|
|
409
|
-
* sends a roap media request
|
|
410
|
-
* @param {RoapOptions} options
|
|
411
|
-
* @returns {Promise}
|
|
412
|
-
* @private
|
|
413
|
-
* @memberof Roap
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
}, {
|
|
417
|
-
key: "roapFinished",
|
|
418
|
-
value:
|
|
419
|
-
/**
|
|
420
|
-
* Called when the roap sequence is finished (completed successfully or failed)
|
|
421
|
-
* @param {String} correlationId id of the meeting affected
|
|
422
|
-
* @param {String} sequenceId the id of the finished sequence
|
|
423
|
-
* @returns {undefined}
|
|
424
|
-
* @private
|
|
425
|
-
* @memberof Roap
|
|
426
|
-
*/
|
|
427
|
-
function roapFinished(correlationId, sequenceId) {
|
|
428
|
-
_collection.default.onSessionSequenceFinish(correlationId, sequenceId);
|
|
429
|
-
|
|
430
|
-
var meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', correlationId);
|
|
431
|
-
meeting.mediaNegotiatedEvent();
|
|
432
|
-
|
|
433
|
-
if (!_collection.default.isBusy(correlationId)) {
|
|
434
|
-
meeting.processNextQueuedMediaUpdate();
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
264
|
/**
|
|
438
265
|
* Performs a TURN server discovery procedure, which involves exchanging
|
|
439
266
|
* some roap messages with the server. This exchange has to be done before
|
package/dist/roap/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Roap","attrs","options","meeting","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","sdps","sdp","version","ROAP_VERSION","seq","roapSeq","tieBreaker","roapHandler","submit","type","SEND_ROAP_MSG","msg","correlationId","roapBody","localMedias","localSdp","roapRequest","attachRechabilityData","audioMuted","isAudioMuted","videoMuted","isVideoMuted","MeetingUtil","joinMeetingOptions","then","locus","SEND_ROAP_MSG_SUCCESS","setRoapSeq","RoapHandler","sendRoapOK","bind","sendRoapAnswer","roapFinished","RoapRequest","lastRoapOffer","turnDiscovery","TurnDiscovery","data","message","LoggerProxy","logger","log","TURN_DISCOVERY_RESPONSE","handleTurnDiscoveryResponse","RECEIVE_ROAP_MSG","RECEIVE_CALL_LEAVE","resolve","webex","meetings","meetingCollection","getByKey","OK","sendRoap","locusSelfUrl","selfUrl","mediaId","meetingId","id","ANSWER","session","errorType","ERROR","reconnect","sendEmptyMediaId","config","experimental","enableTurnDiscovery","mediaConnections","updateMediaConnections","sequenceId","RoapCollection","onSessionSequenceFinish","mediaNegotiatedEvent","isBusy","processNextQueuedMediaUpdate","isReconnecting","doTurnDiscovery","StatelessWebexPlugin"],"sources":["index.js"],"sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport MeetingUtil from '../meeting/util';\n\nimport RoapHandler from './handler';\nimport RoapRequest from './request';\nimport RoapCollection from './collection';\nimport TurnDiscovery from './turnDiscovery';\n\n/**\n * Roap options\n * @typedef {Object} RoapOptions\n * @property {String} sdp\n * @property {Meeting} meeting\n * @property {Number} roapSeq\n * @property {Boolean} reconnect\n */\n\n/**\n * @typedef {Object} SeqOptions\n * @property {String} correlationId\n * @property {String} mediaId\n * @property {Number} seq\n */\n\n/**\n * @class Roap\n * @export\n * @private\n */\nexport default class Roap extends StatelessWebexPlugin {\n /**\n *\n * @param {Object} attrs\n * @param {Object} options\n */\n constructor(attrs, options) {\n super({}, options);\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof Roap\n */\n this.attrs = attrs;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof Roap\n */\n this.options = options;\n /**\n * The Roap Process State Handler\n * @instance\n * @type {RoapHandler}\n * @private\n * @memberof Roap\n */\n this.roapHandler = new RoapHandler(this.attrs, this.options, this.sendRoapOK.bind(this), this.sendRoapAnswer.bind(this), this.roapFinished.bind(this));\n /**\n * The Roap Request Server Proxy Object\n * @instance\n * @type {RoapRequest}\n * @private\n * @memberof Roap\n */\n this.roapRequest = new RoapRequest({}, options);\n /**\n * The last roap offer sent to server and acked\n * @instance\n * @type {Object}\n * @private\n * @memberof Roap\n */\n this.lastRoapOffer = {};\n\n this.turnDiscovery = new TurnDiscovery(this.roapRequest);\n }\n\n /**\n * Starts listening to mercury events for Roap messages\n * @param {object} data event object\n * @returns {Promise}\n * @private\n * @memberof Roap\n */\n roapEvent(data) {\n const msg = data.message;\n const {correlationId} = data;\n\n LoggerProxy.logger.log(`Roap:index#roapEvent --> Received Roap Message [${JSON.stringify(msg, null, 2)}]`);\n\n if (msg.messageType === ROAP.ROAP_TYPES.TURN_DISCOVERY_RESPONSE) {\n // turn discovery is not part of normal roap protocol and so we are not handling it\n // through the usual roap state machine\n this.turnDiscovery.handleTurnDiscoveryResponse(msg);\n }\n else {\n this.roapHandler.submit({\n type: ROAP.RECEIVE_ROAP_MSG,\n msg,\n correlationId\n });\n }\n }\n\n /**\n *\n * @param {String} correlationId correlation id of a meeting\n * @param {Number} seq ROAP sequence number\n * @returns {Promise}\n * @private\n * @memberof Roap\n */\n stop(correlationId, seq) {\n this.roapHandler.submit({\n type: ROAP.RECEIVE_CALL_LEAVE,\n seq,\n correlationId\n });\n\n return Promise.resolve();\n }\n\n /**\n *\n * @param {SeqOptions} options\n * @returns {null}\n * @private\n * @memberof Roap\n */\n sendRoapOK(options) {\n return Promise.resolve().then(() => {\n const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.OK,\n version: ROAP.ROAP_VERSION,\n seq: options.seq\n };\n\n LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sending with seq ${options.seq}`);\n\n return this.roapRequest\n .sendRoap({\n roapMessage,\n locusSelfUrl: meeting.selfUrl,\n mediaId: options.mediaId,\n correlationId: options.correlationId,\n audioMuted: meeting.isAudioMuted(),\n videoMuted: meeting.isVideoMuted(),\n meetingId: meeting.id\n })\n .then(() => {\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG,\n msg: roapMessage,\n correlationId: options.correlationId\n });\n LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sent with seq ${options.seq}`);\n meeting.setRoapSeq(options.seq);\n });\n });\n }\n\n // eslint-disable-next-line no-warning-comments\n // TODO: try to merge sendRoapOk and roapAnswer\n /**\n * Sends a ROAP answer...\n * @param {SeqOptions} options\n * @param {Boolean} options.audioMuted\n * @param {Boolean} options.videoMuted\n * @returns {Promise}\n * @private\n * @memberof Roap\n */\n sendRoapAnswer(options) {\n const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.ANSWER,\n sdps: options.sdps,\n version: ROAP.ROAP_VERSION,\n seq: options.seq\n };\n\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG,\n msg: roapMessage,\n correlationId: options.correlationId\n });\n\n return this.roapRequest\n .sendRoap({\n roapMessage,\n locusSelfUrl: meeting.selfUrl,\n mediaId: options.mediaId,\n correlationId: options.correlationId,\n audioMuted: options.audioMuted,\n videoMuted: options.videoMuted,\n meetingId: meeting.id\n })\n .then(() => {\n meeting.setRoapSeq(options.seq);\n\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG_SUCCESS,\n seq: roapMessage.seq,\n correlationId: meeting.correlationId\n });\n });\n }\n\n /**\n * Sends a ROAP error...\n * @param {Object} session\n * @param {Object} locus\n * @param {String} errorType\n * @returns {Promise}\n * @private\n * @memberof Roap\n */\n sendRoapError(session, locus, errorType) {\n const msg = {\n messageType: ROAP.ROAP_TYPES.ERROR,\n version: ROAP.ROAP_VERSION,\n errorType,\n seq: session.OFFER.seq\n };\n\n return this.roapRequest.sendRoap(msg, locus);\n }\n\n /**\n * sends a roap media request\n * @param {RoapOptions} options\n * @returns {Promise}\n * @private\n * @memberof Roap\n */\n sendRoapMediaRequest(options) {\n const {meeting, reconnect} = options;\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.OFFER,\n sdps: [options.sdp],\n // sdps: [options.sdp],\n version: ROAP.ROAP_VERSION,\n seq: typeof options.roapSeq !== 'number' && Number.isNaN(parseFloat(options.roapSeq)) ? 0 : options.roapSeq + 1,\n tieBreaker: 4294967294 // Math.floor(Math.random() * (2 ** 32) - 1) // TODO: Handle the roap conflict scenario\n };\n\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG,\n msg: roapMessage,\n correlationId: meeting.correlationId\n });\n\n // When reconnecting, it's important that the first roap message being sent out has empty media id.\n // Normally this is the roap offer, but when TURN discovery is enabled,\n // then this is the TURN discovery request message\n const sendEmptyMediaId = reconnect && !meeting.config.experimental.enableTurnDiscovery;\n\n return this.roapRequest\n .sendRoap({\n roapMessage,\n correlationId: meeting.correlationId,\n locusSelfUrl: meeting.selfUrl,\n mediaId: sendEmptyMediaId ? '' : meeting.mediaId,\n audioMuted: meeting.isAudioMuted(),\n videoMuted: meeting.isVideoMuted(),\n meetingId: meeting.id\n })\n .then(({locus, mediaConnections}) => {\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG_SUCCESS,\n seq: roapMessage.seq,\n correlationId: meeting.correlationId\n });\n meeting.setRoapSeq(roapMessage.seq);\n\n if (mediaConnections) {\n meeting.updateMediaConnections(mediaConnections);\n }\n\n // eslint-disable-next-line no-warning-comments\n // TODO: we need to attach peerconenction to locus not sure if we need to pass everything here\n return locus;\n // eslint-disable-next-line no-warning-comments\n // TODO: check where to update the sequence number\n });\n }\n\n /**\n * sends a roap media request\n * @param {RoapOptions} options\n * @returns {Promise}\n * @private\n * @memberof Roap\n */\n sendRoapCallRequest = (options) => {\n const {meeting} = options;\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.OFFER,\n sdps: [options.sdp],\n version: ROAP.ROAP_VERSION,\n seq: typeof options.roapSeq !== 'number' && Number.isNaN(parseFloat(options.roapSeq)) ? 0 : options.roapSeq + 1,\n tieBreaker: 4294967294 // Math.floor(Math.random() * (2 ** 32) - 1) // TODO: Handle the roap conflict scenario\n };\n\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG,\n msg: roapMessage,\n correlationId: meeting.correlationId\n });\n\n const roapBody = {\n localMedias: [\n {\n localSdp: JSON.stringify(this.roapRequest.attachRechabilityData({\n roapMessage,\n // eslint-disable-next-line no-warning-comments\n // TODO: check whats the need for video and audiomute\n audioMuted: !!meeting.isAudioMuted(),\n videoMuted: !!meeting.isVideoMuted()\n }))\n // mediaId: meeting.mediaId\n }\n ]\n };\n\n return MeetingUtil.joinMeetingOptions(meeting, {roapMessage: roapBody})\n .then((locus) => {\n this.roapHandler.submit({\n type: ROAP.SEND_ROAP_MSG_SUCCESS,\n seq: roapMessage.seq,\n correlationId: meeting.correlationId\n });\n meeting.setRoapSeq(roapMessage.seq);\n\n // eslint-disable-next-line no-warning-comments\n // TODO: we need to attach peerconenction to locus not sure if we need to pass everything here\n return locus;\n // eslint-disable-next-line no-warning-comments\n // TODO: check where to update the sequence number\n });\n };\n\n /**\n * Called when the roap sequence is finished (completed successfully or failed)\n * @param {String} correlationId id of the meeting affected\n * @param {String} sequenceId the id of the finished sequence\n * @returns {undefined}\n * @private\n * @memberof Roap\n */\n roapFinished(correlationId, sequenceId) {\n RoapCollection.onSessionSequenceFinish(correlationId, sequenceId);\n const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', correlationId);\n\n meeting.mediaNegotiatedEvent();\n if (!RoapCollection.isBusy(correlationId)) {\n meeting.processNextQueuedMediaUpdate();\n }\n }\n\n /**\n * Performs a TURN server discovery procedure, which involves exchanging\n * some roap messages with the server. This exchange has to be done before\n * any other roap messages are sent\n *\n * @param {Meeting} meeting\n * @param {Boolean} isReconnecting should be set to true if this is a new\n * media connection just after a reconnection\n * @returns {Promise}\n */\n doTurnDiscovery(meeting, isReconnecting) {\n return this.turnDiscovery.doTurnDiscovery(meeting, isReconnecting);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;IACqBA,I;;;;;EACnB;AACF;AACA;AACA;AACA;EAC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ACiC,UAAR,CAAmBhC,WAAW,CAACS,GAA/B;;QAEA,IAAI+D,gBAAJ,EAAsB;UACpBzE,OAAO,CAAC0E,sBAAR,CAA+BD,gBAA/B;QACD,CAVkC,CAYnC;QACA;;;QACA,OAAO1C,KAAP,CAdmC,CAenC;QACA;MACD,CA3BI,CAAP;IA4BD;IAED;AACF;AACA;AACA;AACA;AACA;AACA;;;;;IAiDE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;IACE,sBAAab,aAAb,EAA4ByD,UAA5B,EAAwC;MACtCC,mBAAA,CAAeC,uBAAf,CAAuC3D,aAAvC,EAAsDyD,UAAtD;;MACA,IAAM3E,OAAO,GAAG,KAAKqD,KAAL,CAAWC,QAAX,CAAoBC,iBAApB,CAAsCC,QAAtC,CAA+C,eAA/C,EAAgEtC,aAAhE,CAAhB;MAEAlB,OAAO,CAAC8E,oBAAR;;MACA,IAAI,CAACF,mBAAA,CAAeG,MAAf,CAAsB7D,aAAtB,CAAL,EAA2C;QACzClB,OAAO,CAACgF,4BAAR;MACD;IACF;IAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACE,yBAAgBhF,OAAhB,EAAyBiF,cAAzB,EAAyC;MACvC,OAAO,KAAKxC,aAAL,CAAmByC,eAAnB,CAAmClF,OAAnC,EAA4CiF,cAA5C,CAAP;IACD;;;EA1V+BE,+B"}
|
|
1
|
+
{"version":3,"names":["Roap","attrs","options","roapRequest","RoapRequest","turnDiscovery","TurnDiscovery","resolve","then","meeting","webex","meetings","meetingCollection","getByKey","correlationId","roapMessage","messageType","ROAP","ROAP_TYPES","OK","version","ROAP_VERSION","seq","LoggerProxy","logger","log","sendRoap","locusSelfUrl","selfUrl","mediaId","audioMuted","isAudioMuted","videoMuted","isVideoMuted","meetingId","id","preferTranscoding","isMultistream","ANSWER","sdps","sdp","ERROR","errorType","reconnect","tieBreaker","OFFER","sendEmptyMediaId","config","experimental","enableTurnDiscovery","locus","mediaConnections","updateMediaConnections","isReconnecting","doTurnDiscovery","StatelessWebexPlugin"],"sources":["index.ts"],"sourcesContent":["// @ts-ignore\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport RoapRequest from './request';\nimport TurnDiscovery from './turnDiscovery';\nimport Meeting from '../meeting';\n\n/**\n * Roap options\n * @typedef {Object} RoapOptions\n * @property {String} sdp\n * @property {Meeting} meeting\n * @property {Number} seq\n * @property {Number} tieBreaker\n * @property {Boolean} reconnect\n */\n\n/**\n * @typedef {Object} SeqOptions\n * @property {String} correlationId\n * @property {String} mediaId\n * @property {Number} seq\n */\n\n/**\n * @class Roap\n * @export\n * @private\n */\nexport default class Roap extends StatelessWebexPlugin {\n attrs: any;\n lastRoapOffer: any;\n options: any;\n roapHandler: any;\n roapRequest: any;\n turnDiscovery: any;\n\n /**\n *\n * @param {Object} attrs\n * @param {Object} options\n */\n constructor(attrs: any, options: any) {\n super({}, options);\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof Roap\n */\n this.attrs = attrs;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof Roap\n */\n this.options = options;\n /**\n * The Roap Request Server Proxy Object\n * @instance\n * @type {RoapRequest}\n * @private\n * @memberof Roap\n */\n // @ts-ignore\n this.roapRequest = new RoapRequest({}, options);\n\n this.turnDiscovery = new TurnDiscovery(this.roapRequest);\n }\n\n /**\n *\n * @param {SeqOptions} options\n * @returns {null}\n * @memberof Roap\n */\n public sendRoapOK(options: any) {\n return Promise.resolve().then(() => {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.OK,\n version: ROAP.ROAP_VERSION,\n seq: options.seq\n };\n\n LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sending with seq ${options.seq}`);\n\n return this.roapRequest\n .sendRoap({\n roapMessage,\n locusSelfUrl: meeting.selfUrl,\n mediaId: options.mediaId,\n correlationId: options.correlationId,\n audioMuted: meeting.isAudioMuted(),\n videoMuted: meeting.isVideoMuted(),\n meetingId: meeting.id,\n preferTranscoding: !meeting.isMultistream,\n })\n .then(() => {\n LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sent with seq ${options.seq}`);\n });\n });\n }\n\n /**\n * Sends a ROAP answer...\n * @param {SeqOptions} options\n * @param {Boolean} options.audioMuted\n * @param {Boolean} options.videoMuted\n * @returns {Promise}\n * @memberof Roap\n */\n public sendRoapAnswer(options: any) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.ANSWER,\n sdps: [options.sdp],\n version: ROAP.ROAP_VERSION,\n seq: options.seq\n };\n\n return this.roapRequest\n .sendRoap({\n roapMessage,\n locusSelfUrl: meeting.selfUrl,\n mediaId: options.mediaId,\n correlationId: options.correlationId,\n audioMuted: meeting.isAudioMuted(),\n videoMuted: meeting.isVideoMuted(),\n meetingId: meeting.id,\n preferTranscoding: !meeting.isMultistream,\n });\n }\n\n /**\n * Sends a ROAP error...\n * @param {Object} options\n * @returns {Promise}\n * @memberof Roap\n */\n sendRoapError(options) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.ERROR,\n version: ROAP.ROAP_VERSION,\n errorType: options.errorType,\n seq: options.seq\n\n };\n\n return this.roapRequest.sendRoap({\n roapMessage,\n locusSelfUrl: meeting.selfUrl,\n mediaId: options.mediaId,\n correlationId: options.correlationId,\n audioMuted: meeting.isAudioMuted(),\n videoMuted: meeting.isVideoMuted(),\n meetingId: meeting.id,\n preferTranscoding: !meeting.isMultistream,\n })\n .then(() => {\n LoggerProxy.logger.log(`Roap:index#sendRoapError --> ROAP ERROR sent with seq ${options.seq}`);\n });\n }\n\n /**\n * sends a roap media request\n * @param {RoapOptions} options\n * @returns {Promise}\n * @memberof Roap\n */\n sendRoapMediaRequest(options: any) {\n const {\n meeting, seq, sdp, reconnect, tieBreaker\n } = options;\n const roapMessage = {\n messageType: ROAP.ROAP_TYPES.OFFER,\n sdps: [sdp],\n version: ROAP.ROAP_VERSION,\n seq,\n tieBreaker\n };\n\n // When reconnecting, it's important that the first roap message being sent out has empty media id.\n // Normally this is the roap offer, but when TURN discovery is enabled,\n // then this is the TURN discovery request message\n const sendEmptyMediaId = reconnect && !meeting.config.experimental.enableTurnDiscovery;\n\n return this.roapRequest\n .sendRoap({\n roapMessage,\n correlationId: meeting.correlationId,\n locusSelfUrl: meeting.selfUrl,\n mediaId: sendEmptyMediaId ? '' : meeting.mediaId,\n audioMuted: meeting.isAudioMuted(),\n videoMuted: meeting.isVideoMuted(),\n meetingId: meeting.id,\n preferTranscoding: !meeting.isMultistream,\n })\n .then(({locus, mediaConnections}) => {\n if (mediaConnections) {\n meeting.updateMediaConnections(mediaConnections);\n }\n\n return locus;\n });\n }\n\n /**\n * Performs a TURN server discovery procedure, which involves exchanging\n * some roap messages with the server. This exchange has to be done before\n * any other roap messages are sent\n *\n * @param {Meeting} meeting\n * @param {Boolean} isReconnecting should be set to true if this is a new\n * media connection just after a reconnection\n * @returns {Promise}\n */\n doTurnDiscovery(meeting: Meeting, isReconnecting: boolean) {\n return this.turnDiscovery.doTurnDiscovery(meeting, isReconnecting);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;AAEA;;AACA;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;IACqBA,I;;;;;EAQnB;AACF;AACA;AACA;AACA;EACE,cAAYC,KAAZ,EAAwBC,OAAxB,EAAsC;IAAA;;IAAA;IACpC,0BAAM,EAAN,EAAUA,OAAV;IACA;AACJ;AACA;AACA;AACA;AACA;;IAPwC;IAAA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