@webex/plugin-meetings 3.0.0-beta.1 → 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 +1116 -613
- 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} +961 -474
- 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
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
3
|
+
|
|
4
|
+
import {ROAP} from '../constants';
|
|
5
|
+
import LoggerProxy from '../common/logs/logger-proxy';
|
|
6
|
+
|
|
7
|
+
import RoapRequest from './request';
|
|
8
|
+
import TurnDiscovery from './turnDiscovery';
|
|
9
|
+
import Meeting from '../meeting';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Roap options
|
|
13
|
+
* @typedef {Object} RoapOptions
|
|
14
|
+
* @property {String} sdp
|
|
15
|
+
* @property {Meeting} meeting
|
|
16
|
+
* @property {Number} seq
|
|
17
|
+
* @property {Number} tieBreaker
|
|
18
|
+
* @property {Boolean} reconnect
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} SeqOptions
|
|
23
|
+
* @property {String} correlationId
|
|
24
|
+
* @property {String} mediaId
|
|
25
|
+
* @property {Number} seq
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @class Roap
|
|
30
|
+
* @export
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
export default class Roap extends StatelessWebexPlugin {
|
|
34
|
+
attrs: any;
|
|
35
|
+
lastRoapOffer: any;
|
|
36
|
+
options: any;
|
|
37
|
+
roapHandler: any;
|
|
38
|
+
roapRequest: any;
|
|
39
|
+
turnDiscovery: any;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} attrs
|
|
44
|
+
* @param {Object} options
|
|
45
|
+
*/
|
|
46
|
+
constructor(attrs: any, options: any) {
|
|
47
|
+
super({}, options);
|
|
48
|
+
/**
|
|
49
|
+
* @instance
|
|
50
|
+
* @type {Object}
|
|
51
|
+
* @private
|
|
52
|
+
* @memberof Roap
|
|
53
|
+
*/
|
|
54
|
+
this.attrs = attrs;
|
|
55
|
+
/**
|
|
56
|
+
* @instance
|
|
57
|
+
* @type {Object}
|
|
58
|
+
* @private
|
|
59
|
+
* @memberof Roap
|
|
60
|
+
*/
|
|
61
|
+
this.options = options;
|
|
62
|
+
/**
|
|
63
|
+
* The Roap Request Server Proxy Object
|
|
64
|
+
* @instance
|
|
65
|
+
* @type {RoapRequest}
|
|
66
|
+
* @private
|
|
67
|
+
* @memberof Roap
|
|
68
|
+
*/
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
this.roapRequest = new RoapRequest({}, options);
|
|
71
|
+
|
|
72
|
+
this.turnDiscovery = new TurnDiscovery(this.roapRequest);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @param {SeqOptions} options
|
|
78
|
+
* @returns {null}
|
|
79
|
+
* @memberof Roap
|
|
80
|
+
*/
|
|
81
|
+
public sendRoapOK(options: any) {
|
|
82
|
+
return Promise.resolve().then(() => {
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
85
|
+
const roapMessage = {
|
|
86
|
+
messageType: ROAP.ROAP_TYPES.OK,
|
|
87
|
+
version: ROAP.ROAP_VERSION,
|
|
88
|
+
seq: options.seq
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sending with seq ${options.seq}`);
|
|
92
|
+
|
|
93
|
+
return this.roapRequest
|
|
94
|
+
.sendRoap({
|
|
95
|
+
roapMessage,
|
|
96
|
+
locusSelfUrl: meeting.selfUrl,
|
|
97
|
+
mediaId: options.mediaId,
|
|
98
|
+
correlationId: options.correlationId,
|
|
99
|
+
audioMuted: meeting.isAudioMuted(),
|
|
100
|
+
videoMuted: meeting.isVideoMuted(),
|
|
101
|
+
meetingId: meeting.id,
|
|
102
|
+
preferTranscoding: !meeting.isMultistream,
|
|
103
|
+
})
|
|
104
|
+
.then(() => {
|
|
105
|
+
LoggerProxy.logger.log(`Roap:index#sendRoapOK --> ROAP OK sent with seq ${options.seq}`);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Sends a ROAP answer...
|
|
112
|
+
* @param {SeqOptions} options
|
|
113
|
+
* @param {Boolean} options.audioMuted
|
|
114
|
+
* @param {Boolean} options.videoMuted
|
|
115
|
+
* @returns {Promise}
|
|
116
|
+
* @memberof Roap
|
|
117
|
+
*/
|
|
118
|
+
public sendRoapAnswer(options: any) {
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
121
|
+
const roapMessage = {
|
|
122
|
+
messageType: ROAP.ROAP_TYPES.ANSWER,
|
|
123
|
+
sdps: [options.sdp],
|
|
124
|
+
version: ROAP.ROAP_VERSION,
|
|
125
|
+
seq: options.seq
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
return this.roapRequest
|
|
129
|
+
.sendRoap({
|
|
130
|
+
roapMessage,
|
|
131
|
+
locusSelfUrl: meeting.selfUrl,
|
|
132
|
+
mediaId: options.mediaId,
|
|
133
|
+
correlationId: options.correlationId,
|
|
134
|
+
audioMuted: meeting.isAudioMuted(),
|
|
135
|
+
videoMuted: meeting.isVideoMuted(),
|
|
136
|
+
meetingId: meeting.id,
|
|
137
|
+
preferTranscoding: !meeting.isMultistream,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Sends a ROAP error...
|
|
143
|
+
* @param {Object} options
|
|
144
|
+
* @returns {Promise}
|
|
145
|
+
* @memberof Roap
|
|
146
|
+
*/
|
|
147
|
+
sendRoapError(options) {
|
|
148
|
+
// @ts-ignore
|
|
149
|
+
const meeting = this.webex.meetings.meetingCollection.getByKey('correlationId', options.correlationId);
|
|
150
|
+
const roapMessage = {
|
|
151
|
+
messageType: ROAP.ROAP_TYPES.ERROR,
|
|
152
|
+
version: ROAP.ROAP_VERSION,
|
|
153
|
+
errorType: options.errorType,
|
|
154
|
+
seq: options.seq
|
|
155
|
+
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return this.roapRequest.sendRoap({
|
|
159
|
+
roapMessage,
|
|
160
|
+
locusSelfUrl: meeting.selfUrl,
|
|
161
|
+
mediaId: options.mediaId,
|
|
162
|
+
correlationId: options.correlationId,
|
|
163
|
+
audioMuted: meeting.isAudioMuted(),
|
|
164
|
+
videoMuted: meeting.isVideoMuted(),
|
|
165
|
+
meetingId: meeting.id,
|
|
166
|
+
preferTranscoding: !meeting.isMultistream,
|
|
167
|
+
})
|
|
168
|
+
.then(() => {
|
|
169
|
+
LoggerProxy.logger.log(`Roap:index#sendRoapError --> ROAP ERROR sent with seq ${options.seq}`);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* sends a roap media request
|
|
175
|
+
* @param {RoapOptions} options
|
|
176
|
+
* @returns {Promise}
|
|
177
|
+
* @memberof Roap
|
|
178
|
+
*/
|
|
179
|
+
sendRoapMediaRequest(options: any) {
|
|
180
|
+
const {
|
|
181
|
+
meeting, seq, sdp, reconnect, tieBreaker
|
|
182
|
+
} = options;
|
|
183
|
+
const roapMessage = {
|
|
184
|
+
messageType: ROAP.ROAP_TYPES.OFFER,
|
|
185
|
+
sdps: [sdp],
|
|
186
|
+
version: ROAP.ROAP_VERSION,
|
|
187
|
+
seq,
|
|
188
|
+
tieBreaker
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// When reconnecting, it's important that the first roap message being sent out has empty media id.
|
|
192
|
+
// Normally this is the roap offer, but when TURN discovery is enabled,
|
|
193
|
+
// then this is the TURN discovery request message
|
|
194
|
+
const sendEmptyMediaId = reconnect && !meeting.config.experimental.enableTurnDiscovery;
|
|
195
|
+
|
|
196
|
+
return this.roapRequest
|
|
197
|
+
.sendRoap({
|
|
198
|
+
roapMessage,
|
|
199
|
+
correlationId: meeting.correlationId,
|
|
200
|
+
locusSelfUrl: meeting.selfUrl,
|
|
201
|
+
mediaId: sendEmptyMediaId ? '' : meeting.mediaId,
|
|
202
|
+
audioMuted: meeting.isAudioMuted(),
|
|
203
|
+
videoMuted: meeting.isVideoMuted(),
|
|
204
|
+
meetingId: meeting.id,
|
|
205
|
+
preferTranscoding: !meeting.isMultistream,
|
|
206
|
+
})
|
|
207
|
+
.then(({locus, mediaConnections}) => {
|
|
208
|
+
if (mediaConnections) {
|
|
209
|
+
meeting.updateMediaConnections(mediaConnections);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return locus;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Performs a TURN server discovery procedure, which involves exchanging
|
|
218
|
+
* some roap messages with the server. This exchange has to be done before
|
|
219
|
+
* any other roap messages are sent
|
|
220
|
+
*
|
|
221
|
+
* @param {Meeting} meeting
|
|
222
|
+
* @param {Boolean} isReconnecting should be set to true if this is a new
|
|
223
|
+
* media connection just after a reconnection
|
|
224
|
+
* @returns {Promise}
|
|
225
|
+
*/
|
|
226
|
+
doTurnDiscovery(meeting: Meeting, isReconnecting: boolean) {
|
|
227
|
+
return this.turnDiscovery.doTurnDiscovery(meeting, isReconnecting);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
1
|
/* global window */
|
|
2
|
+
// @ts-ignore
|
|
3
3
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
4
4
|
|
|
5
5
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
6
6
|
import {
|
|
7
|
-
PARTICIPANT,
|
|
8
|
-
LOCI,
|
|
9
|
-
CALL,
|
|
10
7
|
MEDIA,
|
|
11
8
|
HTTP_VERBS,
|
|
12
9
|
REACHABILITY
|
|
13
10
|
} from '../constants';
|
|
14
11
|
import Metrics from '../metrics';
|
|
15
12
|
import {eventType} from '../metrics/config';
|
|
16
|
-
|
|
13
|
+
|
|
17
14
|
/**
|
|
18
15
|
* @class RoapRequest
|
|
19
16
|
*/
|
|
@@ -45,74 +42,6 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
45
42
|
return localSdp;
|
|
46
43
|
}
|
|
47
44
|
|
|
48
|
-
joinMeetingWithRoap(options) {
|
|
49
|
-
LoggerProxy.logger.info('Roap:request#joinMeetingWithRoap --> Join locus with roap');
|
|
50
|
-
LoggerProxy.logger.info(`Roap:request#joinMeetingWithRoap --> Local SDP: ${options.roapMessage}`);
|
|
51
|
-
|
|
52
|
-
return Promise.resolve().then(async () => {
|
|
53
|
-
const deviceUrl = this.webex.internal.device.url;
|
|
54
|
-
let url = '';
|
|
55
|
-
|
|
56
|
-
const body = {
|
|
57
|
-
deviceUrl,
|
|
58
|
-
usingResource: options.resourceId || null,
|
|
59
|
-
correlationId: options.correlationId,
|
|
60
|
-
localMedias: [
|
|
61
|
-
{
|
|
62
|
-
localSdp: JSON.stringify(this.attachRechabilityData({
|
|
63
|
-
roapMessage: options.roapMessage,
|
|
64
|
-
audioMuted: false,
|
|
65
|
-
videoMuted: false
|
|
66
|
-
}))
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
clientMediaPreferences: {
|
|
70
|
-
preferTranscoding: options.preferTranscoding ?? true
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
if (options.locusUrl) {
|
|
75
|
-
url = `${options.locusUrl}/${PARTICIPANT}`;
|
|
76
|
-
}
|
|
77
|
-
else if (options.sipUrl) {
|
|
78
|
-
try {
|
|
79
|
-
await this.webex.internal.services.waitForCatalog('postauth');
|
|
80
|
-
url = `${this.webex.internal.services.get('locus')}/${LOCI}/${CALL}`;
|
|
81
|
-
body.invitee = {
|
|
82
|
-
address: options.sipTarget
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
catch (e) {
|
|
86
|
-
LoggerProxy.logger.error(`Roap:request#joinMeetingWithRoap --> ${e}`);
|
|
87
|
-
throw (e);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
throw new ParameterError('Must provide a locusUrl or sipTarget');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return this.webex
|
|
95
|
-
.request({
|
|
96
|
-
method: HTTP_VERBS.POST,
|
|
97
|
-
uri: url,
|
|
98
|
-
body
|
|
99
|
-
})
|
|
100
|
-
.then((res) => {
|
|
101
|
-
const {locus} = res.body;
|
|
102
|
-
|
|
103
|
-
locus.roapSeq = options.roapMessage.seq;
|
|
104
|
-
locus.id = locus.url.split('/').pop();
|
|
105
|
-
LoggerProxy.logger.info(`Roap:request#joinMeetingWithRoap --> Joined locus [${locus.id}][${locus.fullState.lastActive}]`);
|
|
106
|
-
|
|
107
|
-
return locus;
|
|
108
|
-
})
|
|
109
|
-
.catch((err) => {
|
|
110
|
-
LoggerProxy.logger.error(`Roap:request#joinMeetingWithRoap --> failed with error: ${err}`);
|
|
111
|
-
throw err;
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
45
|
/**
|
|
117
46
|
* Sends a ROAP message
|
|
118
47
|
* @param {Object} options
|
|
@@ -125,7 +54,16 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
125
54
|
* @param {String} options.meetingId
|
|
126
55
|
* @returns {Promise} returns the response/failure of the request
|
|
127
56
|
*/
|
|
128
|
-
sendRoap(options
|
|
57
|
+
sendRoap(options: {
|
|
58
|
+
roapMessage: any;
|
|
59
|
+
locusSelfUrl: string;
|
|
60
|
+
mediaId: string;
|
|
61
|
+
correlationId: string;
|
|
62
|
+
audioMuted: boolean;
|
|
63
|
+
videoMuted: boolean;
|
|
64
|
+
meetingId: string;
|
|
65
|
+
preferTranscoding?: boolean;
|
|
66
|
+
}) {
|
|
129
67
|
const {
|
|
130
68
|
roapMessage, locusSelfUrl, mediaId, correlationId, meetingId
|
|
131
69
|
} = options;
|
|
@@ -135,12 +73,14 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
135
73
|
}
|
|
136
74
|
|
|
137
75
|
const mediaUrl = `${locusSelfUrl}/${MEDIA}`;
|
|
76
|
+
// @ts-ignore
|
|
138
77
|
const deviceUrl = this.webex.internal.device.url;
|
|
139
78
|
|
|
140
79
|
LoggerProxy.logger.info(`Roap:request#sendRoap --> ${mediaUrl} \n ${roapMessage.messageType} \n seq:${roapMessage.seq}`);
|
|
141
80
|
|
|
142
81
|
Metrics.postEvent({event: eventType.MEDIA_REQUEST, meetingId});
|
|
143
82
|
|
|
83
|
+
// @ts-ignore
|
|
144
84
|
return this.webex
|
|
145
85
|
.request({
|
|
146
86
|
uri: mediaUrl,
|
|
@@ -148,6 +88,7 @@ export default class RoapRequest extends StatelessWebexPlugin {
|
|
|
148
88
|
body: {
|
|
149
89
|
device: {
|
|
150
90
|
url: deviceUrl,
|
|
91
|
+
// @ts-ignore
|
|
151
92
|
deviceType: this.config.meetings.deviceType
|
|
152
93
|
},
|
|
153
94
|
correlationId,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-ignore - Types not available for @webex/common
|
|
1
2
|
import {Defer} from '@webex/common';
|
|
2
3
|
|
|
3
4
|
import Metrics from '../metrics';
|
|
@@ -6,9 +7,16 @@ import LoggerProxy from '../common/logs/logger-proxy';
|
|
|
6
7
|
import {ROAP} from '../constants';
|
|
7
8
|
|
|
8
9
|
import RoapRequest from './request';
|
|
10
|
+
import Meeting from '../meeting';
|
|
9
11
|
|
|
10
12
|
const TURN_DISCOVERY_TIMEOUT = 10; // in seconds
|
|
11
13
|
|
|
14
|
+
// Roap spec says that seq should start from 1, but TURN discovery works fine with seq=0
|
|
15
|
+
// and this is handy for us, because TURN discovery is always done before the first SDP exchange,
|
|
16
|
+
// so we can do it with seq=0 or not do it at all and then we create the RoapMediaConnection
|
|
17
|
+
// and do the SDP offer with seq=1
|
|
18
|
+
const TURN_DISCOVERY_SEQ = 0;
|
|
19
|
+
|
|
12
20
|
/**
|
|
13
21
|
* Handles the process of finding out TURN server information from Linus.
|
|
14
22
|
* This is achieved by sending a TURN_DISCOVERY_REQUEST.
|
|
@@ -48,7 +56,7 @@ export default class TurnDiscovery {
|
|
|
48
56
|
* @private
|
|
49
57
|
* @memberof Roap
|
|
50
58
|
*/
|
|
51
|
-
waitForTurnDiscoveryResponse() {
|
|
59
|
+
private waitForTurnDiscoveryResponse() {
|
|
52
60
|
if (!this.defer) {
|
|
53
61
|
LoggerProxy.logger.warn('Roap:turnDiscovery#waitForTurnDiscoveryResponse --> TURN discovery is not in progress');
|
|
54
62
|
|
|
@@ -76,7 +84,8 @@ export default class TurnDiscovery {
|
|
|
76
84
|
* @public
|
|
77
85
|
* @memberof Roap
|
|
78
86
|
*/
|
|
79
|
-
handleTurnDiscoveryResponse(roapMessage) {
|
|
87
|
+
public handleTurnDiscoveryResponse(roapMessage: object) {
|
|
88
|
+
// @ts-ignore - Fix missing type
|
|
80
89
|
const {headers} = roapMessage;
|
|
81
90
|
|
|
82
91
|
if (!this.defer) {
|
|
@@ -125,9 +134,7 @@ export default class TurnDiscovery {
|
|
|
125
134
|
* @private
|
|
126
135
|
* @memberof Roap
|
|
127
136
|
*/
|
|
128
|
-
sendRoapTurnDiscoveryRequest(meeting, isReconnecting) {
|
|
129
|
-
const seq = meeting.roapSeq + 1;
|
|
130
|
-
|
|
137
|
+
sendRoapTurnDiscoveryRequest(meeting: Meeting, isReconnecting: boolean) {
|
|
131
138
|
if (this.defer) {
|
|
132
139
|
LoggerProxy.logger.warn('Roap:turnDiscovery#sendRoapTurnDiscoveryRequest --> already in progress');
|
|
133
140
|
|
|
@@ -139,7 +146,7 @@ export default class TurnDiscovery {
|
|
|
139
146
|
const roapMessage = {
|
|
140
147
|
messageType: ROAP.ROAP_TYPES.TURN_DISCOVERY_REQUEST,
|
|
141
148
|
version: ROAP.ROAP_VERSION,
|
|
142
|
-
seq,
|
|
149
|
+
seq: TURN_DISCOVERY_SEQ,
|
|
143
150
|
};
|
|
144
151
|
|
|
145
152
|
LoggerProxy.logger.info('Roap:turnDiscovery#sendRoapTurnDiscoveryRequest --> sending TURN_DISCOVERY_REQUEST');
|
|
@@ -148,15 +155,15 @@ export default class TurnDiscovery {
|
|
|
148
155
|
.sendRoap({
|
|
149
156
|
roapMessage,
|
|
150
157
|
correlationId: meeting.correlationId,
|
|
158
|
+
// @ts-ignore - Fix missing type
|
|
151
159
|
locusSelfUrl: meeting.selfUrl,
|
|
160
|
+
// @ts-ignore - Fix missing type
|
|
152
161
|
mediaId: isReconnecting ? '' : meeting.mediaId,
|
|
153
162
|
audioMuted: meeting.isAudioMuted(),
|
|
154
163
|
videoMuted: meeting.isVideoMuted(),
|
|
155
164
|
meetingId: meeting.id
|
|
156
165
|
})
|
|
157
166
|
.then(({mediaConnections}) => {
|
|
158
|
-
meeting.setRoapSeq(seq);
|
|
159
|
-
|
|
160
167
|
if (mediaConnections) {
|
|
161
168
|
meeting.updateMediaConnections(mediaConnections);
|
|
162
169
|
}
|
|
@@ -170,16 +177,18 @@ export default class TurnDiscovery {
|
|
|
170
177
|
* @param {Meeting} meeting
|
|
171
178
|
* @returns {Promise}
|
|
172
179
|
*/
|
|
173
|
-
sendRoapOK(meeting) {
|
|
180
|
+
sendRoapOK(meeting: Meeting) {
|
|
174
181
|
LoggerProxy.logger.info('Roap:turnDiscovery#sendRoapOK --> sending OK');
|
|
175
182
|
|
|
176
183
|
return this.roapRequest.sendRoap({
|
|
177
184
|
roapMessage: {
|
|
178
185
|
messageType: ROAP.ROAP_TYPES.OK,
|
|
179
186
|
version: ROAP.ROAP_VERSION,
|
|
180
|
-
seq:
|
|
187
|
+
seq: TURN_DISCOVERY_SEQ,
|
|
181
188
|
},
|
|
189
|
+
// @ts-ignore - fix type
|
|
182
190
|
locusSelfUrl: meeting.selfUrl,
|
|
191
|
+
// @ts-ignore - fix type
|
|
183
192
|
mediaId: meeting.mediaId,
|
|
184
193
|
correlationId: meeting.correlationId,
|
|
185
194
|
audioMuted: meeting.isAudioMuted(),
|
|
@@ -196,12 +205,17 @@ export default class TurnDiscovery {
|
|
|
196
205
|
* | <----TURN_DISCOVERY_RESPONSE----- |
|
|
197
206
|
* | --------------OK----------------> |
|
|
198
207
|
*
|
|
208
|
+
* This TURN discovery roap exchange is always done with seq=0.
|
|
209
|
+
* The RoapMediaConnection SDP exchange always starts with seq=1,
|
|
210
|
+
* so it works fine no matter if TURN discovery is done or not.
|
|
211
|
+
*
|
|
199
212
|
* @param {Meeting} meeting
|
|
200
213
|
* @param {Boolean} isReconnecting should be set to true if this is a new
|
|
201
214
|
* media connection just after a reconnection
|
|
202
215
|
* @returns {Promise}
|
|
203
216
|
*/
|
|
204
|
-
doTurnDiscovery(meeting, isReconnecting) {
|
|
217
|
+
doTurnDiscovery(meeting: Meeting, isReconnecting: boolean) {
|
|
218
|
+
// @ts-ignore - fix type
|
|
205
219
|
const isAnyClusterReachable = meeting.webex.meetings.reachability.isAnyClusterReachable();
|
|
206
220
|
|
|
207
221
|
if (isAnyClusterReachable) {
|
|
@@ -209,6 +223,7 @@ export default class TurnDiscovery {
|
|
|
209
223
|
return Promise.resolve({turnServerInfo: undefined, turnDiscoverySkippedReason: 'reachability'});
|
|
210
224
|
}
|
|
211
225
|
|
|
226
|
+
// @ts-ignore - fix type
|
|
212
227
|
if (!meeting.config.experimental.enableTurnDiscovery) {
|
|
213
228
|
LoggerProxy.logger.info('Roap:turnDiscovery#doTurnDiscovery --> TURN discovery disabled in config, skipping it');
|
|
214
229
|
|
|
@@ -2,6 +2,7 @@ const STATS_DEFAULT = {
|
|
|
2
2
|
encryption: 'sha-256',
|
|
3
3
|
audio: {
|
|
4
4
|
send: {
|
|
5
|
+
trackLabel: '',
|
|
5
6
|
maxPacketLossRatio: 0,
|
|
6
7
|
availableBandwidth: 0,
|
|
7
8
|
bytesSent: 0,
|
|
@@ -17,6 +18,7 @@ const STATS_DEFAULT = {
|
|
|
17
18
|
},
|
|
18
19
|
video: {
|
|
19
20
|
send: {
|
|
21
|
+
trackLabel: '',
|
|
20
22
|
maxPacketLossRatio: 0,
|
|
21
23
|
availableBandwidth: 0,
|
|
22
24
|
meanRemoteJitter: [],
|