@webex/plugin-meetings 1.151.4 → 1.152.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/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/index.js +5 -0
- package/dist/meeting-info/index.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 +33 -24
- package/dist/meetings/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +6 -9
- package/dist/personal-meeting-room/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/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/index.js +6 -1
- package/src/meeting-info/meeting-info-v2.js +67 -3
- package/src/meeting-info/utilv2.js +12 -1
- package/src/meetings/index.js +14 -10
- package/src/personal-meeting-room/index.js +5 -6
- package/test/unit/spec/meeting/index.js +304 -2
- package/test/unit/spec/meeting-info/meetinginfov2.js +93 -3
- package/test/unit/spec/meeting-info/utilv2.js +15 -0
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +33 -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,
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
_MEETING_LINK_,
|
|
7
|
-
_SIP_URI_
|
|
7
|
+
_SIP_URI_,
|
|
8
|
+
_PERSONAL_ROOM_
|
|
8
9
|
} from '../constants';
|
|
9
10
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
10
11
|
|
|
@@ -108,6 +109,10 @@ export default class MeetingInfo {
|
|
|
108
109
|
* @memberof MeetingInfo
|
|
109
110
|
*/
|
|
110
111
|
fetchMeetingInfo(destination, type = null) {
|
|
112
|
+
if (type === _PERSONAL_ROOM_ && !destination) {
|
|
113
|
+
destination = this.webex.internal.device.userId;
|
|
114
|
+
}
|
|
115
|
+
|
|
111
116
|
return this.fetchInfoOptions(
|
|
112
117
|
MeetingInfoUtil.extractDestination(destination, type),
|
|
113
118
|
type
|
|
@@ -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';
|
|
@@ -141,7 +143,7 @@ export default class Meetings extends WebexPlugin {
|
|
|
141
143
|
* @public
|
|
142
144
|
* @memberof Meetings
|
|
143
145
|
*/
|
|
144
|
-
this.personalMeetingRoom =
|
|
146
|
+
this.personalMeetingRoom = null;
|
|
145
147
|
/**
|
|
146
148
|
* The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
|
|
147
149
|
* starts as null
|
|
@@ -174,6 +176,8 @@ export default class Meetings extends WebexPlugin {
|
|
|
174
176
|
getSupportedDevice: Media.getSupportedDevice
|
|
175
177
|
};
|
|
176
178
|
|
|
179
|
+
LoggerProxy.set(this.webex.logger);
|
|
180
|
+
|
|
177
181
|
this.onReady();
|
|
178
182
|
MeetingsUtil.checkH264Support({disableNotifications: true});
|
|
179
183
|
Metrics.initialSetup(this.meetingCollection, this.webex);
|
|
@@ -371,7 +375,6 @@ export default class Meetings extends WebexPlugin {
|
|
|
371
375
|
this.webex.once(READY, () => {
|
|
372
376
|
StaticConfig.set(this.config);
|
|
373
377
|
LoggerConfig.set(this.config.logging);
|
|
374
|
-
LoggerProxy.set(this.webex.logger);
|
|
375
378
|
|
|
376
379
|
/**
|
|
377
380
|
* The MeetingInfo object to interact with server
|
|
@@ -381,6 +384,7 @@ export default class Meetings extends WebexPlugin {
|
|
|
381
384
|
* @memberof Meetings
|
|
382
385
|
*/
|
|
383
386
|
this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);
|
|
387
|
+
this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});
|
|
384
388
|
|
|
385
389
|
Trigger.trigger(
|
|
386
390
|
this,
|
|
@@ -714,7 +718,8 @@ export default class Meetings extends WebexPlugin {
|
|
|
714
718
|
deviceUrl: this.webex.internal.device.url,
|
|
715
719
|
orgId: this.webex.internal.device.orgId,
|
|
716
720
|
roapSeq: 0,
|
|
717
|
-
locus: type === _LOCUS_ID_ ? destination : null // pass the locus object if present
|
|
721
|
+
locus: type === _LOCUS_ID_ ? destination : null, // pass the locus object if present
|
|
722
|
+
meetingInfoProvider: this.meetingInfo
|
|
718
723
|
},
|
|
719
724
|
{
|
|
720
725
|
parent: this.webex
|
|
@@ -724,15 +729,14 @@ export default class Meetings extends WebexPlugin {
|
|
|
724
729
|
this.meetingCollection.set(meeting);
|
|
725
730
|
|
|
726
731
|
try {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
meeting.parseMeetingInfo(info);
|
|
730
|
-
meeting.meetingInfo = info ? info.body : null;
|
|
732
|
+
await meeting.fetchMeetingInfo({destination, type});
|
|
731
733
|
}
|
|
732
734
|
catch (err) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
735
|
+
if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {
|
|
736
|
+
// if there is no meeting info we assume its a 1:1 call or wireless share
|
|
737
|
+
LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);
|
|
738
|
+
LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
|
|
739
|
+
}
|
|
736
740
|
LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);
|
|
737
741
|
// We need to save this info for future reference
|
|
738
742
|
meeting.destination = destination;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {StatelessWebexPlugin} from '@webex/webex-core';
|
|
2
2
|
|
|
3
3
|
import {MEETINGS, _PERSONAL_ROOM_} from '../constants';
|
|
4
|
-
import MeetingInfoRequest from '../meeting-info/request';
|
|
5
4
|
import ParameterError from '../common/errors/parameter';
|
|
6
5
|
|
|
7
6
|
import PersonalMeetingRoomRequest from './request';
|
|
@@ -63,11 +62,11 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
|
|
|
63
62
|
/**
|
|
64
63
|
* The meeting info request server interface
|
|
65
64
|
* @instance
|
|
66
|
-
* @type {
|
|
65
|
+
* @type {MeetingInfo}
|
|
67
66
|
* @private
|
|
68
67
|
* @memberof PersonalMeetingRoom
|
|
69
68
|
*/
|
|
70
|
-
this.
|
|
69
|
+
this.meetingInfo = attrs.meetingInfo;
|
|
71
70
|
/**
|
|
72
71
|
* The pmr server request interface
|
|
73
72
|
* @instance
|
|
@@ -131,11 +130,11 @@ export default class PersonalMeetingRoom extends StatelessWebexPlugin {
|
|
|
131
130
|
*/
|
|
132
131
|
get() {
|
|
133
132
|
const options = {
|
|
134
|
-
type: _PERSONAL_ROOM_
|
|
135
|
-
|
|
133
|
+
type: _PERSONAL_ROOM_
|
|
134
|
+
|
|
136
135
|
};
|
|
137
136
|
|
|
138
|
-
return this.
|
|
137
|
+
return this.meetingInfo.fetchMeetingInfo(options).then((pmr) => {
|
|
139
138
|
if (pmr && pmr.body && pmr.body.isPmr) {
|
|
140
139
|
this.set(pmr.body);
|
|
141
140
|
}
|