@wazo/sdk 0.38.18 → 0.38.20

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 +1 -1
  2. package/esm/__tests__/web-rtc-client.test.js +4 -2
  3. package/esm/checker/Checker.js +4 -2
  4. package/esm/checker/checks/index.js +4 -2
  5. package/esm/checker/checks/webrtc-transport.js +4 -2
  6. package/esm/checker/checks/webrtc.js +4 -2
  7. package/esm/index.js +4 -2
  8. package/esm/simple/Auth.js +4 -2
  9. package/esm/simple/Configuration.js +4 -2
  10. package/esm/simple/Phone.js +4 -2
  11. package/esm/simple/index.js +4 -2
  12. package/esm/simple/room/LocalParticipant.js +4 -2
  13. package/esm/simple/room/Participant.js +4 -2
  14. package/esm/simple/room/RemoteParticipant.js +4 -2
  15. package/esm/simple/room/Room.js +4 -2
  16. package/esm/simple/room/SipRoom.js +4 -2
  17. package/esm/simple/room/Stream.js +4 -2
  18. package/esm/simple/room/__tests__/Participant.test.js +4 -2
  19. package/esm/simple/room/__tests__/RemoteParticipant.test.js +4 -2
  20. package/esm/simple/utils.js +4 -2
  21. package/esm/web-rtc-client.js +4 -2
  22. package/lib/__tests__/web-rtc-client.test.js +4 -2
  23. package/lib/checker/Checker.js +4 -2
  24. package/lib/checker/checks/index.js +4 -2
  25. package/lib/checker/checks/webrtc-transport.js +4 -2
  26. package/lib/checker/checks/webrtc.js +4 -2
  27. package/lib/index.js +4 -2
  28. package/lib/simple/Auth.js +4 -2
  29. package/lib/simple/Configuration.js +4 -2
  30. package/lib/simple/Phone.js +4 -2
  31. package/lib/simple/index.js +4 -2
  32. package/lib/simple/room/LocalParticipant.js +4 -2
  33. package/lib/simple/room/Participant.js +4 -2
  34. package/lib/simple/room/RemoteParticipant.js +4 -2
  35. package/lib/simple/room/Room.js +4 -2
  36. package/lib/simple/room/SipRoom.js +4 -2
  37. package/lib/simple/room/Stream.js +4 -2
  38. package/lib/simple/room/__tests__/Participant.test.js +4 -2
  39. package/lib/simple/room/__tests__/RemoteParticipant.test.js +4 -2
  40. package/lib/simple/utils.js +4 -2
  41. package/lib/web-rtc-client.js +4 -2
  42. package/package.json +1 -1
  43. package/src/web-rtc-client.js +4 -2
