@wazo/sdk 0.37.35 → 0.37.38

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.
Files changed (102) hide show
  1. package/README.md +8 -2
  2. package/dist/wazo-sdk.js +2 -2
  3. package/esm/__tests__/api-client.test.js +7 -1
  4. package/esm/__tests__/web-rtc-client.test.js +7 -1
  5. package/esm/api/auth.js +2 -1
  6. package/esm/api/call-logd.js +1 -1
  7. package/esm/api/chatd.js +6 -0
  8. package/esm/api/confd.js +6 -0
  9. package/esm/api-client.js +7 -1
  10. package/esm/checker/Checker.js +7 -1
  11. package/esm/checker/checks/aor.js +7 -1
  12. package/esm/checker/checks/api.js +7 -1
  13. package/esm/checker/checks/index.js +7 -1
  14. package/esm/checker/checks/webrtc-transport.js +7 -1
  15. package/esm/checker/checks/webrtc.js +7 -1
  16. package/esm/domain/AdHocAPIConference.js +16 -6
  17. package/esm/domain/CallLog.js +1 -1
  18. package/esm/domain/CallSession.js +14 -0
  19. package/esm/domain/Features.js +7 -1
  20. package/esm/domain/Phone/CTIPhone.js +21 -1
  21. package/esm/domain/Phone/WebRTCPhone.js +42 -11
  22. package/esm/domain/Profile.js +6 -0
  23. package/esm/domain/SwitchboardCall.js +5 -5
  24. package/esm/domain/__tests__/CallLog.test.js +5 -1
  25. package/esm/domain/__tests__/CallSession.test.js +14 -0
  26. package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
  27. package/esm/domain/__tests__/Profile.test.js +6 -0
  28. package/esm/domain/__tests__/Room.test.js +14 -0
  29. package/esm/domain/__tests__/Session.test.js +6 -0
  30. package/esm/index.js +83 -29
  31. package/esm/service/CallApi.js +7 -1
  32. package/esm/service/getApiClient.js +7 -1
  33. package/esm/simple/Auth.js +84 -30
  34. package/esm/simple/Configuration.js +83 -29
  35. package/esm/simple/Directory.js +7 -1
  36. package/esm/simple/Phone.js +83 -29
  37. package/esm/simple/index.js +83 -29
  38. package/esm/simple/room/LocalParticipant.js +83 -29
  39. package/esm/simple/room/Participant.js +83 -29
  40. package/esm/simple/room/RemoteParticipant.js +83 -29
  41. package/esm/simple/room/Room.js +83 -29
  42. package/esm/simple/room/SipRoom.js +83 -29
  43. package/esm/simple/room/Stream.js +83 -29
  44. package/esm/simple/room/__tests__/RemoteParticipant.test.js +83 -29
  45. package/esm/simple/utils.js +83 -29
  46. package/esm/web-rtc-client.js +7 -1
  47. package/lib/__tests__/api-client.test.js +7 -1
  48. package/lib/__tests__/web-rtc-client.test.js +7 -1
  49. package/lib/api/auth.js +3 -0
  50. package/lib/api/call-logd.js +1 -1
  51. package/lib/api/chatd.js +6 -0
  52. package/lib/api/confd.js +6 -0
  53. package/lib/api-client.js +7 -1
  54. package/lib/checker/Checker.js +7 -1
  55. package/lib/checker/checks/aor.js +7 -1
  56. package/lib/checker/checks/api.js +7 -1
  57. package/lib/checker/checks/index.js +7 -1
  58. package/lib/checker/checks/webrtc-transport.js +7 -1
  59. package/lib/checker/checks/webrtc.js +7 -1
  60. package/lib/domain/AdHocAPIConference.js +16 -6
  61. package/lib/domain/CallLog.js +1 -1
  62. package/lib/domain/CallSession.js +14 -0
  63. package/lib/domain/Features.js +7 -1
  64. package/lib/domain/Phone/CTIPhone.js +21 -1
  65. package/lib/domain/Phone/WebRTCPhone.js +42 -11
  66. package/lib/domain/Profile.js +6 -0
  67. package/lib/domain/SwitchboardCall.js +5 -5
  68. package/lib/domain/__tests__/CallLog.test.js +5 -1
  69. package/lib/domain/__tests__/CallSession.test.js +14 -0
  70. package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
  71. package/lib/domain/__tests__/Profile.test.js +6 -0
  72. package/lib/domain/__tests__/Room.test.js +14 -0
  73. package/lib/domain/__tests__/Session.test.js +6 -0
  74. package/lib/index.js +83 -29
  75. package/lib/service/CallApi.js +7 -1
  76. package/lib/service/getApiClient.js +7 -1
  77. package/lib/simple/Auth.js +84 -29
  78. package/lib/simple/Configuration.js +83 -29
  79. package/lib/simple/Directory.js +7 -1
  80. package/lib/simple/Phone.js +83 -29
  81. package/lib/simple/index.js +83 -29
  82. package/lib/simple/room/LocalParticipant.js +83 -29
  83. package/lib/simple/room/Participant.js +83 -29
  84. package/lib/simple/room/RemoteParticipant.js +83 -29
  85. package/lib/simple/room/Room.js +83 -29
  86. package/lib/simple/room/SipRoom.js +83 -29
  87. package/lib/simple/room/Stream.js +83 -29
  88. package/lib/simple/room/__tests__/RemoteParticipant.test.js +83 -29
  89. package/lib/simple/utils.js +83 -29
  90. package/lib/web-rtc-client.js +7 -1
  91. package/package.json +1 -1
  92. package/src/api/auth.js +2 -1
  93. package/src/domain/AdHocAPIConference.js +9 -5
  94. package/src/domain/CallLog.js +1 -1
  95. package/src/domain/CallSession.js +14 -0
  96. package/src/domain/Phone/WebRTCPhone.js +28 -11
  97. package/src/domain/Profile.js +6 -0
  98. package/src/domain/SwitchboardCall.js +5 -5
  99. package/src/domain/__tests__/CallLog.test.js +4 -0
  100. package/src/simple/Auth.js +13 -2
  101. package/src/simple/Phone.js +6 -6
  102. package/src/simple/index.js +2 -1
