@wazo/sdk 0.38.19 → 0.38.21

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 (46) hide show
  1. package/dist/wazo-sdk.js +2 -2
  2. package/esm/__tests__/web-rtc-client.test.js +2 -1
  3. package/esm/checker/Checker.js +2 -1
  4. package/esm/checker/checks/index.js +2 -1
  5. package/esm/checker/checks/webrtc-transport.js +2 -1
  6. package/esm/checker/checks/webrtc.js +2 -1
  7. package/esm/domain/Phone/WebRTCPhone.js +3 -2
  8. package/esm/index.js +5 -3
  9. package/esm/simple/Auth.js +5 -3
  10. package/esm/simple/Configuration.js +5 -3
  11. package/esm/simple/Phone.js +5 -3
  12. package/esm/simple/index.js +5 -3
  13. package/esm/simple/room/LocalParticipant.js +5 -3
  14. package/esm/simple/room/Participant.js +5 -3
  15. package/esm/simple/room/RemoteParticipant.js +5 -3
  16. package/esm/simple/room/Room.js +5 -3
  17. package/esm/simple/room/SipRoom.js +5 -3
  18. package/esm/simple/room/Stream.js +5 -3
  19. package/esm/simple/room/__tests__/Participant.test.js +5 -3
  20. package/esm/simple/room/__tests__/RemoteParticipant.test.js +5 -3
  21. package/esm/simple/utils.js +5 -3
  22. package/esm/web-rtc-client.js +2 -1
  23. package/lib/__tests__/web-rtc-client.test.js +2 -1
  24. package/lib/checker/Checker.js +2 -1
  25. package/lib/checker/checks/index.js +2 -1
  26. package/lib/checker/checks/webrtc-transport.js +2 -1
  27. package/lib/checker/checks/webrtc.js +2 -1
  28. package/lib/domain/Phone/WebRTCPhone.js +3 -2
  29. package/lib/index.js +5 -3
  30. package/lib/simple/Auth.js +5 -3
  31. package/lib/simple/Configuration.js +5 -3
  32. package/lib/simple/Phone.js +5 -3
  33. package/lib/simple/index.js +5 -3
  34. package/lib/simple/room/LocalParticipant.js +5 -3
  35. package/lib/simple/room/Participant.js +5 -3
  36. package/lib/simple/room/RemoteParticipant.js +5 -3
  37. package/lib/simple/room/Room.js +5 -3
  38. package/lib/simple/room/SipRoom.js +5 -3
  39. package/lib/simple/room/Stream.js +5 -3
  40. package/lib/simple/room/__tests__/Participant.test.js +5 -3
  41. package/lib/simple/room/__tests__/RemoteParticipant.test.js +5 -3
  42. package/lib/simple/utils.js +5 -3
  43. package/lib/web-rtc-client.js +2 -1
  44. package/package.json +1 -1
  45. package/src/domain/Phone/WebRTCPhone.js +3 -2
  46. package/src/web-rtc-client.js +2 -1
