@wazo/sdk 0.37.34 → 0.37.37
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/README.md +8 -2
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +17 -0
- package/esm/__tests__/web-rtc-client.test.js +17 -0
- package/esm/api/auth.js +7 -1
- package/esm/api/call-logd.js +6 -0
- package/esm/api/chatd.js +6 -0
- package/esm/api/confd.js +6 -0
- package/esm/api-client.js +17 -0
- package/esm/checker/Checker.js +17 -0
- package/esm/checker/checks/aor.js +17 -0
- package/esm/checker/checks/api.js +17 -0
- package/esm/checker/checks/index.js +17 -0
- package/esm/checker/checks/webrtc-transport.js +17 -0
- package/esm/checker/checks/webrtc.js +17 -0
- package/esm/domain/AdHocAPIConference.js +21 -0
- package/esm/domain/CallLog.js +6 -0
- package/esm/domain/CallSession.js +14 -0
- package/esm/domain/Features.js +17 -0
- package/esm/domain/Phone/CTIPhone.js +31 -0
- package/esm/domain/Phone/WebRTCPhone.js +42 -11
- package/esm/domain/Profile.js +6 -0
- package/esm/domain/__tests__/CallLog.test.js +10 -0
- package/esm/domain/__tests__/CallSession.test.js +14 -0
- package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/esm/domain/__tests__/Profile.test.js +6 -0
- package/esm/domain/__tests__/Room.test.js +14 -0
- package/esm/domain/__tests__/Session.test.js +6 -0
- package/esm/index.js +83 -18
- package/esm/service/CallApi.js +17 -0
- package/esm/service/getApiClient.js +17 -0
- package/esm/simple/Auth.js +84 -19
- package/esm/simple/Configuration.js +83 -18
- package/esm/simple/Directory.js +17 -0
- package/esm/simple/Phone.js +83 -18
- package/esm/simple/index.js +83 -18
- package/esm/simple/room/LocalParticipant.js +83 -18
- package/esm/simple/room/Participant.js +83 -18
- package/esm/simple/room/RemoteParticipant.js +83 -18
- package/esm/simple/room/Room.js +83 -18
- package/esm/simple/room/SipRoom.js +83 -18
- package/esm/simple/room/Stream.js +83 -18
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +83 -18
- package/esm/simple/utils.js +83 -18
- package/esm/web-rtc-client.js +17 -0
- package/lib/__tests__/api-client.test.js +17 -0
- package/lib/__tests__/web-rtc-client.test.js +17 -0
- package/lib/api/auth.js +8 -0
- package/lib/api/call-logd.js +6 -0
- package/lib/api/chatd.js +6 -0
- package/lib/api/confd.js +6 -0
- package/lib/api-client.js +17 -0
- package/lib/checker/Checker.js +17 -0
- package/lib/checker/checks/aor.js +17 -0
- package/lib/checker/checks/api.js +17 -0
- package/lib/checker/checks/index.js +17 -0
- package/lib/checker/checks/webrtc-transport.js +17 -0
- package/lib/checker/checks/webrtc.js +17 -0
- package/lib/domain/AdHocAPIConference.js +21 -0
- package/lib/domain/CallLog.js +6 -0
- package/lib/domain/CallSession.js +14 -0
- package/lib/domain/Features.js +17 -0
- package/lib/domain/Phone/CTIPhone.js +31 -0
- package/lib/domain/Phone/WebRTCPhone.js +42 -11
- package/lib/domain/Profile.js +6 -0
- package/lib/domain/__tests__/CallLog.test.js +10 -0
- package/lib/domain/__tests__/CallSession.test.js +14 -0
- package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
- package/lib/domain/__tests__/Profile.test.js +6 -0
- package/lib/domain/__tests__/Room.test.js +14 -0
- package/lib/domain/__tests__/Session.test.js +6 -0
- package/lib/index.js +83 -18
- package/lib/service/CallApi.js +17 -0
- package/lib/service/getApiClient.js +17 -0
- package/lib/simple/Auth.js +84 -18
- package/lib/simple/Configuration.js +83 -18
- package/lib/simple/Directory.js +17 -0
- package/lib/simple/Phone.js +83 -18
- package/lib/simple/index.js +83 -18
- package/lib/simple/room/LocalParticipant.js +83 -18
- package/lib/simple/room/Participant.js +83 -18
- package/lib/simple/room/RemoteParticipant.js +83 -18
- package/lib/simple/room/Room.js +83 -18
- package/lib/simple/room/SipRoom.js +83 -18
- package/lib/simple/room/Stream.js +83 -18
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +83 -18
- package/lib/simple/utils.js +83 -18
- package/lib/web-rtc-client.js +17 -0
- package/package.json +1 -1
- package/src/api/auth.js +7 -1
- package/src/domain/AdHocAPIConference.js +4 -0
- package/src/domain/CallLog.js +6 -0
- package/src/domain/CallSession.js +14 -0
- package/src/domain/Phone/WebRTCPhone.js +28 -11
- package/src/domain/Profile.js +6 -0
- package/src/domain/__tests__/CallLog.test.js +4 -0
- package/src/simple/Auth.js +13 -2
- package/src/simple/Phone.js +6 -6
- package/src/simple/index.js +2 -1
package/lib/index.js
CHANGED
|
@@ -1083,6 +1083,7 @@ const LINE_STATE = {
|
|
|
1083
1083
|
|
|
1084
1084
|
|
|
1085
1085
|
|
|
1086
|
+
|
|
1086
1087
|
|
|
1087
1088
|
|
|
1088
1089
|
|
|
@@ -1119,6 +1120,7 @@ const LINE_STATE = {
|
|
|
1119
1120
|
|
|
1120
1121
|
|
|
1121
1122
|
|
|
1123
|
+
|
|
1122
1124
|
|
|
1123
1125
|
|
|
1124
1126
|
|
|
@@ -1150,6 +1152,7 @@ class Profile {
|
|
|
1150
1152
|
|
|
1151
1153
|
|
|
1152
1154
|
|
|
1155
|
+
|
|
1153
1156
|
|
|
1154
1157
|
|
|
1155
1158
|
|
|
@@ -1166,6 +1169,7 @@ class Profile {
|
|
|
1166
1169
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
1167
1170
|
username: plain.username,
|
|
1168
1171
|
mobileNumber: plain.mobile_phone_number || '',
|
|
1172
|
+
ringSeconds: plain.ring_seconds,
|
|
1169
1173
|
forwards: [
|
|
1170
1174
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
1171
1175
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -1202,6 +1206,7 @@ class Profile {
|
|
|
1202
1206
|
switchboards,
|
|
1203
1207
|
agent,
|
|
1204
1208
|
status,
|
|
1209
|
+
ringSeconds,
|
|
1205
1210
|
sipLines,
|
|
1206
1211
|
callPickupTargetUsers,
|
|
1207
1212
|
onlineCallRecordEnabled,
|
|
@@ -1223,6 +1228,7 @@ class Profile {
|
|
|
1223
1228
|
this.status = status;
|
|
1224
1229
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
1225
1230
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
1231
|
+
this.ringSeconds = ringSeconds;
|
|
1226
1232
|
|
|
1227
1233
|
this.sipLines = sipLines || [];
|
|
1228
1234
|
}
|
|
@@ -2214,6 +2220,7 @@ class Session {
|
|
|
2214
2220
|
/* */
|
|
2215
2221
|
|
|
2216
2222
|
const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
2223
|
+
const BACKEND_LDAP_USER = 'ldap_user';
|
|
2217
2224
|
const DETAULT_EXPIRATION = 3600;
|
|
2218
2225
|
|
|
2219
2226
|
var authMethods = (client , baseUrl ) => ({
|
|
@@ -2228,6 +2235,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2228
2235
|
|
|
2229
2236
|
|
|
2230
2237
|
|
|
2238
|
+
|
|
2231
2239
|
) {
|
|
2232
2240
|
const body = {
|
|
2233
2241
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2247,6 +2255,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2247
2255
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2248
2256
|
}
|
|
2249
2257
|
|
|
2258
|
+
if (params.tenantId) {
|
|
2259
|
+
body.tenant_id = params.tenantId;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2250
2262
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2251
2263
|
},
|
|
2252
2264
|
|
|
@@ -3287,6 +3299,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3287
3299
|
|
|
3288
3300
|
|
|
3289
3301
|
|
|
3302
|
+
|
|
3290
3303
|
|
|
3291
3304
|
|
|
3292
3305
|
class CallSession {
|
|
@@ -3349,6 +3362,8 @@ class CallSession {
|
|
|
3349
3362
|
|
|
3350
3363
|
|
|
3351
3364
|
|
|
3365
|
+
|
|
3366
|
+
|
|
3352
3367
|
|
|
3353
3368
|
|
|
3354
3369
|
|
|
@@ -3380,6 +3395,7 @@ class CallSession {
|
|
|
3380
3395
|
videoRemotelyDowngraded,
|
|
3381
3396
|
sipSession,
|
|
3382
3397
|
answerTime,
|
|
3398
|
+
conference,
|
|
3383
3399
|
} ) {
|
|
3384
3400
|
this.callId = callId;
|
|
3385
3401
|
this.sipCallId = sipCallId;
|
|
@@ -3408,6 +3424,7 @@ class CallSession {
|
|
|
3408
3424
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3409
3425
|
this.sipSession = sipSession;
|
|
3410
3426
|
this.answerTime = answerTime || this.answerTime;
|
|
3427
|
+
this.conference = conference;
|
|
3411
3428
|
|
|
3412
3429
|
// Useful to compare instead of instanceof with minified code
|
|
3413
3430
|
this.type = 'CallSession';
|
|
@@ -3465,6 +3482,10 @@ class CallSession {
|
|
|
3465
3482
|
this.screensharing = false;
|
|
3466
3483
|
}
|
|
3467
3484
|
|
|
3485
|
+
setIsConference(conference ) {
|
|
3486
|
+
this.conference = conference;
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3468
3489
|
isIncoming() {
|
|
3469
3490
|
return !this.isCaller && !this.answered;
|
|
3470
3491
|
}
|
|
@@ -3541,6 +3562,10 @@ class CallSession {
|
|
|
3541
3562
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
3542
3563
|
}
|
|
3543
3564
|
|
|
3565
|
+
isConference() {
|
|
3566
|
+
return this.conference;
|
|
3567
|
+
}
|
|
3568
|
+
|
|
3544
3569
|
getElapsedTimeInSeconds() {
|
|
3545
3570
|
if (!this.startTime) {
|
|
3546
3571
|
return 0;
|
|
@@ -3632,6 +3657,7 @@ class CallSession {
|
|
|
3632
3657
|
cameraEnabled: false,
|
|
3633
3658
|
dialedExtension: call.dialedExtension,
|
|
3634
3659
|
call,
|
|
3660
|
+
conference: false, // @FIXME?
|
|
3635
3661
|
});
|
|
3636
3662
|
}
|
|
3637
3663
|
}
|
|
@@ -3721,11 +3747,13 @@ class Recording {
|
|
|
3721
3747
|
|
|
3722
3748
|
|
|
3723
3749
|
|
|
3750
|
+
|
|
3724
3751
|
|
|
3725
3752
|
|
|
3726
3753
|
|
|
3727
3754
|
|
|
3728
3755
|
|
|
3756
|
+
|
|
3729
3757
|
|
|
3730
3758
|
|
|
3731
3759
|
|
|
@@ -3746,10 +3774,12 @@ class Recording {
|
|
|
3746
3774
|
|
|
3747
3775
|
|
|
3748
3776
|
|
|
3777
|
+
|
|
3749
3778
|
|
|
3750
3779
|
|
|
3751
3780
|
|
|
3752
3781
|
|
|
3782
|
+
|
|
3753
3783
|
|
|
3754
3784
|
|
|
3755
3785
|
|
|
@@ -3811,10 +3841,12 @@ class CallLog {
|
|
|
3811
3841
|
|| plain.destination_extension
|
|
3812
3842
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3813
3843
|
name: plain.requested_name || plain.destination_name || '',
|
|
3844
|
+
uuid: plain.destination_user_uuid,
|
|
3814
3845
|
},
|
|
3815
3846
|
source: {
|
|
3816
3847
|
extension: plain.source_extension,
|
|
3817
3848
|
name: plain.source_name,
|
|
3849
|
+
uuid: plain.source_user_uuid,
|
|
3818
3850
|
},
|
|
3819
3851
|
id: plain.id,
|
|
3820
3852
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
@@ -10092,7 +10124,11 @@ class WebRTCPhone extends Emitter {
|
|
|
10092
10124
|
accept(callSession , cameraEnabled ) {
|
|
10093
10125
|
logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
10094
10126
|
if (this.currentSipSession) {
|
|
10095
|
-
this.holdSipSession(
|
|
10127
|
+
this.holdSipSession(
|
|
10128
|
+
this.currentSipSession,
|
|
10129
|
+
this.currentCallSession,
|
|
10130
|
+
true,
|
|
10131
|
+
);
|
|
10096
10132
|
}
|
|
10097
10133
|
|
|
10098
10134
|
if (!callSession) {
|
|
@@ -10185,22 +10221,22 @@ class WebRTCPhone extends Emitter {
|
|
|
10185
10221
|
}
|
|
10186
10222
|
}
|
|
10187
10223
|
|
|
10188
|
-
hold(callSession , withEvent = true
|
|
10224
|
+
hold(callSession , withEvent = true) {
|
|
10189
10225
|
logger$7.info('WebRTC hold', { id: callSession.getId() });
|
|
10190
10226
|
|
|
10191
10227
|
const sipSession = this.findSipSession(callSession);
|
|
10192
10228
|
|
|
10193
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
10229
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
10194
10230
|
}
|
|
10195
10231
|
|
|
10196
10232
|
// @Deprecated
|
|
10197
|
-
unhold(callSession , withEvent = true
|
|
10233
|
+
unhold(callSession , withEvent = true) {
|
|
10198
10234
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
10199
10235
|
|
|
10200
|
-
return this.resume(callSession,
|
|
10236
|
+
return this.resume(callSession, withEvent);
|
|
10201
10237
|
}
|
|
10202
10238
|
|
|
10203
|
-
resume(callSession ,
|
|
10239
|
+
resume(callSession , withEvent = true) {
|
|
10204
10240
|
logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
10205
10241
|
|
|
10206
10242
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -10213,10 +10249,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10213
10249
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
10214
10250
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
10215
10251
|
logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
10216
|
-
this.holdSipSession(
|
|
10252
|
+
this.holdSipSession(
|
|
10253
|
+
this.currentSipSession,
|
|
10254
|
+
this.currentCallSession,
|
|
10255
|
+
withEvent,
|
|
10256
|
+
);
|
|
10217
10257
|
}
|
|
10218
10258
|
|
|
10219
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
10259
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
10220
10260
|
this.currentSipSession = sipSession;
|
|
10221
10261
|
if (callSession) {
|
|
10222
10262
|
this.currentCallSession = callSession;
|
|
@@ -10229,7 +10269,6 @@ class WebRTCPhone extends Emitter {
|
|
|
10229
10269
|
sipSession ,
|
|
10230
10270
|
callSession ,
|
|
10231
10271
|
withEvent = true,
|
|
10232
|
-
isConference = false,
|
|
10233
10272
|
) {
|
|
10234
10273
|
if (!sipSession) {
|
|
10235
10274
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -10250,6 +10289,8 @@ class WebRTCPhone extends Emitter {
|
|
|
10250
10289
|
await this.client.downgradeToAudio(sipSession);
|
|
10251
10290
|
}
|
|
10252
10291
|
|
|
10292
|
+
const isConference = !!callSession && callSession.isConference();
|
|
10293
|
+
|
|
10253
10294
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
10254
10295
|
if (withEvent) {
|
|
10255
10296
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -10262,11 +10303,13 @@ class WebRTCPhone extends Emitter {
|
|
|
10262
10303
|
sipSession ,
|
|
10263
10304
|
callSession ,
|
|
10264
10305
|
withEvent = true,
|
|
10265
|
-
isConference = false,
|
|
10266
10306
|
) {
|
|
10267
10307
|
if (!sipSession) {
|
|
10268
10308
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
10269
10309
|
}
|
|
10310
|
+
|
|
10311
|
+
const isConference = !!callSession && callSession.isConference();
|
|
10312
|
+
|
|
10270
10313
|
const sessionId = this.getSipSessionId(sipSession);
|
|
10271
10314
|
logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
10272
10315
|
|
|
@@ -10408,7 +10451,11 @@ class WebRTCPhone extends Emitter {
|
|
|
10408
10451
|
await this.client.register();
|
|
10409
10452
|
}
|
|
10410
10453
|
if (this.currentSipSession) {
|
|
10411
|
-
this.holdSipSession(
|
|
10454
|
+
this.holdSipSession(
|
|
10455
|
+
this.currentSipSession,
|
|
10456
|
+
this.currentCallSession,
|
|
10457
|
+
true,
|
|
10458
|
+
).catch(e => {
|
|
10412
10459
|
logger$7.warn('Unable to hold current session when making another call', e);
|
|
10413
10460
|
});
|
|
10414
10461
|
}
|
|
@@ -10423,6 +10470,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10423
10470
|
return Promise.resolve(null);
|
|
10424
10471
|
}
|
|
10425
10472
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
10473
|
+
callSession.setIsConference(conference);
|
|
10426
10474
|
callSession.creationTime = new Date();
|
|
10427
10475
|
this._updateCallSession(callSession);
|
|
10428
10476
|
|
|
@@ -11001,6 +11049,7 @@ class WebRTCPhone extends Emitter {
|
|
|
11001
11049
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
11002
11050
|
recordingPaused: false, // @TODO
|
|
11003
11051
|
sipSession,
|
|
11052
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
11004
11053
|
...extra,
|
|
11005
11054
|
});
|
|
11006
11055
|
|
|
@@ -11659,6 +11708,7 @@ const getCallableNumber = (number , country ) => {
|
|
|
11659
11708
|
|
|
11660
11709
|
class InvalidSubscription extends Error {}
|
|
11661
11710
|
class InvalidAuthorization extends Error {}
|
|
11711
|
+
class NoTenantIdError extends Error {}
|
|
11662
11712
|
|
|
11663
11713
|
const logger$5 = IssueReporter$1.loggerFor('simple-auth');
|
|
11664
11714
|
|
|
@@ -11672,11 +11722,15 @@ class Auth {
|
|
|
11672
11722
|
|
|
11673
11723
|
|
|
11674
11724
|
|
|
11725
|
+
|
|
11726
|
+
|
|
11675
11727
|
|
|
11676
11728
|
constructor() {
|
|
11677
11729
|
this.expiration = DETAULT_EXPIRATION;
|
|
11678
11730
|
this.authenticated = false;
|
|
11679
11731
|
this.minSubscriptionType = null;
|
|
11732
|
+
this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
|
|
11733
|
+
this.BACKEND_LDAP = BACKEND_LDAP_USER;
|
|
11680
11734
|
}
|
|
11681
11735
|
|
|
11682
11736
|
init(clientId ,
|
|
@@ -11709,12 +11763,18 @@ class Auth {
|
|
|
11709
11763
|
setFetchOptions(options);
|
|
11710
11764
|
}
|
|
11711
11765
|
|
|
11712
|
-
async logIn(username , password ) {
|
|
11766
|
+
async logIn(username , password , backend , tenantId ) {
|
|
11767
|
+
if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
|
|
11768
|
+
throw new NoTenantIdError('No tenant id');
|
|
11769
|
+
}
|
|
11770
|
+
|
|
11713
11771
|
this.authenticated = false;
|
|
11714
11772
|
this.session = null;
|
|
11715
11773
|
const rawSession = await getApiClient().auth.logIn({
|
|
11716
11774
|
username,
|
|
11717
11775
|
password,
|
|
11776
|
+
backend,
|
|
11777
|
+
tenantId,
|
|
11718
11778
|
expiration: this.expiration,
|
|
11719
11779
|
mobile: this.mobile,
|
|
11720
11780
|
});
|
|
@@ -11990,6 +12050,10 @@ class AdHocAPIConference {
|
|
|
11990
12050
|
this.conferenceId = conferenceId || '';
|
|
11991
12051
|
this.muted = muted || false;
|
|
11992
12052
|
this.paused = paused || false;
|
|
12053
|
+
|
|
12054
|
+
if (this.host) {
|
|
12055
|
+
this.host.setIsConference(true);
|
|
12056
|
+
}
|
|
11993
12057
|
}
|
|
11994
12058
|
|
|
11995
12059
|
async start() {
|
|
@@ -12284,16 +12348,16 @@ class Phone extends Emitter {
|
|
|
12284
12348
|
}
|
|
12285
12349
|
}
|
|
12286
12350
|
|
|
12287
|
-
hold(callSession
|
|
12288
|
-
return this.phone && this.phone.hold(callSession, true
|
|
12351
|
+
hold(callSession ) {
|
|
12352
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
12289
12353
|
}
|
|
12290
12354
|
|
|
12291
|
-
unhold(callSession
|
|
12292
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
12355
|
+
unhold(callSession ) {
|
|
12356
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
12293
12357
|
}
|
|
12294
12358
|
|
|
12295
|
-
resume(callSession
|
|
12296
|
-
return this.phone && this.phone.resume(callSession
|
|
12359
|
+
resume(callSession ) {
|
|
12360
|
+
return this.phone && this.phone.resume(callSession);
|
|
12297
12361
|
}
|
|
12298
12362
|
|
|
12299
12363
|
reject(callSession ) {
|
|
@@ -14040,6 +14104,7 @@ const Wazo = {
|
|
|
14040
14104
|
InvalidAuthorization,
|
|
14041
14105
|
CanceledCallError,
|
|
14042
14106
|
SFUNotAvailableError,
|
|
14107
|
+
NoTenantIdError,
|
|
14043
14108
|
};
|
|
14044
14109
|
|
|
14045
14110
|
if (window) {
|
package/lib/service/CallApi.js
CHANGED
|
@@ -564,6 +564,7 @@ const LINE_STATE = {
|
|
|
564
564
|
|
|
565
565
|
|
|
566
566
|
|
|
567
|
+
|
|
567
568
|
|
|
568
569
|
|
|
569
570
|
|
|
@@ -600,6 +601,7 @@ const LINE_STATE = {
|
|
|
600
601
|
|
|
601
602
|
|
|
602
603
|
|
|
604
|
+
|
|
603
605
|
|
|
604
606
|
|
|
605
607
|
|
|
@@ -631,6 +633,7 @@ class Profile {
|
|
|
631
633
|
|
|
632
634
|
|
|
633
635
|
|
|
636
|
+
|
|
634
637
|
|
|
635
638
|
|
|
636
639
|
|
|
@@ -647,6 +650,7 @@ class Profile {
|
|
|
647
650
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
648
651
|
username: plain.username,
|
|
649
652
|
mobileNumber: plain.mobile_phone_number || '',
|
|
653
|
+
ringSeconds: plain.ring_seconds,
|
|
650
654
|
forwards: [
|
|
651
655
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
652
656
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -683,6 +687,7 @@ class Profile {
|
|
|
683
687
|
switchboards,
|
|
684
688
|
agent,
|
|
685
689
|
status,
|
|
690
|
+
ringSeconds,
|
|
686
691
|
sipLines,
|
|
687
692
|
callPickupTargetUsers,
|
|
688
693
|
onlineCallRecordEnabled,
|
|
@@ -704,6 +709,7 @@ class Profile {
|
|
|
704
709
|
this.status = status;
|
|
705
710
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
706
711
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
712
|
+
this.ringSeconds = ringSeconds;
|
|
707
713
|
|
|
708
714
|
this.sipLines = sipLines || [];
|
|
709
715
|
}
|
|
@@ -1751,11 +1757,13 @@ class Recording {
|
|
|
1751
1757
|
|
|
1752
1758
|
|
|
1753
1759
|
|
|
1760
|
+
|
|
1754
1761
|
|
|
1755
1762
|
|
|
1756
1763
|
|
|
1757
1764
|
|
|
1758
1765
|
|
|
1766
|
+
|
|
1759
1767
|
|
|
1760
1768
|
|
|
1761
1769
|
|
|
@@ -1776,10 +1784,12 @@ class Recording {
|
|
|
1776
1784
|
|
|
1777
1785
|
|
|
1778
1786
|
|
|
1787
|
+
|
|
1779
1788
|
|
|
1780
1789
|
|
|
1781
1790
|
|
|
1782
1791
|
|
|
1792
|
+
|
|
1783
1793
|
|
|
1784
1794
|
|
|
1785
1795
|
|
|
@@ -1841,10 +1851,12 @@ class CallLog {
|
|
|
1841
1851
|
|| plain.destination_extension
|
|
1842
1852
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
1843
1853
|
name: plain.requested_name || plain.destination_name || '',
|
|
1854
|
+
uuid: plain.destination_user_uuid,
|
|
1844
1855
|
},
|
|
1845
1856
|
source: {
|
|
1846
1857
|
extension: plain.source_extension,
|
|
1847
1858
|
name: plain.source_name,
|
|
1859
|
+
uuid: plain.source_user_uuid,
|
|
1848
1860
|
},
|
|
1849
1861
|
id: plain.id,
|
|
1850
1862
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
@@ -2737,6 +2749,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2737
2749
|
|
|
2738
2750
|
|
|
2739
2751
|
|
|
2752
|
+
|
|
2740
2753
|
) {
|
|
2741
2754
|
const body = {
|
|
2742
2755
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2756,6 +2769,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2756
2769
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2757
2770
|
}
|
|
2758
2771
|
|
|
2772
|
+
if (params.tenantId) {
|
|
2773
|
+
body.tenant_id = params.tenantId;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2759
2776
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2760
2777
|
},
|
|
2761
2778
|
|
|
@@ -1060,6 +1060,7 @@ const LINE_STATE = {
|
|
|
1060
1060
|
|
|
1061
1061
|
|
|
1062
1062
|
|
|
1063
|
+
|
|
1063
1064
|
|
|
1064
1065
|
|
|
1065
1066
|
|
|
@@ -1096,6 +1097,7 @@ const LINE_STATE = {
|
|
|
1096
1097
|
|
|
1097
1098
|
|
|
1098
1099
|
|
|
1100
|
+
|
|
1099
1101
|
|
|
1100
1102
|
|
|
1101
1103
|
|
|
@@ -1127,6 +1129,7 @@ class Profile {
|
|
|
1127
1129
|
|
|
1128
1130
|
|
|
1129
1131
|
|
|
1132
|
+
|
|
1130
1133
|
|
|
1131
1134
|
|
|
1132
1135
|
|
|
@@ -1143,6 +1146,7 @@ class Profile {
|
|
|
1143
1146
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
1144
1147
|
username: plain.username,
|
|
1145
1148
|
mobileNumber: plain.mobile_phone_number || '',
|
|
1149
|
+
ringSeconds: plain.ring_seconds,
|
|
1146
1150
|
forwards: [
|
|
1147
1151
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
1148
1152
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -1179,6 +1183,7 @@ class Profile {
|
|
|
1179
1183
|
switchboards,
|
|
1180
1184
|
agent,
|
|
1181
1185
|
status,
|
|
1186
|
+
ringSeconds,
|
|
1182
1187
|
sipLines,
|
|
1183
1188
|
callPickupTargetUsers,
|
|
1184
1189
|
onlineCallRecordEnabled,
|
|
@@ -1200,6 +1205,7 @@ class Profile {
|
|
|
1200
1205
|
this.status = status;
|
|
1201
1206
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
1202
1207
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
1208
|
+
this.ringSeconds = ringSeconds;
|
|
1203
1209
|
|
|
1204
1210
|
this.sipLines = sipLines || [];
|
|
1205
1211
|
}
|
|
@@ -2205,6 +2211,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2205
2211
|
|
|
2206
2212
|
|
|
2207
2213
|
|
|
2214
|
+
|
|
2208
2215
|
) {
|
|
2209
2216
|
const body = {
|
|
2210
2217
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2224,6 +2231,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2224
2231
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2225
2232
|
}
|
|
2226
2233
|
|
|
2234
|
+
if (params.tenantId) {
|
|
2235
|
+
body.tenant_id = params.tenantId;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2227
2238
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2228
2239
|
},
|
|
2229
2240
|
|
|
@@ -3292,11 +3303,13 @@ class Recording {
|
|
|
3292
3303
|
|
|
3293
3304
|
|
|
3294
3305
|
|
|
3306
|
+
|
|
3295
3307
|
|
|
3296
3308
|
|
|
3297
3309
|
|
|
3298
3310
|
|
|
3299
3311
|
|
|
3312
|
+
|
|
3300
3313
|
|
|
3301
3314
|
|
|
3302
3315
|
|
|
@@ -3317,10 +3330,12 @@ class Recording {
|
|
|
3317
3330
|
|
|
3318
3331
|
|
|
3319
3332
|
|
|
3333
|
+
|
|
3320
3334
|
|
|
3321
3335
|
|
|
3322
3336
|
|
|
3323
3337
|
|
|
3338
|
+
|
|
3324
3339
|
|
|
3325
3340
|
|
|
3326
3341
|
|
|
@@ -3382,10 +3397,12 @@ class CallLog {
|
|
|
3382
3397
|
|| plain.destination_extension
|
|
3383
3398
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3384
3399
|
name: plain.requested_name || plain.destination_name || '',
|
|
3400
|
+
uuid: plain.destination_user_uuid,
|
|
3385
3401
|
},
|
|
3386
3402
|
source: {
|
|
3387
3403
|
extension: plain.source_extension,
|
|
3388
3404
|
name: plain.source_name,
|
|
3405
|
+
uuid: plain.source_user_uuid,
|
|
3389
3406
|
},
|
|
3390
3407
|
id: plain.id,
|
|
3391
3408
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|