@wazo/sdk 0.38.11 → 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 (52) hide show
  1. package/dist/wazo-sdk.js +4 -4
  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/Features.js +5 -1
  8. package/esm/domain/Phone/CTIPhone.js +2 -0
  9. package/esm/index.js +17 -5
  10. package/esm/simple/Auth.js +17 -5
  11. package/esm/simple/Configuration.js +17 -5
  12. package/esm/simple/Phone.js +17 -5
  13. package/esm/simple/index.js +17 -5
  14. package/esm/simple/room/LocalParticipant.js +5521 -5509
  15. package/esm/simple/room/Participant.js +5519 -5507
  16. package/esm/simple/room/RemoteParticipant.js +17 -5
  17. package/esm/simple/room/Room.js +17 -5
  18. package/esm/simple/room/SipRoom.js +17 -5
  19. package/esm/simple/room/Stream.js +17 -5
  20. package/esm/simple/room/__tests__/Participant.test.js +17 -5
  21. package/esm/simple/room/__tests__/RemoteParticipant.test.js +17 -5
  22. package/esm/simple/utils.js +17 -5
  23. package/esm/web-rtc-client.js +2 -1
  24. package/lib/__tests__/web-rtc-client.test.js +2 -1
  25. package/lib/checker/Checker.js +2 -1
  26. package/lib/checker/checks/index.js +2 -1
  27. package/lib/checker/checks/webrtc-transport.js +2 -1
  28. package/lib/checker/checks/webrtc.js +2 -1
  29. package/lib/domain/Features.js +5 -1
  30. package/lib/domain/Phone/CTIPhone.js +2 -0
  31. package/lib/index.js +17 -5
  32. package/lib/simple/Auth.js +17 -5
  33. package/lib/simple/Configuration.js +17 -5
  34. package/lib/simple/Phone.js +17 -5
  35. package/lib/simple/index.js +17 -5
  36. package/lib/simple/room/LocalParticipant.js +6446 -6434
  37. package/lib/simple/room/Participant.js +6546 -6534
  38. package/lib/simple/room/RemoteParticipant.js +17 -5
  39. package/lib/simple/room/Room.js +17 -5
  40. package/lib/simple/room/SipRoom.js +17 -5
  41. package/lib/simple/room/Stream.js +17 -5
  42. package/lib/simple/room/__tests__/Participant.test.js +17 -5
  43. package/lib/simple/room/__tests__/RemoteParticipant.test.js +17 -5
  44. package/lib/simple/utils.js +17 -5
  45. package/lib/web-rtc-client.js +2 -1
  46. package/package.json +1 -1
  47. package/src/domain/Features.js +5 -1
  48. package/src/domain/Phone/CTIPhone.js +2 -0
  49. package/src/domain/Phone/Phone.js +2 -0
  50. package/src/simple/room/Participant.js +7 -1
  51. package/src/simple/room/Room.js +2 -2
  52. package/src/web-rtc-client.js +2 -1
@@ -6007,6 +6007,7 @@ class WebRTCClient extends Emitter {
6007
6007
  conference,
6008
6008
  audioOnly,
6009
6009
  },
6010
+ earlyMedia: true,
6010
6011
  };
6011
6012
 