package/lib/index.js CHANGED
@@ -7530,6 +7530,7 @@ class WebRTCClient extends Emitter {
7530
7530
 
7531
7531
  changeAudioOutputDevice(id ) {
7532
7532
  logger$9.info('Changing audio output device', { id });
7533
+ this.audioOutputDeviceId = id;
7533
7534
 
7534
7535
  Object.values(this.audioElements).forEach(audioElement => {
7535
7536
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8422,7 +8423,7 @@ class WebRTCClient extends Emitter {
8422
8423
 
8423
8424
  _setupMedias(session , newStream ) {
8424
8425
  // Safari hack, because you cannot call .play() from a non user action
8425
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8426
+ const sessionId = this.getSipSessionId(session);
8426
8427
  const isConference = this.isConference(sessionId);
8427
8428
 
8428
8429
  if (sessionId in this.audioElements) {
@@ -11151,9 +11152,10 @@ class WebRTCPhone extends Emitter {
11151
11152
  logger$7.info('WebRTC disconnected');
11152
11153
  this.eventEmitter.emit(ON_DISCONNECTED);
11153
11154
  });
11154
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
11155
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
11155
11156
  logger$7.info('WebRTC early media');
11156
- this.eventEmitter.emit(ON_EARLY_MEDIA);
11157
+ const callSession = this._createCallSession(session);
11158
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
11157
11159
  });
11158
11160
 
11159
11161
  this.client.on(this.client.REGISTERED, () => {
@@ -7709,6 +7709,7 @@ class WebRTCClient extends Emitter {
7709
7709
 
7710
7710
  changeAudioOutputDevice(id ) {
7711
7711
  logger$9.info('Changing audio output device', { id });
7712
+ this.audioOutputDeviceId = id;
7712
7713
 
7713
7714
  Object.values(this.audioElements).forEach(audioElement => {
7714
7715
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8601,7 +8602,7 @@ class WebRTCClient extends Emitter {
8601
8602
 
8602
8603
  _setupMedias(session , newStream ) {
8603
8604
  // Safari hack, because you cannot call .play() from a non user action
8604
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8605
+ const sessionId = this.getSipSessionId(session);
8605
8606
  const isConference = this.isConference(sessionId);
8606
8607
 
8607
8608
  if (sessionId in this.audioElements) {
@@ -10422,9 +10423,10 @@ class WebRTCPhone extends Emitter {
10422
10423
  logger$8.info('WebRTC disconnected');
10423
10424
  this.eventEmitter.emit(ON_DISCONNECTED);
10424
10425
  });
10425
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10426
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10426
10427
  logger$8.info('WebRTC early media');
10427
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10428
+ const callSession = this._createCallSession(session);
10429
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10428
10430
  });
10429
10431
 
10430
10432
  this.client.on(this.client.REGISTERED, () => {
@@ -7707,6 +7707,7 @@ class WebRTCClient extends Emitter {
7707
7707
 
7708
7708
  changeAudioOutputDevice(id ) {
7709
7709
  logger$9.info('Changing audio output device', { id });
7710
+ this.audioOutputDeviceId = id;
7710
7711
 
7711
7712
  Object.values(this.audioElements).forEach(audioElement => {
7712
7713
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8599,7 +8600,7 @@ class WebRTCClient extends Emitter {
8599
8600
 
8600
8601
  _setupMedias(session , newStream ) {
8601
8602
  // Safari hack, because you cannot call .play() from a non user action
8602
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8603
+ const sessionId = this.getSipSessionId(session);
8603
8604
  const isConference = this.isConference(sessionId);
8604
8605
 
8605
8606
  if (sessionId in this.audioElements) {
@@ -10420,9 +10421,10 @@ class WebRTCPhone extends Emitter {
10420
10421
  logger$8.info('WebRTC disconnected');
10421
10422
  this.eventEmitter.emit(ON_DISCONNECTED);
10422
10423
  });
10423
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10424
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10424
10425
  logger$8.info('WebRTC early media');
10425
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10426
+ const callSession = this._createCallSession(session);
10427
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10426
10428
  });
10427
10429
 
10428
10430
  this.client.on(this.client.REGISTERED, () => {
@@ -7707,6 +7707,7 @@ class WebRTCClient extends Emitter {
7707
7707
 
7708
7708
  changeAudioOutputDevice(id ) {
7709
7709
  logger$9.info('Changing audio output device', { id });
7710
+ this.audioOutputDeviceId = id;
7710
7711
 
7711
7712
  Object.values(this.audioElements).forEach(audioElement => {
7712
7713
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8599,7 +8600,7 @@ class WebRTCClient extends Emitter {
8599
8600
 
8600
8601
  _setupMedias(session , newStream ) {
8601
8602
  // Safari hack, because you cannot call .play() from a non user action
8602
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8603
+ const sessionId = this.getSipSessionId(session);
8603
8604
  const isConference = this.isConference(sessionId);
8604
8605
 
8605
8606
  if (sessionId in this.audioElements) {
@@ -10420,9 +10421,10 @@ class WebRTCPhone extends Emitter {
10420
10421
  logger$8.info('WebRTC disconnected');
10421
10422
  this.eventEmitter.emit(ON_DISCONNECTED);
10422
10423
  });
10423
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10424
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10424
10425
  logger$8.info('WebRTC early media');
10425
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10426
+ const callSession = this._createCallSession(session);
10427
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10426
10428
  });
10427
10429
 
10428
10430
  this.client.on(this.client.REGISTERED, () => {
@@ -8038,6 +8038,7 @@ class WebRTCClient extends Emitter {
8038
8038
 
8039
8039
  changeAudioOutputDevice(id ) {
8040
8040
  logger$8.info('Changing audio output device', { id });
8041
+ this.audioOutputDeviceId = id;
8041
8042
 
8042
8043
  Object.values(this.audioElements).forEach(audioElement => {
8043
8044
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8930,7 +8931,7 @@ class WebRTCClient extends Emitter {
8930
8931
 
8931
8932
  _setupMedias(session , newStream ) {
8932
8933
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8934
+ const sessionId = this.getSipSessionId(session);
8934
8935
  const isConference = this.isConference(sessionId);
8935
8936
 
8936
8937
  if (sessionId in this.audioElements) {
@@ -10751,9 +10752,10 @@ class WebRTCPhone extends Emitter {
10751
10752
  logger$7.info('WebRTC disconnected');
10752
10753
  this.eventEmitter.emit(ON_DISCONNECTED);
10753
10754
  });
10754
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10755
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10755
10756
  logger$7.info('WebRTC early media');
10756
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10757
+ const callSession = this._createCallSession(session);
10758
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10757
10759
  });
10758
10760
 
10759
10761
  this.client.on(this.client.REGISTERED, () => {
@@ -7707,6 +7707,7 @@ class WebRTCClient extends Emitter {
7707
7707
 
7708
7708
  changeAudioOutputDevice(id ) {
7709
7709
  logger$9.info('Changing audio output device', { id });
7710
+ this.audioOutputDeviceId = id;
7710
7711
 
7711
7712
  Object.values(this.audioElements).forEach(audioElement => {
7712
7713
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8599,7 +8600,7 @@ class WebRTCClient extends Emitter {
8599
8600
 
8600
8601
  _setupMedias(session , newStream ) {
8601
8602
  // Safari hack, because you cannot call .play() from a non user action
8602
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8603
+ const sessionId = this.getSipSessionId(session);
8603
8604
  const isConference = this.isConference(sessionId);
8604
8605
 
8605
8606
  if (sessionId in this.audioElements) {
@@ -10420,9 +10421,10 @@ class WebRTCPhone extends Emitter {
10420
10421
  logger$8.info('WebRTC disconnected');
10421
10422
  this.eventEmitter.emit(ON_DISCONNECTED);
10422
10423
  });
10423
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10424
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10424
10425
  logger$8.info('WebRTC early media');
10425
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10426
+ const callSession = this._createCallSession(session);
10427
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10426
10428
  });
10427
10429
 
10428
10430
  this.client.on(this.client.REGISTERED, () => {
@@ -7707,6 +7707,7 @@ class WebRTCClient extends Emitter {
7707
7707
 
7708
7708
  changeAudioOutputDevice(id ) {
7709
7709
  logger$9.info('Changing audio output device', { id });
7710
+ this.audioOutputDeviceId = id;
7710
7711
 
7711
7712
  Object.values(this.audioElements).forEach(audioElement => {
7712
7713
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8599,7 +8600,7 @@ class WebRTCClient extends Emitter {
8599
8600
 
8600
8601
  _setupMedias(session , newStream ) {
8601
8602
  // Safari hack, because you cannot call .play() from a non user action
8602
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8603
+ const sessionId = this.getSipSessionId(session);
8603
8604
  const isConference = this.isConference(sessionId);
8604
8605
 
8605
8606
  if (sessionId in this.audioElements) {
@@ -10420,9 +10421,10 @@ class WebRTCPhone extends Emitter {
10420
10421
  logger$8.info('WebRTC disconnected');
10421
10422
  this.eventEmitter.emit(ON_DISCONNECTED);
10422
10423
  });
10423
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10424
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10424
10425
  logger$8.info('WebRTC early media');
10425
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10426
+ const callSession = this._createCallSession(session);
10427
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10426
10428
  });
10427
10429
 
10428
10430
  this.client.on(this.client.REGISTERED, () => {
@@ -8038,6 +8038,7 @@ class WebRTCClient extends Emitter {
8038
8038
 
8039
8039
  changeAudioOutputDevice(id ) {
8040
8040
  logger$8.info('Changing audio output device', { id });
8041
+ this.audioOutputDeviceId = id;
8041
8042
 
8042
8043
  Object.values(this.audioElements).forEach(audioElement => {
8043
8044
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8930,7 +8931,7 @@ class WebRTCClient extends Emitter {
8930
8931
 
8931
8932
  _setupMedias(session , newStream ) {
8932
8933
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8934
+ const sessionId = this.getSipSessionId(session);
8934
8935
  const isConference = this.isConference(sessionId);
8935
8936
 
8936
8937
  if (sessionId in this.audioElements) {
@@ -10751,9 +10752,10 @@ class WebRTCPhone extends Emitter {
10751
10752
  logger$7.info('WebRTC disconnected');
10752
10753
  this.eventEmitter.emit(ON_DISCONNECTED);
10753
10754
  });
10754
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10755
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10755
10756
  logger$7.info('WebRTC early media');
10756
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10757
+ const callSession = this._createCallSession(session);
10758
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10757
10759
  });
10758
10760
 
10759
10761
  this.client.on(this.client.REGISTERED, () => {
@@ -8040,6 +8040,7 @@ class WebRTCClient extends Emitter {
8040
8040
 
8041
8041
  changeAudioOutputDevice(id ) {
8042
8042
  logger$8.info('Changing audio output device', { id });
8043
+ this.audioOutputDeviceId = id;
8043
8044
 
8044
8045
  Object.values(this.audioElements).forEach(audioElement => {
8045
8046
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8932,7 +8933,7 @@ class WebRTCClient extends Emitter {
8932
8933
 
8933
8934
  _setupMedias(session , newStream ) {
8934
8935
  // Safari hack, because you cannot call .play() from a non user action
8935
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8936
+ const sessionId = this.getSipSessionId(session);
8936
8937
  const isConference = this.isConference(sessionId);
8937
8938
 
8938
8939
  if (sessionId in this.audioElements) {
@@ -10753,9 +10754,10 @@ class WebRTCPhone extends Emitter {
10753
10754
  logger$7.info('WebRTC disconnected');
10754
10755
  this.eventEmitter.emit(ON_DISCONNECTED);
10755
10756
  });
10756
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10757
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10757
10758
  logger$7.info('WebRTC early media');
10758
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10759
+ const callSession = this._createCallSession(session);
10760
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10759
10761
  });
10760
10762
 
10761
10763
  this.client.on(this.client.REGISTERED, () => {
@@ -8038,6 +8038,7 @@ class WebRTCClient extends Emitter {
8038
8038
 
8039
8039
  changeAudioOutputDevice(id ) {
8040
8040
  logger$8.info('Changing audio output device', { id });
8041
+ this.audioOutputDeviceId = id;
8041
8042
 
8042
8043
  Object.values(this.audioElements).forEach(audioElement => {
8043
8044
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8930,7 +8931,7 @@ class WebRTCClient extends Emitter {
8930
8931
 
8931
8932
  _setupMedias(session , newStream ) {
8932
8933
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8934
+ const sessionId = this.getSipSessionId(session);
8934
8935
  const isConference = this.isConference(sessionId);
8935
8936
 
8936
8937
  if (sessionId in this.audioElements) {
@@ -10751,9 +10752,10 @@ class WebRTCPhone extends Emitter {
10751
10752
  logger$7.info('WebRTC disconnected');
10752
10753
  this.eventEmitter.emit(ON_DISCONNECTED);
10753
10754
  });
10754
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10755
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10755
10756
  logger$7.info('WebRTC early media');
10756
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10757
+ const callSession = this._createCallSession(session);
10758
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10757
10759
  });
10758
10760
 
10759
10761
  this.client.on(this.client.REGISTERED, () => {
@@ -8038,6 +8038,7 @@ class WebRTCClient extends Emitter {
8038
8038
 
8039
8039
  changeAudioOutputDevice(id ) {
8040
8040
  logger$8.info('Changing audio output device', { id });
8041
+ this.audioOutputDeviceId = id;
8041
8042
 
8042
8043
  Object.values(this.audioElements).forEach(audioElement => {
8043
8044
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8930,7 +8931,7 @@ class WebRTCClient extends Emitter {
8930
8931
 
8931
8932
  _setupMedias(session , newStream ) {
8932
8933
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8934
+ const sessionId = this.getSipSessionId(session);
8934
8935
  const isConference = this.isConference(sessionId);
8935
8936
 
8936
8937
  if (sessionId in this.audioElements) {
@@ -10751,9 +10752,10 @@ class WebRTCPhone extends Emitter {
10751
10752
  logger$7.info('WebRTC disconnected');
10752
10753
  this.eventEmitter.emit(ON_DISCONNECTED);
10753
10754
  });
10754
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10755
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10755
10756
  logger$7.info('WebRTC early media');
10756
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10757
+ const callSession = this._createCallSession(session);
10758
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10757
10759
  });
10758
10760
 
10759
10761
  this.client.on(this.client.REGISTERED, () => {
@@ -8038,6 +8038,7 @@ class WebRTCClient extends Emitter {
8038
8038
 
8039
8039
  changeAudioOutputDevice(id ) {
8040
8040
  logger$8.info('Changing audio output device', { id });
8041
+ this.audioOutputDeviceId = id;
8041
8042
 
8042
8043
  Object.values(this.audioElements).forEach(audioElement => {
8043
8044
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8930,7 +8931,7 @@ class WebRTCClient extends Emitter {
8930
8931
 
8931
8932
  _setupMedias(session , newStream ) {
8932
8933
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8934
+ const sessionId = this.getSipSessionId(session);
8934
8935
  const isConference = this.isConference(sessionId);
8935
8936
 
8936
8937
  if (sessionId in this.audioElements) {
@@ -10751,9 +10752,10 @@ class WebRTCPhone extends Emitter {
10751
10752
  logger$7.info('WebRTC disconnected');
10752
10753
  this.eventEmitter.emit(ON_DISCONNECTED);
10753
10754
  });
10754
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10755
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10755
10756
  logger$7.info('WebRTC early media');
10756
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10757
+ const callSession = this._createCallSession(session);
10758
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10757
10759
  });
10758
10760
 
10759
10761
  this.client.on(this.client.REGISTERED, () => {
@@ -8038,6 +8038,7 @@ class WebRTCClient extends Emitter {
8038
8038
 
8039
8039
  changeAudioOutputDevice(id ) {
8040
8040
  logger$8.info('Changing audio output device', { id });
8041
+ this.audioOutputDeviceId = id;
8041
8042
 
8042
8043
  Object.values(this.audioElements).forEach(audioElement => {
8043
8044
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8930,7 +8931,7 @@ class WebRTCClient extends Emitter {
8930
8931
 
8931
8932
  _setupMedias(session , newStream ) {
8932
8933
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8934
+ const sessionId = this.getSipSessionId(session);
8934
8935
  const isConference = this.isConference(sessionId);
8935
8936
 
8936
8937
  if (sessionId in this.audioElements) {
@@ -10751,9 +10752,10 @@ class WebRTCPhone extends Emitter {
10751
10752
  logger$7.info('WebRTC disconnected');
10752
10753
  this.eventEmitter.emit(ON_DISCONNECTED);
10753
10754
  });
10754
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10755
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10755
10756
  logger$7.info('WebRTC early media');
10756
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10757
+ const callSession = this._createCallSession(session);
10758
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10757
10759
  });
10758
10760
 
10759
10761
  this.client.on(this.client.REGISTERED, () => {
@@ -8040,6 +8040,7 @@ class WebRTCClient extends Emitter {
8040
8040
 
8041
8041
  changeAudioOutputDevice(id ) {
8042
8042
  logger$8.info('Changing audio output device', { id });
8043
+ this.audioOutputDeviceId = id;
8043
8044
 
8044
8045
  Object.values(this.audioElements).forEach(audioElement => {
8045
8046
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -8932,7 +8933,7 @@ class WebRTCClient extends Emitter {
8932
8933
 
8933
8934
  _setupMedias(session , newStream ) {
8934
8935
  // Safari hack, because you cannot call .play() from a non user action
8935
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8936
+ const sessionId = this.getSipSessionId(session);
8936
8937
  const isConference = this.isConference(sessionId);
8937
8938
 
8938
8939
  if (sessionId in this.audioElements) {
@@ -10753,9 +10754,10 @@ class WebRTCPhone extends Emitter {
10753
10754
  logger$7.info('WebRTC disconnected');
10754
10755
  this.eventEmitter.emit(ON_DISCONNECTED);
10755
10756
  });
10756
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
10757
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
10757
10758
  logger$7.info('WebRTC early media');
10758
- this.eventEmitter.emit(ON_EARLY_MEDIA);
10759
+ const callSession = this._createCallSession(session);
10760
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
10759
10761
  });
10760
10762
 
10761
10763
  this.client.on(this.client.REGISTERED, () => {
@@ -6627,6 +6627,7 @@ class WebRTCClient extends Emitter {
6627
6627
 
6628
6628
  changeAudioOutputDevice(id ) {
6629
6629
  logger.info('Changing audio output device', { id });
6630
+ this.audioOutputDeviceId = id;
6630
6631
 
6631
6632
  Object.values(this.audioElements).forEach(audioElement => {
6632
6633
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -7519,7 +7520,7 @@ class WebRTCClient extends Emitter {
7519
7520
 
7520
7521
  _setupMedias(session , newStream ) {
7521
7522
  // Safari hack, because you cannot call .play() from a non user action
7522
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7523
+ const sessionId = this.getSipSessionId(session);
7523
7524
  const isConference = this.isConference(sessionId);
7524
7525
 
7525
7526
  if (sessionId in this.audioElements) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wazo/sdk",
3
- "version": "0.38.19",
3
+ "version": "0.38.21",
4
4
  "description": "Wazo's JavaScript Software Development Kit.",
5
5
  "main": "dist/wazo-sdk.js",
6
6
  "author": "Wazo (http://wazo.io)",
@@ -1528,9 +1528,10 @@ export default class WebRTCPhone extends Emitter implements Phone {
1528
1528
  logger.info('WebRTC disconnected');
1529
1529
  this.eventEmitter.emit(ON_DISCONNECTED);
1530
1530
  });
1531
- this.client.on(this.client.ON_EARLY_MEDIA, () => {
1531
+ this.client.on(this.client.ON_EARLY_MEDIA, session => {
1532
1532
  logger.info('WebRTC early media');
1533
- this.eventEmitter.emit(ON_EARLY_MEDIA);
1533
+ const callSession = this._createCallSession(session);
1534
+ this.eventEmitter.emit(ON_EARLY_MEDIA, callSession);
1534
1535
  });
1535
1536
 
1536
1537
  this.client.on(this.client.REGISTERED, () => {
@@ -1073,6 +1073,7 @@ export default class WebRTCClient extends Emitter {
1073
1073
 
1074
1074
  changeAudioOutputDevice(id: string) {
1075
1075
  logger.info('Changing audio output device', { id });
1076
+ this.audioOutputDeviceId = id;
1076
1077
 
1077
1078
  Object.values(this.audioElements).forEach(audioElement => {
1078
1079
  // `setSinkId` method is not included in any flow type definitions for HTMLAudioElements but is a valid method
@@ -1965,7 +1966,7 @@ export default class WebRTCClient extends Emitter {
1965
1966
 
1966
1967
  _setupMedias(session: Session, newStream: ?MediaStream) {
1967
1968
  // Safari hack, because you cannot call .play() from a non user action
1968
- const sessionId = this.getSipSessionId(session).substr(0, 20);
1969
+ const sessionId = this.getSipSessionId(session);
1969
1970
  const isConference = this.isConference(sessionId);
1970
1971
 
1971
1972
  if (sessionId in this.audioElements) {