@wazo/sdk 0.37.33 → 0.37.36
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 +1 -0
- package/dist/wazo-sdk.js +2 -2
- package/esm/__tests__/api-client.test.js +17 -0
- package/esm/__tests__/web-rtc-client.test.js +18 -1
- package/esm/api/auth.js +5 -0
- 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 +18 -1
- package/esm/checker/checks/aor.js +17 -0
- package/esm/checker/checks/api.js +17 -0
- package/esm/checker/checks/index.js +18 -1
- package/esm/checker/checks/webrtc-transport.js +18 -1
- package/esm/checker/checks/webrtc.js +18 -1
- 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 +65 -15
- 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 +93 -22
- package/esm/service/CallApi.js +17 -0
- package/esm/service/getApiClient.js +17 -0
- package/esm/simple/Auth.js +93 -22
- package/esm/simple/Configuration.js +93 -22
- package/esm/simple/Directory.js +17 -0
- package/esm/simple/Phone.js +93 -22
- package/esm/simple/index.js +93 -22
- package/esm/simple/room/LocalParticipant.js +93 -22
- package/esm/simple/room/Participant.js +93 -22
- package/esm/simple/room/RemoteParticipant.js +93 -22
- package/esm/simple/room/Room.js +93 -22
- package/esm/simple/room/SipRoom.js +93 -22
- package/esm/simple/room/Stream.js +93 -22
- package/esm/simple/room/__tests__/RemoteParticipant.test.js +93 -22
- package/esm/simple/utils.js +93 -22
- package/esm/web-rtc-client.js +18 -1
- package/lib/__tests__/api-client.test.js +17 -0
- package/lib/__tests__/web-rtc-client.test.js +18 -1
- package/lib/api/auth.js +5 -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 +18 -1
- package/lib/checker/checks/aor.js +17 -0
- package/lib/checker/checks/api.js +17 -0
- package/lib/checker/checks/index.js +18 -1
- package/lib/checker/checks/webrtc-transport.js +18 -1
- package/lib/checker/checks/webrtc.js +18 -1
- 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 +65 -15
- 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 +93 -22
- package/lib/service/CallApi.js +17 -0
- package/lib/service/getApiClient.js +17 -0
- package/lib/simple/Auth.js +93 -22
- package/lib/simple/Configuration.js +93 -22
- package/lib/simple/Directory.js +17 -0
- package/lib/simple/Phone.js +93 -22
- package/lib/simple/index.js +93 -22
- package/lib/simple/room/LocalParticipant.js +93 -22
- package/lib/simple/room/Participant.js +93 -22
- package/lib/simple/room/RemoteParticipant.js +93 -22
- package/lib/simple/room/Room.js +93 -22
- package/lib/simple/room/SipRoom.js +93 -22
- package/lib/simple/room/Stream.js +93 -22
- package/lib/simple/room/__tests__/RemoteParticipant.test.js +93 -22
- package/lib/simple/utils.js +93 -22
- package/lib/web-rtc-client.js +18 -1
- package/package.json +1 -1
- package/src/api/auth.js +5 -0
- 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 +51 -15
- package/src/domain/Profile.js +6 -0
- package/src/domain/__tests__/CallLog.test.js +4 -0
- package/src/simple/Phone.js +6 -6
- package/src/web-rtc-client.js +1 -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
|
}
|
|
@@ -2228,6 +2234,7 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2228
2234
|
|
|
2229
2235
|
|
|
2230
2236
|
|
|
2237
|
+
|
|
2231
2238
|
) {
|
|
2232
2239
|
const body = {
|
|
2233
2240
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -2247,6 +2254,10 @@ var authMethods = (client , baseUrl ) => ({
|
|
|
2247
2254
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
2248
2255
|
}
|
|
2249
2256
|
|
|
2257
|
+
if (params.tenantId) {
|
|
2258
|
+
body.tenant_id = params.tenantId;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2250
2261
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
2251
2262
|
},
|
|
2252
2263
|
|
|
@@ -3287,6 +3298,7 @@ var updateFrom = (instance , from ) => {
|
|
|
3287
3298
|
|
|
3288
3299
|
|
|
3289
3300
|
|
|
3301
|
+
|
|
3290
3302
|
|
|
3291
3303
|
|
|
3292
3304
|
class CallSession {
|
|
@@ -3349,6 +3361,8 @@ class CallSession {
|
|
|
3349
3361
|
|
|
3350
3362
|
|
|
3351
3363
|
|
|
3364
|
+
|
|
3365
|
+
|
|
3352
3366
|
|
|
3353
3367
|
|
|
3354
3368
|
|
|
@@ -3380,6 +3394,7 @@ class CallSession {
|
|
|
3380
3394
|
videoRemotelyDowngraded,
|
|
3381
3395
|
sipSession,
|
|
3382
3396
|
answerTime,
|
|
3397
|
+
conference,
|
|
3383
3398
|
} ) {
|
|
3384
3399
|
this.callId = callId;
|
|
3385
3400
|
this.sipCallId = sipCallId;
|
|
@@ -3408,6 +3423,7 @@ class CallSession {
|
|
|
3408
3423
|
this.videoRemotelyDowngraded = videoRemotelyDowngraded;
|
|
3409
3424
|
this.sipSession = sipSession;
|
|
3410
3425
|
this.answerTime = answerTime || this.answerTime;
|
|
3426
|
+
this.conference = conference;
|
|
3411
3427
|
|
|
3412
3428
|
// Useful to compare instead of instanceof with minified code
|
|
3413
3429
|
this.type = 'CallSession';
|
|
@@ -3465,6 +3481,10 @@ class CallSession {
|
|
|
3465
3481
|
this.screensharing = false;
|
|
3466
3482
|
}
|
|
3467
3483
|
|
|
3484
|
+
setIsConference(conference ) {
|
|
3485
|
+
this.conference = conference;
|
|
3486
|
+
}
|
|
3487
|
+
|
|
3468
3488
|
isIncoming() {
|
|
3469
3489
|
return !this.isCaller && !this.answered;
|
|
3470
3490
|
}
|
|
@@ -3541,6 +3561,10 @@ class CallSession {
|
|
|
3541
3561
|
return this.sipStatus === sessionState.SessionState.Terminated;
|
|
3542
3562
|
}
|
|
3543
3563
|
|
|
3564
|
+
isConference() {
|
|
3565
|
+
return this.conference;
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3544
3568
|
getElapsedTimeInSeconds() {
|
|
3545
3569
|
if (!this.startTime) {
|
|
3546
3570
|
return 0;
|
|
@@ -3632,6 +3656,7 @@ class CallSession {
|
|
|
3632
3656
|
cameraEnabled: false,
|
|
3633
3657
|
dialedExtension: call.dialedExtension,
|
|
3634
3658
|
call,
|
|
3659
|
+
conference: false, // @FIXME?
|
|
3635
3660
|
});
|
|
3636
3661
|
}
|
|
3637
3662
|
}
|
|
@@ -3721,11 +3746,13 @@ class Recording {
|
|
|
3721
3746
|
|
|
3722
3747
|
|
|
3723
3748
|
|
|
3749
|
+
|
|
3724
3750
|
|
|
3725
3751
|
|
|
3726
3752
|
|
|
3727
3753
|
|
|
3728
3754
|
|
|
3755
|
+
|
|
3729
3756
|
|
|
3730
3757
|
|
|
3731
3758
|
|
|
@@ -3746,10 +3773,12 @@ class Recording {
|
|
|
3746
3773
|
|
|
3747
3774
|
|
|
3748
3775
|
|
|
3776
|
+
|
|
3749
3777
|
|
|
3750
3778
|
|
|
3751
3779
|
|
|
3752
3780
|
|
|
3781
|
+
|
|
3753
3782
|
|
|
3754
3783
|
|
|
3755
3784
|
|
|
@@ -3811,10 +3840,12 @@ class CallLog {
|
|
|
3811
3840
|
|| plain.destination_extension
|
|
3812
3841
|
|| `meeting-${plain.requested_name || plain.destination_name || ''}`,
|
|
3813
3842
|
name: plain.requested_name || plain.destination_name || '',
|
|
3843
|
+
uuid: plain.destination_user_uuid,
|
|
3814
3844
|
},
|
|
3815
3845
|
source: {
|
|
3816
3846
|
extension: plain.source_extension,
|
|
3817
3847
|
name: plain.source_name,
|
|
3848
|
+
uuid: plain.source_user_uuid,
|
|
3818
3849
|
},
|
|
3819
3850
|
id: plain.id,
|
|
3820
3851
|
duration: (plain.duration || 0) * 1000, // duration is in seconds
|
|
@@ -5921,6 +5952,10 @@ class AdHocAPIConference {
|
|
|
5921
5952
|
this.conferenceId = conferenceId || '';
|
|
5922
5953
|
this.muted = muted || false;
|
|
5923
5954
|
this.paused = paused || false;
|
|
5955
|
+
|
|
5956
|
+
if (this.host) {
|
|
5957
|
+
this.host.setIsConference(true);
|
|
5958
|
+
}
|
|
5924
5959
|
}
|
|
5925
5960
|
|
|
5926
5961
|
async start() {
|
|
@@ -6675,7 +6710,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6675
6710
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6676
6711
|
class CanceledCallError extends Error {}
|
|
6677
6712
|
|
|
6678
|
-
const MAX_REGISTER_TRIES =
|
|
6713
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6679
6714
|
|
|
6680
6715
|
|
|
6681
6716
|
|
|
@@ -9630,7 +9665,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9630
9665
|
accept(callSession , cameraEnabled ) {
|
|
9631
9666
|
logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
9632
9667
|
if (this.currentSipSession) {
|
|
9633
|
-
this.holdSipSession(
|
|
9668
|
+
this.holdSipSession(
|
|
9669
|
+
this.currentSipSession,
|
|
9670
|
+
this.currentCallSession,
|
|
9671
|
+
true,
|
|
9672
|
+
);
|
|
9634
9673
|
}
|
|
9635
9674
|
|
|
9636
9675
|
if (!callSession) {
|
|
@@ -9638,6 +9677,12 @@ class WebRTCPhone extends Emitter {
|
|
|
9638
9677
|
return Promise.resolve(null);
|
|
9639
9678
|
}
|
|
9640
9679
|
|
|
9680
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
9681
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
9682
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
9683
|
+
return Promise.resolve(null);
|
|
9684
|
+
}
|
|
9685
|
+
|
|
9641
9686
|
if (callSession.getId() in this.acceptedSessions) {
|
|
9642
9687
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
9643
9688
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -9717,22 +9762,22 @@ class WebRTCPhone extends Emitter {
|
|
|
9717
9762
|
}
|
|
9718
9763
|
}
|
|
9719
9764
|
|
|
9720
|
-
hold(callSession , withEvent = true
|
|
9765
|
+
hold(callSession , withEvent = true) {
|
|
9721
9766
|
logger$7.info('WebRTC hold', { id: callSession.getId() });
|
|
9722
9767
|
|
|
9723
9768
|
const sipSession = this.findSipSession(callSession);
|
|
9724
9769
|
|
|
9725
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
9770
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
9726
9771
|
}
|
|
9727
9772
|
|
|
9728
9773
|
// @Deprecated
|
|
9729
|
-
unhold(callSession , withEvent = true
|
|
9774
|
+
unhold(callSession , withEvent = true) {
|
|
9730
9775
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
9731
9776
|
|
|
9732
|
-
return this.resume(callSession,
|
|
9777
|
+
return this.resume(callSession, withEvent);
|
|
9733
9778
|
}
|
|
9734
9779
|
|
|
9735
|
-
resume(callSession ,
|
|
9780
|
+
resume(callSession , withEvent = true) {
|
|
9736
9781
|
logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
9737
9782
|
|
|
9738
9783
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -9745,10 +9790,14 @@ class WebRTCPhone extends Emitter {
|
|
|
9745
9790
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
9746
9791
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
9747
9792
|
logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
9748
|
-
this.holdSipSession(
|
|
9793
|
+
this.holdSipSession(
|
|
9794
|
+
this.currentSipSession,
|
|
9795
|
+
this.currentCallSession,
|
|
9796
|
+
withEvent,
|
|
9797
|
+
);
|
|
9749
9798
|
}
|
|
9750
9799
|
|
|
9751
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
9800
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
9752
9801
|
this.currentSipSession = sipSession;
|
|
9753
9802
|
if (callSession) {
|
|
9754
9803
|
this.currentCallSession = callSession;
|
|
@@ -9761,7 +9810,6 @@ class WebRTCPhone extends Emitter {
|
|
|
9761
9810
|
sipSession ,
|
|
9762
9811
|
callSession ,
|
|
9763
9812
|
withEvent = true,
|
|
9764
|
-
isConference = false,
|
|
9765
9813
|
) {
|
|
9766
9814
|
if (!sipSession) {
|
|
9767
9815
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -9782,6 +9830,8 @@ class WebRTCPhone extends Emitter {
|
|
|
9782
9830
|
await this.client.downgradeToAudio(sipSession);
|
|
9783
9831
|
}
|
|
9784
9832
|
|
|
9833
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9834
|
+
|
|
9785
9835
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
9786
9836
|
if (withEvent) {
|
|
9787
9837
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -9794,11 +9844,13 @@ class WebRTCPhone extends Emitter {
|
|
|
9794
9844
|
sipSession ,
|
|
9795
9845
|
callSession ,
|
|
9796
9846
|
withEvent = true,
|
|
9797
|
-
isConference = false,
|
|
9798
9847
|
) {
|
|
9799
9848
|
if (!sipSession) {
|
|
9800
9849
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
9801
9850
|
}
|
|
9851
|
+
|
|
9852
|
+
const isConference = !!callSession && callSession.isConference();
|
|
9853
|
+
|
|
9802
9854
|
const sessionId = this.getSipSessionId(sipSession);
|
|
9803
9855
|
logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
9804
9856
|
|
|
@@ -9940,7 +9992,11 @@ class WebRTCPhone extends Emitter {
|
|
|
9940
9992
|
await this.client.register();
|
|
9941
9993
|
}
|
|
9942
9994
|
if (this.currentSipSession) {
|
|
9943
|
-
this.holdSipSession(
|
|
9995
|
+
this.holdSipSession(
|
|
9996
|
+
this.currentSipSession,
|
|
9997
|
+
this.currentCallSession,
|
|
9998
|
+
true,
|
|
9999
|
+
).catch(e => {
|
|
9944
10000
|
logger$7.warn('Unable to hold current session when making another call', e);
|
|
9945
10001
|
});
|
|
9946
10002
|
}
|
|
@@ -9955,6 +10011,7 @@ class WebRTCPhone extends Emitter {
|
|
|
9955
10011
|
return Promise.resolve(null);
|
|
9956
10012
|
}
|
|
9957
10013
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
10014
|
+
callSession.setIsConference(conference);
|
|
9958
10015
|
callSession.creationTime = new Date();
|
|
9959
10016
|
this._updateCallSession(callSession);
|
|
9960
10017
|
|
|
@@ -10262,9 +10319,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10262
10319
|
});
|
|
10263
10320
|
|
|
10264
10321
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10265
|
-
|
|
10322
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10323
|
+
const hasSession = sessionId in this.callSessions;
|
|
10266
10324
|
|
|
10267
|
-
|
|
10325
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10326
|
+
|
|
10327
|
+
if (!hasSession) {
|
|
10328
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10329
|
+
return;
|
|
10330
|
+
}
|
|
10331
|
+
|
|
10332
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10268
10333
|
|
|
10269
10334
|
if (this.audioOutputDeviceId) {
|
|
10270
10335
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10400,9 +10465,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10400
10465
|
return this.client.getSipSessionId(sipSession);
|
|
10401
10466
|
}
|
|
10402
10467
|
|
|
10403
|
-
|
|
10468
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10404
10469
|
const sipSession = this.findSipSession(callSession);
|
|
10405
|
-
|
|
10470
|
+
|
|
10471
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10472
|
+
}
|
|
10473
|
+
|
|
10474
|
+
_updateCallSession(callSession ) {
|
|
10475
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10406
10476
|
|
|
10407
10477
|
if (sipSessionId) {
|
|
10408
10478
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -10520,6 +10590,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10520
10590
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10521
10591
|
recordingPaused: false, // @TODO
|
|
10522
10592
|
sipSession,
|
|
10593
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10523
10594
|
...extra,
|
|
10524
10595
|
});
|
|
10525
10596
|
|
|
@@ -10776,16 +10847,16 @@ class Phone extends Emitter {
|
|
|
10776
10847
|
}
|
|
10777
10848
|
}
|
|
10778
10849
|
|
|
10779
|
-
hold(callSession
|
|
10780
|
-
return this.phone && this.phone.hold(callSession, true
|
|
10850
|
+
hold(callSession ) {
|
|
10851
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
10781
10852
|
}
|
|
10782
10853
|
|
|
10783
|
-
unhold(callSession
|
|
10784
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
10854
|
+
unhold(callSession ) {
|
|
10855
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
10785
10856
|
}
|
|
10786
10857
|
|
|
10787
|
-
resume(callSession
|
|
10788
|
-
return this.phone && this.phone.resume(callSession
|
|
10858
|
+
resume(callSession ) {
|
|
10859
|
+
return this.phone && this.phone.resume(callSession);
|
|
10789
10860
|
}
|
|
10790
10861
|
|
|
10791
10862
|
reject(callSession ) {
|
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
|
|
@@ -5376,7 +5393,7 @@ const events = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
5376
5393
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
5377
5394
|
class CanceledCallError extends Error {}
|
|
5378
5395
|
|
|
5379
|
-
const MAX_REGISTER_TRIES =
|
|
5396
|
+
const MAX_REGISTER_TRIES = 5;
|
|
5380
5397
|
|
|
5381
5398
|
|
|
5382
5399
|
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
|
@@ -31,6 +31,7 @@ export default (client: ApiRequester, baseUrl: string) => ({
|
|
|
31
31
|
backend: string,
|
|
32
32
|
expiration: number,
|
|
33
33
|
mobile?: boolean,
|
|
34
|
+
tenantId?: string,
|
|
34
35
|
}): Promise<?Session> {
|
|
35
36
|
const body: Object = {
|
|
36
37
|
backend: params.backend || DEFAULT_BACKEND_USER,
|
|
@@ -50,6 +51,10 @@ export default (client: ApiRequester, baseUrl: string) => ({
|
|
|
50
51
|
headers['Wazo-Session-Type'] = 'mobile';
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
if (params.tenantId) {
|
|
55
|
+
body.tenant_id = params.tenantId;
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
return client.post(`${baseUrl}/token`, body, headers).then(response => Session.parse(response));
|
|
54
59
|
},
|
|
55
60
|
|
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
|
}
|