@wazo/sdk 0.37.30 → 0.37.31

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 (42) hide show
  1. package/dist/wazo-sdk.js +4 -4
  2. package/esm/domain/CallSession.js +1 -1
  3. package/esm/domain/Phone/CTIPhone.js +1 -1
  4. package/esm/domain/Phone/WebRTCPhone.js +10 -2
  5. package/esm/domain/__tests__/CallSession.test.js +1 -1
  6. package/esm/domain/__tests__/IndirectTransfer.test.js +1 -1
  7. package/esm/domain/__tests__/Room.test.js +1 -1
  8. package/esm/index.js +10 -2
  9. package/esm/simple/Auth.js +10 -2
  10. package/esm/simple/Configuration.js +10 -2
  11. package/esm/simple/Phone.js +10 -2
  12. package/esm/simple/index.js +10 -2
  13. package/esm/simple/room/LocalParticipant.js +10 -2
  14. package/esm/simple/room/Participant.js +10 -2
  15. package/esm/simple/room/RemoteParticipant.js +10 -2
  16. package/esm/simple/room/Room.js +10 -2
  17. package/esm/simple/room/SipRoom.js +10 -2
  18. package/esm/simple/room/Stream.js +10 -2
  19. package/esm/simple/room/__tests__/RemoteParticipant.test.js +10 -2
  20. package/esm/simple/utils.js +10 -2
  21. package/lib/domain/CallSession.js +1 -1
  22. package/lib/domain/Phone/CTIPhone.js +1 -1
  23. package/lib/domain/Phone/WebRTCPhone.js +10 -2
  24. package/lib/domain/__tests__/CallSession.test.js +1 -1
  25. package/lib/domain/__tests__/IndirectTransfer.test.js +1 -1
  26. package/lib/domain/__tests__/Room.test.js +1 -1
  27. package/lib/index.js +10 -2
  28. package/lib/simple/Auth.js +10 -2
  29. package/lib/simple/Configuration.js +10 -2
  30. package/lib/simple/Phone.js +10 -2
  31. package/lib/simple/index.js +10 -2
  32. package/lib/simple/room/LocalParticipant.js +10 -2
  33. package/lib/simple/room/Participant.js +10 -2
  34. package/lib/simple/room/RemoteParticipant.js +10 -2
  35. package/lib/simple/room/Room.js +10 -2
  36. package/lib/simple/room/SipRoom.js +10 -2
  37. package/lib/simple/room/Stream.js +10 -2
  38. package/lib/simple/room/__tests__/RemoteParticipant.test.js +10 -2
  39. package/lib/simple/utils.js +10 -2
  40. package/package.json +1 -1
  41. package/src/domain/CallSession.js +1 -1
  42. package/src/domain/Phone/WebRTCPhone.js +9 -1
@@ -344,7 +344,7 @@ export default class CallSession {
344
344
 
345
345
  // Retro-compatibility: `answered` was a boolean before. We can reproduce the behaviour with a getter/setter
346
346
  set answered(value: boolean) {
347
- this.answerTime = value ? new Date() : null;
347
+ this.answerTime = value ? this.answerTime || new Date() : null;
348
348
  }
349
349
 
350
350
  get answered(): boolean {
@@ -631,6 +631,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
631
631
  }
632
632
 
633
633
  callSession.answerTime = new Date();
634
+ this._updateCallSession(callSession);
634
635
  this.eventEmitter.emit(ON_CALL_ACCEPTED, callSession, cameraEnabled);
635
636
 
636
637
  return callSession;
@@ -847,6 +848,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
847
848
 
848
849
  this.shouldSendReinvite = false;
849
850
  callSession.answerTime = new Date();
851
+ this._updateCallSession(callSession);
850
852
  this.acceptedSessions[callSession.getId()] = true;
851
853
 
852
854
  this.eventEmitter.emit(ON_CALL_ANSWERED, callSession);
@@ -946,7 +948,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
946
948
  // Hold current session if different from the current one (we don't want 2 sessions active at the same time).
947
949
  if (this.currentSipSession && this.currentSipSession.id !== sipSession.id) {
948
950
  logger.info('WebRTC hold call after resume', { id: this.currentSipSession.id });
949
- this.holdSipSession(this.currentSipSession, callSession);
951
+ this.holdSipSession(this.currentSipSession, this.currentCallSession);
950
952
  }
951
953
 
952
954
  const promise = this.unholdSipSession(sipSession, callSession, withEvent, isConference);
@@ -1157,6 +1159,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
1157
1159
  }
1158
1160
  const callSession = this._createOutgoingCallSession(sipSession, cameraEnabled || false);
1159
1161
  callSession.creationTime = new Date();
1162
+ this._updateCallSession(callSession);
1160
1163
 
1161
1164
  this.eventEmitter.emit(ON_PLAY_PROGRESS_SOUND, this.audioOutputDeviceId, this.audioOutputVolume);
1162
1165
 
@@ -1436,6 +1439,8 @@ export default class WebRTCPhone extends Emitter implements Phone {
1436
1439
  }
1437
1440
 
1438
1441
  callSession.creationTime = new Date();
1442
+ this._updateCallSession(callSession);
1443
+
1439
1444
  this.eventEmitter.emit(ON_CALL_INCOMING, callSession, wantsToDoVideo);
1440
1445
  });
1441
1446
 
@@ -1479,6 +1484,8 @@ export default class WebRTCPhone extends Emitter implements Phone {
1479
1484
  logger.info('WebRTC call rejected', session.id);
1480
1485
  const callSession = this._createCallSession(session);
1481
1486
  callSession.endTime = new Date();
1487
+ this._updateCallSession(callSession);
1488
+
1482
1489
  this.eventEmitter.emit(ON_CALL_REJECTED, callSession);
1483
1490
  });
1484
1491
 
@@ -1705,6 +1712,7 @@ export default class WebRTCPhone extends Emitter implements Phone {
1705
1712
  displayName: identity ? identity.displayName || number : number,
1706
1713
  startTime: fromSession ? fromSession.startTime : new Date(),
1707
1714
  creationTime: fromSession ? fromSession.creationTime : null,
1715
+ answerTime: fromSession ? fromSession.answerTime : null,
1708
1716
  endTime: fromSession ? fromSession.endTime : null,
1709
1717
  answered: state === SessionState.Established,
1710
1718
  paused: this.client.isCallHeld(sipSession),