@@ -7505,7 +7505,7 @@ class WebRTCClient extends Emitter {
7505
7505
 
7506
7506
  _setupMedias(session , newStream ) {
7507
7507
  // Safari hack, because you cannot call .play() from a non user action
7508
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7508
+ const sessionId = this.getSipSessionId(session);
7509
7509
  const isConference = this.isConference(sessionId);
7510
7510
 
7511
7511
  if (sessionId in this.audioElements) {
@@ -7520,7 +7520,9 @@ class WebRTCClient extends Emitter {
7520
7520
  const audioElement = this.audioElements[sessionId];
7521
7521
  const sipSession = this.sipSessions[session.callId];
7522
7522
  const removeStream = this.getRemoteStream(sessionId);
7523
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7523
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7524
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7525
+ const stream = newStream || removeStream || earlyStream;
7524
7526
 
7525
7527
  if (!this._isWeb() || !stream) {
7526
7528
  return;
@@ -8092,7 +8092,7 @@ class WebRTCClient extends Emitter {
8092
8092
 
8093
8093
  _setupMedias(session , newStream ) {
8094
8094
  // Safari hack, because you cannot call .play() from a non user action
8095
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8095
+ const sessionId = this.getSipSessionId(session);
8096
8096
  const isConference = this.isConference(sessionId);
8097
8097
 
8098
8098
  if (sessionId in this.audioElements) {
@@ -8107,7 +8107,9 @@ class WebRTCClient extends Emitter {
8107
8107
  const audioElement = this.audioElements[sessionId];
8108
8108
  const sipSession = this.sipSessions[session.callId];
8109
8109
  const removeStream = this.getRemoteStream(sessionId);
8110
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8110
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8111
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8112
+ const stream = newStream || removeStream || earlyStream;
8111
8113
 
8112
8114
  if (!this._isWeb() || !stream) {
8113
8115
  return;
@@ -8092,7 +8092,7 @@ class WebRTCClient extends Emitter {
8092
8092
 
8093
8093
  _setupMedias(session , newStream ) {
8094
8094
  // Safari hack, because you cannot call .play() from a non user action
8095
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8095
+ const sessionId = this.getSipSessionId(session);
8096
8096
  const isConference = this.isConference(sessionId);
8097
8097
 
8098
8098
  if (sessionId in this.audioElements) {
@@ -8107,7 +8107,9 @@ class WebRTCClient extends Emitter {
8107
8107
  const audioElement = this.audioElements[sessionId];
8108
8108
  const sipSession = this.sipSessions[session.callId];
8109
8109
  const removeStream = this.getRemoteStream(sessionId);
8110
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8110
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8111
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8112
+ const stream = newStream || removeStream || earlyStream;
8111
8113
 
8112
8114
  if (!this._isWeb() || !stream) {
8113
8115
  return;
@@ -7505,7 +7505,7 @@ class WebRTCClient extends Emitter {
7505
7505
 
7506
7506
  _setupMedias(session , newStream ) {
7507
7507
  // Safari hack, because you cannot call .play() from a non user action
7508
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7508
+ const sessionId = this.getSipSessionId(session);
7509
7509
  const isConference = this.isConference(sessionId);
7510
7510
 
7511
7511
  if (sessionId in this.audioElements) {
@@ -7520,7 +7520,9 @@ class WebRTCClient extends Emitter {
7520
7520
  const audioElement = this.audioElements[sessionId];
7521
7521
  const sipSession = this.sipSessions[session.callId];
7522
7522
  const removeStream = this.getRemoteStream(sessionId);
7523
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7523
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7524
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7525
+ const stream = newStream || removeStream || earlyStream;
7524
7526
 
7525
7527
  if (!this._isWeb() || !stream) {
7526
7528
  return;
@@ -7505,7 +7505,7 @@ class WebRTCClient extends Emitter {
7505
7505
 
7506
7506
  _setupMedias(session , newStream ) {
7507
7507
  // Safari hack, because you cannot call .play() from a non user action
7508
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7508
+ const sessionId = this.getSipSessionId(session);
7509
7509
  const isConference = this.isConference(sessionId);
7510
7510
 
7511
7511
  if (sessionId in this.audioElements) {
@@ -7520,7 +7520,9 @@ class WebRTCClient extends Emitter {
7520
7520
  const audioElement = this.audioElements[sessionId];
7521
7521
  const sipSession = this.sipSessions[session.callId];
7522
7522
  const removeStream = this.getRemoteStream(sessionId);
7523
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7523
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7524
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7525
+ const stream = newStream || removeStream || earlyStream;
7524
7526
 
7525
7527
  if (!this._isWeb() || !stream) {
7526
7528
  return;
package/esm/index.js CHANGED
@@ -8411,7 +8411,7 @@ class WebRTCClient extends Emitter {
8411
8411
 
8412
8412
  _setupMedias(session , newStream ) {
8413
8413
  // Safari hack, because you cannot call .play() from a non user action
8414
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8414
+ const sessionId = this.getSipSessionId(session);
8415
8415
  const isConference = this.isConference(sessionId);
8416
8416
 
8417
8417
  if (sessionId in this.audioElements) {
@@ -8426,7 +8426,9 @@ class WebRTCClient extends Emitter {
8426
8426
  const audioElement = this.audioElements[sessionId];
8427
8427
  const sipSession = this.sipSessions[session.callId];
8428
8428
  const removeStream = this.getRemoteStream(sessionId);
8429
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8429
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8430
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8431
+ const stream = newStream || removeStream || earlyStream;
8430
8432
 
8431
8433
  if (!this._isWeb() || !stream) {
8432
8434
  return;
@@ -8589,7 +8589,7 @@ class WebRTCClient extends Emitter {
8589
8589
 
8590
8590
  _setupMedias(session , newStream ) {
8591
8591
  // Safari hack, because you cannot call .play() from a non user action
8592
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8592
+ const sessionId = this.getSipSessionId(session);
8593
8593
  const isConference = this.isConference(sessionId);
8594
8594
 
8595
8595
  if (sessionId in this.audioElements) {
@@ -8604,7 +8604,9 @@ class WebRTCClient extends Emitter {
8604
8604
  const audioElement = this.audioElements[sessionId];
8605
8605
  const sipSession = this.sipSessions[session.callId];
8606
8606
  const removeStream = this.getRemoteStream(sessionId);
8607
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8607
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8608
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8609
+ const stream = newStream || removeStream || earlyStream;
8608
8610
 
8609
8611
  if (!this._isWeb() || !stream) {
8610
8612
  return;
@@ -8589,7 +8589,7 @@ class WebRTCClient extends Emitter {
8589
8589
 
8590
8590
  _setupMedias(session , newStream ) {
8591
8591
  // Safari hack, because you cannot call .play() from a non user action
8592
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8592
+ const sessionId = this.getSipSessionId(session);
8593
8593
  const isConference = this.isConference(sessionId);
8594
8594
 
8595
8595
  if (sessionId in this.audioElements) {
@@ -8604,7 +8604,9 @@ class WebRTCClient extends Emitter {
8604
8604
  const audioElement = this.audioElements[sessionId];
8605
8605
  const sipSession = this.sipSessions[session.callId];
8606
8606
  const removeStream = this.getRemoteStream(sessionId);
8607
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8607
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8608
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8609
+ const stream = newStream || removeStream || earlyStream;
8608
8610
 
8609
8611
  if (!this._isWeb() || !stream) {
8610
8612
  return;
@@ -8589,7 +8589,7 @@ class WebRTCClient extends Emitter {
8589
8589
 
8590
8590
  _setupMedias(session , newStream ) {
8591
8591
  // Safari hack, because you cannot call .play() from a non user action
8592
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8592
+ const sessionId = this.getSipSessionId(session);
8593
8593
  const isConference = this.isConference(sessionId);
8594
8594
 
8595
8595
  if (sessionId in this.audioElements) {
@@ -8604,7 +8604,9 @@ class WebRTCClient extends Emitter {
8604
8604
  const audioElement = this.audioElements[sessionId];
8605
8605
  const sipSession = this.sipSessions[session.callId];
8606
8606
  const removeStream = this.getRemoteStream(sessionId);
8607
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8607
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8608
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8609
+ const stream = newStream || removeStream || earlyStream;
8608
8610
 
8609
8611
  if (!this._isWeb() || !stream) {
8610
8612
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8589,7 +8589,7 @@ class WebRTCClient extends Emitter {
8589
8589
 
8590
8590
  _setupMedias(session , newStream ) {
8591
8591
  // Safari hack, because you cannot call .play() from a non user action
8592
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8592
+ const sessionId = this.getSipSessionId(session);
8593
8593
  const isConference = this.isConference(sessionId);
8594
8594
 
8595
8595
  if (sessionId in this.audioElements) {
@@ -8604,7 +8604,9 @@ class WebRTCClient extends Emitter {
8604
8604
  const audioElement = this.audioElements[sessionId];
8605
8605
  const sipSession = this.sipSessions[session.callId];
8606
8606
  const removeStream = this.getRemoteStream(sessionId);
8607
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8607
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8608
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8609
+ const stream = newStream || removeStream || earlyStream;
8608
8610
 
8609
8611
  if (!this._isWeb() || !stream) {
8610
8612
  return;
@@ -8589,7 +8589,7 @@ class WebRTCClient extends Emitter {
8589
8589
 
8590
8590
  _setupMedias(session , newStream ) {
8591
8591
  // Safari hack, because you cannot call .play() from a non user action
8592
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8592
+ const sessionId = this.getSipSessionId(session);
8593
8593
  const isConference = this.isConference(sessionId);
8594
8594
 
8595
8595
  if (sessionId in this.audioElements) {
@@ -8604,7 +8604,9 @@ class WebRTCClient extends Emitter {
8604
8604
  const audioElement = this.audioElements[sessionId];
8605
8605
  const sipSession = this.sipSessions[session.callId];
8606
8606
  const removeStream = this.getRemoteStream(sessionId);
8607
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8607
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8608
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8609
+ const stream = newStream || removeStream || earlyStream;
8608
8610
 
8609
8611
  if (!this._isWeb() || !stream) {
8610
8612
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -8920,7 +8920,7 @@ class WebRTCClient extends Emitter {
8920
8920
 
8921
8921
  _setupMedias(session , newStream ) {
8922
8922
  // Safari hack, because you cannot call .play() from a non user action
8923
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8923
+ const sessionId = this.getSipSessionId(session);
8924
8924
  const isConference = this.isConference(sessionId);
8925
8925
 
8926
8926
  if (sessionId in this.audioElements) {
@@ -8935,7 +8935,9 @@ class WebRTCClient extends Emitter {
8935
8935
  const audioElement = this.audioElements[sessionId];
8936
8936
  const sipSession = this.sipSessions[session.callId];
8937
8937
  const removeStream = this.getRemoteStream(sessionId);
8938
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8938
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8939
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8940
+ const stream = newStream || removeStream || earlyStream;
8939
8941
 
8940
8942
  if (!this._isWeb() || !stream) {
8941
8943
  return;
@@ -7508,7 +7508,7 @@ class WebRTCClient extends Emitter {
7508
7508
 
7509
7509
  _setupMedias(session , newStream ) {
7510
7510
  // Safari hack, because you cannot call .play() from a non user action
7511
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7511
+ const sessionId = this.getSipSessionId(session);
7512
7512
  const isConference = this.isConference(sessionId);
7513
7513
 
7514
7514
  if (sessionId in this.audioElements) {
@@ -7523,7 +7523,9 @@ class WebRTCClient extends Emitter {
7523
7523
  const audioElement = this.audioElements[sessionId];
7524
7524
  const sipSession = this.sipSessions[session.callId];
7525
7525
  const removeStream = this.getRemoteStream(sessionId);
7526
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7526
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7527
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7528
+ const stream = newStream || removeStream || earlyStream;
7527
7529
 
7528
7530
  if (!this._isWeb() || !stream) {
7529
7531
  return;
@@ -7514,7 +7514,7 @@ class WebRTCClient extends Emitter {
7514
7514
 
7515
7515
  _setupMedias(session , newStream ) {
7516
7516
  // Safari hack, because you cannot call .play() from a non user action
7517
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7517
+ const sessionId = this.getSipSessionId(session);
7518
7518
  const isConference = this.isConference(sessionId);
7519
7519
 
7520
7520
  if (sessionId in this.audioElements) {
@@ -7529,7 +7529,9 @@ class WebRTCClient extends Emitter {
7529
7529
  const audioElement = this.audioElements[sessionId];
7530
7530
  const sipSession = this.sipSessions[session.callId];
7531
7531
  const removeStream = this.getRemoteStream(sessionId);
7532
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7532
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7533
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7534
+ const stream = newStream || removeStream || earlyStream;
7533
7535
 
7534
7536
  if (!this._isWeb() || !stream) {
7535
7537
  return;
@@ -8102,7 +8102,7 @@ class WebRTCClient extends Emitter {
8102
8102
 
8103
8103
  _setupMedias(session , newStream ) {
8104
8104
  // Safari hack, because you cannot call .play() from a non user action
8105
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8105
+ const sessionId = this.getSipSessionId(session);
8106
8106
  const isConference = this.isConference(sessionId);
8107
8107
 
8108
8108
  if (sessionId in this.audioElements) {
@@ -8117,7 +8117,9 @@ class WebRTCClient extends Emitter {
8117
8117
  const audioElement = this.audioElements[sessionId];
8118
8118
  const sipSession = this.sipSessions[session.callId];
8119
8119
  const removeStream = this.getRemoteStream(sessionId);
8120
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8120
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8121
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8122
+ const stream = newStream || removeStream || earlyStream;
8121
8123
 
8122
8124
  if (!this._isWeb() || !stream) {
8123
8125
  return;
@@ -8102,7 +8102,7 @@ class WebRTCClient extends Emitter {
8102
8102
 
8103
8103
  _setupMedias(session , newStream ) {
8104
8104
  // Safari hack, because you cannot call .play() from a non user action
8105
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8105
+ const sessionId = this.getSipSessionId(session);
8106
8106
  const isConference = this.isConference(sessionId);
8107
8107
 
8108
8108
  if (sessionId in this.audioElements) {
@@ -8117,7 +8117,9 @@ class WebRTCClient extends Emitter {
8117
8117
  const audioElement = this.audioElements[sessionId];
8118
8118
  const sipSession = this.sipSessions[session.callId];
8119
8119
  const removeStream = this.getRemoteStream(sessionId);
8120
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8120
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8121
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8122
+ const stream = newStream || removeStream || earlyStream;
8121
8123
 
8122
8124
  if (!this._isWeb() || !stream) {
8123
8125
  return;
@@ -7514,7 +7514,7 @@ class WebRTCClient extends Emitter {
7514
7514
 
7515
7515
  _setupMedias(session , newStream ) {
7516
7516
  // Safari hack, because you cannot call .play() from a non user action
7517
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7517
+ const sessionId = this.getSipSessionId(session);
7518
7518
  const isConference = this.isConference(sessionId);
7519
7519
 
7520
7520
  if (sessionId in this.audioElements) {
@@ -7529,7 +7529,9 @@ class WebRTCClient extends Emitter {
7529
7529
  const audioElement = this.audioElements[sessionId];
7530
7530
  const sipSession = this.sipSessions[session.callId];
7531
7531
  const removeStream = this.getRemoteStream(sessionId);
7532
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7532
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7533
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7534
+ const stream = newStream || removeStream || earlyStream;
7533
7535
 
7534
7536
  if (!this._isWeb() || !stream) {
7535
7537
  return;
@@ -7514,7 +7514,7 @@ class WebRTCClient extends Emitter {
7514
7514
 
7515
7515
  _setupMedias(session , newStream ) {
7516
7516
  // Safari hack, because you cannot call .play() from a non user action
7517
- const sessionId = this.getSipSessionId(session).substr(0, 20);
7517
+ const sessionId = this.getSipSessionId(session);
7518
7518
  const isConference = this.isConference(sessionId);
7519
7519
 
7520
7520
  if (sessionId in this.audioElements) {
@@ -7529,7 +7529,9 @@ class WebRTCClient extends Emitter {
7529
7529
  const audioElement = this.audioElements[sessionId];
7530
7530
  const sipSession = this.sipSessions[session.callId];
7531
7531
  const removeStream = this.getRemoteStream(sessionId);
7532
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
7532
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
7533
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
7534
+ const stream = newStream || removeStream || earlyStream;
7533
7535
 
7534
7536
  if (!this._isWeb() || !stream) {
7535
7537
  return;
package/lib/index.js CHANGED
@@ -8422,7 +8422,7 @@ class WebRTCClient extends Emitter {
8422
8422
 
8423
8423
  _setupMedias(session , newStream ) {
8424
8424
  // Safari hack, because you cannot call .play() from a non user action
8425
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8425
+ const sessionId = this.getSipSessionId(session);
8426
8426
  const isConference = this.isConference(sessionId);
8427
8427
 
8428
8428
  if (sessionId in this.audioElements) {
@@ -8437,7 +8437,9 @@ class WebRTCClient extends Emitter {
8437
8437
  const audioElement = this.audioElements[sessionId];
8438
8438
  const sipSession = this.sipSessions[session.callId];
8439
8439
  const removeStream = this.getRemoteStream(sessionId);
8440
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8440
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8441
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8442
+ const stream = newStream || removeStream || earlyStream;
8441
8443
 
8442
8444
  if (!this._isWeb() || !stream) {
8443
8445
  return;
@@ -8601,7 +8601,7 @@ class WebRTCClient extends Emitter {
8601
8601
 
8602
8602
  _setupMedias(session , newStream ) {
8603
8603
  // Safari hack, because you cannot call .play() from a non user action
8604
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8604
+ const sessionId = this.getSipSessionId(session);
8605
8605
  const isConference = this.isConference(sessionId);
8606
8606
 
8607
8607
  if (sessionId in this.audioElements) {
@@ -8616,7 +8616,9 @@ class WebRTCClient extends Emitter {
8616
8616
  const audioElement = this.audioElements[sessionId];
8617
8617
  const sipSession = this.sipSessions[session.callId];
8618
8618
  const removeStream = this.getRemoteStream(sessionId);
8619
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8619
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8620
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8621
+ const stream = newStream || removeStream || earlyStream;
8620
8622
 
8621
8623
  if (!this._isWeb() || !stream) {
8622
8624
  return;
@@ -8599,7 +8599,7 @@ class WebRTCClient extends Emitter {
8599
8599
 
8600
8600
  _setupMedias(session , newStream ) {
8601
8601
  // Safari hack, because you cannot call .play() from a non user action
8602
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8602
+ const sessionId = this.getSipSessionId(session);
8603
8603
  const isConference = this.isConference(sessionId);
8604
8604
 
8605
8605
  if (sessionId in this.audioElements) {
@@ -8614,7 +8614,9 @@ class WebRTCClient extends Emitter {
8614
8614
  const audioElement = this.audioElements[sessionId];
8615
8615
  const sipSession = this.sipSessions[session.callId];
8616
8616
  const removeStream = this.getRemoteStream(sessionId);
8617
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8617
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8618
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8619
+ const stream = newStream || removeStream || earlyStream;
8618
8620
 
8619
8621
  if (!this._isWeb() || !stream) {
8620
8622
  return;
@@ -8599,7 +8599,7 @@ class WebRTCClient extends Emitter {
8599
8599
 
8600
8600
  _setupMedias(session , newStream ) {
8601
8601
  // Safari hack, because you cannot call .play() from a non user action
8602
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8602
+ const sessionId = this.getSipSessionId(session);
8603
8603
  const isConference = this.isConference(sessionId);
8604
8604
 
8605
8605
  if (sessionId in this.audioElements) {
@@ -8614,7 +8614,9 @@ class WebRTCClient extends Emitter {
8614
8614
  const audioElement = this.audioElements[sessionId];
8615
8615
  const sipSession = this.sipSessions[session.callId];
8616
8616
  const removeStream = this.getRemoteStream(sessionId);
8617
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8617
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8618
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8619
+ const stream = newStream || removeStream || earlyStream;
8618
8620
 
8619
8621
  if (!this._isWeb() || !stream) {
8620
8622
  return;
@@ -8930,7 +8930,7 @@ class WebRTCClient extends Emitter {
8930
8930
 
8931
8931
  _setupMedias(session , newStream ) {
8932
8932
  // Safari hack, because you cannot call .play() from a non user action
8933
- const sessionId = this.getSipSessionId(session).substr(0, 20);
8933
+ const sessionId = this.getSipSessionId(session);
8934
8934
  const isConference = this.isConference(sessionId);
8935
8935
 
8936
8936
  if (sessionId in this.audioElements) {
@@ -8945,7 +8945,9 @@ class WebRTCClient extends Emitter {
8945
8945
  const audioElement = this.audioElements[sessionId];
8946
8946
  const sipSession = this.sipSessions[session.callId];
8947
8947
  const removeStream = this.getRemoteStream(sessionId);
8948
- const stream = newStream || removeStream || sipSession.sessionDescriptionHandler.remoteMediaStream;
8948
+ const earlyStream = sipSession && sipSession.sessionDescriptionHandler
8949
+ ? sipSession.sessionDescriptionHandler.remoteMediaStream : null;
8950
+ const stream = newStream || removeStream || earlyStream;
8949
8951
 
8950
8952
  if (!this._isWeb() || !stream) {
8951
8953
  return;