@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/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
|
}
|
|
@@ -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
|
|
@@ -6236,7 +6267,7 @@ const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
|
|
|
6236
6267
|
const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
|
|
6237
6268
|
class CanceledCallError extends Error {}
|
|
6238
6269
|
|
|
6239
|
-
const MAX_REGISTER_TRIES =
|
|
6270
|
+
const MAX_REGISTER_TRIES = 5;
|
|
6240
6271
|
|
|
6241
6272
|
|
|
6242
6273
|
|
|
@@ -10092,7 +10123,11 @@ class WebRTCPhone extends Emitter {
|
|
|
10092
10123
|
accept(callSession , cameraEnabled ) {
|
|
10093
10124
|
logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
|
|
10094
10125
|
if (this.currentSipSession) {
|
|
10095
|
-
this.holdSipSession(
|
|
10126
|
+
this.holdSipSession(
|
|
10127
|
+
this.currentSipSession,
|
|
10128
|
+
this.currentCallSession,
|
|
10129
|
+
true,
|
|
10130
|
+
);
|
|
10096
10131
|
}
|
|
10097
10132
|
|
|
10098
10133
|
if (!callSession) {
|
|
@@ -10100,6 +10135,12 @@ class WebRTCPhone extends Emitter {
|
|
|
10100
10135
|
return Promise.resolve(null);
|
|
10101
10136
|
}
|
|
10102
10137
|
|
|
10138
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10139
|
+
if (sipSessionId && !(sipSessionId in this.callSessions)) {
|
|
10140
|
+
logger$7.warn('Call session already ended or not found, can\'t accept it.', { sipSessionId });
|
|
10141
|
+
return Promise.resolve(null);
|
|
10142
|
+
}
|
|
10143
|
+
|
|
10103
10144
|
if (callSession.getId() in this.acceptedSessions) {
|
|
10104
10145
|
logger$7.warn('CallSession already accepted.', { id: callSession ? callSession.getId() : 'n/a' });
|
|
10105
10146
|
return Promise.resolve(callSession.sipCallId);
|
|
@@ -10179,22 +10220,22 @@ class WebRTCPhone extends Emitter {
|
|
|
10179
10220
|
}
|
|
10180
10221
|
}
|
|
10181
10222
|
|
|
10182
|
-
hold(callSession , withEvent = true
|
|
10223
|
+
hold(callSession , withEvent = true) {
|
|
10183
10224
|
logger$7.info('WebRTC hold', { id: callSession.getId() });
|
|
10184
10225
|
|
|
10185
10226
|
const sipSession = this.findSipSession(callSession);
|
|
10186
10227
|
|
|
10187
|
-
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent
|
|
10228
|
+
return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
|
|
10188
10229
|
}
|
|
10189
10230
|
|
|
10190
10231
|
// @Deprecated
|
|
10191
|
-
unhold(callSession , withEvent = true
|
|
10232
|
+
unhold(callSession , withEvent = true) {
|
|
10192
10233
|
console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
|
|
10193
10234
|
|
|
10194
|
-
return this.resume(callSession,
|
|
10235
|
+
return this.resume(callSession, withEvent);
|
|
10195
10236
|
}
|
|
10196
10237
|
|
|
10197
|
-
resume(callSession ,
|
|
10238
|
+
resume(callSession , withEvent = true) {
|
|
10198
10239
|
logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
|
|
10199
10240
|
|
|
10200
10241
|
const sipSession = this.findSipSession(callSession);
|
|
@@ -10207,10 +10248,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10207
10248
|
// Hold current session if different from the current one (we don't want 2 sessions active at the same time).
|
|
10208
10249
|
if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
|
|
10209
10250
|
logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
|
|
10210
|
-
this.holdSipSession(
|
|
10251
|
+
this.holdSipSession(
|
|
10252
|
+
this.currentSipSession,
|
|
10253
|
+
this.currentCallSession,
|
|
10254
|
+
withEvent,
|
|
10255
|
+
);
|
|
10211
10256
|
}
|
|
10212
10257
|
|
|
10213
|
-
const promise = this.unholdSipSession(sipSession, callSession, withEvent
|
|
10258
|
+
const promise = this.unholdSipSession(sipSession, callSession, withEvent);
|
|
10214
10259
|
this.currentSipSession = sipSession;
|
|
10215
10260
|
if (callSession) {
|
|
10216
10261
|
this.currentCallSession = callSession;
|
|
@@ -10223,7 +10268,6 @@ class WebRTCPhone extends Emitter {
|
|
|
10223
10268
|
sipSession ,
|
|
10224
10269
|
callSession ,
|
|
10225
10270
|
withEvent = true,
|
|
10226
|
-
isConference = false,
|
|
10227
10271
|
) {
|
|
10228
10272
|
if (!sipSession) {
|
|
10229
10273
|
return new Promise((resolve, reject) => reject(new Error('No session to hold')));
|
|
@@ -10244,6 +10288,8 @@ class WebRTCPhone extends Emitter {
|
|
|
10244
10288
|
await this.client.downgradeToAudio(sipSession);
|
|
10245
10289
|
}
|
|
10246
10290
|
|
|
10291
|
+
const isConference = !!callSession && callSession.isConference();
|
|
10292
|
+
|
|
10247
10293
|
const promise = this.client.hold(sipSession, isConference, hasVideo);
|
|
10248
10294
|
if (withEvent) {
|
|
10249
10295
|
this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
|
|
@@ -10256,11 +10302,13 @@ class WebRTCPhone extends Emitter {
|
|
|
10256
10302
|
sipSession ,
|
|
10257
10303
|
callSession ,
|
|
10258
10304
|
withEvent = true,
|
|
10259
|
-
isConference = false,
|
|
10260
10305
|
) {
|
|
10261
10306
|
if (!sipSession) {
|
|
10262
10307
|
return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
|
|
10263
10308
|
}
|
|
10309
|
+
|
|
10310
|
+
const isConference = !!callSession && callSession.isConference();
|
|
10311
|
+
|
|
10264
10312
|
const sessionId = this.getSipSessionId(sipSession);
|
|
10265
10313
|
logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
|
|
10266
10314
|
|
|
@@ -10402,7 +10450,11 @@ class WebRTCPhone extends Emitter {
|
|
|
10402
10450
|
await this.client.register();
|
|
10403
10451
|
}
|
|
10404
10452
|
if (this.currentSipSession) {
|
|
10405
|
-
this.holdSipSession(
|
|
10453
|
+
this.holdSipSession(
|
|
10454
|
+
this.currentSipSession,
|
|
10455
|
+
this.currentCallSession,
|
|
10456
|
+
true,
|
|
10457
|
+
).catch(e => {
|
|
10406
10458
|
logger$7.warn('Unable to hold current session when making another call', e);
|
|
10407
10459
|
});
|
|
10408
10460
|
}
|
|
@@ -10417,6 +10469,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10417
10469
|
return Promise.resolve(null);
|
|
10418
10470
|
}
|
|
10419
10471
|
const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
|
|
10472
|
+
callSession.setIsConference(conference);
|
|
10420
10473
|
callSession.creationTime = new Date();
|
|
10421
10474
|
this._updateCallSession(callSession);
|
|
10422
10475
|
|
|
@@ -10724,9 +10777,17 @@ class WebRTCPhone extends Emitter {
|
|
|
10724
10777
|
});
|
|
10725
10778
|
|
|
10726
10779
|
this.client.on(this.client.ACCEPTED, (sipSession ) => {
|
|
10727
|
-
|
|
10780
|
+
const sessionId = this.getSipSessionId(sipSession);
|
|
10781
|
+
const hasSession = sessionId in this.callSessions;
|
|
10782
|
+
|
|
10783
|
+
logger$7.info('WebRTC call accepted', { sipId: sessionId, hasSession });
|
|
10784
|
+
|
|
10785
|
+
if (!hasSession) {
|
|
10786
|
+
logger$7.warn('Call accepted ignored, session is no longer present in the WebRtcPhone', { sessionId });
|
|
10787
|
+
return;
|
|
10788
|
+
}
|
|
10728
10789
|
|
|
10729
|
-
this._onCallAccepted(sipSession, this.client.hasVideo(
|
|
10790
|
+
this._onCallAccepted(sipSession, this.client.hasVideo(sessionId));
|
|
10730
10791
|
|
|
10731
10792
|
if (this.audioOutputDeviceId) {
|
|
10732
10793
|
this.client.changeAudioOutputDevice(this.audioOutputDeviceId);
|
|
@@ -10862,9 +10923,14 @@ class WebRTCPhone extends Emitter {
|
|
|
10862
10923
|
return this.client.getSipSessionId(sipSession);
|
|
10863
10924
|
}
|
|
10864
10925
|
|
|
10865
|
-
|
|
10926
|
+
getSipSessionIdFromCallSession(callSession ) {
|
|
10866
10927
|
const sipSession = this.findSipSession(callSession);
|
|
10867
|
-
|
|
10928
|
+
|
|
10929
|
+
return sipSession ? this.getSipSessionId(sipSession) : null;
|
|
10930
|
+
}
|
|
10931
|
+
|
|
10932
|
+
_updateCallSession(callSession ) {
|
|
10933
|
+
const sipSessionId = this.getSipSessionIdFromCallSession(callSession);
|
|
10868
10934
|
|
|
10869
10935
|
if (sipSessionId) {
|
|
10870
10936
|
this.callSessions[sipSessionId] = callSession;
|
|
@@ -10982,6 +11048,7 @@ class WebRTCPhone extends Emitter {
|
|
|
10982
11048
|
recording: fromSession ? fromSession.isRecording() : false,
|
|
10983
11049
|
recordingPaused: false, // @TODO
|
|
10984
11050
|
sipSession,
|
|
11051
|
+
conference: !!fromSession && fromSession.isConference(),
|
|
10985
11052
|
...extra,
|
|
10986
11053
|
});
|
|
10987
11054
|
|
|
@@ -11971,6 +12038,10 @@ class AdHocAPIConference {
|
|
|
11971
12038
|
this.conferenceId = conferenceId || '';
|
|
11972
12039
|
this.muted = muted || false;
|
|
11973
12040
|
this.paused = paused || false;
|
|
12041
|
+
|
|
12042
|
+
if (this.host) {
|
|
12043
|
+
this.host.setIsConference(true);
|
|
12044
|
+
}
|
|
11974
12045
|
}
|
|
11975
12046
|
|
|
11976
12047
|
async start() {
|
|
@@ -12265,16 +12336,16 @@ class Phone extends Emitter {
|
|
|
12265
12336
|
}
|
|
12266
12337
|
}
|
|
12267
12338
|
|
|
12268
|
-
hold(callSession
|
|
12269
|
-
return this.phone && this.phone.hold(callSession, true
|
|
12339
|
+
hold(callSession ) {
|
|
12340
|
+
return this.phone && this.phone.hold(callSession, true);
|
|
12270
12341
|
}
|
|
12271
12342
|
|
|
12272
|
-
unhold(callSession
|
|
12273
|
-
return this.phone && this.phone.unhold(callSession, true
|
|
12343
|
+
unhold(callSession ) {
|
|
12344
|
+
return this.phone && this.phone.unhold(callSession, true);
|
|
12274
12345
|
}
|
|
12275
12346
|
|
|
12276
|
-
resume(callSession
|
|
12277
|
-
return this.phone && this.phone.resume(callSession
|
|
12347
|
+
resume(callSession ) {
|
|
12348
|
+
return this.phone && this.phone.resume(callSession);
|
|
12278
12349
|
}
|
|
12279
12350
|
|
|
12280
12351
|
reject(callSession ) {
|
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
|