@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
|
@@ -394,6 +394,7 @@ const LINE_STATE = {
|
|
|
394
394
|
|
|
395
395
|
|
|
396
396
|
|
|
397
|
+
|
|
397
398
|
|
|
398
399
|
|
|
399
400
|
|
|
@@ -430,6 +431,7 @@ const LINE_STATE = {
|
|
|
430
431
|
|
|
431
432
|
|
|
432
433
|
|
|
434
|
+
|
|
433
435
|
|
|
434
436
|
|
|
435
437
|
|
|
@@ -461,6 +463,7 @@ class Profile {
|
|
|
461
463
|
|
|
462
464
|
|
|
463
465
|
|
|
466
|
+
|
|
464
467
|
|
|
465
468
|
|
|
466
469
|
|
|
@@ -477,6 +480,7 @@ class Profile {
|
|
|
477
480
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
478
481
|
username: plain.username,
|
|
479
482
|
mobileNumber: plain.mobile_phone_number || '',
|
|
483
|
+
ringSeconds: plain.ring_seconds,
|
|
480
484
|
forwards: [
|
|
481
485
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
482
486
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -513,6 +517,7 @@ class Profile {
|
|
|
513
517
|
switchboards,
|
|
514
518
|
agent,
|
|
515
519
|
status,
|
|
520
|
+
ringSeconds,
|
|
516
521
|
sipLines,
|
|
517
522
|
callPickupTargetUsers,
|
|
518
523
|
onlineCallRecordEnabled,
|
|
@@ -534,6 +539,7 @@ class Profile {
|
|
|
534
539
|
this.status = status;
|
|
535
540
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
536
541
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
542
|
+
this.ringSeconds = ringSeconds;
|
|
537
543
|
|
|
538
544
|
this.sipLines = sipLines || [];
|
|
539
545
|
}
|
|
@@ -2212,6 +2218,7 @@ class ApiRequester {
|
|
|
2212
2218
|
/* */
|
|
2213
2219
|
|
|
2214
2220
|
const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
2221
|
+
const BACKEND_LDAP_USER = 'ldap_user';
|
|
2215
2222
|
const DETAULT_EXPIRATION = 3600;
|
|
2216
2223
|
|
|
2217
2224
|
var authMethods = (client , baseUrl ) => ({
|
|
@@ -2226,6 +2233,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2226
2233
|
|
|
2227
2234
|
|
|
2228
2235
|
|
|
2236
|
+
|
|
2229
2237
|
) {
|
|
2230
2238
|
const body = {
|
|
2231
2239
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2245,6 +2253,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2245
2253
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2246
2254
|
}
|
|
2247
2255
|
|
|
2256
|
+
if (params.tenantId) {
|
|
2257
|
+
body.tenant_id = params.tenantId;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2248
2260
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2249
2261
|
},
|
|
2250
2262
|
|
|
@@ -3285,6 +3297,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3285
3297
|
|
|
3286
3298
|
|
|
3287
3299
|
|
|
3300
|
+
|
|
3288
3301
|
|
|
3289
3302
|
|
|
3290
3303
|
class CallSession {
|
|
@@ -3347,6 +3360,8 @@ class CallSession {
|
|
|
3347
3360
|
|
|
3348
3361
|
|
|
3349
3362
|
|
|
3363
|
+
|
|
3364
|
+
|
|
3350
3365
|
|
|
3351
3366
|
|
|
3352
3367
|
|
|
@@ -3378,6 +3393,7 @@ class CallSession {
|
|
|
3378
3393
|
videoRemotelyDowngraded,
|
|
3379
3394
|
sipSession,
|
|
3380
3395
|
answerTime,
|
|
3396
|
+
conference,
|
|
3381
3397
|
} ) {
|
|
3382
3398
|
this.callId = callId;
|
|
3383
3399
|
this.sipCallId = sipCallId;
|
|
@@ -3406,6 +3422,7 @@ class CallSession {
|
|
|
3406
3422
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3407
3423
|
this.sipSession = sipSession;
|
|
3408
3424
|
this.answerTime = answerTime || this.answerTime;
|
|
3425
|
+
this.conference = conference;
|
|
3409
3426
|
|
|
3410
3427
|
// Useful to compare instead of instanceof with minified code
|
|
3411
3428
|
this.type = 'CallSession';
|
|
@@ -3463,6 +3480,10 @@ class CallSession {
|
|
|
3463
3480
|
this.screensharing = false;
|
|
3464
3481
|
}
|
|
3465
3482
|
|
|
3483
|
+
setIsConference(conference ) {
|
|
3484
|
+
this.conference = conference;
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3466
3487
|
isIncoming() {
|
|
3467
3488
|
return !this.isCaller && !this.answered;
|
|
3468
3489
|
}
|
|
@@ -3539,6 +3560,10 @@ class CallSession {
|
|
|
3539
3560
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
3540
3561
|
}
|
|
3541
3562
|
|
|
3563
|
+
isConference() {
|
|
3564
|
+
return this.conference;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3542
3567
|
getElapsedTimeInSeconds() {
|
|
3543
3568
|
if (!this.startTime) {
|
|
3544
3569
|
return 0;
|
|
@@ -3630,6 +3655,7 @@ class CallSession {
|
|
|
3630
3655
|
cameraEnabled: false,
|
|
3631
3656
|
dialedExtension: call.dialedExtension,
|
|
3632
3657
|
call,
|
|
3658
|
+
conference: false, // @FIXME?
|
|
3633
3659
|
});
|
|
3634
3660
|
}
|
|
3635
3661
|
}
|
|
@@ -3719,11 +3745,13 @@ class Recording {
|
|
|
3719
3745
|
|
|
3720
3746
|
|
|
3721
3747
|
|
|
3748
|
+
|
|
3722
3749
|
|
|
3723
3750
|
|
|
3724
3751
|
|
|
3725
3752
|
|
|
3726
3753
|
|
|
3754
|
+
|
|
3727
3755
|
|
|
3728
3756
|
|
|
3729
3757
|
|
|
@@ -3744,10 +3772,12 @@ class Recording {
|
|
|
3744
3772
|
|
|
3745
3773
|
|
|
3746
3774
|
|
|
3775
|
+
|
|
3747
3776
|
|
|
3748
3777
|
|
|
3749
3778
|
|
|
3750
3779
|
|
|
3780
|
+
|
|
3751
3781
|
|
|
3752
3782
|
|
|
3753
3783
|
|
|
@@ -3809,10 +3839,12 @@ class CallLog {
|
|
|
3809
3839
|
|| plain.destination_extension
|
|
3810
3840
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3811
3841
|
name: plain.requested_name || plain.destination_name || '',
|
|
3842
|
+
uuid: plain.destination_user_uuid,
|
|
3812
3843
|
},
|
|
3813
3844
|
source: {
|
|
3814
3845
|
extension: plain.source_extension,
|
|
3815
3846
|
name: plain.source_name,
|
|
3847
|
+
uuid: plain.source_user_uuid,
|
|
3816
3848
|
},
|
|
3817
3849
|
id: plain.id,
|
|
3818
3850
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
@@ -5655,6 +5687,10 @@ class AdHocAPIConference {
|
|
|
5655
5687
|
this.conferenceId = conferenceId || '';
|
|
5656
5688
|
this.muted = muted || false;
|
|
5657
5689
|
this.paused = paused || false;
|
|
5690
|
+
|
|
5691
|
+
if (this.host) {
|
|
5692
|
+
this.host.setIsConference(true);
|
|
5693
|
+
}
|
|
5658
5694
|
}
|
|
5659
5695
|
|
|
5660
5696
|
async start() {
|
|
@@ -9364,7 +9400,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9364
9400
|
accept(callSession , cameraEnabled ) {
|
|
9365
9401
|
logger$8.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
9366
9402
|
if (this.currentSipSession) {
|
|
9367
|
-
this.holdSipSession(
|
|
9403
|
+
this.holdSipSession(
|
|
9404
|
+
this.currentSipSession,
|
|
9405
|
+
this.currentCallSession,
|
|
9406
|
+
true,
|
|
9407
|
+
);
|
|
9368
9408
|
}
|
|
9369
9409
|
|
|
9370
9410
|
if (!callSession) {
|
|
@@ -9457,22 +9497,22 @@ class WebRTCPhone extends Emitter {
|
|
|
9457
9497
|
}
|
|
9458
9498
|
}
|
|
9459
9499
|
|
|
9460
|
-
hold(callSession , withEvent = true
|
|
9500
|
+
hold(callSession , withEvent = true) {
|
|
9461
9501
|
logger$8.info('WebRTC hold', { id: callSession.getId() });
|
|
9462
9502
|
|
|
9463
9503
|
const sipSession = this.findSipSession(callSession);
|
|
9464
9504
|
|
|
9465
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
9505
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
9466
9506
|
}
|
|
9467
9507
|
|
|
9468
9508
|
// @Deprecated
|
|
9469
|
-
unhold(callSession , withEvent = true
|
|
9509
|
+
unhold(callSession , withEvent = true) {
|
|
9470
9510
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
9471
9511
|
|
|
9472
|
-
return this.resume(callSession,
|
|
9512
|
+
return this.resume(callSession, withEvent);
|
|
9473
9513
|
}
|
|
9474
9514
|
|
|
9475
|
-
resume(callSession ,
|
|
9515
|
+
resume(callSession , withEvent = true) {
|
|
9476
9516
|
logger$8.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
9477
9517
|
|
|
9478
9518
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -9485,10 +9525,14 @@ class WebRTCPhone extends Emitter {
|
|
|
9485
9525
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
9486
9526
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
9487
9527
|
logger$8.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
9488
|
-
this.holdSipSession(
|
|
9528
|
+
this.holdSipSession(
|
|
9529
|
+
this.currentSipSession,
|
|
9530
|
+
this.currentCallSession,
|
|
9531
|
+
withEvent,
|
|
9532
|
+
);
|
|
9489
9533
|
}
|
|
9490
9534
|
|
|
9491
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
9535
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
9492
9536
|
this.currentSipSession = sipSession;
|
|
9493
9537
|
if (callSession) {
|
|
9494
9538
|
this.currentCallSession = callSession;
|
|
@@ -9501,7 +9545,6 @@ class WebRTCPhone extends Emitter {
|
|
|
9501
9545
|
sipSession ,
|
|
9502
9546
|
callSession ,
|
|
9503
9547
|
withEvent = true,
|
|
9504
|
-
isConference = false,
|
|
9505
9548
|
) {
|
|
9506
9549
|
if (!sipSession) {
|
|
9507
9550
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -9522,6 +9565,8 @@ class WebRTCPhone extends Emitter {
|
|
|
9522
9565
|
await this.client.downgradeToAudio(sipSession);
|
|
9523
9566
|
}
|
|
9524
9567
|
|
|
9568
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9569
|
+
|
|
9525
9570
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
9526
9571
|
if (withEvent) {
|
|
9527
9572
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -9534,11 +9579,13 @@ class WebRTCPhone extends Emitter {
|
|
|
9534
9579
|
sipSession ,
|
|
9535
9580
|
callSession ,
|
|
9536
9581
|
withEvent = true,
|
|
9537
|
-
isConference = false,
|
|
9538
9582
|
) {
|
|
9539
9583
|
if (!sipSession) {
|
|
9540
9584
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
9541
9585
|
}
|
|
9586
|
+
|
|
9587
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9588
|
+
|
|
9542
9589
|
const sessionId = this.getSipSessionId(sipSession);
|
|
9543
9590
|
logger$8.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
9544
9591
|
|
|
@@ -9680,7 +9727,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9680
9727
|
await this.client.register();
|
|
9681
9728
|
}
|
|
9682
9729
|
if (this.currentSipSession) {
|
|
9683
|
-
this.holdSipSession(
|
|
9730
|
+
this.holdSipSession(
|
|
9731
|
+
this.currentSipSession,
|
|
9732
|
+
this.currentCallSession,
|
|
9733
|
+
true,
|
|
9734
|
+
).catch(e => {
|
|
9684
9735
|
logger$8.warn('Unable to hold current session when making another call', e);
|
|
9685
9736
|
});
|
|
9686
9737
|
}
|
|
@@ -9695,6 +9746,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9695
9746
|
return Promise.resolve(null);
|
|
9696
9747
|
}
|
|
9697
9748
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
9749
|
+
callSession.setIsConference(conference);
|
|
9698
9750
|
callSession.creationTime = new Date();
|
|
9699
9751
|
this._updateCallSession(callSession);
|
|
9700
9752
|
|
|
@@ -10273,6 +10325,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10273
10325
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10274
10326
|
recordingPaused: false, // @TODO
|
|
10275
10327
|
sipSession,
|
|
10328
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10276
10329
|
...extra,
|
|
10277
10330
|
});
|
|
10278
10331
|
|
|
@@ -10529,16 +10582,16 @@ class Phone extends Emitter {
|
|
|
10529
10582
|
}
|
|
10530
10583
|
}
|
|
10531
10584
|
|
|
10532
|
-
hold(callSession
|
|
10533
|
-
return this.phone && this.phone.hold(callSession, true
|
|
10585
|
+
hold(callSession ) {
|
|
10586
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
10534
10587
|
}
|
|
10535
10588
|
|
|
10536
|
-
unhold(callSession
|
|
10537
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
10589
|
+
unhold(callSession ) {
|
|
10590
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
10538
10591
|
}
|
|
10539
10592
|
|
|
10540
|
-
resume(callSession
|
|
10541
|
-
return this.phone && this.phone.resume(callSession
|
|
10593
|
+
resume(callSession ) {
|
|
10594
|
+
return this.phone && this.phone.resume(callSession);
|
|
10542
10595
|
}
|
|
10543
10596
|
|
|
10544
10597
|
reject(callSession ) {
|
|
@@ -13620,6 +13673,7 @@ const Wazo = {
|
|
|
13620
13673
|
InvalidAuthorization,
|
|
13621
13674
|
CanceledCallError,
|
|
13622
13675
|
SFUNotAvailableError,
|
|
13676
|
+
NoTenantIdError,
|
|
13623
13677
|
};
|
|
13624
13678
|
|
|
13625
13679
|
if (window) {
|
|
@@ -13633,6 +13687,7 @@ if (global) {
|
|
|
13633
13687
|
|
|
13634
13688
|
class InvalidSubscription extends Error {}
|
|
13635
13689
|
class InvalidAuthorization extends Error {}
|
|
13690
|
+
class NoTenantIdError extends Error {}
|
|
13636
13691
|
|
|
13637
13692
|
const logger = IssueReporter$1.loggerFor('simple-auth');
|
|
13638
13693
|
|
|
@@ -13646,11 +13701,15 @@ class Auth {
|
|
|
13646
13701
|
|
|
13647
13702
|
|
|
13648
13703
|
|
|
13704
|
+
|
|
13705
|
+
|
|
13649
13706
|
|
|
13650
13707
|
constructor() {
|
|
13651
13708
|
this.expiration = DETAULT_EXPIRATION;
|
|
13652
13709
|
this.authenticated = false;
|
|
13653
13710
|
this.minSubscriptionType = null;
|
|
13711
|
+
this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
|
|
13712
|
+
this.BACKEND_LDAP = BACKEND_LDAP_USER;
|
|
13654
13713
|
}
|
|
13655
13714
|
|
|
13656
13715
|
init(clientId ,
|
|
@@ -13683,12 +13742,18 @@ class Auth {
|
|
|
13683
13742
|
setFetchOptions(options);
|
|
13684
13743
|
}
|
|
13685
13744
|
|
|
13686
|
-
async logIn(username , password ) {
|
|
13745
|
+
async logIn(username , password , backend , tenantId ) {
|
|
13746
|
+
if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
|
|
13747
|
+
throw new NoTenantIdError('No tenant id');
|
|
13748
|
+
}
|
|
13749
|
+
|
|
13687
13750
|
this.authenticated = false;
|
|
13688
13751
|
this.session = null;
|
|
13689
13752
|
const rawSession = await getApiClient().auth.logIn({
|
|
13690
13753
|
username,
|
|
13691
13754
|
password,
|
|
13755
|
+
backend,
|
|
13756
|
+
tenantId,
|
|
13692
13757
|
expiration: this.expiration,
|
|
13693
13758
|
mobile: this.mobile,
|
|
13694
13759
|
});
|
package/lib/simple/Directory.js
CHANGED
|
@@ -1058,6 +1058,7 @@ const LINE_STATE = {
|
|
|
1058
1058
|
|
|
1059
1059
|
|
|
1060
1060
|
|
|
1061
|
+
|
|
1061
1062
|
|
|
1062
1063
|
|
|
1063
1064
|
|
|
@@ -1094,6 +1095,7 @@ const LINE_STATE = {
|
|
|
1094
1095
|
|
|
1095
1096
|
|
|
1096
1097
|
|
|
1098
|
+
|
|
1097
1099
|
|
|
1098
1100
|
|
|
1099
1101
|
|
|
@@ -1125,6 +1127,7 @@ class Profile {
|
|
|
1125
1127
|
|
|
1126
1128
|
|
|
1127
1129
|
|
|
1130
|
+
|
|
1128
1131
|
|
|
1129
1132
|
|
|
1130
1133
|
|
|
@@ -1141,6 +1144,7 @@ class Profile {
|
|
|
1141
1144
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
1142
1145
|
username: plain.username,
|
|
1143
1146
|
mobileNumber: plain.mobile_phone_number || '',
|
|
1147
|
+
ringSeconds: plain.ring_seconds,
|
|
1144
1148
|
forwards: [
|
|
1145
1149
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
1146
1150
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -1177,6 +1181,7 @@ class Profile {
|
|
|
1177
1181
|
switchboards,
|
|
1178
1182
|
agent,
|
|
1179
1183
|
status,
|
|
1184
|
+
ringSeconds,
|
|
1180
1185
|
sipLines,
|
|
1181
1186
|
callPickupTargetUsers,
|
|
1182
1187
|
onlineCallRecordEnabled,
|
|
@@ -1198,6 +1203,7 @@ class Profile {
|
|
|
1198
1203
|
this.status = status;
|
|
1199
1204
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
1200
1205
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
1206
|
+
this.ringSeconds = ringSeconds;
|
|
1201
1207
|
|
|
1202
1208
|
this.sipLines = sipLines || [];
|
|
1203
1209
|
}
|
|
@@ -2203,6 +2209,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2203
2209
|
|
|
2204
2210
|
|
|
2205
2211
|
|
|
2212
|
+
|
|
2206
2213
|
) {
|
|
2207
2214
|
const body = {
|
|
2208
2215
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2222,6 +2229,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2222
2229
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2223
2230
|
}
|
|
2224
2231
|
|
|
2232
|
+
if (params.tenantId) {
|
|
2233
|
+
body.tenant_id = params.tenantId;
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2225
2236
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2226
2237
|
},
|
|
2227
2238
|
|
|
@@ -3290,11 +3301,13 @@ class Recording {
|
|
|
3290
3301
|
|
|
3291
3302
|
|
|
3292
3303
|
|
|
3304
|
+
|
|
3293
3305
|
|
|
3294
3306
|
|
|
3295
3307
|
|
|
3296
3308
|
|
|
3297
3309
|
|
|
3310
|
+
|
|
3298
3311
|
|
|
3299
3312
|
|
|
3300
3313
|
|
|
@@ -3315,10 +3328,12 @@ class Recording {
|
|
|
3315
3328
|
|
|
3316
3329
|
|
|
3317
3330
|
|
|
3331
|
+
|
|
3318
3332
|
|
|
3319
3333
|
|
|
3320
3334
|
|
|
3321
3335
|
|
|
3336
|
+
|
|
3322
3337
|
|
|
3323
3338
|
|
|
3324
3339
|
|
|
@@ -3380,10 +3395,12 @@ class CallLog {
|
|
|
3380
3395
|
|| plain.destination_extension
|
|
3381
3396
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3382
3397
|
name: plain.requested_name || plain.destination_name || '',
|
|
3398
|
+
uuid: plain.destination_user_uuid,
|
|
3383
3399
|
},
|
|
3384
3400
|
source: {
|
|
3385
3401
|
extension: plain.source_extension,
|
|
3386
3402
|
name: plain.source_name,
|
|
3403
|
+
uuid: plain.source_user_uuid,
|
|
3387
3404
|
},
|
|
3388
3405
|
id: plain.id,
|
|
3389
3406
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|