@wazo/sdk 0.37.35 → 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.
Files changed (94) hide show
  1. package/README.md +1 -0
  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/call-logd.js +1 -1
  6. package/esm/api/chatd.js +6 -0
  7. package/esm/api/confd.js +6 -0
  8. package/esm/api-client.js +7 -1
  9. package/esm/checker/Checker.js +7 -1
  10. package/esm/checker/checks/aor.js +7 -1
  11. package/esm/checker/checks/api.js +7 -1
  12. package/esm/checker/checks/index.js +7 -1
  13. package/esm/checker/checks/webrtc-transport.js +7 -1
  14. package/esm/checker/checks/webrtc.js +7 -1
  15. package/esm/domain/AdHocAPIConference.js +11 -1
  16. package/esm/domain/CallLog.js +1 -1
  17. package/esm/domain/CallSession.js +14 -0
  18. package/esm/domain/Features.js +7 -1
  19. package/esm/domain/Phone/CTIPhone.js +21 -1
  20. package/esm/domain/Phone/WebRTCPhone.js +42 -11
  21. package/esm/domain/Profile.js +6 -0
  22. package/esm/domain/__tests__/CallLog.test.js +5 -1
  23. package/esm/domain/__tests__/CallSession.test.js +14 -0
  24. package/esm/domain/__tests__/IndirectTransfer.test.js +14 -0
  25. package/esm/domain/__tests__/Profile.test.js +6 -0
  26. package/esm/domain/__tests__/Room.test.js +14 -0
  27. package/esm/domain/__tests__/Session.test.js +6 -0
  28. package/esm/index.js +59 -18
  29. package/esm/service/CallApi.js +7 -1
  30. package/esm/service/getApiClient.js +7 -1
  31. package/esm/simple/Auth.js +59 -18
  32. package/esm/simple/Configuration.js +59 -18
  33. package/esm/simple/Directory.js +7 -1
  34. package/esm/simple/Phone.js +59 -18
  35. package/esm/simple/index.js +59 -18
  36. package/esm/simple/room/LocalParticipant.js +59 -18
  37. package/esm/simple/room/Participant.js +59 -18
  38. package/esm/simple/room/RemoteParticipant.js +59 -18
  39. package/esm/simple/room/Room.js +59 -18
  40. package/esm/simple/room/SipRoom.js +59 -18
  41. package/esm/simple/room/Stream.js +59 -18
  42. package/esm/simple/room/__tests__/RemoteParticipant.test.js +59 -18
  43. package/esm/simple/utils.js +59 -18
  44. package/esm/web-rtc-client.js +7 -1
  45. package/lib/__tests__/api-client.test.js +7 -1
  46. package/lib/__tests__/web-rtc-client.test.js +7 -1
  47. package/lib/api/call-logd.js +1 -1
  48. package/lib/api/chatd.js +6 -0
  49. package/lib/api/confd.js +6 -0
  50. package/lib/api-client.js +7 -1
  51. package/lib/checker/Checker.js +7 -1
  52. package/lib/checker/checks/aor.js +7 -1
  53. package/lib/checker/checks/api.js +7 -1
  54. package/lib/checker/checks/index.js +7 -1
  55. package/lib/checker/checks/webrtc-transport.js +7 -1
  56. package/lib/checker/checks/webrtc.js +7 -1
  57. package/lib/domain/AdHocAPIConference.js +11 -1
  58. package/lib/domain/CallLog.js +1 -1
  59. package/lib/domain/CallSession.js +14 -0
  60. package/lib/domain/Features.js +7 -1
  61. package/lib/domain/Phone/CTIPhone.js +21 -1
  62. package/lib/domain/Phone/WebRTCPhone.js +42 -11
  63. package/lib/domain/Profile.js +6 -0
  64. package/lib/domain/__tests__/CallLog.test.js +5 -1
  65. package/lib/domain/__tests__/CallSession.test.js +14 -0
  66. package/lib/domain/__tests__/IndirectTransfer.test.js +14 -0
  67. package/lib/domain/__tests__/Profile.test.js +6 -0
  68. package/lib/domain/__tests__/Room.test.js +14 -0
  69. package/lib/domain/__tests__/Session.test.js +6 -0
  70. package/lib/index.js +59 -18
  71. package/lib/service/CallApi.js +7 -1
  72. package/lib/service/getApiClient.js +7 -1
  73. package/lib/simple/Auth.js +59 -18
  74. package/lib/simple/Configuration.js +59 -18
  75. package/lib/simple/Directory.js +7 -1
  76. package/lib/simple/Phone.js +59 -18
  77. package/lib/simple/index.js +59 -18
  78. package/lib/simple/room/LocalParticipant.js +59 -18
  79. package/lib/simple/room/Participant.js +59 -18
  80. package/lib/simple/room/RemoteParticipant.js +59 -18
  81. package/lib/simple/room/Room.js +59 -18
  82. package/lib/simple/room/SipRoom.js +59 -18
  83. package/lib/simple/room/Stream.js +59 -18
  84. package/lib/simple/room/__tests__/RemoteParticipant.test.js +59 -18
  85. package/lib/simple/utils.js +59 -18
  86. package/lib/web-rtc-client.js +7 -1
  87. package/package.json +1 -1
  88. package/src/domain/AdHocAPIConference.js +4 -0
  89. package/src/domain/CallLog.js +1 -1
  90. package/src/domain/CallSession.js +14 -0
  91. package/src/domain/Phone/WebRTCPhone.js +28 -11
  92. package/src/domain/Profile.js +6 -0
  93. package/src/domain/__tests__/CallLog.test.js +4 -0
  94. package/src/simple/Phone.js +6 -6