6012
6013
  if (audioOnly) {
@@ -6371,7 +6372,7 @@ class WebRTCClient extends Emitter {
6371
6372
 
6372
6373
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
6373
6374
  } else {
6374
- videoSender = pc.getSenders().find(sender => sender.track === null);
6375
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
6375
6376
  }
6376
6377
 
6377
6378
  if (!videoSender) {
@@ -6013,6 +6013,7 @@ class WebRTCClient extends Emitter {
6013
6013
  conference,
6014
6014
  audioOnly,
6015
6015
  },
6016
+ earlyMedia: true,
6016
6017
  };
6017
6018
 
6018
6019
  if (audioOnly) {
@@ -6377,7 +6378,7 @@ class WebRTCClient extends Emitter {
6377
6378
 
6378
6379
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
6379
6380
  } else {
6380
- videoSender = pc.getSenders().find(sender => sender.track === null);
6381
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
6381
6382
  }
6382
6383
 
6383
6384
  if (!videoSender) {
@@ -6601,6 +6601,7 @@ class WebRTCClient extends Emitter {
6601
6601
  conference,
6602
6602
  audioOnly,
6603
6603
  },
6604
+ earlyMedia: true,
6604
6605
  };
6605
6606
 
6606
6607
  if (audioOnly) {
@@ -6965,7 +6966,7 @@ class WebRTCClient extends Emitter {
6965
6966
 
6966
6967
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
6967
6968
  } else {
6968
- videoSender = pc.getSenders().find(sender => sender.track === null);
6969
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
6969
6970
  }
6970
6971
 
6971
6972
  if (!videoSender) {
@@ -6601,6 +6601,7 @@ class WebRTCClient extends Emitter {
6601
6601
  conference,
6602
6602
  audioOnly,
6603
6603
  },
6604
+ earlyMedia: true,
6604
6605
  };
6605
6606
 
6606
6607
  if (audioOnly) {
@@ -6965,7 +6966,7 @@ class WebRTCClient extends Emitter {
6965
6966
 
6966
6967
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
6967
6968
  } else {
6968
- videoSender = pc.getSenders().find(sender => sender.track === null);
6969
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
6969
6970
  }
6970
6971
 
6971
6972
  if (!videoSender) {
@@ -6013,6 +6013,7 @@ class WebRTCClient extends Emitter {
6013
6013
  conference,
6014
6014
  audioOnly,
6015
6015
  },
6016
+ earlyMedia: true,
6016
6017
  };
6017
6018
 
6018
6019
  if (audioOnly) {
@@ -6377,7 +6378,7 @@ class WebRTCClient extends Emitter {
6377
6378
 
6378
6379
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
6379
6380
  } else {
6380
- videoSender = pc.getSenders().find(sender => sender.track === null);
6381
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
6381
6382
  }
6382
6383
 
6383
6384
  if (!videoSender) {
@@ -6013,6 +6013,7 @@ class WebRTCClient extends Emitter {
6013
6013
  conference,
6014
6014
  audioOnly,
6015
6015
  },
6016
+ earlyMedia: true,
6016
6017
  };
6017
6018
 
6018
6019
  if (audioOnly) {
@@ -6377,7 +6378,7 @@ class WebRTCClient extends Emitter {
6377
6378
 
6378
6379
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
6379
6380
  } else {
6380
- videoSender = pc.getSenders().find(sender => sender.track === null);
6381
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
6381
6382
  }
6382
6383
 
6383
6384
  if (!videoSender) {
@@ -4951,7 +4951,7 @@ var getApiClient = (forServer = null) => {
4951
4951
 
4952
4952
  //
4953
4953
 
4954
- const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm'];
4954
+ const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting'];
4955
4955
 
4956
4956
  const getScopeName = (featureName ) => `enterprise.app.${featureName}`;
4957
4957
 
@@ -4965,6 +4965,7 @@ class Features {
4965
4965
 
4966
4966
 
4967
4967
 
4968
+
4968
4969
 
4969
4970
  constructor() {
4970
4971
  this._hasChat = true;
@@ -4973,6 +4974,7 @@ class Features {
4973
4974
  this._hasFax = true;
4974
4975
  this._hasMobileDoubleCall = true;
4975
4976
  this._hasMobileGsm = true;
4977
+ this._hasMeeting = true;
4976
4978
  }
4977
4979
 
4978
4980
  async fetchAccess() {
@@ -4993,6 +4995,7 @@ class Features {
4993
4995
  this._hasFax = this._hasFeatures(scopes, 'fax');
4994
4996
  this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
4995
4997
  this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
4998
+ this._hasMeeting = this._hasFeatures(scopes, 'meeting');
4996
4999
  }
4997
5000
 
4998
5001
  hasChat() { return this._hasChat; }
@@ -5001,6 +5004,7 @@ class Features {
5001
5004
  hasFax() { return this._hasFax; }
5002
5005
  hasMobileDoubleCall() { return this._hasMobileDoubleCall; }
5003
5006
  hasMobileGsm() { return this._hasMobileGsm; }
5007
+ hasMeeting() { return this._hasMeeting; }
5004
5008
 
5005
5009
  _hasFeatures(scopes , featureName ) {
5006
5010
  const scopeName = getScopeName(featureName);
@@ -5777,6 +5777,8 @@ class CTIPhone extends Emitter {
5777
5777
  }
5778
5778
 
5779
5779
  useLocalVideoElement() {}
5780
+
5781
+ setMediaConstraints() {}
5780
5782
  }
5781
5783
 
5782
5784
  exports.TRANSFER_FLOW_ATTENDED = TRANSFER_FLOW_ATTENDED;
package/lib/index.js CHANGED
@@ -4730,6 +4730,8 @@ class CTIPhone extends Emitter {
4730
4730
  }
4731
4731
 
4732
4732
  useLocalVideoElement() {}
4733
+
4734
+ setMediaConstraints() {}
4733
4735
  }
4734
4736
 
4735
4737
  /* */
@@ -6919,6 +6921,7 @@ class WebRTCClient extends Emitter {
6919
6921
  conference,
6920
6922
  audioOnly,
6921
6923
  },
6924
+ earlyMedia: true,
6922
6925
  };
6923
6926
 
6924
6927
  if (audioOnly) {
@@ -7283,7 +7286,7 @@ class WebRTCClient extends Emitter {
7283
7286
 
7284
7287
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7285
7288
  } else {
7286
- videoSender = pc.getSenders().find(sender => sender.track === null);
7289
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
7287
7290
  }
7288
7291
 
7289
7292
  if (!videoSender) {
@@ -9230,7 +9233,7 @@ var COUNTRIES = {
9230
9233
 
9231
9234
  //
9232
9235
 
9233
- const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm'];
9236
+ const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting'];
9234
9237
 
9235
9238
  const getScopeName = (featureName ) => `enterprise.app.${featureName}`;
9236
9239
 
@@ -9244,6 +9247,7 @@ class Features {
9244
9247
 
9245
9248
 
9246
9249
 
9250
+
9247
9251
 
9248
9252
  constructor() {
9249
9253
  this._hasChat = true;
@@ -9252,6 +9256,7 @@ class Features {
9252
9256
  this._hasFax = true;
9253
9257
  this._hasMobileDoubleCall = true;
9254
9258
  this._hasMobileGsm = true;
9259
+ this._hasMeeting = true;
9255
9260
  }
9256
9261
 
9257
9262
  async fetchAccess() {
@@ -9272,6 +9277,7 @@ class Features {
9272
9277
  this._hasFax = this._hasFeatures(scopes, 'fax');
9273
9278
  this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
9274
9279
  this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
9280
+ this._hasMeeting = this._hasFeatures(scopes, 'meeting');
9275
9281
  }
9276
9282
 
9277
9283
  hasChat() { return this._hasChat; }
@@ -9280,6 +9286,7 @@ class Features {
9280
9286
  hasFax() { return this._hasFax; }
9281
9287
  hasMobileDoubleCall() { return this._hasMobileDoubleCall; }
9282
9288
  hasMobileGsm() { return this._hasMobileGsm; }
9289
+ hasMeeting() { return this._hasMeeting; }
9283
9290
 
9284
9291
  _hasFeatures(scopes , featureName ) {
9285
9292
  const scopeName = getScopeName(featureName);
@@ -13278,10 +13285,15 @@ class Participant extends Emitter {
13278
13285
  }
13279
13286
  }
13280
13287
 
13281
- broadcastStatus(inboundStatus = null) {
13288
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
13282
13289
  const status = inboundStatus || this.getStatus();
13283
13290
  logger$2.info('broadcasting participant status', { callId: this.callId, status });
13284
13291
 
13292
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
13293
+ // eslint-disable-next-line no-underscore-dangle
13294
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
13295
+ }
13296
+
13285
13297
  this.room.sendSignal({
13286
13298
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
13287
13299
  origin: this.callId,
@@ -13924,7 +13936,7 @@ class Room extends Emitter {
13924
13936
  // callId is null, someone's requesting everyone's state;
13925
13937
  // or callId is set and matches ours;
13926
13938
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
13927
- this.localParticipant.broadcastStatus();
13939
+ this.localParticipant.broadcastStatus(null, true);
13928
13940
  }
13929
13941
 
13930
13942
  // might as well update the requester's status
@@ -14026,7 +14038,7 @@ class Room extends Emitter {
14026
14038
 
14027
14039
  this.connected = true;
14028
14040
 
14029
- localParticipant.broadcastStatus();
14041
+ localParticipant.broadcastStatus(null, true);
14030
14042
 
14031
14043
  // we're in the room, now let's request everyone's status
14032
14044
  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
  /* */
@@ -7098,6 +7100,7 @@ class WebRTCClient extends Emitter {
7098
7100
  conference,
7099
7101
  audioOnly,
7100
7102
  },
7103
+ earlyMedia: true,
7101
7104
  };
7102
7105
 
7103
7106
  if (audioOnly) {
@@ -7462,7 +7465,7 @@ class WebRTCClient extends Emitter {
7462
7465
 
7463
7466
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7464
7467
  } else {
7465
- videoSender = pc.getSenders().find(sender => sender.track === null);
7468
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
7466
7469
  }
7467
7470
 
7468
7471
  if (!videoSender) {
@@ -11973,10 +11976,15 @@ class Participant extends Emitter {
11973
11976
  }
11974
11977
  }
11975
11978
 
11976
- broadcastStatus(inboundStatus = null) {
11979
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
11977
11980
  const status = inboundStatus || this.getStatus();
11978
11981
  logger$4.info('broadcasting participant status', { callId: this.callId, status });
11979
11982
 
11983
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
11984
+ // eslint-disable-next-line no-underscore-dangle
11985
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
11986
+ }
11987
+
11980
11988
  this.room.sendSignal({
11981
11989
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
11982
11990
  origin: this.callId,
@@ -12619,7 +12627,7 @@ class Room$1 extends Emitter {
12619
12627
  // callId is null, someone's requesting everyone's state;
12620
12628
  // or callId is set and matches ours;
12621
12629
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12622
- this.localParticipant.broadcastStatus();
12630
+ this.localParticipant.broadcastStatus(null, true);
12623
12631
  }
12624
12632
 
12625
12633
  // might as well update the requester's status
@@ -12721,7 +12729,7 @@ class Room$1 extends Emitter {
12721
12729
 
12722
12730
  this.connected = true;
12723
12731
 
12724
- localParticipant.broadcastStatus();
12732
+ localParticipant.broadcastStatus(null, true);
12725
12733
 
12726
12734
  // we're in the room, now let's request everyone's status
12727
12735
  if (this.localParticipant) {
@@ -13405,7 +13413,7 @@ SwitchboardCall.STATE = {
13405
13413
 
13406
13414
  //
13407
13415
 
13408
- const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm'];
13416
+ const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting'];
13409
13417
 
13410
13418
  const getScopeName = (featureName ) => `enterprise.app.${featureName}`;
13411
13419
 
@@ -13419,6 +13427,7 @@ class Features {
13419
13427
 
13420
13428
 
13421
13429
 
13430
+
13422
13431
 
13423
13432
  constructor() {
13424
13433
  this._hasChat = true;
@@ -13427,6 +13436,7 @@ class Features {
13427
13436
  this._hasFax = true;
13428
13437
  this._hasMobileDoubleCall = true;
13429
13438
  this._hasMobileGsm = true;
13439
+ this._hasMeeting = true;
13430
13440
  }
13431
13441
 
13432
13442
  async fetchAccess() {
@@ -13447,6 +13457,7 @@ class Features {
13447
13457
  this._hasFax = this._hasFeatures(scopes, 'fax');
13448
13458
  this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
13449
13459
  this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
13460
+ this._hasMeeting = this._hasFeatures(scopes, 'meeting');
13450
13461
  }
13451
13462
 
13452
13463
  hasChat() { return this._hasChat; }
@@ -13455,6 +13466,7 @@ class Features {
13455
13466
  hasFax() { return this._hasFax; }
13456
13467
  hasMobileDoubleCall() { return this._hasMobileDoubleCall; }
13457
13468
  hasMobileGsm() { return this._hasMobileGsm; }
13469
+ hasMeeting() { return this._hasMeeting; }
13458
13470
 
13459
13471
  _hasFeatures(scopes , featureName ) {
13460
13472
  const scopeName = getScopeName(featureName);
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7096,6 +7098,7 @@ class WebRTCClient extends Emitter {
7096
7098
  conference,
7097
7099
  audioOnly,
7098
7100
  },
7101
+ earlyMedia: true,
7099
7102
  };
7100
7103
 
7101
7104
  if (audioOnly) {
@@ -7460,7 +7463,7 @@ class WebRTCClient extends Emitter {
7460
7463
 
7461
7464
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7462
7465
  } else {
7463
- videoSender = pc.getSenders().find(sender => sender.track === null);
7466
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
7464
7467
  }
7465
7468
 
7466
7469
  if (!videoSender) {
@@ -11971,10 +11974,15 @@ class Participant extends Emitter {
11971
11974
  }
11972
11975
  }
11973
11976
 
11974
- broadcastStatus(inboundStatus = null) {
11977
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
11975
11978
  const status = inboundStatus || this.getStatus();
11976
11979
  logger$4.info('broadcasting participant status', { callId: this.callId, status });
11977
11980
 
11981
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
11982
+ // eslint-disable-next-line no-underscore-dangle
11983
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
11984
+ }
11985
+
11978
11986
  this.room.sendSignal({
11979
11987
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
11980
11988
  origin: this.callId,
@@ -12617,7 +12625,7 @@ class Room$1 extends Emitter {
12617
12625
  // callId is null, someone's requesting everyone's state;
12618
12626
  // or callId is set and matches ours;
12619
12627
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12620
- this.localParticipant.broadcastStatus();
12628
+ this.localParticipant.broadcastStatus(null, true);
12621
12629
  }
12622
12630
 
12623
12631
  // might as well update the requester's status
@@ -12719,7 +12727,7 @@ class Room$1 extends Emitter {
12719
12727
 
12720
12728
  this.connected = true;
12721
12729
 
12722
- localParticipant.broadcastStatus();
12730
+ localParticipant.broadcastStatus(null, true);
12723
12731
 
12724
12732
  // we're in the room, now let's request everyone's status
12725
12733
  if (this.localParticipant) {
@@ -13386,7 +13394,7 @@ SwitchboardCall.STATE = {
13386
13394
 
13387
13395
  //
13388
13396
 
13389
- const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm'];
13397
+ const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting'];
13390
13398
 
13391
13399
  const getScopeName = (featureName ) => `enterprise.app.${featureName}`;
13392
13400
 
@@ -13400,6 +13408,7 @@ class Features {
13400
13408
 
13401
13409
 
13402
13410
 
13411
+
13403
13412
 
13404
13413
  constructor() {
13405
13414
  this._hasChat = true;
@@ -13408,6 +13417,7 @@ class Features {
13408
13417
  this._hasFax = true;
13409
13418
  this._hasMobileDoubleCall = true;
13410
13419
  this._hasMobileGsm = true;
13420
+ this._hasMeeting = true;
13411
13421
  }
13412
13422
 
13413
13423
  async fetchAccess() {
@@ -13428,6 +13438,7 @@ class Features {
13428
13438
  this._hasFax = this._hasFeatures(scopes, 'fax');
13429
13439
  this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
13430
13440
  this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
13441
+ this._hasMeeting = this._hasFeatures(scopes, 'meeting');
13431
13442
  }
13432
13443
 
13433
13444
  hasChat() { return this._hasChat; }
@@ -13436,6 +13447,7 @@ class Features {
13436
13447
  hasFax() { return this._hasFax; }
13437
13448
  hasMobileDoubleCall() { return this._hasMobileDoubleCall; }
13438
13449
  hasMobileGsm() { return this._hasMobileGsm; }
13450
+ hasMeeting() { return this._hasMeeting; }
13439
13451
 
13440
13452
  _hasFeatures(scopes , featureName ) {
13441
13453
  const scopeName = getScopeName(featureName);
@@ -4616,6 +4616,8 @@ class CTIPhone extends Emitter {
4616
4616
  }
4617
4617
 
4618
4618
  useLocalVideoElement() {}
4619
+
4620
+ setMediaConstraints() {}
4619
4621
  }
4620
4622
 
4621
4623
  /* */
@@ -7096,6 +7098,7 @@ class WebRTCClient extends Emitter {
7096
7098
  conference,
7097
7099
  audioOnly,
7098
7100
  },
7101
+ earlyMedia: true,
7099
7102
  };
7100
7103
 
7101
7104
  if (audioOnly) {
@@ -7460,7 +7463,7 @@ class WebRTCClient extends Emitter {
7460
7463
 
7461
7464
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7462
7465
  } else {
7463
- videoSender = pc.getSenders().find(sender => sender.track === null);
7466
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
7464
7467
  }
7465
7468
 
7466
7469
  if (!videoSender) {
@@ -11884,10 +11887,15 @@ class Participant extends Emitter {
11884
11887
  }
11885
11888
  }
11886
11889
 
11887
- broadcastStatus(inboundStatus = null) {
11890
+ broadcastStatus(inboundStatus = null, sendReinvite ) {
11888
11891
  const status = inboundStatus || this.getStatus();
11889
11892
  logger$4.info('broadcasting participant status', { callId: this.callId, status });
11890
11893
 
11894
+ if (sendReinvite && !this.streams.length && Phone$1.phone) {
11895
+ // eslint-disable-next-line no-underscore-dangle
11896
+ Phone$1.phone._sendReinviteMessage(this.room.callSession, false);
11897
+ }
11898
+
11891
11899
  this.room.sendSignal({
11892
11900
  type: SIGNAL_TYPE_PARTICIPANT_UPDATE,
11893
11901
  origin: this.callId,
@@ -12530,7 +12538,7 @@ class Room$1 extends Emitter {
12530
12538
  // callId is null, someone's requesting everyone's state;
12531
12539
  // or callId is set and matches ours;
12532
12540
  if (this.localParticipant && (!callId || callId === this.localParticipant.callId)) {
12533
- this.localParticipant.broadcastStatus();
12541
+ this.localParticipant.broadcastStatus(null, true);
12534
12542
  }
12535
12543
 
12536
12544
  // might as well update the requester's status
@@ -12632,7 +12640,7 @@ class Room$1 extends Emitter {
12632
12640
 
12633
12641
  this.connected = true;
12634
12642
 
12635
- localParticipant.broadcastStatus();
12643
+ localParticipant.broadcastStatus(null, true);
12636
12644
 
12637
12645
  // we're in the room, now let's request everyone's status
12638
12646
  if (this.localParticipant) {
@@ -13324,7 +13332,7 @@ SwitchboardCall.STATE = {
13324
13332
 
13325
13333
  //
13326
13334
 
13327
- const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm'];
13335
+ const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting'];
13328
13336
 
13329
13337
  const getScopeName = (featureName ) => `enterprise.app.${featureName}`;
13330
13338
 
@@ -13338,6 +13346,7 @@ class Features {
13338
13346
 
13339
13347
 
13340
13348
 
13349
+
13341
13350
 
13342
13351
  constructor() {
13343
13352
  this._hasChat = true;
@@ -13346,6 +13355,7 @@ class Features {
13346
13355
  this._hasFax = true;
13347
13356
  this._hasMobileDoubleCall = true;
13348
13357
  this._hasMobileGsm = true;
13358
+ this._hasMeeting = true;
13349
13359
  }
13350
13360
 
13351
13361
  async fetchAccess() {
@@ -13366,6 +13376,7 @@ class Features {
13366
13376
  this._hasFax = this._hasFeatures(scopes, 'fax');
13367
13377
  this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
13368
13378
  this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
13379
+ this._hasMeeting = this._hasFeatures(scopes, 'meeting');
13369
13380
  }
13370
13381
 
13371
13382
  hasChat() { return this._hasChat; }
@@ -13374,6 +13385,7 @@ class Features {
13374
13385
  hasFax() { return this._hasFax; }
13375
13386
  hasMobileDoubleCall() { return this._hasMobileDoubleCall; }
13376
13387
  hasMobileGsm() { return this._hasMobileGsm; }
13388
+ hasMeeting() { return this._hasMeeting; }
13377
13389
 
13378
13390
  _hasFeatures(scopes , featureName ) {
13379
13391
  const scopeName = getScopeName(featureName);
@@ -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) {
@@ -7791,7 +7794,7 @@ class WebRTCClient extends Emitter {
7791
7794
 
7792
7795
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7793
7796
  } else {
7794
- videoSender = pc.getSenders().find(sender => sender.track === null);
7797
+ videoSender = pc && pc.getSenders && pc.getSenders().find(sender => sender.track === null);
7795
7798
  }
7796
7799
 
7797
7800
  if (!videoSender) {
@@ -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) {
@@ -13734,7 +13742,7 @@ SwitchboardCall.STATE = {
13734
13742
 
13735
13743
  //
13736
13744
 
13737
- const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm'];
13745
+ const FEATURES = ['chat', 'video', 'call_recording', 'fax', 'mobile_double_call', 'mobile_gsm', 'meeting'];
13738
13746
 
13739
13747
  const getScopeName = (featureName ) => `enterprise.app.${featureName}`;
13740
13748
 
@@ -13748,6 +13756,7 @@ class Features {
13748
13756
 
13749
13757
 
13750
13758
 
13759
+
13751
13760
 
13752
13761
  constructor() {
13753
13762
  this._hasChat = true;
@@ -13756,6 +13765,7 @@ class Features {
13756
13765
  this._hasFax = true;
13757
13766
  this._hasMobileDoubleCall = true;
13758
13767
  this._hasMobileGsm = true;
13768
+ this._hasMeeting = true;
13759
13769
  }
13760
13770
 
13761
13771
  async fetchAccess() {
@@ -13776,6 +13786,7 @@ class Features {
13776
13786
  this._hasFax = this._hasFeatures(scopes, 'fax');
13777
13787
  this._hasMobileDoubleCall = this._hasFeatures(scopes, 'mobile_double_call');
13778
13788
  this._hasMobileGsm = this._hasFeatures(scopes, 'mobile_gsm');
13789
+ this._hasMeeting = this._hasFeatures(scopes, 'meeting');
13779
13790
  }
13780
13791
 
13781
13792
  hasChat() { return this._hasChat; }
@@ -13784,6 +13795,7 @@ class Features {
13784
13795
  hasFax() { return this._hasFax; }
13785
13796
  hasMobileDoubleCall() { return this._hasMobileDoubleCall; }
13786
13797
  hasMobileGsm() { return this._hasMobileGsm; }
13798
+ hasMeeting() { return this._hasMeeting; }
13787
13799
 
13788
13800
  _hasFeatures(scopes , featureName ) {
13789
13801
  const scopeName = getScopeName(featureName);