@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/simple/utils.js
CHANGED
|
@@ -396,6 +396,7 @@ const LINE_STATE = {
|
|
|
396
396
|
|
|
397
397
|
|
|
398
398
|
|
|
399
|
+
|
|
399
400
|
|
|
400
401
|
|
|
401
402
|
|
|
@@ -432,6 +433,7 @@ const LINE_STATE = {
|
|
|
432
433
|
|
|
433
434
|
|
|
434
435
|
|
|
436
|
+
|
|
435
437
|
|
|
436
438
|
|
|
437
439
|
|
|
@@ -463,6 +465,7 @@ class Profile {
|
|
|
463
465
|
|
|
464
466
|
|
|
465
467
|
|
|
468
|
+
|
|
466
469
|
|
|
467
470
|
|
|
468
471
|
|
|
@@ -479,6 +482,7 @@ class Profile {
|
|
|
479
482
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
480
483
|
username: plain.username,
|
|
481
484
|
mobileNumber: plain.mobile_phone_number || '',
|
|
485
|
+
ringSeconds: plain.ring_seconds,
|
|
482
486
|
forwards: [
|
|
483
487
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
484
488
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -515,6 +519,7 @@ class Profile {
|
|
|
515
519
|
switchboards,
|
|
516
520
|
agent,
|
|
517
521
|
status,
|
|
522
|
+
ringSeconds,
|
|
518
523
|
sipLines,
|
|
519
524
|
callPickupTargetUsers,
|
|
520
525
|
onlineCallRecordEnabled,
|
|
@@ -536,6 +541,7 @@ class Profile {
|
|
|
536
541
|
this.status = status;
|
|
537
542
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
538
543
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
544
|
+
this.ringSeconds = ringSeconds;
|
|
539
545
|
|
|
540
546
|
this.sipLines = sipLines || [];
|
|
541
547
|
}
|
|
@@ -2214,6 +2220,7 @@ class ApiRequester {
|
|
|
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
|
|
@@ -5590,6 +5622,7 @@ var getApiClient = (forServer ) => {
|
|
|
5590
5622
|
|
|
5591
5623
|
class InvalidSubscription extends Error {}
|
|
5592
5624
|
class InvalidAuthorization extends Error {}
|
|
5625
|
+
class NoTenantIdError extends Error {}
|
|
5593
5626
|
|
|
5594
5627
|
const logger$9 = IssueReporter$1.loggerFor('simple-auth');
|
|
5595
5628
|
|
|
@@ -5603,11 +5636,15 @@ class Auth {
|
|
|
5603
5636
|
|
|
5604
5637
|
|
|
5605
5638
|
|
|
5639
|
+
|
|
5640
|
+
|
|
5606
5641
|
|
|
5607
5642
|
constructor() {
|
|
5608
5643
|
this.expiration = DETAULT_EXPIRATION;
|
|
5609
5644
|
this.authenticated = false;
|
|
5610
5645
|
this.minSubscriptionType = null;
|
|
5646
|
+
this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
|
|
5647
|
+
this.BACKEND_LDAP = BACKEND_LDAP_USER;
|
|
5611
5648
|
}
|
|
5612
5649
|
|
|
5613
5650
|
init(clientId ,
|
|
@@ -5640,12 +5677,18 @@ class Auth {
|
|
|
5640
5677
|
setFetchOptions(options);
|
|
5641
5678
|
}
|
|
5642
5679
|
|
|
5643
|
-
async logIn(username , password ) {
|
|
5680
|
+
async logIn(username , password , backend , tenantId ) {
|
|
5681
|
+
if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
|
|
5682
|
+
throw new NoTenantIdError('No tenant id');
|
|
5683
|
+
}
|
|
5684
|
+
|
|
5644
5685
|
this.authenticated = false;
|
|
5645
5686
|
this.session = null;
|
|
5646
5687
|
const rawSession = await getApiClient().auth.logIn({
|
|
5647
5688
|
username,
|
|
5648
5689
|
password,
|
|
5690
|
+
backend,
|
|
5691
|
+
tenantId,
|
|
5649
5692
|
expiration: this.expiration,
|
|
5650
5693
|
mobile: this.mobile,
|
|
5651
5694
|
});
|
|
@@ -5921,6 +5964,10 @@ class AdHocAPIConference {
|
|
|
5921
5964
|
this.conferenceId = conferenceId || '';
|
|
5922
5965
|
this.muted = muted || false;
|
|
5923
5966
|
this.paused = paused || false;
|
|
5967
|
+
|
|
5968
|
+
if (this.host) {
|
|
5969
|
+
this.host.setIsConference(true);
|
|
5970
|
+
}
|
|
5924
5971
|
}
|
|
5925
5972
|
|
|
5926
5973
|
async start() {
|
|
@@ -9630,7 +9677,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9630
9677
|
accept(callSession , cameraEnabled ) {
|
|
9631
9678
|
logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
9632
9679
|
if (this.currentSipSession) {
|
|
9633
|
-
this.holdSipSession(
|
|
9680
|
+
this.holdSipSession(
|
|
9681
|
+
this.currentSipSession,
|
|
9682
|
+
this.currentCallSession,
|
|
9683
|
+
true,
|
|
9684
|
+
);
|
|
9634
9685
|
}
|
|
9635
9686
|
|
|
9636
9687
|
if (!callSession) {
|
|
@@ -9723,22 +9774,22 @@ class WebRTCPhone extends Emitter {
|
|
|
9723
9774
|
}
|
|
9724
9775
|
}
|
|
9725
9776
|
|
|
9726
|
-
hold(callSession , withEvent = true
|
|
9777
|
+
hold(callSession , withEvent = true) {
|
|
9727
9778
|
logger$7.info('WebRTC hold', { id: callSession.getId() });
|
|
9728
9779
|
|
|
9729
9780
|
const sipSession = this.findSipSession(callSession);
|
|
9730
9781
|
|
|
9731
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
9782
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
9732
9783
|
}
|
|
9733
9784
|
|
|
9734
9785
|
// @Deprecated
|
|
9735
|
-
unhold(callSession , withEvent = true
|
|
9786
|
+
unhold(callSession , withEvent = true) {
|
|
9736
9787
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
9737
9788
|
|
|
9738
|
-
return this.resume(callSession,
|
|
9789
|
+
return this.resume(callSession, withEvent);
|
|
9739
9790
|
}
|
|
9740
9791
|
|
|
9741
|
-
resume(callSession ,
|
|
9792
|
+
resume(callSession , withEvent = true) {
|
|
9742
9793
|
logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
9743
9794
|
|
|
9744
9795
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -9751,10 +9802,14 @@ class WebRTCPhone extends Emitter {
|
|
|
9751
9802
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
9752
9803
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
9753
9804
|
logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
9754
|
-
this.holdSipSession(
|
|
9805
|
+
this.holdSipSession(
|
|
9806
|
+
this.currentSipSession,
|
|
9807
|
+
this.currentCallSession,
|
|
9808
|
+
withEvent,
|
|
9809
|
+
);
|
|
9755
9810
|
}
|
|
9756
9811
|
|
|
9757
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
9812
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
9758
9813
|
this.currentSipSession = sipSession;
|
|
9759
9814
|
if (callSession) {
|
|
9760
9815
|
this.currentCallSession = callSession;
|
|
@@ -9767,7 +9822,6 @@ class WebRTCPhone extends Emitter {
|
|
|
9767
9822
|
sipSession ,
|
|
9768
9823
|
callSession ,
|
|
9769
9824
|
withEvent = true,
|
|
9770
|
-
isConference = false,
|
|
9771
9825
|
) {
|
|
9772
9826
|
if (!sipSession) {
|
|
9773
9827
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -9788,6 +9842,8 @@ class WebRTCPhone extends Emitter {
|
|
|
9788
9842
|
await this.client.downgradeToAudio(sipSession);
|
|
9789
9843
|
}
|
|
9790
9844
|
|
|
9845
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9846
|
+
|
|
9791
9847
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
9792
9848
|
if (withEvent) {
|
|
9793
9849
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -9800,11 +9856,13 @@ class WebRTCPhone extends Emitter {
|
|
|
9800
9856
|
sipSession ,
|
|
9801
9857
|
callSession ,
|
|
9802
9858
|
withEvent = true,
|
|
9803
|
-
isConference = false,
|
|
9804
9859
|
) {
|
|
9805
9860
|
if (!sipSession) {
|
|
9806
9861
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
9807
9862
|
}
|
|
9863
|
+
|
|
9864
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9865
|
+
|
|
9808
9866
|
const sessionId = this.getSipSessionId(sipSession);
|
|
9809
9867
|
logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
9810
9868
|
|
|
@@ -9946,7 +10004,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9946
10004
|
await this.client.register();
|
|
9947
10005
|
}
|
|
9948
10006
|
if (this.currentSipSession) {
|
|
9949
|
-
this.holdSipSession(
|
|
10007
|
+
this.holdSipSession(
|
|
10008
|
+
this.currentSipSession,
|
|
10009
|
+
this.currentCallSession,
|
|
10010
|
+
true,
|
|
10011
|
+
).catch(e => {
|
|
9950
10012
|
logger$7.warn('Unable to hold current session when making another call', e);
|
|
9951
10013
|
});
|
|
9952
10014
|
}
|
|
@@ -9961,6 +10023,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9961
10023
|
return Promise.resolve(null);
|
|
9962
10024
|
}
|
|
9963
10025
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
10026
|
+
callSession.setIsConference(conference);
|
|
9964
10027
|
callSession.creationTime = new Date();
|
|
9965
10028
|
this._updateCallSession(callSession);
|
|
9966
10029
|
|
|
@@ -10539,6 +10602,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10539
10602
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10540
10603
|
recordingPaused: false, // @TODO
|
|
10541
10604
|
sipSession,
|
|
10605
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10542
10606
|
...extra,
|
|
10543
10607
|
});
|
|
10544
10608
|
|
|
@@ -10795,16 +10859,16 @@ class Phone extends Emitter {
|
|
|
10795
10859
|
}
|
|
10796
10860
|
}
|
|
10797
10861
|
|
|
10798
|
-
hold(callSession
|
|
10799
|
-
return this.phone && this.phone.hold(callSession, true
|
|
10862
|
+
hold(callSession ) {
|
|
10863
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
10800
10864
|
}
|
|
10801
10865
|
|
|
10802
|
-
unhold(callSession
|
|
10803
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
10866
|
+
unhold(callSession ) {
|
|
10867
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
10804
10868
|
}
|
|
10805
10869
|
|
|
10806
|
-
resume(callSession
|
|
10807
|
-
return this.phone && this.phone.resume(callSession
|
|
10870
|
+
resume(callSession ) {
|
|
10871
|
+
return this.phone && this.phone.resume(callSession);
|
|
10808
10872
|
}
|
|
10809
10873
|
|
|
10810
10874
|
reject(callSession ) {
|
|
@@ -13887,6 +13951,7 @@ const Wazo = {
|
|
|
13887
13951
|
InvalidAuthorization,
|
|
13888
13952
|
CanceledCallError,
|
|
13889
13953
|
SFUNotAvailableError,
|
|
13954
|
+
NoTenantIdError,
|
|
13890
13955
|
};
|
|
13891
13956
|
|
|
13892
13957
|
if (window) {
|
package/lib/web-rtc-client.js
CHANGED
|
@@ -1611,6 +1611,7 @@ const LINE_STATE = {
|
|
|
1611
1611
|
|
|
1612
1612
|
|
|
1613
1613
|
|
|
1614
|
+
|
|
1614
1615
|
|
|
1615
1616
|
|
|
1616
1617
|
|
|
@@ -1647,6 +1648,7 @@ const LINE_STATE = {
|
|
|
1647
1648
|
|
|
1648
1649
|
|
|
1649
1650
|
|
|
1651
|
+
|
|
1650
1652
|
|
|
1651
1653
|
|
|
1652
1654
|
|
|
@@ -1678,6 +1680,7 @@ class Profile {
|
|
|
1678
1680
|
|
|
1679
1681
|
|
|
1680
1682
|
|
|
1683
|
+
|
|
1681
1684
|
|
|
1682
1685
|
|
|
1683
1686
|
|
|
@@ -1694,6 +1697,7 @@ class Profile {
|
|
|
1694
1697
|
lines: plain.lines.map(line => Line.parse(line)),
|
|
1695
1698
|
username: plain.username,
|
|
1696
1699
|
mobileNumber: plain.mobile_phone_number || '',
|
|
1700
|
+
ringSeconds: plain.ring_seconds,
|
|
1697
1701
|
forwards: [
|
|
1698
1702
|
ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
|
|
1699
1703
|
ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
|
|
@@ -1730,6 +1734,7 @@ class Profile {
|
|
|
1730
1734
|
switchboards,
|
|
1731
1735
|
agent,
|
|
1732
1736
|
status,
|
|
1737
|
+
ringSeconds,
|
|
1733
1738
|
sipLines,
|
|
1734
1739
|
callPickupTargetUsers,
|
|
1735
1740
|
onlineCallRecordEnabled,
|
|
@@ -1751,6 +1756,7 @@ class Profile {
|
|
|
1751
1756
|
this.status = status;
|
|
1752
1757
|
this.callPickupTargetUsers = callPickupTargetUsers;
|
|
1753
1758
|
this.onlineCallRecordEnabled = onlineCallRecordEnabled;
|
|
1759
|
+
this.ringSeconds = ringSeconds;
|
|
1754
1760
|
|
|
1755
1761
|
this.sipLines = sipLines || [];
|
|
1756
1762
|
}
|
|
@@ -2756,6 +2762,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2756
2762
|
|
|
2757
2763
|
|
|
2758
2764
|
|
|
2765
|
+
|
|
2759
2766
|
) {
|
|
2760
2767
|
const body = {
|
|
2761
2768
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2775,6 +2782,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2775
2782
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2776
2783
|
}
|
|
2777
2784
|
|
|
2785
|
+
if (params.tenantId) {
|
|
2786
|
+
body.tenant_id = params.tenantId;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2778
2789
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2779
2790
|
},
|
|
2780
2791
|
|
|
@@ -3843,11 +3854,13 @@ class Recording {
|
|
|
3843
3854
|
|
|
3844
3855
|
|
|
3845
3856
|
|
|
3857
|
+
|
|
3846
3858
|
|
|
3847
3859
|
|
|
3848
3860
|
|
|
3849
3861
|
|
|
3850
3862
|
|
|
3863
|
+
|
|
3851
3864
|
|
|
3852
3865
|
|
|
3853
3866
|
|
|
@@ -3868,10 +3881,12 @@ class Recording {
|
|
|
3868
3881
|
|
|
3869
3882
|
|
|
3870
3883
|
|
|
3884
|
+
|
|
3871
3885
|
|
|
3872
3886
|
|
|
3873
3887
|
|
|
3874
3888
|
|
|
3889
|
+
|
|
3875
3890
|
|
|
3876
3891
|
|
|
3877
3892
|
|
|
@@ -3933,10 +3948,12 @@ class CallLog {
|
|
|
3933
3948
|
|| plain.destination_extension
|
|
3934
3949
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3935
3950
|
name: plain.requested_name || plain.destination_name || '',
|
|
3951
|
+
uuid: plain.destination_user_uuid,
|
|
3936
3952
|
},
|
|
3937
3953
|
source: {
|
|
3938
3954
|
extension: plain.source_extension,
|
|
3939
3955
|
name: plain.source_name,
|
|
3956
|
+
uuid: plain.source_user_uuid,
|
|
3940
3957
|
},
|
|
3941
3958
|
id: plain.id,
|
|
3942
3959
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
|
@@ -16,7 +16,8 @@ import type {
|
|
|
16
16
|
} from '../domain/types';
|
|
17
17
|
import Session from '../domain/Session';
|
|
18
18
|
|
|
19
|
-
const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
19
|
+
export const DEFAULT_BACKEND_USER = 'wazo_user';
|
|
20
|
+
export const BACKEND_LDAP_USER = 'ldap_user';
|
|
20
21
|
export const DETAULT_EXPIRATION = 3600;
|
|
21
22
|
|
|
22
23
|
export default (client: ApiRequester, baseUrl: string) => ({
|
|
@@ -31,6 +32,7 @@ export default (client: ApiRequester, baseUrl: string) => ({
|
|
|
31
32
|
backend: string,
|
|
32
33
|
expiration: number,
|
|
33
34
|
mobile?: boolean,
|
|
35
|
+
tenantId?: string,
|
|
34
36
|
}): Promise<?Session> {
|
|
35
37
|
const body: Object = {
|
|
36
38
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -50,6 +52,10 @@ export default (client: ApiRequester, baseUrl: string) => ({
|
|
|
50
52
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
if (params.tenantId) {
|
|
56
|
+
body.tenant_id = params.tenantId;
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
54
60
|
},
|
|
55
61
|
|
package/src/domain/CallLog.js
CHANGED
|
@@ -13,11 +13,13 @@ type CallLogResponse = {
|
|
|
13
13
|
call_direction: string,
|
|
14
14
|
destination_extension: string,
|
|
15
15
|
destination_name: ?string,
|
|
16
|
+
destination_user_uuid: ?string,
|
|
16
17
|
duration: number,
|
|
17
18
|
end: ?string,
|
|
18
19
|
id: number,
|
|
19
20
|
source_extension: string,
|
|
20
21
|
source_name: string,
|
|
22
|
+
source_user_uuid: ?string,
|
|
21
23
|
recordings: RecordingResponse[],
|
|
22
24
|
requested_extension: string,
|
|
23
25
|
requested_name: string,
|
|
@@ -38,10 +40,12 @@ type CallLogArguments = {
|
|
|
38
40
|
destination: {
|
|
39
41
|
extension: string,
|
|
40
42
|
name: string,
|
|
43
|
+
uuid: ?string,
|
|
41
44
|
},
|
|
42
45
|
source: {
|
|
43
46
|
extension: string,
|
|
44
47
|
name: string,
|
|
48
|
+
uuid: ?string,
|
|
45
49
|
},
|
|
46
50
|
id: number,
|
|
47
51
|
duration: number,
|
|
@@ -103,10 +107,12 @@ export default class CallLog {
|
|
|
103
107
|
|| plain.destination_extension
|
|
104
108
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
105
109
|
name: plain.requested_name || plain.destination_name || '',
|
|
110
|
+
uuid: plain.destination_user_uuid,
|
|
106
111
|
},
|
|
107
112
|
source: {
|
|
108
113
|
extension: plain.source_extension,
|
|
109
114
|
name: plain.source_name,
|
|
115
|
+
uuid: plain.source_user_uuid,
|
|
110
116
|
},
|
|
111
117
|
id: plain.id,
|
|
112
118
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
@@ -35,6 +35,7 @@ type CallSessionArguments = {
|
|
|
35
35
|
recording: boolean,
|
|
36
36
|
recordingPaused: boolean,
|
|
37
37
|
sipSession?: Session,
|
|
38
|
+
conference: boolean,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export default class CallSession {
|
|
@@ -100,6 +101,8 @@ export default class CallSession {
|
|
|
100
101
|
|
|
101
102
|
sipSession: Session;
|
|
102
103
|
|
|
104
|
+
conference: boolean;
|
|
105
|
+
|
|
103
106
|
constructor({
|
|
104
107
|
answered,
|
|
105
108
|
answeredBySystem,
|
|
@@ -128,6 +131,7 @@ export default class CallSession {
|
|
|
128
131
|
videoRemotelyDowngraded,
|
|
129
132
|
sipSession,
|
|
130
133
|
answerTime,
|
|
134
|
+
conference,
|
|
131
135
|
}: CallSessionArguments) {
|
|
132
136
|
this.callId = callId;
|
|
133
137
|
this.sipCallId = sipCallId;
|
|
@@ -156,6 +160,7 @@ export default class CallSession {
|
|
|
156
160
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
157
161
|
this.sipSession = sipSession;
|
|
158
162
|
this.answerTime = answerTime || this.answerTime;
|
|
163
|
+
this.conference = conference;
|
|
159
164
|
|
|
160
165
|
// Useful to compare instead of instanceof with minified code
|
|
161
166
|
this.type = 'CallSession';
|
|
@@ -213,6 +218,10 @@ export default class CallSession {
|
|
|
213
218
|
this.screensharing = false;
|
|
214
219
|
}
|
|
215
220
|
|
|
221
|
+
setIsConference(conference: boolean) {
|
|
222
|
+
this.conference = conference;
|
|
223
|
+
}
|
|
224
|
+
|
|
216
225
|
isIncoming(): boolean {
|
|
217
226
|
return !this.isCaller && !this.answered;
|
|
218
227
|
}
|
|
@@ -289,6 +298,10 @@ export default class CallSession {
|
|
|
289
298
|
return this.sipStatus === SessionState.Terminated;
|
|
290
299
|
}
|
|
291
300
|
|
|
301
|
+
isConference(): boolean {
|
|
302
|
+
return this.conference;
|
|
303
|
+
}
|
|
304
|
+
|
|
292
305
|
getElapsedTimeInSeconds() {
|
|
293
306
|
if (!this.startTime) {
|
|
294
307
|
return 0;
|
|
@@ -380,6 +393,7 @@ export default class CallSession {
|
|
|
380
393
|
cameraEnabled: false,
|
|
381
394
|
dialedExtension: call.dialedExtension,
|
|
382
395
|
call,
|
|
396
|
+
conference: false, // @FIXME?
|
|
383
397
|
});
|
|
384
398
|
}
|
|
385
399
|
}
|