@wazo/sdk 0.37.17 → 0.37.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 (118) hide show
  1. package/dist/wazo-sdk.js +3 -3
  2. package/esm/__tests__/api-client.test.js +52 -9
  3. package/esm/__tests__/web-rtc-client.test.js +96 -21
  4. package/esm/api/agentd.js +26 -3
  5. package/esm/api/amid.js +26 -3
  6. package/esm/api/application.js +26 -3
  7. package/esm/api/auth.js +26 -3
  8. package/esm/api/call-logd.js +28 -5
  9. package/esm/api/calld.js +26 -3
  10. package/esm/api/chatd.js +26 -3
  11. package/esm/api/confd.js +50 -7
  12. package/esm/api/ctid-ng.js +26 -3
  13. package/esm/api/dird.js +26 -3
  14. package/esm/api/webhookd.js +26 -3
  15. package/esm/api-client.js +52 -9
  16. package/esm/checker/Checker.js +98 -21
  17. package/esm/checker/checks/aor.js +52 -9
  18. package/esm/checker/checks/api.js +52 -9
  19. package/esm/checker/checks/index.js +98 -21
  20. package/esm/checker/checks/wazo-websocket.js +28 -3
  21. package/esm/checker/checks/webrtc-transport.js +96 -21
  22. package/esm/checker/checks/webrtc.js +96 -21
  23. package/esm/domain/AdHocAPIConference.js +52 -9
  24. package/esm/domain/CallLog.js +2 -2
  25. package/esm/domain/Features.js +52 -9
  26. package/esm/domain/Meeting.js +19 -2
  27. package/esm/domain/Phone/CTIPhone.js +52 -9
  28. package/esm/domain/Phone/WebRTCPhone.js +41 -5
  29. package/esm/domain/Recording.js +1 -1
  30. package/esm/domain/__tests__/CallLog.test.js +2 -2
  31. package/esm/index.js +119 -22
  32. package/esm/lib/WazoSessionDescriptionHandler.js +26 -3
  33. package/esm/service/CallApi.js +52 -9
  34. package/esm/service/IssueReporter.js +26 -3
  35. package/esm/service/__tests__/IssueReporter.test.js +26 -3
  36. package/esm/service/getApiClient.js +52 -9
  37. package/esm/simple/Auth.js +119 -22
  38. package/esm/simple/Configuration.js +119 -22
  39. package/esm/simple/Directory.js +52 -9
  40. package/esm/simple/Phone.js +119 -22
  41. package/esm/simple/Websocket.js +29 -3
  42. package/esm/simple/index.js +119 -22
  43. package/esm/simple/room/LocalParticipant.js +119 -22
  44. package/esm/simple/room/Participant.js +119 -22
  45. package/esm/simple/room/RemoteParticipant.js +119 -22
  46. package/esm/simple/room/Room.js +119 -22
  47. package/esm/simple/room/SipRoom.js +119 -22
  48. package/esm/simple/room/Stream.js +119 -22
  49. package/esm/simple/room/__tests__/RemoteParticipant.test.js +119 -22
  50. package/esm/simple/utils.js +119 -22
  51. package/esm/utils/__tests__/api-requester.test.js +26 -3
  52. package/esm/utils/api-requester.js +26 -3
  53. package/esm/web-rtc-client.js +96 -21
  54. package/esm/websocket-client.js +29 -4
  55. package/lib/__tests__/api-client.test.js +52 -9
  56. package/lib/__tests__/web-rtc-client.test.js +96 -21
  57. package/lib/api/agentd.js +26 -3
  58. package/lib/api/amid.js +26 -3
  59. package/lib/api/application.js +26 -3
  60. package/lib/api/auth.js +26 -3
  61. package/lib/api/call-logd.js +28 -5
  62. package/lib/api/calld.js +26 -3
  63. package/lib/api/chatd.js +26 -3
  64. package/lib/api/confd.js +50 -7
  65. package/lib/api/ctid-ng.js +26 -3
  66. package/lib/api/dird.js +26 -3
  67. package/lib/api/webhookd.js +26 -3
  68. package/lib/api-client.js +52 -9
  69. package/lib/checker/Checker.js +98 -21
  70. package/lib/checker/checks/aor.js +52 -9
  71. package/lib/checker/checks/api.js +52 -9
  72. package/lib/checker/checks/index.js +98 -21
  73. package/lib/checker/checks/wazo-websocket.js +28 -3
  74. package/lib/checker/checks/webrtc-transport.js +96 -21
  75. package/lib/checker/checks/webrtc.js +96 -21
  76. package/lib/domain/AdHocAPIConference.js +52 -9
  77. package/lib/domain/CallLog.js +2 -2
  78. package/lib/domain/Features.js +52 -9
  79. package/lib/domain/Meeting.js +19 -2
  80. package/lib/domain/Phone/CTIPhone.js +52 -9
  81. package/lib/domain/Phone/WebRTCPhone.js +41 -4
  82. package/lib/domain/Recording.js +1 -1
  83. package/lib/domain/__tests__/CallLog.test.js +2 -2
  84. package/lib/index.js +119 -22
  85. package/lib/lib/WazoSessionDescriptionHandler.js +26 -3
  86. package/lib/service/CallApi.js +52 -9
  87. package/lib/service/IssueReporter.js +26 -3
  88. package/lib/service/__tests__/IssueReporter.test.js +26 -3
  89. package/lib/service/getApiClient.js +52 -9
  90. package/lib/simple/Auth.js +119 -22
  91. package/lib/simple/Configuration.js +119 -22
  92. package/lib/simple/Directory.js +52 -9
  93. package/lib/simple/Phone.js +119 -22
  94. package/lib/simple/Websocket.js +29 -3
  95. package/lib/simple/index.js +119 -22
  96. package/lib/simple/room/LocalParticipant.js +119 -22
  97. package/lib/simple/room/Participant.js +119 -22
  98. package/lib/simple/room/RemoteParticipant.js +119 -22
  99. package/lib/simple/room/Room.js +119 -22
  100. package/lib/simple/room/SipRoom.js +119 -22
  101. package/lib/simple/room/Stream.js +119 -22
  102. package/lib/simple/room/__tests__/RemoteParticipant.test.js +119 -22
  103. package/lib/simple/utils.js +119 -22
  104. package/lib/utils/__tests__/api-requester.test.js +26 -3
  105. package/lib/utils/api-requester.js +26 -3
  106. package/lib/web-rtc-client.js +96 -21
  107. package/lib/websocket-client.js +29 -3
  108. package/package.json +2 -2
  109. package/src/api/confd.js +5 -2
  110. package/src/domain/CallLog.js +1 -1
  111. package/src/domain/Meeting.js +19 -2
  112. package/src/domain/Phone/WebRTCPhone.js +14 -1
  113. package/src/domain/Recording.js +1 -1
  114. package/src/service/IssueReporter.js +26 -3
  115. package/src/simple/Phone.js +5 -0
  116. package/src/types/WebSocketMessage.js +5 -1
  117. package/src/web-rtc-client.js +44 -12
  118. package/src/websocket-client.js +2 -0
