@wazo/sdk 0.38.13 → 0.38.14

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 (49) hide show
  1. package/dist/wazo-sdk.js +4 -4
  2. package/esm/__tests__/web-rtc-client.test.js +1 -0
  3. package/esm/checker/Checker.js +1 -0
  4. package/esm/checker/checks/index.js +1 -0
  5. package/esm/checker/checks/webrtc-transport.js +1 -0
  6. package/esm/checker/checks/webrtc.js +1 -0
  7. package/esm/domain/Phone/CTIPhone.js +2 -0
  8. package/esm/index.js +11 -3
  9. package/esm/simple/Auth.js +11 -3
  10. package/esm/simple/Configuration.js +11 -3
  11. package/esm/simple/Phone.js +11 -3
  12. package/esm/simple/index.js +11 -3
  13. package/esm/simple/room/LocalParticipant.js +5521 -5513
  14. package/esm/simple/room/Participant.js +5527 -5519
  15. package/esm/simple/room/RemoteParticipant.js +11 -3
  16. package/esm/simple/room/Room.js +11 -3
  17. package/esm/simple/room/SipRoom.js +11 -3
  18. package/esm/simple/room/Stream.js +11 -3
  19. package/esm/simple/room/__tests__/Participant.test.js +11 -3
  20. package/esm/simple/room/__tests__/RemoteParticipant.test.js +11 -3
  21. package/esm/simple/utils.js +11 -3
  22. package/esm/web-rtc-client.js +1 -0
  23. package/lib/__tests__/web-rtc-client.test.js +1 -0
  24. package/lib/checker/Checker.js +1 -0
  25. package/lib/checker/checks/index.js +1 -0
  26. package/lib/checker/checks/webrtc-transport.js +1 -0
  27. package/lib/checker/checks/webrtc.js +1 -0
  28. package/lib/domain/Phone/CTIPhone.js +2 -0
  29. package/lib/index.js +11 -3
  30. package/lib/simple/Auth.js +11 -3
  31. package/lib/simple/Configuration.js +11 -3
  32. package/lib/simple/Phone.js +11 -3
  33. package/lib/simple/index.js +11 -3
  34. package/lib/simple/room/LocalParticipant.js +6430 -6422
  35. package/lib/simple/room/Participant.js +6433 -6425
  36. package/lib/simple/room/RemoteParticipant.js +11 -3
  37. package/lib/simple/room/Room.js +11 -3
  38. package/lib/simple/room/SipRoom.js +11 -3
  39. package/lib/simple/room/Stream.js +11 -3
  40. package/lib/simple/room/__tests__/Participant.test.js +11 -3
  41. package/lib/simple/room/__tests__/RemoteParticipant.test.js +11 -3
  42. package/lib/simple/utils.js +11 -3
  43. package/lib/web-rtc-client.js +1 -0
  44. package/package.json +1 -1
  45. package/src/domain/Phone/CTIPhone.js +2 -0
  46. package/src/domain/Phone/Phone.js +2 -0
  47. package/src/simple/room/Participant.js +7 -1
  48. package/src/simple/room/Room.js +2 -2
  49. package/src/web-rtc-client.js +1 -0
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7427,6 +7429,7 @@ class WebRTCClient extends Emitter {
7427
7429
  conference,
7428
7430
  audioOnly,
7429
7431
  },
7432
+ earlyMedia: true,
7430
7433
  };
7431
7434
 
7432
7435
  if (audioOnly) {
@@ -12441,10 +12444,15 @@ class Participant extends Emitter {
12441
12444
  }
12442
12445
  }
12443
12446
 
