@wazo/sdk 0.37.28 → 0.37.29

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 (43) hide show
  1. package/dist/wazo-sdk.js +2 -2
  2. package/esm/domain/CallSession.js +15 -3
  3. package/esm/domain/Phone/CTIPhone.js +15 -3
  4. package/esm/domain/Phone/WebRTCPhone.js +17 -3
  5. package/esm/domain/__tests__/CallSession.test.js +32 -3
  6. package/esm/domain/__tests__/IndirectTransfer.test.js +15 -3
  7. package/esm/domain/__tests__/Room.test.js +15 -3
  8. package/esm/index.js +17 -3
  9. package/esm/simple/Auth.js +17 -3
  10. package/esm/simple/Configuration.js +17 -3
  11. package/esm/simple/Phone.js +17 -3
  12. package/esm/simple/index.js +17 -3
  13. package/esm/simple/room/LocalParticipant.js +17 -3
  14. package/esm/simple/room/Participant.js +17 -3
  15. package/esm/simple/room/RemoteParticipant.js +17 -3
  16. package/esm/simple/room/Room.js +17 -3
  17. package/esm/simple/room/SipRoom.js +17 -3
  18. package/esm/simple/room/Stream.js +17 -3
  19. package/esm/simple/room/__tests__/RemoteParticipant.test.js +17 -3
  20. package/esm/simple/utils.js +17 -3
  21. package/lib/domain/CallSession.js +15 -3
  22. package/lib/domain/Phone/CTIPhone.js +15 -3
  23. package/lib/domain/Phone/WebRTCPhone.js +17 -3
  24. package/lib/domain/__tests__/CallSession.test.js +32 -3
  25. package/lib/domain/__tests__/IndirectTransfer.test.js +15 -3
  26. package/lib/domain/__tests__/Room.test.js +15 -3
  27. package/lib/index.js +17 -3
  28. package/lib/simple/Auth.js +17 -3
  29. package/lib/simple/Configuration.js +17 -3
  30. package/lib/simple/Phone.js +17 -3
  31. package/lib/simple/index.js +17 -3
  32. package/lib/simple/room/LocalParticipant.js +17 -3
  33. package/lib/simple/room/Participant.js +17 -3
  34. package/lib/simple/room/RemoteParticipant.js +17 -3
  35. package/lib/simple/room/Room.js +17 -3
  36. package/lib/simple/room/SipRoom.js +17 -3
  37. package/lib/simple/room/Stream.js +17 -3
  38. package/lib/simple/room/__tests__/RemoteParticipant.test.js +17 -3
  39. package/lib/simple/utils.js +17 -3
  40. package/package.json +1 -1
  41. package/src/domain/CallSession.js +16 -4
  42. package/src/domain/Phone/WebRTCPhone.js +2 -0
  43. package/src/domain/__tests__/CallSession.test.js +17 -0