@@ -384,6 +384,7 @@ const LINE_STATE = {
384
384
 
385
385
 
386
386
 
387
+
387
388
 
388
389
 
389
390
 
@@ -420,6 +421,7 @@ const LINE_STATE = {
420
421
 
421
422
 
422
423
 
424
+
423
425
 
424
426
 
425
427
 
@@ -451,6 +453,7 @@ class Profile {
451
453
 
452
454
 
453
455
 
456
+
454
457
 
455
458
 
456
459
 
@@ -467,6 +470,7 @@ class Profile {
467
470
  lines: plain.lines.map(line => Line.parse(line)),
468
471
  username: plain.username,
469
472
  mobileNumber: plain.mobile_phone_number || '',
473
+ ringSeconds: plain.ring_seconds,
470
474
  forwards: [
471
475
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
472
476
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -503,6 +507,7 @@ class Profile {
503
507
  switchboards,
504
508
  agent,
505
509
  status,
510
+ ringSeconds,
506
511
  sipLines,
507
512
  callPickupTargetUsers,
508
513
  onlineCallRecordEnabled,
@@ -524,6 +529,7 @@ class Profile {
524
529
  this.status = status;
525
530
  this.callPickupTargetUsers = callPickupTargetUsers;
526
531
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
532
+ this.ringSeconds = ringSeconds;
527
533
 
528
534
  this.sipLines = sipLines || [];
529
535
  }
@@ -3280,6 +3286,7 @@ var updateFrom = (instance , from ) => {
3280
3286
 
3281
3287
 
3282
3288
 
3289
+
3283
3290
 
3284
3291
 
3285
3292
  class CallSession {
@@ -3342,6 +3349,8 @@ class CallSession {
3342
3349
 
3343
3350
 
3344
3351
 
3352
+
3353
+
3345
3354
 
3346
3355
 
3347
3356
 
@@ -3373,6 +3382,7 @@ class CallSession {
3373
3382
  videoRemotelyDowngraded,
3374
3383
  sipSession,
3375
3384
  answerTime,
3385
+ conference,
3376
3386
  } ) {
3377
3387
  this.callId = callId;
3378
3388
  this.sipCallId = sipCallId;
@@ -3401,6 +3411,7 @@ class CallSession {
3401
3411
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3402
3412
  this.sipSession = sipSession;
3403
3413
  this.answerTime = answerTime || this.answerTime;
3414
+ this.conference = conference;
3404
3415
 
3405
3416
  // Useful to compare instead of instanceof with minified code
3406
3417
  this.type = 'CallSession';
@@ -3458,6 +3469,10 @@ class CallSession {
3458
3469
  this.screensharing = false;
3459
3470
  }
3460
3471
 
3472
+ setIsConference(conference ) {
3473
+ this.conference = conference;
3474
+ }
3475
+
3461
3476
  isIncoming() {
3462
3477
  return !this.isCaller && !this.answered;
3463
3478
  }
@@ -3534,6 +3549,10 @@ class CallSession {
3534
3549
  return this.sipStatus === SessionState.Terminated;
3535
3550
  }
3536
3551
 
3552
+ isConference() {
3553
+ return this.conference;
3554
+ }
3555
+
3537
3556
  getElapsedTimeInSeconds() {
3538
3557
  if (!this.startTime) {
3539
3558
  return 0;
@@ -3625,6 +3644,7 @@ class CallSession {
3625
3644
  cameraEnabled: false,
3626
3645
  dialedExtension: call.dialedExtension,
3627
3646
  call,
3647
+ conference: false, // @FIXME?
3628
3648
  });
3629
3649
  }
3630
3650
  }
@@ -3720,7 +3740,7 @@ class Recording {
3720
3740
 
3721
3741
 
3722
3742
 
3723
-
3743
+
3724
3744
 
3725
3745
 
3726
3746
 
@@ -5656,6 +5676,10 @@ class AdHocAPIConference {
5656
5676
  this.conferenceId = conferenceId || '';
5657
5677
  this.muted = muted || false;
5658
5678
  this.paused = paused || false;
5679
+
5680
+ if (this.host) {
5681
+ this.host.setIsConference(true);
5682
+ }
5659
5683
  }
5660
5684
 
5661
5685
  async start() {
@@ -9365,7 +9389,11 @@ class WebRTCPhone extends Emitter {
9365
9389
  accept(callSession , cameraEnabled ) {
9366
9390
  logger$8.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9367
9391
  if (this.currentSipSession) {
9368
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9392
+ this.holdSipSession(
9393
+ this.currentSipSession,
9394
+ this.currentCallSession,
9395
+ true,
9396
+ );
9369
9397
  }
9370
9398
 
9371
9399
  if (!callSession) {
@@ -9458,22 +9486,22 @@ class WebRTCPhone extends Emitter {
9458
9486
  }
9459
9487
  }
9460
9488
 
9461
- hold(callSession , withEvent = true, isConference = false) {
9489
+ hold(callSession , withEvent = true) {
9462
9490
  logger$8.info('WebRTC hold', { id: callSession.getId() });
9463
9491
 
9464
9492
  const sipSession = this.findSipSession(callSession);
9465
9493
 
9466
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9494
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9467
9495
  }
9468
9496
 
9469
9497
  // @Deprecated
9470
- unhold(callSession , withEvent = true, isConference = false) {
9498
+ unhold(callSession , withEvent = true) {
9471
9499
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9472
9500
 
9473
- return this.resume(callSession, isConference, withEvent);
9501
+ return this.resume(callSession, withEvent);
9474
9502
  }
9475
9503
 
9476
- resume(callSession , isConference = false, withEvent = true) {
9504
+ resume(callSession , withEvent = true) {
9477
9505
  logger$8.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9478
9506
 
9479
9507
  const sipSession = this.findSipSession(callSession);
@@ -9486,10 +9514,14 @@ class WebRTCPhone extends Emitter {
9486
9514
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9487
9515
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9488
9516
  logger$8.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9489
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9517
+ this.holdSipSession(
9518
+ this.currentSipSession,
9519
+ this.currentCallSession,
9520
+ withEvent,
9521
+ );
9490
9522
  }
9491
9523
 
9492
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9524
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9493
9525
  this.currentSipSession = sipSession;
9494
9526
  if (callSession) {
9495
9527
  this.currentCallSession = callSession;
@@ -9502,7 +9534,6 @@ class WebRTCPhone extends Emitter {
9502
9534
  sipSession ,
9503
9535
  callSession ,
9504
9536
  withEvent = true,
9505
- isConference = false,
9506
9537
  ) {
9507
9538
  if (!sipSession) {
9508
9539
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9523,6 +9554,8 @@ class WebRTCPhone extends Emitter {
9523
9554
  await this.client.downgradeToAudio(sipSession);
9524
9555
  }
9525
9556
 
9557
+ const isConference = !!callSession && callSession.isConference();
9558
+
9526
9559
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9527
9560
  if (withEvent) {
9528
9561
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9535,11 +9568,13 @@ class WebRTCPhone extends Emitter {
9535
9568
  sipSession ,
9536
9569
  callSession ,
9537
9570
  withEvent = true,
9538
- isConference = false,
9539
9571
  ) {
9540
9572
  if (!sipSession) {
9541
9573
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9542
9574
  }
9575
+
9576
+ const isConference = !!callSession && callSession.isConference();
9577
+
9543
9578
  const sessionId = this.getSipSessionId(sipSession);
9544
9579
  logger$8.info('WebRTC unhold sip session', { sessionId, isConference });
9545
9580
 
@@ -9681,7 +9716,11 @@ class WebRTCPhone extends Emitter {
9681
9716
  await this.client.register();
9682
9717
  }
9683
9718
  if (this.currentSipSession) {
9684
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9719
+ this.holdSipSession(
9720
+ this.currentSipSession,
9721
+ this.currentCallSession,
9722
+ true,
9723
+ ).catch(e => {
9685
9724
  logger$8.warn('Unable to hold current session when making another call', e);
9686
9725
  });
9687
9726
  }
@@ -9696,6 +9735,7 @@ class WebRTCPhone extends Emitter {
9696
9735
  return Promise.resolve(null);
9697
9736
  }
9698
9737
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
9738
+ callSession.setIsConference(conference);
9699
9739
  callSession.creationTime = new Date();
9700
9740
  this._updateCallSession(callSession);
9701
9741
 
@@ -10274,6 +10314,7 @@ class WebRTCPhone extends Emitter {
10274
10314
  recording: fromSession ? fromSession.isRecording() : false,
10275
10315
  recordingPaused: false, // @TODO
10276
10316
  sipSession,
10317
+ conference: !!fromSession && fromSession.isConference(),
10277
10318
  ...extra,
10278
10319
  });
10279
10320
 
@@ -10530,16 +10571,16 @@ class Phone extends Emitter {
10530
10571
  }
10531
10572
  }
10532
10573
 
10533
- hold(callSession , isConference = false) {
10534
- return this.phone && this.phone.hold(callSession, true, isConference);
10574
+ hold(callSession ) {
10575
+ return this.phone && this.phone.hold(callSession, true);
10535
10576
  }
10536
10577
 
10537
- unhold(callSession , isConference = false) {
10538
- return this.phone && this.phone.unhold(callSession, true, isConference);
10578
+ unhold(callSession ) {
10579
+ return this.phone && this.phone.unhold(callSession, true);
10539
10580
  }
10540
10581
 
10541
- resume(callSession , isConference = false) {
10542
- return this.phone && this.phone.resume(callSession, isConference);
10582
+ resume(callSession ) {
10583
+ return this.phone && this.phone.resume(callSession);
10543
10584
  }
10544
10585
 
10545
10586
  reject(callSession ) {
@@ -384,6 +384,7 @@ const LINE_STATE = {
384
384
 
385
385
 
386
386
 
387
+
387
388
 
388
389
 
389
390
 
@@ -420,6 +421,7 @@ const LINE_STATE = {
420
421
 
421
422
 
422
423
 
424
+
423
425
 
424
426
 
425
427
 
@@ -451,6 +453,7 @@ class Profile {
451
453
 
452
454
 
453
455
 
456
+
454
457
 
455
458
 
456
459
 
@@ -467,6 +470,7 @@ class Profile {
467
470
  lines: plain.lines.map(line => Line.parse(line)),
468
471
  username: plain.username,
469
472
  mobileNumber: plain.mobile_phone_number || '',
473
+ ringSeconds: plain.ring_seconds,
470
474
  forwards: [
471
475
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
472
476
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -503,6 +507,7 @@ class Profile {
503
507
  switchboards,
504
508
  agent,
505
509
  status,
510
+ ringSeconds,
506
511
  sipLines,
507
512
  callPickupTargetUsers,
508
513
  onlineCallRecordEnabled,
@@ -524,6 +529,7 @@ class Profile {
524
529
  this.status = status;
525
530
  this.callPickupTargetUsers = callPickupTargetUsers;
526
531
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
532
+ this.ringSeconds = ringSeconds;
527
533
 
528
534
  this.sipLines = sipLines || [];
529
535
  }
@@ -3280,6 +3286,7 @@ var updateFrom = (instance , from ) => {
3280
3286
 
3281
3287
 
3282
3288
 
3289
+
3283
3290
 
3284
3291
 
3285
3292
  class CallSession {
@@ -3342,6 +3349,8 @@ class CallSession {
3342
3349
 
3343
3350
 
3344
3351
 
3352
+
3353
+
3345
3354
 
3346
3355
 
3347
3356
 
@@ -3373,6 +3382,7 @@ class CallSession {
3373
3382
  videoRemotelyDowngraded,
3374
3383
  sipSession,
3375
3384
  answerTime,
3385
+ conference,
3376
3386
  } ) {
3377
3387
  this.callId = callId;
3378
3388
  this.sipCallId = sipCallId;
@@ -3401,6 +3411,7 @@ class CallSession {
3401
3411
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3402
3412
  this.sipSession = sipSession;
3403
3413
  this.answerTime = answerTime || this.answerTime;
3414
+ this.conference = conference;
3404
3415
 
3405
3416
  // Useful to compare instead of instanceof with minified code
3406
3417
  this.type = 'CallSession';
@@ -3458,6 +3469,10 @@ class CallSession {
3458
3469
  this.screensharing = false;
3459
3470
  }
3460
3471
 
3472
+ setIsConference(conference ) {
3473
+ this.conference = conference;
3474
+ }
3475
+
3461
3476
  isIncoming() {
3462
3477
  return !this.isCaller && !this.answered;
3463
3478
  }
@@ -3534,6 +3549,10 @@ class CallSession {
3534
3549
  return this.sipStatus === SessionState.Terminated;
3535
3550
  }
3536
3551
 
3552
+ isConference() {
3553
+ return this.conference;
3554
+ }
3555
+
3537
3556
  getElapsedTimeInSeconds() {
3538
3557
  if (!this.startTime) {
3539
3558
  return 0;
@@ -3625,6 +3644,7 @@ class CallSession {
3625
3644
  cameraEnabled: false,
3626
3645
  dialedExtension: call.dialedExtension,
3627
3646
  call,
3647
+ conference: false, // @FIXME?
3628
3648
  });
3629
3649
  }
3630
3650
  }
@@ -3720,7 +3740,7 @@ class Recording {
3720
3740
 
3721
3741
 
3722
3742
 
3723
-
3743
+
3724
3744
 
3725
3745
 
3726
3746
 
@@ -5656,6 +5676,10 @@ class AdHocAPIConference {
5656
5676
  this.conferenceId = conferenceId || '';
5657
5677
  this.muted = muted || false;
5658
5678
  this.paused = paused || false;
5679
+
5680
+ if (this.host) {
5681
+ this.host.setIsConference(true);
5682
+ }
5659
5683
  }
5660
5684
 
5661
5685
  async start() {
@@ -9365,7 +9389,11 @@ class WebRTCPhone extends Emitter {
9365
9389
  accept(callSession , cameraEnabled ) {
9366
9390
  logger$8.info('WebRTC phone - accept call', { id: callSession ? callSession.getId() : 'n/a', cameraEnabled });
9367
9391
  if (this.currentSipSession) {
9368
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true);
9392
+ this.holdSipSession(
9393
+ this.currentSipSession,
9394
+ this.currentCallSession,
9395
+ true,
9396
+ );
9369
9397
  }
9370
9398
 
9371
9399
  if (!callSession) {
@@ -9458,22 +9486,22 @@ class WebRTCPhone extends Emitter {
9458
9486
  }
9459
9487
  }
9460
9488
 
9461
- hold(callSession , withEvent = true, isConference = false) {
9489
+ hold(callSession , withEvent = true) {
9462
9490
  logger$8.info('WebRTC hold', { id: callSession.getId() });
9463
9491
 
9464
9492
  const sipSession = this.findSipSession(callSession);
9465
9493
 
9466
- return sipSession ? this.holdSipSession(sipSession, callSession, withEvent, isConference) : null;
9494
+ return sipSession ? this.holdSipSession(sipSession, callSession, withEvent) : null;
9467
9495
  }
9468
9496
 
9469
9497
  // @Deprecated
9470
- unhold(callSession , withEvent = true, isConference = false) {
9498
+ unhold(callSession , withEvent = true) {
9471
9499
  console.warn('Please note that `phone.unhold()` is being deprecated; `phone.resume()` is the preferred method');
9472
9500
 
9473
- return this.resume(callSession, isConference, withEvent);
9501
+ return this.resume(callSession, withEvent);
9474
9502
  }
9475
9503
 
9476
- resume(callSession , isConference = false, withEvent = true) {
9504
+ resume(callSession , withEvent = true) {
9477
9505
  logger$8.info('WebRTC resume called', { id: callSession ? callSession.getId() : null });
9478
9506
 
9479
9507
  const sipSession = this.findSipSession(callSession);
@@ -9486,10 +9514,14 @@ class WebRTCPhone extends Emitter {
9486
9514
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
9487
9515
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
9488
9516
  logger$8.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
9489
- this.holdSipSession(this.currentSipSession, this.currentCallSession);
9517
+ this.holdSipSession(
9518
+ this.currentSipSession,
9519
+ this.currentCallSession,
9520
+ withEvent,
9521
+ );
9490
9522
  }
9491
9523
 
9492
- const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
9524
+ const promise = this.unholdSipSession(sipSession, callSession, withEvent);
9493
9525
  this.currentSipSession = sipSession;
9494
9526
  if (callSession) {
9495
9527
  this.currentCallSession = callSession;
@@ -9502,7 +9534,6 @@ class WebRTCPhone extends Emitter {
9502
9534
  sipSession ,
9503
9535
  callSession ,
9504
9536
  withEvent = true,
9505
- isConference = false,
9506
9537
  ) {
9507
9538
  if (!sipSession) {
9508
9539
  return new Promise((resolve, reject) => reject(new Error('No session to hold')));
@@ -9523,6 +9554,8 @@ class WebRTCPhone extends Emitter {
9523
9554
  await this.client.downgradeToAudio(sipSession);
9524
9555
  }
9525
9556
 
9557
+ const isConference = !!callSession && callSession.isConference();
9558
+
9526
9559
  const promise = this.client.hold(sipSession, isConference, hasVideo);
9527
9560
  if (withEvent) {
9528
9561
  this.eventEmitter.emit(ON_CALL_HELD, this._createCallSession(sipSession, callSession));
@@ -9535,11 +9568,13 @@ class WebRTCPhone extends Emitter {
9535
9568
  sipSession ,
9536
9569
  callSession ,
9537
9570
  withEvent = true,
9538
- isConference = false,
9539
9571
  ) {
9540
9572
  if (!sipSession) {
9541
9573
  return new Promise((resolve, reject) => reject(new Error('No session to unhold')));
9542
9574
  }
9575
+
9576
+ const isConference = !!callSession && callSession.isConference();
9577
+
9543
9578
  const sessionId = this.getSipSessionId(sipSession);
9544
9579
  logger$8.info('WebRTC unhold sip session', { sessionId, isConference });
9545
9580
 
@@ -9681,7 +9716,11 @@ class WebRTCPhone extends Emitter {
9681
9716
  await this.client.register();
9682
9717
  }
9683
9718
  if (this.currentSipSession) {
9684
- this.holdSipSession(this.currentSipSession, this.currentCallSession, true).catch(e => {
9719
+ this.holdSipSession(
9720
+ this.currentSipSession,
9721
+ this.currentCallSession,
9722
+ true,
9723
+ ).catch(e => {
9685
9724
  logger$8.warn('Unable to hold current session when making another call', e);
9686
9725
  });
9687
9726
  }
@@ -9696,6 +9735,7 @@ class WebRTCPhone extends Emitter {
9696
9735
  return Promise.resolve(null);
9697
9736
  }
9698
9737
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
9738
+ callSession.setIsConference(conference);
9699
9739
  callSession.creationTime = new Date();
9700
9740
  this._updateCallSession(callSession);
9701
9741
 
@@ -10274,6 +10314,7 @@ class WebRTCPhone extends Emitter {
10274
10314
  recording: fromSession ? fromSession.isRecording() : false,
10275
10315
  recordingPaused: false, // @TODO
10276
10316
  sipSession,
10317
+ conference: !!fromSession && fromSession.isConference(),
10277
10318
  ...extra,
10278
10319
  });
10279
10320
 
@@ -10530,16 +10571,16 @@ class Phone extends Emitter {
10530
10571
  }
10531
10572
  }
10532
10573
 
10533
- hold(callSession , isConference = false) {
10534
- return this.phone && this.phone.hold(callSession, true, isConference);
10574
+ hold(callSession ) {
10575
+ return this.phone && this.phone.hold(callSession, true);
10535
10576
  }
10536
10577
 
10537
- unhold(callSession , isConference = false) {
10538
- return this.phone && this.phone.unhold(callSession, true, isConference);
10578
+ unhold(callSession ) {
10579
+ return this.phone && this.phone.unhold(callSession, true);
10539
10580
  }
10540
10581
 
10541
- resume(callSession , isConference = false) {
10542
- return this.phone && this.phone.resume(callSession, isConference);
10582
+ resume(callSession ) {
10583
+ return this.phone && this.phone.resume(callSession);
10543
10584
  }
10544
10585
 
10545
10586
  reject(callSession ) {
@@ -1052,6 +1052,7 @@ const LINE_STATE = {
1052
1052
 
1053
1053
 
1054
1054
 
1055
+
1055
1056
 
1056
1057
 
1057
1058
 
@@ -1088,6 +1089,7 @@ const LINE_STATE = {
1088
1089
 
1089
1090
 
1090
1091
 
1092
+
1091
1093
 
1092
1094
 
1093
1095
 
@@ -1119,6 +1121,7 @@ class Profile {
1119
1121
 
1120
1122
 
1121
1123
 
1124
+
1122
1125
 
1123
1126
 
1124
1127
 
@@ -1135,6 +1138,7 @@ class Profile {
1135
1138
  lines: plain.lines.map(line => Line.parse(line)),
1136
1139
  username: plain.username,
1137
1140
  mobileNumber: plain.mobile_phone_number || '',
1141
+ ringSeconds: plain.ring_seconds,
1138
1142
  forwards: [
1139
1143
  ForwardOption.parse(plain.forwards.unconditional, FORWARD_KEYS.UNCONDITIONAL),
1140
1144
  ForwardOption.parse(plain.forwards.noanswer, FORWARD_KEYS.NO_ANSWER),
@@ -1171,6 +1175,7 @@ class Profile {
1171
1175
  switchboards,
1172
1176
  agent,
1173
1177
  status,
1178
+ ringSeconds,
1174
1179
  sipLines,
1175
1180
  callPickupTargetUsers,
1176
1181
  onlineCallRecordEnabled,
@@ -1192,6 +1197,7 @@ class Profile {
1192
1197
  this.status = status;
1193
1198
  this.callPickupTargetUsers = callPickupTargetUsers;
1194
1199
  this.onlineCallRecordEnabled = onlineCallRecordEnabled;
1200
+ this.ringSeconds = ringSeconds;
1195
1201
 
1196
1202
  this.sipLines = sipLines || [];
1197
1203
  }
@@ -3295,7 +3301,7 @@ class Recording {
3295
3301
 
3296
3302
 
3297
3303
 
3298
-
3304
+
3299
3305
 
3300
3306
 
3301
3307