@webex/plugin-meetings 1.151.6 → 1.153.0
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/errors/captcha-error.js +64 -0
- package/dist/common/errors/captcha-error.js.map +1 -0
- package/dist/common/errors/password-error.js +64 -0
- package/dist/common/errors/password-error.js.map +1 -0
- package/dist/config.js +2 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +33 -1
- package/dist/constants.js.map +1 -1
- package/dist/meeting/index.js +674 -433
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/request.js +59 -32
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +12 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +142 -8
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +12 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +47 -19
- package/dist/meetings/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +10 -1
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/package.json +5 -5
- package/src/common/errors/captcha-error.js +21 -0
- package/src/common/errors/password-error.js +21 -0
- package/src/config.js +2 -1
- package/src/constants.js +24 -0
- package/src/meeting/index.js +180 -5
- package/src/meeting/request.js +27 -0
- package/src/meeting/util.js +15 -4
- package/src/meeting-info/meeting-info-v2.js +67 -3
- package/src/meeting-info/utilv2.js +12 -1
- package/src/meetings/index.js +27 -8
- package/src/peer-connection-manager/index.js +13 -2
- package/test/unit/spec/meeting/index.js +304 -2
- package/test/unit/spec/meeting-info/meetinginfov2.js +74 -1
- package/test/unit/spec/meetings/index.js +29 -0
- package/test/unit/spec/peerconnection-manager/index.js +66 -0
package/src/meeting/index.js
CHANGED
|
@@ -29,12 +29,15 @@ import WebRTCStats from '../stats/index';
|
|
|
29
29
|
import StatsMetrics from '../stats/metrics';
|
|
30
30
|
import StatsUtil from '../stats/util';
|
|
31
31
|
import Transcription from '../transcription';
|
|
32
|
+
import PasswordError from '../common/errors/password-error';
|
|
33
|
+
import CaptchaError from '../common/errors/captcha-error';
|
|
32
34
|
import ReconnectionError from '../common/errors/reconnection';
|
|
33
35
|
import ReconnectInProgress from '../common/errors/reconnection-in-progress';
|
|
34
36
|
import {
|
|
35
37
|
_CALL_,
|
|
36
38
|
_INCOMING_,
|
|
37
39
|
_JOIN_,
|
|
40
|
+
_SIP_URI_,
|
|
38
41
|
AUDIO,
|
|
39
42
|
CONNECTION_STATE,
|
|
40
43
|
CONTENT,
|
|
@@ -47,6 +50,7 @@ import {
|
|
|
47
50
|
LAYOUT_TYPES,
|
|
48
51
|
LIVE,
|
|
49
52
|
LOCUSINFO,
|
|
53
|
+
MEETING_INFO_FAILURE_REASON,
|
|
50
54
|
MEETING_REMOVED_REASON,
|
|
51
55
|
MEETING_STATE_MACHINE,
|
|
52
56
|
MEETING_STATE,
|
|
@@ -57,6 +61,7 @@ import {
|
|
|
57
61
|
NETWORK_STATUS,
|
|
58
62
|
ONLINE,
|
|
59
63
|
OFFLINE,
|
|
64
|
+
PASSWORD_STATUS,
|
|
60
65
|
PC_BAIL_TIMEOUT,
|
|
61
66
|
PSTN_STATUS,
|
|
62
67
|
QUALITY_LEVELS,
|
|
@@ -73,6 +78,7 @@ import {
|
|
|
73
78
|
} from '../constants';
|
|
74
79
|
import ParameterError from '../common/errors/parameter';
|
|
75
80
|
import MediaError from '../common/errors/media';
|
|
81
|
+
import {MeetingInfoV2PasswordError, MeetingInfoV2CaptchaError} from '../meeting-info/meeting-info-v2';
|
|
76
82
|
import MQAProcessor from '../metrics/mqa-processor';
|
|
77
83
|
import BrowserDetection from '../common/browser-detection';
|
|
78
84
|
import RoapCollection from '../roap/collection';
|
|
@@ -846,8 +852,173 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
846
852
|
*/
|
|
847
853
|
this.transcription = undefined;
|
|
848
854
|
|
|
855
|
+
/**
|
|
856
|
+
* Password status. If it's PASSWORD_STATUS.REQUIRED then verifyPassword() needs to be called
|
|
857
|
+
* with the correct password before calling join()
|
|
858
|
+
* @instance
|
|
859
|
+
* @type {PASSWORD_STATUS}
|
|
860
|
+
* @public
|
|
861
|
+
* @memberof Meeting
|
|
862
|
+
*/
|
|
863
|
+
this.passwordStatus = PASSWORD_STATUS.UNKNOWN;
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Information about required captcha. If null, then no captcha is required. status. If it's PASSWORD_STATUS.REQUIRED then verifyPassword() needs to be called
|
|
867
|
+
* with the correct password before calling join()
|
|
868
|
+
* @instance
|
|
869
|
+
* @type {Object}
|
|
870
|
+
* @property {string} captchaId captcha id
|
|
871
|
+
* @property {string} verificationImageURL Url of the captcha image
|
|
872
|
+
* @property {string} verificationAudioURL Url of the captcha audio file
|
|
873
|
+
* @property {string} refreshURL Url used for refreshing the captcha (don't use it directly, call refreshCaptcha() instead)
|
|
874
|
+
* @public
|
|
875
|
+
* @memberof Meeting
|
|
876
|
+
*/
|
|
877
|
+
this.requiredCaptcha = null;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Indicates the reason for last failure to obtain meeting.meetingInfo. MEETING_INFO_FAILURE_REASON.NONE if meeting info was
|
|
881
|
+
* retrieved successfully
|
|
882
|
+
* @instance
|
|
883
|
+
* @type {MEETING_INFO_FAILURE_REASON}
|
|
884
|
+
* @private
|
|
885
|
+
* @memberof Meeting
|
|
886
|
+
*/
|
|
887
|
+
this.meetingInfoFailureReason = undefined;
|
|
888
|
+
|
|
849
889
|
this.setUpLocusInfoListeners();
|
|
850
890
|
this.locusInfo.init(attrs.locus ? attrs.locus : {});
|
|
891
|
+
this.isCreated = true;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Fetches meeting information.
|
|
896
|
+
* @param {Object} options
|
|
897
|
+
* @param {String} options.destination
|
|
898
|
+
* @param {String} options.type
|
|
899
|
+
* @private
|
|
900
|
+
* @memberof Meeting
|
|
901
|
+
* @returns {Promise}
|
|
902
|
+
*/
|
|
903
|
+
async fetchMeetingInfo({
|
|
904
|
+
destination, type, password = null, captchaCode = null
|
|
905
|
+
}) {
|
|
906
|
+
if (captchaCode && !this.requiredCaptcha) {
|
|
907
|
+
return Promise.reject(new Error('fetchMeetingInfo() called with captchaCode when captcha was not required'));
|
|
908
|
+
}
|
|
909
|
+
if (password && (this.passwordStatus !== PASSWORD_STATUS.REQUIRED && this.passwordStatus !== PASSWORD_STATUS.UNKNOWN)) {
|
|
910
|
+
return Promise.reject(new Error('fetchMeetingInfo() called with password when password was not required'));
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
try {
|
|
914
|
+
const captchaInfo = captchaCode ? {code: captchaCode, id: this.requiredCaptcha.captchaId} : null;
|
|
915
|
+
|
|
916
|
+
const info = await this.attrs.meetingInfoProvider.fetchMeetingInfo(destination, type, password, captchaInfo);
|
|
917
|
+
|
|
918
|
+
this.parseMeetingInfo(info);
|
|
919
|
+
this.meetingInfo = info ? info.body : null;
|
|
920
|
+
this.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.NONE;
|
|
921
|
+
this.requiredCaptcha = null;
|
|
922
|
+
if ((this.passwordStatus === PASSWORD_STATUS.REQUIRED) || (this.passwordStatus === PASSWORD_STATUS.VERIFIED)) {
|
|
923
|
+
this.passwordStatus = PASSWORD_STATUS.VERIFIED;
|
|
924
|
+
}
|
|
925
|
+
else {
|
|
926
|
+
this.passwordStatus = PASSWORD_STATUS.NOT_REQUIRED;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
return Promise.resolve();
|
|
930
|
+
}
|
|
931
|
+
catch (err) {
|
|
932
|
+
if (err instanceof MeetingInfoV2PasswordError) {
|
|
933
|
+
LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${destination} - password required (code=${err?.body?.code}).`);
|
|
934
|
+
|
|
935
|
+
// when wbxappapi requires password it still populates partial meeting info in the response
|
|
936
|
+
if (err.meetingInfo) {
|
|
937
|
+
this.meetingInfo = err.meetingInfo;
|
|
938
|
+
this.meetingNumber = err.meetingInfo.meetingNumber;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
this.passwordStatus = PASSWORD_STATUS.REQUIRED;
|
|
942
|
+
this.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD;
|
|
943
|
+
if (this.requiredCaptcha) {
|
|
944
|
+
// this is a workaround for captcha service bug, see WEBEX-224862
|
|
945
|
+
await this.refreshCaptcha();
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
throw (new PasswordError());
|
|
949
|
+
}
|
|
950
|
+
else if (err instanceof MeetingInfoV2CaptchaError) {
|
|
951
|
+
LoggerProxy.logger.info(`Meeting:index#fetchMeetingInfo --> Info Unable to fetch meeting info for ${destination} - captcha required (code=${err?.body?.code}).`);
|
|
952
|
+
|
|
953
|
+
this.meetingInfoFailureReason = (this.requiredCaptcha) ?
|
|
954
|
+
MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA :
|
|
955
|
+
MEETING_INFO_FAILURE_REASON.WRONG_PASSWORD;
|
|
956
|
+
|
|
957
|
+
if (err.isPasswordRequired) {
|
|
958
|
+
this.passwordStatus = PASSWORD_STATUS.REQUIRED;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
this.requiredCaptcha = err.captchaInfo;
|
|
962
|
+
throw (new CaptchaError());
|
|
963
|
+
}
|
|
964
|
+
else {
|
|
965
|
+
this.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.OTHER;
|
|
966
|
+
throw (err);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Checks if the supplied password/host key is correct. It returns a promise with information whether the
|
|
973
|
+
* password and captcha code were correct or not.
|
|
974
|
+
* @param {String} password - this can be either a password or a host key, can be undefined if only captcha was required
|
|
975
|
+
* @param {String} captchaCode - can be undefined if captcha was not required by the server
|
|
976
|
+
* @public
|
|
977
|
+
* @memberof Meeting
|
|
978
|
+
* @returns {Promise<{isPasswordValid: boolean, requiredCaptcha: boolean, failureReason: MEETING_INFO_FAILURE_REASON}>}
|
|
979
|
+
*/
|
|
980
|
+
verifyPassword(password, captchaCode) {
|
|
981
|
+
return this.fetchMeetingInfo({
|
|
982
|
+
destination: this.sipUri, type: _SIP_URI_, password, captchaCode
|
|
983
|
+
})
|
|
984
|
+
.then(() => ({isPasswordValid: true, requiredCaptcha: null, failureReason: MEETING_INFO_FAILURE_REASON.NONE}))
|
|
985
|
+
.catch((error) => {
|
|
986
|
+
if (error instanceof PasswordError || error instanceof CaptchaError) {
|
|
987
|
+
return {
|
|
988
|
+
isPasswordValid: this.passwordStatus === PASSWORD_STATUS.VERIFIED,
|
|
989
|
+
requiredCaptcha: this.requiredCaptcha,
|
|
990
|
+
failureReason: this.meetingInfoFailureReason
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
throw (error);
|
|
994
|
+
});
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Refreshes the captcha. As a result the meeting will have new captcha id, image and audio.
|
|
999
|
+
* If the refresh operation fails, meeting remains with the old captcha properties.
|
|
1000
|
+
* @public
|
|
1001
|
+
* @memberof Meeting
|
|
1002
|
+
* @returns {Promise}
|
|
1003
|
+
*/
|
|
1004
|
+
refreshCaptcha() {
|
|
1005
|
+
if (!this.requiredCaptcha) {
|
|
1006
|
+
return Promise.reject(new Error('There is no captcha to refresh'));
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
// in order to get fully populated uris for captcha audio and image in response to refresh captcha request
|
|
1010
|
+
// we have to pass the wbxappapi hostname as the siteFullName parameter
|
|
1011
|
+
const {hostname} = new URL(this.requiredCaptcha.refreshURL);
|
|
1012
|
+
|
|
1013
|
+
return this.meetingRequest.refreshCaptcha({
|
|
1014
|
+
captchaRefreshUrl: `${this.requiredCaptcha.refreshURL}&siteFullName=${hostname}`,
|
|
1015
|
+
captchaId: this.requiredCaptcha.captchaId
|
|
1016
|
+
})
|
|
1017
|
+
.then((response) => {
|
|
1018
|
+
this.requiredCaptcha.captchaId = response.body.captchaID;
|
|
1019
|
+
this.requiredCaptcha.verificationImageURL = response.body.verificationImageURL;
|
|
1020
|
+
this.requiredCaptcha.verificationAudioURL = response.body.verificationAudioURL;
|
|
1021
|
+
});
|
|
851
1022
|
}
|
|
852
1023
|
|
|
853
1024
|
/**
|
|
@@ -3325,11 +3496,15 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
3325
3496
|
joinSuccess = resolve;
|
|
3326
3497
|
});
|
|
3327
3498
|
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3499
|
+
if (this.isCreated) {
|
|
3500
|
+
this.isCreated = false;
|
|
3501
|
+
}
|
|
3502
|
+
else {
|
|
3503
|
+
LoggerProxy.logger.log(`Meeting:index#join --> Generating a new correlation id for meeting ${this.id}`);
|
|
3504
|
+
LoggerProxy.logger.log(`Meeting:index#join --> Previous correlation id ${this.correlationId}`);
|
|
3505
|
+
this.setCorrelationId(uuid.v4());
|
|
3506
|
+
LoggerProxy.logger.log(`Meeting:index#join --> New correlation id ${this.correlationId}`);
|
|
3507
|
+
}
|
|
3333
3508
|
|
|
3334
3509
|
if (options.rejoin) {
|
|
3335
3510
|
this.meetingFiniteStateMachine.reset();
|
package/src/meeting/request.js
CHANGED
|
@@ -140,6 +140,33 @@ export default class MeetingRequest extends StatelessWebexPlugin {
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Send a request to refresh the captcha
|
|
145
|
+
* @param {Object} options
|
|
146
|
+
* @param {String} options.captchaRefreshUrl
|
|
147
|
+
* @param {String} options.captchaId
|
|
148
|
+
* @returns {Promise}
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
refreshCaptcha({
|
|
152
|
+
captchaRefreshUrl,
|
|
153
|
+
captchaId
|
|
154
|
+
}) {
|
|
155
|
+
const body = {
|
|
156
|
+
captchaId
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
return this.request({
|
|
160
|
+
method: HTTP_VERBS.POST,
|
|
161
|
+
uri: captchaRefreshUrl,
|
|
162
|
+
body
|
|
163
|
+
}).catch((err) => {
|
|
164
|
+
LoggerProxy.logger.error(`Meeting:request#refreshCaptcha --> Error: ${err}`);
|
|
165
|
+
|
|
166
|
+
throw err;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
143
170
|
/**
|
|
144
171
|
* Make a network request to add a dial in device
|
|
145
172
|
* @param {Object} options
|
package/src/meeting/util.js
CHANGED
|
@@ -7,19 +7,23 @@ import {eventType, trigger, mediaType} from '../metrics/config';
|
|
|
7
7
|
import Media from '../media';
|
|
8
8
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
9
9
|
import WebRTCStats from '../stats/index';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
INTENT_TO_JOIN,
|
|
11
12
|
_LEFT_,
|
|
12
13
|
_IDLE_,
|
|
13
14
|
_JOINED_,
|
|
14
15
|
STATS,
|
|
15
|
-
EVENT_TRIGGERS
|
|
16
|
-
,
|
|
16
|
+
EVENT_TRIGGERS,
|
|
17
|
+
FULL_STATE,
|
|
18
|
+
PASSWORD_STATUS
|
|
19
|
+
} from '../constants';
|
|
17
20
|
import Trigger from '../common/events/trigger-proxy';
|
|
18
21
|
import IntentToJoinError from '../common/errors/intent-to-join';
|
|
19
22
|
import JoinMeetingError from '../common/errors/join-meeting';
|
|
20
23
|
import ParameterError from '../common/errors/parameter';
|
|
21
24
|
import PermissionError from '../common/errors/permission';
|
|
22
|
-
|
|
25
|
+
import PasswordError from '../common/errors/password-error';
|
|
26
|
+
import CaptchaError from '../common/errors/captcha-error';
|
|
23
27
|
|
|
24
28
|
const MeetingUtil = {};
|
|
25
29
|
|
|
@@ -240,6 +244,13 @@ MeetingUtil.isMediaEstablished = (currentMediaStatus) =>
|
|
|
240
244
|
MeetingUtil.joinMeetingOptions = (meeting, options = {}) => {
|
|
241
245
|
meeting.resourceId = meeting.resourceId || options.resourceId;
|
|
242
246
|
|
|
247
|
+
if (meeting.requiredCaptcha) {
|
|
248
|
+
return Promise.reject(new CaptchaError());
|
|
249
|
+
}
|
|
250
|
+
if (meeting.passwordStatus === PASSWORD_STATUS.REQUIRED) {
|
|
251
|
+
return Promise.reject(new PasswordError());
|
|
252
|
+
}
|
|
253
|
+
|
|
243
254
|
if (options.pin) {
|
|
244
255
|
Metrics.postEvent({
|
|
245
256
|
event: eventType.PIN_COLLECTED,
|
|
@@ -3,6 +3,52 @@ import {HTTP_VERBS} from '../constants';
|
|
|
3
3
|
|
|
4
4
|
import MeetingInfoUtil from './utilv2';
|
|
5
5
|
|
|
6
|
+
const PASSWORD_ERROR_DEFAULT_MESSAGE = 'Password required. Call fetchMeetingInfo() with password argument';
|
|
7
|
+
const CAPTCHA_ERROR_DEFAULT_MESSAGE = 'Captcha required. Call fetchMeetingInfo() with captchaInfo argument';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Error to indicate that wbxappapi requires a password
|
|
11
|
+
*/
|
|
12
|
+
export class MeetingInfoV2PasswordError extends Error {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @constructor
|
|
16
|
+
* @param {Number} [wbxAppApiErrorCode]
|
|
17
|
+
* @param {Object} [meetingInfo]
|
|
18
|
+
* @param {String} [message]
|
|
19
|
+
*/
|
|
20
|
+
constructor(wbxAppApiErrorCode, meetingInfo, message = PASSWORD_ERROR_DEFAULT_MESSAGE) {
|
|
21
|
+
super(`${message}, code=${wbxAppApiErrorCode}`);
|
|
22
|
+
this.name = 'MeetingInfoV2PasswordError';
|
|
23
|
+
this.sdkMessage = message;
|
|
24
|
+
this.stack = (new Error()).stack;
|
|
25
|
+
this.wbxAppApiCode = wbxAppApiErrorCode;
|
|
26
|
+
this.meetingInfo = meetingInfo;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Error to indicate that wbxappapi requires a captcha
|
|
32
|
+
*/
|
|
33
|
+
export class MeetingInfoV2CaptchaError extends Error {
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @constructor
|
|
37
|
+
* @param {Number} [wbxAppApiErrorCode]
|
|
38
|
+
* @param {Object} [captchaInfo]
|
|
39
|
+
* @param {String} [message]
|
|
40
|
+
*/
|
|
41
|
+
constructor(wbxAppApiErrorCode, captchaInfo, message = CAPTCHA_ERROR_DEFAULT_MESSAGE) {
|
|
42
|
+
super(`${message}, code=${wbxAppApiErrorCode}`);
|
|
43
|
+
this.name = 'MeetingInfoV2PasswordError';
|
|
44
|
+
this.sdkMessage = message;
|
|
45
|
+
this.stack = (new Error()).stack;
|
|
46
|
+
this.wbxAppApiCode = wbxAppApiErrorCode;
|
|
47
|
+
this.isPasswordRequired = wbxAppApiErrorCode === 423005;
|
|
48
|
+
this.captchaInfo = captchaInfo;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
6
52
|
/**
|
|
7
53
|
* @class MeetingInfo
|
|
8
54
|
*/
|
|
@@ -35,24 +81,42 @@ export default class MeetingInfoV2 {
|
|
|
35
81
|
* Fetches meeting info from the server
|
|
36
82
|
* @param {String} destination one of many different types of destinations to look up info for
|
|
37
83
|
* @param {String} [type] to match up with the destination value
|
|
84
|
+
* @param {String} password
|
|
85
|
+
* @param {Object} captchaInfo
|
|
86
|
+
* @param {String} captchaInfo.code
|
|
87
|
+
* @param {String} captchaInfo.id
|
|
38
88
|
* @returns {Promise} returns a meeting info object
|
|
39
89
|
* @public
|
|
40
90
|
* @memberof MeetingInfo
|
|
41
91
|
*/
|
|
42
|
-
async fetchMeetingInfo(destination, type = null) {
|
|
92
|
+
async fetchMeetingInfo(destination, type = null, password = null, captchaInfo = null) {
|
|
43
93
|
const destinationType = await MeetingInfoUtil.getDestinationType({
|
|
44
94
|
destination,
|
|
45
95
|
type,
|
|
46
96
|
webex: this.webex
|
|
47
97
|
});
|
|
48
|
-
const body = await MeetingInfoUtil.getRequestBody(destinationType);
|
|
98
|
+
const body = await MeetingInfoUtil.getRequestBody({...destinationType, password, captchaInfo});
|
|
49
99
|
|
|
50
100
|
return this.webex.request({
|
|
51
101
|
method: HTTP_VERBS.POST,
|
|
52
102
|
service: 'webex-appapi-service',
|
|
53
103
|
resource: 'meetingInfo',
|
|
54
104
|
body
|
|
55
|
-
})
|
|
105
|
+
})
|
|
106
|
+
.catch((err) => {
|
|
107
|
+
if (err?.statusCode === 403) {
|
|
108
|
+
throw new MeetingInfoV2PasswordError(err.body?.code, err.body?.data?.meetingInfo);
|
|
109
|
+
}
|
|
110
|
+
if (err?.statusCode === 423) {
|
|
111
|
+
throw new MeetingInfoV2CaptchaError(err.body?.code, {
|
|
112
|
+
captchaId: err.body.captchaID,
|
|
113
|
+
verificationImageURL: err.body.verificationImageURL,
|
|
114
|
+
verificationAudioURL: err.body.verificationAudioURL,
|
|
115
|
+
refreshURL: err.body.refreshURL
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
throw err;
|
|
119
|
+
});
|
|
56
120
|
}
|
|
57
121
|
}
|
|
58
122
|
|
|
@@ -212,7 +212,9 @@ MeetingInfoUtil.getDestinationType = async (from) => {
|
|
|
212
212
|
* @returns {Object} returns an object with {resource, method}
|
|
213
213
|
*/
|
|
214
214
|
MeetingInfoUtil.getRequestBody = (options) => {
|
|
215
|
-
const {
|
|
215
|
+
const {
|
|
216
|
+
type, destination, password, captchaInfo
|
|
217
|
+
} = options;
|
|
216
218
|
const body = {
|
|
217
219
|
supportHostKey: true
|
|
218
220
|
};
|
|
@@ -250,6 +252,15 @@ MeetingInfoUtil.getRequestBody = (options) => {
|
|
|
250
252
|
default:
|
|
251
253
|
}
|
|
252
254
|
|
|
255
|
+
if (password) {
|
|
256
|
+
body.password = password;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (captchaInfo) {
|
|
260
|
+
body.captchaID = captchaInfo.id;
|
|
261
|
+
body.captchaVerifyCode = captchaInfo.code;
|
|
262
|
+
}
|
|
263
|
+
|
|
253
264
|
return body;
|
|
254
265
|
};
|
|
255
266
|
|
package/src/meetings/index.js
CHANGED
|
@@ -48,6 +48,8 @@ import Reachability from '../reachability';
|
|
|
48
48
|
import Request from '../meetings/request';
|
|
49
49
|
import StatsAnalyzer from '../analyzer/analyzer';
|
|
50
50
|
import StatsCalculator from '../analyzer/calculator';
|
|
51
|
+
import PasswordError from '../common/errors/password-error';
|
|
52
|
+
import CaptchaError from '../common/errors/captcha-error';
|
|
51
53
|
|
|
52
54
|
import MeetingCollection from './collection';
|
|
53
55
|
import MeetingsUtil from './util';
|
|
@@ -395,6 +397,23 @@ export default class Meetings extends WebexPlugin {
|
|
|
395
397
|
});
|
|
396
398
|
}
|
|
397
399
|
|
|
400
|
+
/**
|
|
401
|
+
* API to toggle unified meetings
|
|
402
|
+
* @param {Boolean} changeState
|
|
403
|
+
* @private
|
|
404
|
+
* @memberof Meetings
|
|
405
|
+
* @returns {undefined}
|
|
406
|
+
*/
|
|
407
|
+
_toggleUnifiedMeetings(changeState) {
|
|
408
|
+
if (typeof changeState !== 'boolean') {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
if (this.config?.experimental?.enableUnifiedMeetings !== changeState) {
|
|
412
|
+
this.config.experimental.enableUnifiedMeetings = changeState;
|
|
413
|
+
this.meetingInfo = changeState ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
398
417
|
/**
|
|
399
418
|
* Explicitly sets up the meetings plugin by registering
|
|
400
419
|
* the device, connecting to mercury, and listening for locus events.
|
|
@@ -716,7 +735,8 @@ export default class Meetings extends WebexPlugin {
|
|
|
716
735
|
deviceUrl: this.webex.internal.device.url,
|
|
717
736
|
orgId: this.webex.internal.device.orgId,
|
|
718
737
|
roapSeq: 0,
|
|
719
|
-
locus: type === _LOCUS_ID_ ? destination : null // pass the locus object if present
|
|
738
|
+
locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present
|
|
739
|
+
meetingInfoProvider: this.meetingInfo
|
|
720
740
|
},
|
|
721
741
|
{
|
|
722
742
|
parent: this.webex
|
|
@@ -726,15 +746,14 @@ export default class Meetings extends WebexPlugin {
|
|
|
726
746
|
this.meetingCollection.set(meeting);
|
|
727
747
|
|
|
728
748
|
try {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
meeting.parseMeetingInfo(info);
|
|
732
|
-
meeting.meetingInfo = info ? info.body : null;
|
|
749
|
+
await meeting.fetchMeetingInfo({destination, type});
|
|
733
750
|
}
|
|
734
751
|
catch (err) {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
752
|
+
if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {
|
|
753
|
+
// if there is no meeting info we assume its a 1:1 call or wireless share
|
|
754
|
+
LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);
|
|
755
|
+
LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
|
|
756
|
+
}
|
|
738
757
|
LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);
|
|
739
758
|
// We need to save this info for future reference
|
|
740
759
|
meeting.destination = destination;
|
|
@@ -79,11 +79,20 @@ const setMaxFs = (sdp, level = QUALITY_LEVELS.HIGH) => {
|
|
|
79
79
|
let replaceSdp = sdp;
|
|
80
80
|
const maxFsLine = `${SDP.MAX_FS}${MAX_FRAMESIZES[level]}`;
|
|
81
81
|
|
|
82
|
-
replaceSdp = replaceSdp.replace(/(\na=fmtp:(\d+).*level-
|
|
82
|
+
replaceSdp = replaceSdp.replace(/(\na=fmtp:(\d+).*profile-level-id=.*)/gi, `$1;${maxFsLine}`);
|
|
83
83
|
|
|
84
84
|
return replaceSdp;
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
+
|
|
88
|
+
const setStartBitrateOnRemoteSdp = (sdp) => {
|
|
89
|
+
if (StaticConfig.meetings.bandwidth.startBitrate) {
|
|
90
|
+
sdp = sdp.replace(/(\na=fmtp:(\d+).*profile-level-id=.*)/gi, `$1;x-google-start-bitrate=${StaticConfig.meetings.bandwidth.startBitrate}`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return sdp;
|
|
94
|
+
};
|
|
95
|
+
|
|
87
96
|
/**
|
|
88
97
|
* checks that sdp has h264 codec in it
|
|
89
98
|
* @param {String} sdp
|
|
@@ -295,7 +304,7 @@ pc.setRemoteSessionDetails = (
|
|
|
295
304
|
meetingId,
|
|
296
305
|
) => {
|
|
297
306
|
LoggerProxy.logger.log(`PeerConnectionManager:index#setRemoteSessionDetails --> Setting the remote description type: ${typeStr}State: ${peerConnection.signalingState}`);
|
|
298
|
-
|
|
307
|
+
let sdp = remoteSdp;
|
|
299
308
|
|
|
300
309
|
// making sure that the remoteDescription is only set when there is a answer for offer
|
|
301
310
|
// or there is a offer from the server
|
|
@@ -312,6 +321,8 @@ pc.setRemoteSessionDetails = (
|
|
|
312
321
|
});
|
|
313
322
|
}
|
|
314
323
|
if (peerConnection.signalingState === SDP.HAVE_LOCAL_OFFER || (peerConnection.signalingState === SDP.STABLE && typeStr === SDP.OFFER)) {
|
|
324
|
+
sdp = setStartBitrateOnRemoteSdp(sdp);
|
|
325
|
+
|
|
315
326
|
return peerConnection.setRemoteDescription(
|
|
316
327
|
new window.RTCSessionDescription({
|
|
317
328
|
type: typeStr,
|