@@ -450,6 +450,7 @@ class IssueReporter {
450
450
 
451
451
 
452
452
 
453
+
453
454
 
454
455
  constructor() {
455
456
  addLevelsTo(this);
@@ -461,12 +462,17 @@ class IssueReporter {
461
462
  this.bufferTimeout = null;
462
463
  this._boundProcessBuffer = this._processBuffer.bind(this);
463
464
  this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
465
+ this._callback = null;
464
466
  }
465
467
 
466
468
  init() {
467
469
  this._catchConsole();
468
470
  }
469
471
 
472
+ setCallback(cb ) {
473
+ this._callback = cb;
474
+ }
475
+
470
476
  configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
471
477
  this.remoteClientConfiguration = configuration;
472
478
  }
@@ -502,6 +508,7 @@ class IssueReporter {
502
508
 
503
509
  // Handle category label
504
510
  let category = null;
511
+ let skipSendToRemote = false;
505
512
  let extra = {};
506
513
  if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
507
514
  category = args[0].split('=')[1];
@@ -517,6 +524,7 @@ class IssueReporter {
517
524
  errorMessage: lastArg.message,
518
525
  errorStack: lastArg.stack,
519
526
  errorType: lastArg.constructor.name,
527
+ skipSendToRemote: lastArg.skipSendToRemote,
520
528
  };
521
529
  } else {
522
530
  extra = lastArg;
@@ -525,6 +533,11 @@ class IssueReporter {
525
533
  args.splice(1, 1);
526
534
  }
527
535
 
536
+ if (extra.skipSendToRemote) {
537
+ skipSendToRemote = true;
538
+ delete extra.skipSendToRemote;
539
+ }
540
+
528
541
  const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
529
542
  const message = args.join(', ');
530
543
  let consoleMessage = message;
@@ -545,7 +558,13 @@ class IssueReporter {
545
558
  const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
546
559
  oldMethod.apply(oldMethod, [date, consoleMessage]);
547
560
 
548
- this._sendToRemoteLogger(level, { date, message, category, ...extra });
561
+ if (this._callback) {
562
+ this._callback(level, consoleMessage);
563
+ }
564
+
565
+ if (!skipSendToRemote) {
566
+ this._sendToRemoteLogger(level, { date, message, category, ...extra });
567
+ }
549
568
  }
550
569
 
551
570
  logRequest(url , options , response , start ) {
@@ -690,7 +709,11 @@ class IssueReporter {
690
709
  },
691
710
  // $FlowFixMe
692
711
  body,
693
- }).catch(() => {
712
+ }).catch((e ) => {
713
+ // $FlowFixMe
714
+ e.skipSendToRemote = true;
715
+ this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
716
+
694
717
  setTimeout(() => {
695
718
  if (isArray) {
696
719
  payload = payload.map(message => {
@@ -702,7 +725,7 @@ class IssueReporter {
702
725
  payload._retry = retry + 1;
703
726
  }
704
727
 
705
- this._sendDebugToGrafana(body, retry + 1);
728
+ this._sendDebugToGrafana(payload, retry + 1);
706
729
  }, 5000 + retry * 1000);
707
730
  });
708
731
  }
@@ -2640,7 +2663,8 @@ class ExternalApp {
2640
2663
 
2641
2664
 
2642
2665
 
2643
-
2666
+
2667
+
2644
2668
 
2645
2669
 
2646
2670
  class Meeting {
@@ -2652,6 +2676,7 @@ class Meeting {
2652
2676
 
2653
2677
 
2654
2678
 
2679
+
2655
2680
 
2656
2681
 
2657
2682
  static parse(plain ) {
@@ -2663,14 +2688,28 @@ class Meeting {
2663
2688
  port: plain.port,
2664
2689
  uuid: plain.uuid,
2665
2690
  number: plain.number,
2691
+ persistent: plain.persistent,
2666
2692
  });
2667
2693
  }
2668
2694
 
2695
+ static parseMany(items ) {
2696
+ return items.map(plain => Meeting.parse(plain));
2697
+ }
2698
+
2669
2699
  static newFrom(meeting ) {
2670
2700
  return newFrom(meeting, Meeting);
2671
2701
  }
2672
2702
 
2673
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
2703
+ constructor({
2704
+ uuid,
2705
+ name,
2706
+ guestSipAuthorization,
2707
+ ownerUuids,
2708
+ port,
2709
+ uri,
2710
+ number,
2711
+ persistent,
2712
+ } = {}) {
2674
2713
  this.guestSipAuthorization = guestSipAuthorization;
2675
2714
  this.uri = uri;
2676
2715
  this.name = name;
@@ -2678,6 +2717,7 @@ class Meeting {
2678
2717
  this.port = port;
2679
2718
  this.uuid = uuid;
2680
2719
  this.number = number;
2720
+ this.persistent = persistent;
2681
2721
 
2682
2722
  // Useful to compare instead of instanceof with minified code
2683
2723
  this.type = 'Meeting';
@@ -2755,8 +2795,11 @@ var confdMethods = (client , baseUrl ) => ({
2755
2795
  }
2756
2796
  },
2757
2797
 
2758
- createMyMeeting: (name ) =>
2759
- client.post(`${baseUrl}/users/me/meetings`, { name }).then(Meeting.parse),
2798
+ getMyMeetings: () =>
2799
+ client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
2800
+
2801
+ createMyMeeting: (name , persistent ) =>
2802
+ client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
2760
2803
 
2761
2804
  deleteMyMeeting: (meetingUuid ) =>
2762
2805
  client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
@@ -3586,7 +3629,7 @@ class Recording {
3586
3629
 
3587
3630
 
3588
3631
 
3589
- static parseMany(recordings ) {
3632
+ static parseMany(recordings = []) {
3590
3633
  return recordings.map(item => Recording.parse(item));
3591
3634
  }
3592
3635
 
@@ -3712,7 +3755,7 @@ class CallLog {
3712
3755
  duration: (plain.duration || 0) * 1000, // duration is in seconds
3713
3756
  start: moment__default['default'](plain.start).toDate(),
3714
3757
  end: plain.end ? moment__default['default'](plain.end).toDate() : null,
3715
- recordings: Recording.parseMany(plain.recordings),
3758
+ recordings: Recording.parseMany(plain.recordings || []),
3716
3759
  });
3717
3760
  }
3718
3761
 
@@ -6557,6 +6600,7 @@ const ON_REINVITE$1 = 'reinvite';
6557
6600
  const ON_ERROR = 'onError';
6558
6601
  const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
6559
6602
  const ON_NETWORK_STATS$1 = 'onNetworkStats';
6603
+ const ON_DISCONNECTED$1 = 'onDisconnected';
6560
6604
 
6561
6605
  const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
6562
6606
  const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
@@ -6633,6 +6677,7 @@ class WebRTCClient extends Emitter {
6633
6677
 
6634
6678
 
6635
6679
 
6680
+
6636
6681
 
6637
6682
  static isAPrivateIp(ip ) {
6638
6683
  const regex = /^(?:10|127|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\..*/;
@@ -6698,6 +6743,7 @@ class WebRTCClient extends Emitter {
6698
6743
  this.ON_ERROR = ON_ERROR;
6699
6744
  this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
6700
6745
  this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
6746
+ this.ON_DISCONNECTED = ON_DISCONNECTED$1;
6701
6747
  }
6702
6748
 
6703
6749
  configureMedia(media ) {
@@ -6963,7 +7009,9 @@ class WebRTCClient extends Emitter {
6963
7009
  const inviteOptions = {
6964
7010
  requestDelegate: {
6965
7011
  onAccept: (response ) => {
6966
- session.sessionDescriptionHandler.peerConnection.sfu = conference;
7012
+ if (session.sessionDescriptionHandler.peerConnection) {
7013
+ session.sessionDescriptionHandler.peerConnection.sfu = conference;
7014
+ }
6967
7015
  this._onAccepted(session, response.session, true);
6968
7016
  },
6969
7017
  onReject: (response ) => {
@@ -7299,7 +7347,7 @@ class WebRTCClient extends Emitter {
7299
7347
  // We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
7300
7348
  const transceivers = pc.getTransceivers();
7301
7349
  const transceiverIdx = lastIndexOf(transceivers, transceiver =>
7302
- transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
7350
+ transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
7303
7351
 
7304
7352
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7305
7353
  } else {
@@ -7835,6 +7883,16 @@ class WebRTCClient extends Emitter {
7835
7883
  return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
7836
7884
  }
7837
7885
 
7886
+ // Useful in a react-native environment when remoteMediaStream is not updated
7887
+ getRemoteVideoStreamFromPc(sessionId ) {
7888
+ const pc = this.getPeerConnection(sessionId);
7889
+ if (!pc) {
7890
+ return null;
7891
+ }
7892
+
7893
+ return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
7894
+ }
7895
+
7838
7896
  hasVideo(sessionId ) {
7839
7897
  return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
7840
7898
  }
@@ -8324,6 +8382,7 @@ class WebRTCClient extends Emitter {
8324
8382
 
8325
8383
  this.updateRemoteStream(this.getSipSessionId(session));
8326
8384
 
8385
+ const pc = session.sessionDescriptionHandler.peerConnection;
8327
8386
  const onTrack = (event ) => {
8328
8387
  const isAudioOnly = this._isAudioOnly(session);
8329
8388
  const { kind, label, readyState, id, muted } = event.track;
@@ -8343,6 +8402,12 @@ class WebRTCClient extends Emitter {
8343
8402
 
8344
8403
  session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
8345
8404
 
8405
+ pc.oniceconnectionstatechange = () => {
8406
+ if (pc.iceConnectionState === 'disconnected') {
8407
+ this.eventEmitter.emit(ON_DISCONNECTED$1);
8408
+ }
8409
+ };
8410
+
8346
8411
  if (withEvent) {
8347
8412
  this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
8348
8413
  }
@@ -8562,6 +8627,7 @@ class WebRTCClient extends Emitter {
8562
8627
  let videoBytesReceived = 0;
8563
8628
  let transportSent = 0;
8564
8629
  let transportReceived = 0;
8630
+ let packetsLost = 0;
8565
8631
 
8566
8632
  stats.forEach(report => {
8567
8633
  if (report.type === 'outbound-rtp' && report.kind === 'audio') {
@@ -8574,7 +8640,7 @@ class WebRTCClient extends Emitter {
8574
8640
  videoBytesSent += report.bytesSent + report.headerBytesSent;
8575
8641
  }
8576
8642
  if (report.type === 'inbound-rtp' && report.kind === 'audio') {
8577
- networkStats.packetsLost = report.packetsLost;
8643
+ packetsLost += report.packetsLost;
8578
8644
  networkStats.packetsReceived = report.packetsReceived;
8579
8645
  audioBytesReceived += report.bytesReceived + report.headerBytesReceived;
8580
8646
  }
@@ -8591,27 +8657,36 @@ class WebRTCClient extends Emitter {
8591
8657
  }
8592
8658
  }
8593
8659
  if (report.type === 'remote-inbound-rtp' && report.kind === 'audio') {
8660
+ packetsLost += report.packetsLost;
8594
8661
  networkStats.roundTripTime = report.roundTripTime;
8595
8662
  networkStats.jitter = report.jitter;
8596
8663
  }
8664
+ if (report.type === 'remote-inbound-rtp' && report.kind === 'video') {
8665
+ packetsLost += report.packetsLost;
8666
+ }
8597
8667
  if (report.type === 'transport') {
8598
8668
  transportSent += report.bytesSent;
8599
8669
  transportReceived += report.bytesReceived;
8600
8670
  }
8601
8671
  });
8602
8672
 
8603
- networkStats.audioBytesSent = audioBytesSent;
8673
+ networkStats.packetsLost = packetsLost;
8674
+ networkStats.totalAudioBytesSent = audioBytesSent;
8675
+ networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
8676
+ networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
8604
8677
  networkStats.audioBytesReceived = audioBytesReceived;
8605
- networkStats.videoBytesSent = videoBytesSent;
8606
- networkStats.videoBytesReceived = videoBytesReceived;
8678
+ networkStats.totalVideoBytesSent = videoBytesSent;
8679
+ networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
8680
+ networkStats.totalVideoBytesReceived = videoBytesReceived;
8681
+ networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
8682
+ networkStats.totalTransportSent = transportSent - lastTransportSent;
8607
8683
  networkStats.transportSent = transportSent;
8608
- networkStats.transportReceived = transportReceived;
8684
+ networkStats.totalTransportReceived = transportReceived;
8685
+ networkStats.transportReceived = transportReceived - lastTransportReceived;
8609
8686
 
8610
- const bandwidth = (networkStats.audioBytesSent - lastAudioSent) + (networkStats.videoBytesSent - lastVideoSent)
8611
- + (networkStats.audioBytesReceived - lastAudioReceived) + (networkStats.videoBytesReceived - lastVideoReceived)
8612
- + (networkStats.transportReceived - lastTransportReceived) + (networkStats.transportSent - lastTransportSent);
8613
-
8614
- networkStats.bandwidth = bandwidth;
8687
+ networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
8688
+ + networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
8689
+ + networkStats.transportSent;
8615
8690
 
8616
8691
  this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
8617
8692
  this.sessionNetworkStats[sessionId].push(networkStats);
@@ -8660,6 +8735,7 @@ const ON_MESSAGE_TRACK_UPDATED = 'onTrackUpdated';
8660
8735
  const ON_NETWORK_STATS = 'onNetworkStats';
8661
8736
  const ON_CHAT = 'phone/ON_CHAT';
8662
8737
  const ON_SIGNAL = 'phone/ON_SIGNAL';
8738
+ const ON_DISCONNECTED = 'onDisconnected';
8663
8739
 
8664
8740
  const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
8665
8741
  const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
@@ -8699,6 +8775,7 @@ const events = [
8699
8775
  ON_CHAT,
8700
8776
  ON_SIGNAL,
8701
8777
  ON_NETWORK_STATS,
8778
+ ON_DISCONNECTED,
8702
8779
  ];
8703
8780
 
8704
8781
  const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
@@ -9020,9 +9097,11 @@ class WebRTCPhone extends Emitter {
9020
9097
  case sessionState.SessionState.Terminated: {
9021
9098
  logger$7.info('WebRTC phone - call terminated', { sipId: sipSession.id });
9022
9099
 
9100
+ // Should be called before `_onCallTerminated` or the callCount will not decrement...
9101
+ const callSession = this._createCallSession(sipSession);
9023
9102
  const wasCurrentSession = this._onCallTerminated(sipSession);
9024
9103
 
9025
- return this.eventEmitter.emit(ON_CALL_ENDED, this._createCallSession(sipSession), wasCurrentSession);
9104
+ return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
9026
9105
  }
9027
9106
  }
9028
9107
  });
@@ -9970,6 +10049,10 @@ class WebRTCPhone extends Emitter {
9970
10049
  return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
9971
10050
  }
9972
10051
 
10052
+ getRemoteVideoStreamFromPc(callSession ) {
10053
+ return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
10054
+ }
10055
+
9973
10056
  hasRemoteVideo(callSession ) {
9974
10057
  return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
9975
10058
  }
@@ -10051,6 +10134,11 @@ class WebRTCPhone extends Emitter {
10051
10134
  this.eventEmitter.emit(ON_UNREGISTERED);
10052
10135
  });
10053
10136
 
10137
+ this.client.on(this.client.ON_DISCONNECTED, () => {
10138
+ logger$7.info('WebRTC disconnected');
10139
+ this.eventEmitter.emit(ON_DISCONNECTED);
10140
+ });
10141
+
10054
10142
  this.client.on(this.client.REGISTERED, () => {
10055
10143
  logger$7.info('WebRTC registered', {
10056
10144
  shouldSendReinvite: this.shouldSendReinvite,
@@ -10307,6 +10395,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
10307
10395
  ON_NETWORK_STATS: ON_NETWORK_STATS,
10308
10396
  ON_CHAT: ON_CHAT,
10309
10397
  ON_SIGNAL: ON_SIGNAL,
10398
+ ON_DISCONNECTED: ON_DISCONNECTED,
10310
10399
  MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
10311
10400
  MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
10312
10401
  events: events,
@@ -10647,6 +10736,11 @@ class Phone extends Emitter {
10647
10736
  return this.getRemoteVideoStream(callSession);
10648
10737
  }
10649
10738
 
10739
+ // Useful in a react-native environment when remoteMediaStream is not updated
10740
+ getRemoteVideoStreamFromPc(callSession ) {
10741
+ return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
10742
+ }
10743
+
10650
10744
  hasVideo(callSession ) {
10651
10745
  return this.phone ? this.phone.hasVideo(callSession) : false;
10652
10746
  }
@@ -10806,6 +10900,7 @@ const AGENT_PAUSED = 'agent_paused';
10806
10900
  const AGENT_UNPAUSED = 'agent_unpaused';
10807
10901
  const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
10808
10902
  const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
10903
+ const MEETING_USER_PROGRESS = 'meeting_user_progress';
10809
10904
 
10810
10905
  const BLACKLIST_EVENTS = [
10811
10906
  CHAT_MESSAGE_SENT,
@@ -11156,6 +11251,7 @@ WebSocketClient.eventLists = [
11156
11251
  AGENT_UNPAUSED,
11157
11252
  CONFERENCE_ADHOC_PARTICIPANT_LEFT,
11158
11253
  CONFERENCE_ADHOC_DELETED,
11254
+ MEETING_USER_PROGRESS,
11159
11255
  ];
11160
11256
 
11161
11257
  var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
@@ -11226,6 +11322,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
11226
11322
  AGENT_UNPAUSED: AGENT_UNPAUSED,
11227
11323
  CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
11228
11324
  CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
11325
+ MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
11229
11326
  HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
11230
11327
  'default': WebSocketClient
11231
11328
  });