@@ -59,6 +59,7 @@ var updateFrom = (instance , from ) => {
59
59
 
60
60
 
61
61
 
62
+
62
63
 
63
64
 
64
65
  class CallSession {
@@ -121,6 +122,8 @@ class CallSession {
121
122
 
122
123
 
123
124
 
125
+
126
+
124
127
 
125
128
 
126
129
 
@@ -152,6 +155,7 @@ class CallSession {
152
155
  videoRemotelyDowngraded,
153
156
  sipSession,
154
157
  answerTime,
158
+ conference,
155
159
  } ) {
156
160
  this.callId = callId;
157
161
  this.sipCallId = sipCallId;
@@ -180,6 +184,7 @@ class CallSession {
180
184
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
181
185
  this.sipSession = sipSession;
182
186
  this.answerTime = answerTime || this.answerTime;
187
+ this.conference = conference;
183
188
 
184
189
  // Useful to compare instead of instanceof with minified code
185
190
  this.type = 'CallSession';
@@ -237,6 +242,10 @@ class CallSession {
237
242
  this.screensharing = false;
238
243
  }
239
244
 
245
+ setIsConference(conference ) {
246
+ this.conference = conference;
247
+ }
248
+
240
249
  isIncoming() {
241
250
  return !this.isCaller && !this.answered;
242
251
  }
@@ -313,6 +322,10 @@ class CallSession {
313
322
  return this.sipStatus === SessionState.Terminated;
314
323
  }
315
324
 
325
+ isConference() {
326
+ return this.conference;
327
+ }
328
+
316
329
  getElapsedTimeInSeconds() {
317
330
  if (!this.startTime) {
318
331
  return 0;
@@ -404,6 +417,7 @@ class CallSession {
404
417
  cameraEnabled: false,
405
418
  dialedExtension: call.dialedExtension,
406
419
  call,
420
+ conference: false, // @FIXME?
407
421
  });
408
422
  }
409
423
  }
@@ -59,6 +59,7 @@ var updateFrom = (instance , from ) => {
59
59
 
60
60
 
61
61
 
62
+
62
63
 
63
64
 
64
65
  class CallSession {
@@ -121,6 +122,8 @@ class CallSession {
121
122
 
122
123
 
123
124
 
125
+
126
+
124
127
 
125
128
 
126
129
 
@@ -152,6 +155,7 @@ class CallSession {
152
155
  videoRemotelyDowngraded,
153
156
  sipSession,
154
157
  answerTime,
158
+ conference,
155
159
  } ) {
156
160
  this.callId = callId;
157
161
  this.sipCallId = sipCallId;
@@ -180,6 +184,7 @@ class CallSession {
180
184
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
181
185
  this.sipSession = sipSession;
182
186
  this.answerTime = answerTime || this.answerTime;
187
+ this.conference = conference;
183
188
 
184
189
  // Useful to compare instead of instanceof with minified code
185
190
  this.type = 'CallSession';
@@ -237,6 +242,10 @@ class CallSession {
237
242
  this.screensharing = false;
238
243
  }
239
244
 
245
+ setIsConference(conference ) {
246
+ this.conference = conference;
247
+ }
248
+
240
249
  isIncoming() {
241
250
  return !this.isCaller && !this.answered;
242
251
  }
@@ -313,6 +322,10 @@ class CallSession {
313
322
  return this.sipStatus === SessionState.Terminated;
314
323
  }
315
324
 
325
+ isConference() {
326
+ return this.conference;
327
+ }
328
+
316
329
  getElapsedTimeInSeconds() {
317
330
  if (!this.startTime) {
318
331
  return 0;
@@ -404,6 +417,7 @@ class CallSession {
404
417
  cameraEnabled: false,
405
418
  dialedExtension: call.dialedExtension,
406
419
  call,
420
+ conference: false, // @FIXME?
407
421
  });
408
422
  }
409
423
  }
@@ -191,6 +191,7 @@ const LINE_STATE = {
191
191
 
192
192
 
193
193
 
194
+
194
195
 
195
196
 
196
197
 
@@ -227,6 +228,7 @@ const LINE_STATE = {
227
228
 
228
229
 
229
230
 
231
+
230
232
 
231
233
 
232
234
 
@@ -258,6 +260,7 @@ class Profile {
258
260
 
259
261
 
260
262
 
263
+
261
264
 
262
265
 
263
266
 
@@ -274,6 +277,7 @@ class Profile {
274
277
  lines: plain.lines.map(line => Line.parse(line)),
275
278
  username: plain.username,
276
279
  mobileNumber: plain.mobile_phone_number || '',
280
+ ringSeconds: plain.ring_seconds,
277
281
  forwards: [
278
282
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
279
283
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -310,6 +314,7 @@ class Profile {
310
314
  switchboards,
311
315
  agent,
312
316
  status,
317
+ ringSeconds,
313
318
  sipLines,
314
319
  callPickupTargetUsers,
315
320
  onlineCallRecordEnabled,
@@ -331,6 +336,7 @@ class Profile {
331
336
  this.status = status;
332
337
  this.callPickupTargetUsers = callPickupTargetUsers;
333
338
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
339
+ this.ringSeconds = ringSeconds;
334
340
 
335
341
  this.sipLines = sipLines || [];
336
342
  }
@@ -59,6 +59,7 @@ var updateFrom = (instance , from ) => {
59
59
 
60
60
 
61
61
 
62
+
62
63
 
63
64
 
64
65
  class CallSession {
@@ -121,6 +122,8 @@ class CallSession {
121
122
 
122
123
 
123
124
 
125
+
126
+
124
127
 
125
128
 
126
129
 
@@ -152,6 +155,7 @@ class CallSession {
152
155
  videoRemotelyDowngraded,
153
156
  sipSession,
154
157
  answerTime,
158
+ conference,
155
159
  } ) {
156
160
  this.callId = callId;
157
161
  this.sipCallId = sipCallId;
@@ -180,6 +184,7 @@ class CallSession {
180
184
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
181
185
  this.sipSession = sipSession;
182
186
  this.answerTime = answerTime || this.answerTime;
187
+ this.conference = conference;
183
188
 
184
189
  // Useful to compare instead of instanceof with minified code
185
190
  this.type = 'CallSession';
@@ -237,6 +242,10 @@ class CallSession {
237
242
  this.screensharing = false;
238
243
  }
239
244
 
245
+ setIsConference(conference ) {
246
+ this.conference = conference;
247
+ }
248
+
240
249
  isIncoming() {
241
250
  return !this.isCaller && !this.answered;
242
251
  }
@@ -313,6 +322,10 @@ class CallSession {
313
322
  return this.sipStatus === SessionState.Terminated;
314
323
  }
315
324
 
325
+ isConference() {
326
+ return this.conference;
327
+ }
328
+
316
329
  getElapsedTimeInSeconds() {
317
330
  if (!this.startTime) {
318
331
  return 0;
@@ -404,6 +417,7 @@ class CallSession {
404
417
  cameraEnabled: false,
405
418
  dialedExtension: call.dialedExtension,
406
419
  call,
420
+ conference: false, // @FIXME?
407
421
  });
408
422
  }
409
423
  }
@@ -205,6 +205,7 @@ const LINE_STATE = {
205
205
 
206
206
 
207
207
 
208
+
208
209
 
209
210
 
210
211
 
@@ -241,6 +242,7 @@ const LINE_STATE = {
241
242
 
242
243
 
243
244
 
245
+
244
246
 
245
247
 
246
248
 
@@ -272,6 +274,7 @@ class Profile {
272
274
 
273
275
 
274
276
 
277
+
275
278
 
276
279
 
277
280
 
@@ -288,6 +291,7 @@ class Profile {
288
291
  lines: plain.lines.map(line => Line.parse(line)),
289
292
  username: plain.username,
290
293
  mobileNumber: plain.mobile_phone_number || '',
294
+ ringSeconds: plain.ring_seconds,
291
295
  forwards: [
292
296
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
293
297
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -324,6 +328,7 @@ class Profile {
324
328
  switchboards,
325
329
  agent,
326
330
  status,
331
+ ringSeconds,
327
332
  sipLines,
328
333
  callPickupTargetUsers,
329
334
  onlineCallRecordEnabled,
@@ -345,6 +350,7 @@ class Profile {
345
350
  this.status = status;
346
351
  this.callPickupTargetUsers = callPickupTargetUsers;
347
352
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
353
+ this.ringSeconds = ringSeconds;
348
354
 
349
355
  this.sipLines = sipLines || [];
350
356
  }
package/esm/index.js CHANGED
@@ -1072,6 +1072,7 @@ const LINE_STATE = {
1072
1072
 
1073
1073
 
1074
1074
 
1075
+
1075
1076
 
1076
1077
 
1077
1078
 
@@ -1108,6 +1109,7 @@ const LINE_STATE = {
1108
1109
 
1109
1110
 
1110
1111
 
1112
+
1111
1113
 
1112
1114
 
1113
1115
 
@@ -1139,6 +1141,7 @@ class Profile {
1139
1141
 
1140
1142
 
1141
1143
 
1144
+
1142
1145
 
1143
1146
 
1144
1147
 
@@ -1155,6 +1158,7 @@ class Profile {
1155
1158
  lines: plain.lines.map(line => Line.parse(line)),
1156
1159
  username: plain.username,
1157
1160
  mobileNumber: plain.mobile_phone_number || '',
1161
+ ringSeconds: plain.ring_seconds,
1158
1162
  forwards: [
1159
1163
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1160
1164
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1191,6 +1195,7 @@ class Profile {
1191
1195
  switchboards,
1192
1196
  agent,
1193
1197
  status,
1198
+ ringSeconds,
1194
1199
  sipLines,
1195
1200
  callPickupTargetUsers,
1196
1201
  onlineCallRecordEnabled,
@@ -1212,6 +1217,7 @@ class Profile {
1212
1217
  this.status = status;
1213
1218
  this.callPickupTargetUsers = callPickupTargetUsers;
1214
1219
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1220
+ this.ringSeconds = ringSeconds;
1215
1221
 
1216
1222
  this.sipLines = sipLines || [];
1217
1223
  }
@@ -2203,6 +2209,7 @@ class Session {
2203
2209
  /* */
2204
2210
 
2205
2211
  const DEFAULT_BACKEND_USER = 'wazo_user';
2212
+ const BACKEND_LDAP_USER = 'ldap_user';
2206
2213
  const DETAULT_EXPIRATION = 3600;
2207
2214
 
2208
2215
  var authMethods = (client , baseUrl ) => ({
@@ -3281,6 +3288,7 @@ var updateFrom = (instance , from ) => {
3281
3288
 
3282
3289
 
3283
3290
 
3291
+
3284
3292
 
3285
3293
 
3286
3294
  class CallSession {
@@ -3343,6 +3351,8 @@ class CallSession {
3343
3351
 
3344
3352
 
3345
3353
 
3354
+
3355
+
3346
3356
 
3347
3357
 
3348
3358
 
@@ -3374,6 +3384,7 @@ class CallSession {
3374
3384
  videoRemotelyDowngraded,
3375
3385
  sipSession,
3376
3386
  answerTime,
3387
+ conference,
3377
3388
  } ) {
3378
3389
  this.callId = callId;
3379
3390
  this.sipCallId = sipCallId;
@@ -3402,6 +3413,7 @@ class CallSession {
3402
3413
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3403
3414
  this.sipSession = sipSession;
3404
3415
  this.answerTime = answerTime || this.answerTime;
3416
+ this.conference = conference;
3405
3417
 
3406
3418
  // Useful to compare instead of instanceof with minified code
3407
3419
  this.type = 'CallSession';
@@ -3459,6 +3471,10 @@ class CallSession {
3459
3471
  this.screensharing = false;
3460
3472
  }
3461
3473
 
3474
+ setIsConference(conference ) {
3475
+ this.conference = conference;
3476
+ }
3477
+
3462
3478
  isIncoming() {
3463
3479
  return !this.isCaller && !this.answered;
3464
3480
  }
@@ -3535,6 +3551,10 @@ class CallSession {
3535
3551
  return this.sipStatus === SessionState.Terminated;
3536
3552
  }
3537
3553
 
3554
+ isConference() {
3555
+ return this.conference;
3556
+ }
3557
+
3538
3558
  getElapsedTimeInSeconds() {
3539
3559
  if (!this.startTime) {
3540
3560
  return 0;
@@ -3626,6 +3646,7 @@ class CallSession {
3626
3646
  cameraEnabled: false,
3627
3647
  dialedExtension: call.dialedExtension,
3628
3648
  call,
3649
+ conference: false, // @FIXME?
3629
3650
  });
3630
3651
  }
3631
3652
  }
@@ -3721,7 +3742,7 @@ class Recording {
3721
3742
 
3722
3743
 
3723
3744
 
3724
-
3745
+
3725
3746
 
3726
3747
 
3727
3748
 
@@ -9181,7 +9202,7 @@ class Room$1 {
9181
9202
 
9182
9203
 
9183
9204
 
9184
-
9205
+
9185
9206
 
9186
9207
 
9187
9208
 
@@ -9207,7 +9228,7 @@ class SwitchboardCall {
9207
9228
 
9208
9229
 
9209
9230
 
9210
-
9231
+
9211
9232
 
9212
9233
 
9213
9234
 
@@ -9221,7 +9242,7 @@ class SwitchboardCall {
9221
9242
  callerIdName: plain.caller_id_name || null,
9222
9243
  callerIdNumber: plain.caller_id_number || null,
9223
9244
  participantId: plain.participantId || null,
9224
- startTime: plain.startTime,
9245
+ answerTime: plain.startTime,
9225
9246
  state: plain.state,
9226
9247
  switchboardName: plain.switchboardName,
9227
9248
  switchboardUuid: plain.switchboardUuid,
@@ -9234,7 +9255,7 @@ class SwitchboardCall {
9234
9255
  callerIdName,
9235
9256
  callerIdNumber,
9236
9257
  participantId,
9237
- startTime,
9258
+ answerTime,
9238
9259
  state,
9239
9260
  switchboardName,
9240
9261
  switchboardUuid,
@@ -9244,7 +9265,7 @@ class SwitchboardCall {
9244
9265
  this.callerIdName = callerIdName;
9245
9266
  this.callerIdNumber = callerIdNumber;
9246
9267
  this.participantId = participantId;
9247
- this.startTime = startTime;
9268
+ this.answerTime = answerTime;
9248
9269
  this.state = state;
9249
9270
  this.switchboardName = switchboardName;
9250
9271
  this.switchboardUuid = switchboardUuid;
@@ -10092,7 +10113,11 @@ class WebRTCPhone extends Emitter {
10092
10113
  accept(callSession , cameraEnabled ) {
10093
10114
  logger$7.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
10094
10115
  if (this.currentSipSession) {
10095
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
10116
+ this.holdSipSession(
10117
+ this.currentSipSession,
10118
+ this.currentCallSession,
10119
+ true,
10120
+ );
10096
10121
  }
10097
10122
 
10098
10123
  if (!callSession) {
@@ -10185,22 +10210,22 @@ class WebRTCPhone extends Emitter {
10185
10210
  }
10186
10211
  }
10187
10212
 
10188
- hold(callSession , withEvent = true, isConference = false) {
10213
+ hold(callSession , withEvent = true) {
10189
10214
  logger$7.info('WebRTC hold', { id: callSession.getId() });
10190
10215
 
10191
10216
  const sipSession = this.findSipSession(callSession);
10192
10217
 
10193
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
10218
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
10194
10219
  }
10195
10220
 
10196
10221
  // @Deprecated
10197
- unhold(callSession , withEvent = true, isConference = false) {
10222
+ unhold(callSession , withEvent = true) {
10198
10223
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
10199
10224
 
10200
- return this.resume(callSession, isConference, withEvent);
10225
+ return this.resume(callSession, withEvent);
10201
10226
  }
10202
10227
 
10203
- resume(callSession , isConference = false, withEvent = true) {
10228
+ resume(callSession , withEvent = true) {
10204
10229
  logger$7.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
10205
10230
 
10206
10231
  const sipSession = this.findSipSession(callSession);
@@ -10213,10 +10238,14 @@ class WebRTCPhone extends Emitter {
10213
10238
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
10214
10239
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
10215
10240
  logger$7.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
10216
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
10241
+ this.holdSipSession(
10242
+ this.currentSipSession,
10243
+ this.currentCallSession,
10244
+ withEvent,
10245
+ );
10217
10246
  }
10218
10247
 
10219
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
10248
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
10220
10249
  this.currentSipSession = sipSession;
10221
10250
  if (callSession) {
10222
10251
  this.currentCallSession = callSession;
@@ -10229,7 +10258,6 @@ class WebRTCPhone extends Emitter {
10229
10258
  sipSession ,
10230
10259
  callSession ,
10231
10260
  withEvent = true,
10232
- isConference = false,
10233
10261
  ) {
10234
10262
  if (!sipSession) {
10235
10263
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -10250,6 +10278,8 @@ class WebRTCPhone extends Emitter {
10250
10278
  await this.client.downgradeToAudio(sipSession);
10251
10279
  }
10252
10280
 
10281
+ const isConference = !!callSession && callSession.isConference();
10282
+
10253
10283
  const promise = this.client.hold(sipSession, isConference, hasVideo);
10254
10284
  if (withEvent) {
10255
10285
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -10262,11 +10292,13 @@ class WebRTCPhone extends Emitter {
10262
10292
  sipSession ,
10263
10293
  callSession ,
10264
10294
  withEvent = true,
10265
- isConference = false,
10266
10295
  ) {
10267
10296
  if (!sipSession) {
10268
10297
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
10269
10298
  }
10299
+
10300
+ const isConference = !!callSession && callSession.isConference();
10301
+
10270
10302
  const sessionId = this.getSipSessionId(sipSession);
10271
10303
  logger$7.info('WebRTC unhold sip session', { sessionId, isConference });
10272
10304
 
@@ -10408,7 +10440,11 @@ class WebRTCPhone extends Emitter {
10408
10440
  await this.client.register();
10409
10441
  }
10410
10442
  if (this.currentSipSession) {
10411
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
10443
+ this.holdSipSession(
10444
+ this.currentSipSession,
10445
+ this.currentCallSession,
10446
+ true,
10447
+ ).catch(e => {
10412
10448
  logger$7.warn('Unable to hold current session when making another call', e);
10413
10449
  });
10414
10450
  }
@@ -10423,6 +10459,7 @@ class WebRTCPhone extends Emitter {
10423
10459
  return Promise.resolve(null);
10424
10460
  }
10425
10461
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
10462
+ callSession.setIsConference(conference);
10426
10463
  callSession.creationTime = new Date();
10427
10464
  this._updateCallSession(callSession);
10428
10465
 
@@ -11001,6 +11038,7 @@ class WebRTCPhone extends Emitter {
11001
11038
  recording: fromSession ? fromSession.isRecording() : false,
11002
11039
  recordingPaused: false, // @TODO
11003
11040
  sipSession,
11041
+ conference: !!fromSession && fromSession.isConference(),
11004
11042
  ...extra,
11005
11043
  });
11006
11044
 
@@ -11659,6 +11697,7 @@ const getCallableNumber = (number , country ) => {
11659
11697
 
11660
11698
  class InvalidSubscription extends Error {}
11661
11699
  class InvalidAuthorization extends Error {}
11700
+ class NoTenantIdError extends Error {}
11662
11701
 
11663
11702
  const logger$5 = IssueReporter$1.loggerFor('simple-auth');
11664
11703
 
@@ -11672,11 +11711,15 @@ class Auth {
11672
11711
 
11673
11712
 
11674
11713
 
11714
+
11715
+
11675
11716
 
11676
11717
  constructor() {
11677
11718
  this.expiration = DETAULT_EXPIRATION;
11678
11719
  this.authenticated = false;
11679
11720
  this.minSubscriptionType = null;
11721
+ this.BACKEND_WAZO = DEFAULT_BACKEND_USER;
11722
+ this.BACKEND_LDAP = BACKEND_LDAP_USER;
11680
11723
  }
11681
11724
 
11682
11725
  init(clientId ,
@@ -11709,12 +11752,18 @@ class Auth {
11709
11752
  setFetchOptions(options);
11710
11753
  }
11711
11754
 
11712
- async logIn(username , password ) {
11755
+ async logIn(username , password , backend , tenantId ) {
11756
+ if (backend && backend !== this.BACKEND_WAZO && !tenantId) {
11757
+ throw new NoTenantIdError('No tenant id');
11758
+ }
11759
+
11713
11760
  this.authenticated = false;
11714
11761
  this.session = null;
11715
11762
  const rawSession = await getApiClient().auth.logIn({
11716
11763
  username,
11717
11764
  password,
11765
+ backend,
11766
+ tenantId,
11718
11767
  expiration: this.expiration,
11719
11768
  mobile: this.mobile,
11720
11769
  });
@@ -11944,7 +11993,7 @@ var Auth$1 = global.wazoAuthInstance;
11944
11993
 
11945
11994
 
11946
11995
 
11947
-
11996
+
11948
11997
 
11949
11998
 
11950
11999
 
@@ -11964,7 +12013,7 @@ class AdHocAPIConference {
11964
12013
 
11965
12014
 
11966
12015
 
11967
-
12016
+
11968
12017
 
11969
12018
 
11970
12019
 
@@ -11976,7 +12025,7 @@ class AdHocAPIConference {
11976
12025
  participants,
11977
12026
  started,
11978
12027
  finished,
11979
- startTime,
12028
+ answerTime,
11980
12029
  conferenceId,
11981
12030
  muted,
11982
12031
  paused,
@@ -11986,16 +12035,20 @@ class AdHocAPIConference {
11986
12035
  this.participants = participants || {};
11987
12036
  this.started = started || false;
11988
12037
  this.finished = finished || false;
11989
- this.startTime = startTime;
12038
+ this.answerTime = answerTime;
11990
12039
  this.conferenceId = conferenceId || '';
11991
12040
  this.muted = muted || false;
11992
12041
  this.paused = paused || false;
12042
+
12043
+ if (this.host) {
12044
+ this.host.setIsConference(true);
12045
+ }
11993
12046
  }
11994
12047
 
11995
12048
  async start() {
11996
12049
  this.started = true;
11997
12050
  // $FlowFixMe
11998
- this.startTime = Object.values(this.participants).length ? Object.values(this.participants)[0].startTime : null;
12051
+ this.answerTime = Object.values(this.participants).length ? Object.values(this.participants)[0].answerTime : null;
11999
12052
 
12000
12053
  const participantIds = Object.keys(this.participants);
12001
12054
  const conference = await getApiClient().calld.createAdHocConference(this.host.callId, participantIds);
@@ -12284,16 +12337,16 @@ class Phone extends Emitter {
12284
12337
  }
12285
12338
  }
12286
12339
 
12287
- hold(callSession , isConference = false) {
12288
- return this.phone && this.phone.hold(callSession, true, isConference);
12340
+ hold(callSession ) {
12341
+ return this.phone && this.phone.hold(callSession, true);
12289
12342
  }
12290
12343
 
12291
- unhold(callSession , isConference = false) {
12292
- return this.phone && this.phone.unhold(callSession, true, isConference);
12344
+ unhold(callSession ) {
12345
+ return this.phone && this.phone.unhold(callSession, true);
12293
12346
  }
12294
12347
 
12295
- resume(callSession , isConference = false) {
12296
- return this.phone && this.phone.resume(callSession, isConference);
12348
+ resume(callSession ) {
12349
+ return this.phone && this.phone.resume(callSession);
12297
12350
  }
12298
12351
 
12299
12352
  reject(callSession ) {
@@ -14040,6 +14093,7 @@ const Wazo = {
14040
14093
  InvalidAuthorization,
14041
14094
  CanceledCallError,
14042
14095
  SFUNotAvailableError,
14096
+ NoTenantIdError,
14043
14097
  };
14044
14098
 
14045
14099
  if (window) {