12444
- broadcastStatus(inboundStatus = null) {
12447
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12445
12448
  const status = inboundStatus || this.getStatus();
12446
12449
  logger$2.info('broadcasting participant status', { callId: this.callId, status });
12447
12450
 
12451
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12452
+ // eslint-disable-next-line no-underscore-dangle
12453
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12454
+ }
12455
+
12448
12456
  this.room.sendSignal({
12449
12457
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12450
12458
  origin: this.callId,
@@ -14494,7 +14502,7 @@ class Room extends Emitter {
14494
14502
  // callId is null, someone's requesting everyone's state;
14495
14503
  // or callId is set and matches ours;
14496
14504
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
14497
- this.localParticipant.broadcastStatus();
14505
+ this.localParticipant.broadcastStatus(null, true);
14498
14506
  }
14499
14507
 
14500
14508
  // might as well update the requester's status
@@ -14596,7 +14604,7 @@ class Room extends Emitter {
14596
14604
 
14597
14605
  this.connected = true;
14598
14606
 
14599
- localParticipant.broadcastStatus();
14607
+ localParticipant.broadcastStatus(null, true);
14600
14608
 
14601
14609
  // we're in the room, now let's request everyone's status
14602
14610
  if (this.localParticipant) {
@@ -4618,6 +4618,8 @@ class CTIPhone extends Emitter {
4618
4618
  }
4619
4619
 
4620
4620
  useLocalVideoElement() {}
4621
+
4622
+ setMediaConstraints() {}
4621
4623
  }
4622
4624
 
4623
4625
  /* */
@@ -7429,6 +7431,7 @@ class WebRTCClient extends Emitter {
7429
7431
  conference,
7430
7432
  audioOnly,
7431
7433
  },
7434
+ earlyMedia: true,
7432
7435
  };
7433
7436
 
7434
7437
  if (audioOnly) {
@@ -12443,10 +12446,15 @@ class Participant extends Emitter {
12443
12446
  }
12444
12447
  }
12445
12448
 
12446
- broadcastStatus(inboundStatus = null) {
12449
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12447
12450
  const status = inboundStatus || this.getStatus();
12448
12451
  logger$2.info('broadcasting participant status', { callId: this.callId, status });
12449
12452
 
12453
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12454
+ // eslint-disable-next-line no-underscore-dangle
12455
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12456
+ }
12457
+
12450
12458
  this.room.sendSignal({
12451
12459
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12452
12460
  origin: this.callId,
@@ -14507,7 +14515,7 @@ class Room extends Emitter {
14507
14515
  // callId is null, someone's requesting everyone's state;
14508
14516
  // or callId is set and matches ours;
14509
14517
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
14510
- this.localParticipant.broadcastStatus();
14518
+ this.localParticipant.broadcastStatus(null, true);
14511
14519
  }
14512
14520
 
14513
14521
  // might as well update the requester's status
@@ -14609,7 +14617,7 @@ class Room extends Emitter {
14609
14617
 
14610
14618
  this.connected = true;
14611
14619
 
14612
- localParticipant.broadcastStatus();
14620
+ localParticipant.broadcastStatus(null, true);
14613
14621
 
14614
14622
  // we're in the room, now let's request everyone's status
14615
14623
  if (this.localParticipant) {
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7427,6 +7429,7 @@ class WebRTCClient extends Emitter {
7427
7429
  conference,
7428
7430
  audioOnly,
7429
7431
  },
7432
+ earlyMedia: true,
7430
7433
  };
7431
7434
 
7432
7435
  if (audioOnly) {
@@ -12302,10 +12305,15 @@ class Participant extends Emitter {
12302
12305
  }
12303
12306
  }
12304
12307
 
12305
- broadcastStatus(inboundStatus = null) {
12308
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12306
12309
  const status = inboundStatus || this.getStatus();
12307
12310
  logger$3.info('broadcasting participant status', { callId: this.callId, status });
12308
12311
 
12312
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12313
+ // eslint-disable-next-line no-underscore-dangle
12314
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12315
+ }
12316
+
12309
12317
  this.room.sendSignal({
12310
12318
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12311
12319
  origin: this.callId,
@@ -12948,7 +12956,7 @@ class Room$1 extends Emitter {
12948
12956
  // callId is null, someone's requesting everyone's state;
12949
12957
  // or callId is set and matches ours;
12950
12958
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12951
- this.localParticipant.broadcastStatus();
12959
+ this.localParticipant.broadcastStatus(null, true);
12952
12960
  }
12953
12961
 
12954
12962
  // might as well update the requester's status
@@ -13050,7 +13058,7 @@ class Room$1 extends Emitter {
13050
13058
 
13051
13059
  this.connected = true;
13052
13060
 
13053
- localParticipant.broadcastStatus();
13061
+ localParticipant.broadcastStatus(null, true);
13054
13062
 
13055
13063
  // we're in the room, now let's request everyone's status
13056
13064
  if (this.localParticipant) {
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7427,6 +7429,7 @@ class WebRTCClient extends Emitter {
7427
7429
  conference,
7428
7430
  audioOnly,
7429
7431
  },
7432
+ earlyMedia: true,
7430
7433
  };
7431
7434
 
7432
7435
  if (audioOnly) {
@@ -12302,10 +12305,15 @@ class Participant extends Emitter {
12302
12305
  }
12303
12306
  }
12304
12307
 
12305
- broadcastStatus(inboundStatus = null) {
12308
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12306
12309
  const status = inboundStatus || this.getStatus();
12307
12310
  logger$3.info('broadcasting participant status', { callId: this.callId, status });
12308
12311
 
12312
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12313
+ // eslint-disable-next-line no-underscore-dangle
12314
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12315
+ }
12316
+
12309
12317
  this.room.sendSignal({
12310
12318
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12311
12319
  origin: this.callId,
@@ -12948,7 +12956,7 @@ class Room$1 extends Emitter {
12948
12956
  // callId is null, someone's requesting everyone's state;
12949
12957
  // or callId is set and matches ours;
12950
12958
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12951
- this.localParticipant.broadcastStatus();
12959
+ this.localParticipant.broadcastStatus(null, true);
12952
12960
  }
12953
12961
 
12954
12962
  // might as well update the requester's status
@@ -13050,7 +13058,7 @@ class Room$1 extends Emitter {
13050
13058
 
13051
13059
  this.connected = true;
13052
13060
 
13053
- localParticipant.broadcastStatus();
13061
+ localParticipant.broadcastStatus(null, true);
13054
13062
 
13055
13063
  // we're in the room, now let's request everyone's status
13056
13064
  if (this.localParticipant) {
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7427,6 +7429,7 @@ class WebRTCClient extends Emitter {
7427
7429
  conference,
7428
7430
  audioOnly,
7429
7431
  },
7432
+ earlyMedia: true,
7430
7433
  };
7431
7434
 
7432
7435
  if (audioOnly) {
@@ -12302,10 +12305,15 @@ class Participant extends Emitter {
12302
12305
  }
12303
12306
  }
12304
12307
 
12305
- broadcastStatus(inboundStatus = null) {
12308
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12306
12309
  const status = inboundStatus || this.getStatus();
12307
12310
  logger$3.info('broadcasting participant status', { callId: this.callId, status });
12308
12311
 
12312
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12313
+ // eslint-disable-next-line no-underscore-dangle
12314
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12315
+ }
12316
+
12309
12317
  this.room.sendSignal({
12310
12318
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12311
12319
  origin: this.callId,
@@ -12948,7 +12956,7 @@ class Room$1 extends Emitter {
12948
12956
  // callId is null, someone's requesting everyone's state;
12949
12957
  // or callId is set and matches ours;
12950
12958
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12951
- this.localParticipant.broadcastStatus();
12959
+ this.localParticipant.broadcastStatus(null, true);
12952
12960
  }
12953
12961
 
12954
12962
  // might as well update the requester's status
@@ -13050,7 +13058,7 @@ class Room$1 extends Emitter {
13050
13058
 
13051
13059
  this.connected = true;
13052
13060
 
13053
- localParticipant.broadcastStatus();
13061
+ localParticipant.broadcastStatus(null, true);
13054
13062
 
13055
13063
  // we're in the room, now let's request everyone's status
13056
13064
  if (this.localParticipant) {
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7427,6 +7429,7 @@ class WebRTCClient extends Emitter {
7427
7429
  conference,
7428
7430
  audioOnly,
7429
7431
  },
7432
+ earlyMedia: true,
7430
7433
  };
7431
7434
 
7432
7435
  if (audioOnly) {
@@ -12302,10 +12305,15 @@ class Participant extends Emitter {
12302
12305
  }
12303
12306
  }
12304
12307
 
12305
- broadcastStatus(inboundStatus = null) {
12308
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12306
12309
  const status = inboundStatus || this.getStatus();
12307
12310
  logger$3.info('broadcasting participant status', { callId: this.callId, status });
12308
12311
 
12312
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12313
+ // eslint-disable-next-line no-underscore-dangle
12314
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12315
+ }
12316
+
12309
12317
  this.room.sendSignal({
12310
12318
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12311
12319
  origin: this.callId,
@@ -12948,7 +12956,7 @@ class Room$1 extends Emitter {
12948
12956
  // callId is null, someone's requesting everyone's state;
12949
12957
  // or callId is set and matches ours;
12950
12958
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12951
- this.localParticipant.broadcastStatus();
12959
+ this.localParticipant.broadcastStatus(null, true);
12952
12960
  }
12953
12961
 
12954
12962
  // might as well update the requester's status
@@ -13050,7 +13058,7 @@ class Room$1 extends Emitter {
13050
13058
 
13051
13059
  this.connected = true;
13052
13060
 
13053
- localParticipant.broadcastStatus();
13061
+ localParticipant.broadcastStatus(null, true);
13054
13062
 
13055
13063
  // we're in the room, now let's request everyone's status
13056
13064
  if (this.localParticipant) {
@@ -4618,6 +4618,8 @@ class CTIPhone extends Emitter {
4618
4618
  }
4619
4619
 
4620
4620
  useLocalVideoElement() {}
4621
+
4622
+ setMediaConstraints() {}
4621
4623
  }
4622
4624
 
4623
4625
  /* */
@@ -7429,6 +7431,7 @@ class WebRTCClient extends Emitter {
7429
7431
  conference,
7430
7432
  audioOnly,
7431
7433
  },
7434
+ earlyMedia: true,
7432
7435
  };
7433
7436
 
7434
7437
  if (audioOnly) {
@@ -12304,10 +12307,15 @@ class Participant extends Emitter {
12304
12307
  }
12305
12308
  }
12306
12309
 
12307
- broadcastStatus(inboundStatus = null) {
12310
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
12308
12311
  const status = inboundStatus || this.getStatus();
12309
12312
  logger$3.info('broadcasting participant status', { callId: this.callId, status });
12310
12313
 
12314
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
12315
+ // eslint-disable-next-line no-underscore-dangle
12316
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
12317
+ }
12318
+
12311
12319
  this.room.sendSignal({
12312
12320
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
12313
12321
  origin: this.callId,
@@ -12950,7 +12958,7 @@ class Room$1 extends Emitter {
12950
12958
  // callId is null, someone's requesting everyone's state;
12951
12959
  // or callId is set and matches ours;
12952
12960
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12953
- this.localParticipant.broadcastStatus();
12961
+ this.localParticipant.broadcastStatus(null, true);
12954
12962
  }
12955
12963
 
12956
12964
  // might as well update the requester's status
@@ -13052,7 +13060,7 @@ class Room$1 extends Emitter {
13052
13060
 
13053
13061
  this.connected = true;
13054
13062
 
13055
- localParticipant.broadcastStatus();
13063
+ localParticipant.broadcastStatus(null, true);
13056
13064
 
13057
13065
  // we're in the room, now let's request everyone's status
13058
13066
  if (this.localParticipant) {
@@ -6018,6 +6018,7 @@ class WebRTCClient extends Emitter {
6018
6018
  conference,
6019
6019
  audioOnly,
6020
6020
  },
6021
+ earlyMedia: true,
6021
6022
  };
6022
6023
 
6023
6024
  if (audioOnly) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wazo/sdk",
3
- "version": "0.38.13",
3
+ "version": "0.38.14",
4
4
  "description": "Wazo's JavaScript Software Development Kit.",
5
5
  "main": "dist/wazo-sdk.js",
6
6
  "author": "Wazo (http://wazo.io)",
@@ -341,4 +341,6 @@ export default class CTIPhone extends Emitter implements Phone {
341
341
  }
342
342
 
343
343
  useLocalVideoElement() {}
344
+
345
+ setMediaConstraints() {}
344
346
  }
@@ -110,4 +110,6 @@ export interface Phone {
110
110
  isRegistered(): boolean;
111
111
 
112
112
  hasIncomingCallSession(): boolean;
113
+
114
+ setMediaConstraints(media: MediaStreamConstraints): PhoneVoid;
113
115
  }
@@ -2,6 +2,7 @@
2
2
  import Emitter from '../../utils/Emitter';
3
3
  import IssueReporter from '../../service/IssueReporter';
4
4
 
5
+ import Phone from '../Phone';
5
6
  import Room, { SIGNAL_TYPE_PARTICIPANT_UPDATE } from './Room';
6
7
  import Contact from '../../domain/Contact';
7
8
  import getApiClient from '../../service/getApiClient';
@@ -296,10 +297,15 @@ class Participant extends Emitter {
296
297
  }
297
298
  }
298
299
 
299
- broadcastStatus(inboundStatus: Object = null) {
300
+ broadcastStatus(inboundStatus: Object = null, sendReinvite: ?boolean) {
300
301
  const status = inboundStatus || this.getStatus();
301
302
  logger.info('broadcasting participant status', { callId: this.callId, status });
302
303
 
304
+ if (sendReinvite && !this.streams.length && Phone.phone) {
305
+ // eslint-disable-next-line no-underscore-dangle
306
+ Phone.phone._sendReinviteMessage(this.room.callSession, false);
307
+ }
308
+
303
309
  this.room.sendSignal({
304
310
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
305
311
  origin: this.callId,
@@ -602,7 +602,7 @@ class Room extends Emitter {
602
602
  // callId is null, someone's requesting everyone's state;
603
603
  // or callId is set and matches ours;
604
604
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
605
- this.localParticipant.broadcastStatus();
605
+ this.localParticipant.broadcastStatus(null, true);
606
606
  }
607
607
 
608
608
  // might as well update the requester's status
@@ -704,7 +704,7 @@ class Room extends Emitter {
704
704
 
705
705
  this.connected = true;
706
706
 
707
- localParticipant.broadcastStatus();
707
+ localParticipant.broadcastStatus(null, true);
708
708
 
709
709
  // we're in the room, now let's request everyone's status
710
710
  if (this.localParticipant) {
@@ -472,6 +472,7 @@ export default class WebRTCClient extends Emitter {
472
472
  conference,
473
473
  audioOnly,
474
474
  },
475
+ earlyMedia: true,
475
476
  };
476
477
 
477
478
  if (audioOnly) {