@@ -248,6 +248,7 @@ var updateFrom = (instance , from ) => {
248
248
 
249
249
 
250
250
 
251
+
251
252
 
252
253
 
253
254
 
@@ -295,14 +296,14 @@ class CallSession {
295
296
 
296
297
 
297
298
 
299
+ // = creationTime
300
+
298
301
 
299
302
 
300
303
 
301
304
 
302
305
 
303
306
 
304
-
305
-
306
307
 
307
308
 
308
309
 
@@ -366,6 +367,7 @@ class CallSession {
366
367
  recordingPaused,
367
368
  videoRemotelyDowngraded,
368
369
  sipSession,
370
+ answerTime,
369
371
  } ) {
370
372
  this.callId = callId;
371
373
  this.sipCallId = sipCallId;
@@ -393,6 +395,7 @@ class CallSession {
393
395
  this.recordingPaused = recordingPaused || false;
394
396
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
395
397
  this.sipSession = sipSession;
398
+ this.answerTime = answerTime || this.answerTime;
396
399
 
397
400
  // Useful to compare instead of instanceof with minified code
398
401
  this.type = 'CallSession';
@@ -423,7 +426,7 @@ class CallSession {
423
426
  }
424
427
 
425
428
  answer() {
426
- this.answered = true;
429
+ this.answerTime = new Date();
427
430
  }
428
431
 
429
432
  systemAnswer() {
@@ -579,6 +582,15 @@ class CallSession {
579
582
  return newFrom(callSession, CallSession);
580
583
  }
581
584
 
585
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
586
+ set answered(value ) {
587
+ this.answerTime = value ? new Date() : null;
588
+ }
589
+
590
+ get answered() {
591
+ return !!this.answerTime;
592
+ }
593
+
582
594
  static parseCall(call ) {
583
595
  return new CallSession({
584
596
  callId: call.id,
@@ -9072,6 +9084,7 @@ class WebRTCPhone extends Emitter {
9072
9084
  this.removeIncomingSessions(sipSessionId);
9073
9085
  }
9074
9086
 
9087
+ callSession.answerTime = new Date();
9075
9088
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9076
9089
 
9077
9090
  return callSession;
@@ -9287,6 +9300,7 @@ class WebRTCPhone extends Emitter {
9287
9300
  }
9288
9301
 
9289
9302
  this.shouldSendReinvite = false;
9303
+ callSession.answerTime = new Date();
9290
9304
  this.acceptedSessions[callSession.getId()] = true;
9291
9305
 
9292
9306
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3248,6 +3248,7 @@ var updateFrom = (instance , from ) => {
3248
3248
 
3249
3249
 
3250
3250
 
3251
+
3251
3252
 
3252
3253
 
3253
3254
 
@@ -3295,14 +3296,14 @@ class CallSession {
3295
3296
 
3296
3297
 
3297
3298
 
3299
+ // = creationTime
3300
+
3298
3301
 
3299
3302
 
3300
3303
 
3301
3304
 
3302
3305
 
3303
3306
 
3304
-
3305
-
3306
3307
 
3307
3308
 
3308
3309
 
@@ -3366,6 +3367,7 @@ class CallSession {
3366
3367
  recordingPaused,
3367
3368
  videoRemotelyDowngraded,
3368
3369
  sipSession,
3370
+ answerTime,
3369
3371
  } ) {
3370
3372
  this.callId = callId;
3371
3373
  this.sipCallId = sipCallId;
@@ -3393,6 +3395,7 @@ class CallSession {
3393
3395
  this.recordingPaused = recordingPaused || false;
3394
3396
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3395
3397
  this.sipSession = sipSession;
3398
+ this.answerTime = answerTime || this.answerTime;
3396
3399
 
3397
3400
  // Useful to compare instead of instanceof with minified code
3398
3401
  this.type = 'CallSession';
@@ -3423,7 +3426,7 @@ class CallSession {
3423
3426
  }
3424
3427
 
3425
3428
  answer() {
3426
- this.answered = true;
3429
+ this.answerTime = new Date();
3427
3430
  }
3428
3431
 
3429
3432
  systemAnswer() {
@@ -3579,6 +3582,15 @@ class CallSession {
3579
3582
  return newFrom(callSession, CallSession);
3580
3583
  }
3581
3584
 
3585
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3586
+ set answered(value ) {
3587
+ this.answerTime = value ? new Date() : null;
3588
+ }
3589
+
3590
+ get answered() {
3591
+ return !!this.answerTime;
3592
+ }
3593
+
3582
3594
  static parseCall(call ) {
3583
3595
  return new CallSession({
3584
3596
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3274,6 +3274,7 @@ var updateFrom = (instance , from ) => {
3274
3274
 
3275
3275
 
3276
3276
 
3277
+
3277
3278
 
3278
3279
 
3279
3280
 
@@ -3321,14 +3322,14 @@ class CallSession {
3321
3322
 
3322
3323
 
3323
3324
 
3325
+ // = creationTime
3326
+
3324
3327
 
3325
3328
 
3326
3329
 
3327
3330
 
3328
3331
 
3329
3332
 
3330
-
3331
-
3332
3333
 
3333
3334
 
3334
3335
 
@@ -3392,6 +3393,7 @@ class CallSession {
3392
3393
  recordingPaused,
3393
3394
  videoRemotelyDowngraded,
3394
3395
  sipSession,
3396
+ answerTime,
3395
3397
  } ) {
3396
3398
  this.callId = callId;
3397
3399
  this.sipCallId = sipCallId;
@@ -3419,6 +3421,7 @@ class CallSession {
3419
3421
  this.recordingPaused = recordingPaused || false;
3420
3422
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3421
3423
  this.sipSession = sipSession;
3424
+ this.answerTime = answerTime || this.answerTime;
3422
3425
 
3423
3426
  // Useful to compare instead of instanceof with minified code
3424
3427
  this.type = 'CallSession';
@@ -3449,7 +3452,7 @@ class CallSession {
3449
3452
  }
3450
3453
 
3451
3454
  answer() {
3452
- this.answered = true;
3455
+ this.answerTime = new Date();
3453
3456
  }
3454
3457
 
3455
3458
  systemAnswer() {
@@ -3605,6 +3608,15 @@ class CallSession {
3605
3608
  return newFrom(callSession, CallSession);
3606
3609
  }
3607
3610
 
3611
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3612
+ set answered(value ) {
3613
+ this.answerTime = value ? new Date() : null;
3614
+ }
3615
+
3616
+ get answered() {
3617
+ return !!this.answerTime;
3618
+ }
3619
+
3608
3620
  static parseCall(call ) {
3609
3621
  return new CallSession({
3610
3622
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3274,6 +3274,7 @@ var updateFrom = (instance , from ) => {
3274
3274
 
3275
3275
 
3276
3276
 
3277
+
3277
3278
 
3278
3279
 
3279
3280
 
@@ -3321,14 +3322,14 @@ class CallSession {
3321
3322
 
3322
3323
 
3323
3324
 
3325
+ // = creationTime
3326
+
3324
3327
 
3325
3328
 
3326
3329
 
3327
3330
 
3328
3331
 
3329
3332
 
3330
-
3331
-
3332
3333
 
3333
3334
 
3334
3335
 
@@ -3392,6 +3393,7 @@ class CallSession {
3392
3393
  recordingPaused,
3393
3394
  videoRemotelyDowngraded,
3394
3395
  sipSession,
3396
+ answerTime,
3395
3397
  } ) {
3396
3398
  this.callId = callId;
3397
3399
  this.sipCallId = sipCallId;
@@ -3419,6 +3421,7 @@ class CallSession {
3419
3421
  this.recordingPaused = recordingPaused || false;
3420
3422
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3421
3423
  this.sipSession = sipSession;
3424
+ this.answerTime = answerTime || this.answerTime;
3422
3425
 
3423
3426
  // Useful to compare instead of instanceof with minified code
3424
3427
  this.type = 'CallSession';
@@ -3449,7 +3452,7 @@ class CallSession {
3449
3452
  }
3450
3453
 
3451
3454
  answer() {
3452
- this.answered = true;
3455
+ this.answerTime = new Date();
3453
3456
  }
3454
3457
 
3455
3458
  systemAnswer() {
@@ -3605,6 +3608,15 @@ class CallSession {
3605
3608
  return newFrom(callSession, CallSession);
3606
3609
  }
3607
3610
 
3611
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3612
+ set answered(value ) {
3613
+ this.answerTime = value ? new Date() : null;
3614
+ }
3615
+
3616
+ get answered() {
3617
+ return !!this.answerTime;
3618
+ }
3619
+
3608
3620
  static parseCall(call ) {
3609
3621
  return new CallSession({
3610
3622
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3248,6 +3248,7 @@ var updateFrom = (instance , from ) => {
3248
3248
 
3249
3249
 
3250
3250
 
3251
+
3251
3252
 
3252
3253
 
3253
3254
 
@@ -3295,14 +3296,14 @@ class CallSession {
3295
3296
 
3296
3297
 
3297
3298
 
3299
+ // = creationTime
3300
+
3298
3301
 
3299
3302
 
3300
3303
 
3301
3304
 
3302
3305
 
3303
3306
 
3304
-
3305
-
3306
3307
 
3307
3308
 
3308
3309
 
@@ -3366,6 +3367,7 @@ class CallSession {
3366
3367
  recordingPaused,
3367
3368
  videoRemotelyDowngraded,
3368
3369
  sipSession,
3370
+ answerTime,
3369
3371
  } ) {
3370
3372
  this.callId = callId;
3371
3373
  this.sipCallId = sipCallId;
@@ -3393,6 +3395,7 @@ class CallSession {
3393
3395
  this.recordingPaused = recordingPaused || false;
3394
3396
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3395
3397
  this.sipSession = sipSession;
3398
+ this.answerTime = answerTime || this.answerTime;
3396
3399
 
3397
3400
  // Useful to compare instead of instanceof with minified code
3398
3401
  this.type = 'CallSession';
@@ -3423,7 +3426,7 @@ class CallSession {
3423
3426
  }
3424
3427
 
3425
3428
  answer() {
3426
- this.answered = true;
3429
+ this.answerTime = new Date();
3427
3430
  }
3428
3431
 
3429
3432
  systemAnswer() {
@@ -3579,6 +3582,15 @@ class CallSession {
3579
3582
  return newFrom(callSession, CallSession);
3580
3583
  }
3581
3584
 
3585
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3586
+ set answered(value ) {
3587
+ this.answerTime = value ? new Date() : null;
3588
+ }
3589
+
3590
+ get answered() {
3591
+ return !!this.answerTime;
3592
+ }
3593
+
3582
3594
  static parseCall(call ) {
3583
3595
  return new CallSession({
3584
3596
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3248,6 +3248,7 @@ var updateFrom = (instance , from ) => {
3248
3248
 
3249
3249
 
3250
3250
 
3251
+
3251
3252
 
3252
3253
 
3253
3254
 
@@ -3295,14 +3296,14 @@ class CallSession {
3295
3296
 
3296
3297
 
3297
3298
 
3299
+ // = creationTime
3300
+
3298
3301
 
3299
3302
 
3300
3303
 
3301
3304
 
3302
3305
 
3303
3306
 
3304
-
3305
-
3306
3307
 
3307
3308
 
3308
3309
 
@@ -3366,6 +3367,7 @@ class CallSession {
3366
3367
  recordingPaused,
3367
3368
  videoRemotelyDowngraded,
3368
3369
  sipSession,
3370
+ answerTime,
3369
3371
  } ) {
3370
3372
  this.callId = callId;
3371
3373
  this.sipCallId = sipCallId;
@@ -3393,6 +3395,7 @@ class CallSession {
3393
3395
  this.recordingPaused = recordingPaused || false;
3394
3396
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3395
3397
  this.sipSession = sipSession;
3398
+ this.answerTime = answerTime || this.answerTime;
3396
3399
 
3397
3400
  // Useful to compare instead of instanceof with minified code
3398
3401
  this.type = 'CallSession';
@@ -3423,7 +3426,7 @@ class CallSession {
3423
3426
  }
3424
3427
 
3425
3428
  answer() {
3426
- this.answered = true;
3429
+ this.answerTime = new Date();
3427
3430
  }
3428
3431
 
3429
3432
  systemAnswer() {
@@ -3579,6 +3582,15 @@ class CallSession {
3579
3582
  return newFrom(callSession, CallSession);
3580
3583
  }
3581
3584
 
3585
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3586
+ set answered(value ) {
3587
+ this.answerTime = value ? new Date() : null;
3588
+ }
3589
+
3590
+ get answered() {
3591
+ return !!this.answerTime;
3592
+ }
3593
+
3582
3594
  static parseCall(call ) {
3583
3595
  return new CallSession({
3584
3596
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3248,6 +3248,7 @@ var updateFrom = (instance , from ) => {
3248
3248
 
3249
3249
 
3250
3250
 
3251
+
3251
3252
 
3252
3253
 
3253
3254
 
@@ -3295,14 +3296,14 @@ class CallSession {
3295
3296
 
3296
3297
 
3297
3298
 
3299
+ // = creationTime
3300
+
3298
3301
 
3299
3302
 
3300
3303
 
3301
3304
 
3302
3305
 
3303
3306
 
3304
-
3305
-
3306
3307
 
3307
3308
 
3308
3309
 
@@ -3366,6 +3367,7 @@ class CallSession {
3366
3367
  recordingPaused,
3367
3368
  videoRemotelyDowngraded,
3368
3369
  sipSession,
3370
+ answerTime,
3369
3371
  } ) {
3370
3372
  this.callId = callId;
3371
3373
  this.sipCallId = sipCallId;
@@ -3393,6 +3395,7 @@ class CallSession {
3393
3395
  this.recordingPaused = recordingPaused || false;
3394
3396
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3395
3397
  this.sipSession = sipSession;
3398
+ this.answerTime = answerTime || this.answerTime;
3396
3399
 
3397
3400
  // Useful to compare instead of instanceof with minified code
3398
3401
  this.type = 'CallSession';
@@ -3423,7 +3426,7 @@ class CallSession {
3423
3426
  }
3424
3427
 
3425
3428
  answer() {
3426
- this.answered = true;
3429
+ this.answerTime = new Date();
3427
3430
  }
3428
3431
 
3429
3432
  systemAnswer() {
@@ -3579,6 +3582,15 @@ class CallSession {
3579
3582
  return newFrom(callSession, CallSession);
3580
3583
  }
3581
3584
 
3585
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3586
+ set answered(value ) {
3587
+ this.answerTime = value ? new Date() : null;
3588
+ }
3589
+
3590
+ get answered() {
3591
+ return !!this.answerTime;
3592
+ }
3593
+
3582
3594
  static parseCall(call ) {
3583
3595
  return new CallSession({
3584
3596
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -3248,6 +3248,7 @@ var updateFrom = (instance , from ) => {
3248
3248
 
3249
3249
 
3250
3250
 
3251
+
3251
3252
 
3252
3253
 
3253
3254
 
@@ -3295,14 +3296,14 @@ class CallSession {
3295
3296
 
3296
3297
 
3297
3298
 
3299
+ // = creationTime
3300
+
3298
3301
 
3299
3302
 
3300
3303
 
3301
3304
 
3302
3305
 
3303
3306
 
3304
-
3305
-
3306
3307
 
3307
3308
 
3308
3309
 
@@ -3366,6 +3367,7 @@ class CallSession {
3366
3367
  recordingPaused,
3367
3368
  videoRemotelyDowngraded,
3368
3369
  sipSession,
3370
+ answerTime,
3369
3371
  } ) {
3370
3372
  this.callId = callId;
3371
3373
  this.sipCallId = sipCallId;
@@ -3393,6 +3395,7 @@ class CallSession {
3393
3395
  this.recordingPaused = recordingPaused || false;
3394
3396
  this.videoRemotelyDowngraded = videoRemotelyDowngraded;
3395
3397
  this.sipSession = sipSession;
3398
+ this.answerTime = answerTime || this.answerTime;
3396
3399
 
3397
3400
  // Useful to compare instead of instanceof with minified code
3398
3401
  this.type = 'CallSession';
@@ -3423,7 +3426,7 @@ class CallSession {
3423
3426
  }
3424
3427
 
3425
3428
  answer() {
3426
- this.answered = true;
3429
+ this.answerTime = new Date();
3427
3430
  }
3428
3431
 
3429
3432
  systemAnswer() {
@@ -3579,6 +3582,15 @@ class CallSession {
3579
3582
  return newFrom(callSession, CallSession);
3580
3583
  }
3581
3584
 
3585
+ // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
3586
+ set answered(value ) {
3587
+ this.answerTime = value ? new Date() : null;
3588
+ }
3589
+
3590
+ get answered() {
3591
+ return !!this.answerTime;
3592
+ }
3593
+
3582
3594
  static parseCall(call ) {
3583
3595
  return new CallSession({
3584
3596
  callId: call.id,
@@ -9336,6 +9348,7 @@ class WebRTCPhone extends Emitter {
9336
9348
  this.removeIncomingSessions(sipSessionId);
9337
9349
  }
9338
9350
 
9351
+ callSession.answerTime = new Date();
9339
9352
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
9340
9353
 
9341
9354
  return callSession;
@@ -9551,6 +9564,7 @@ class WebRTCPhone extends Emitter {
9551
9564
  }
9552
9565
 
9553
9566
  this.shouldSendReinvite = false;
9567
+ callSession.answerTime = new Date();
9554
9568
  this.acceptedSessions[callSession.getId()] = true;
9555
9569
 
9556
9570
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);