@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
@@ -1644,6 +1644,7 @@ class IssueReporter {
1644
1644
 
1645
1645
 
1646
1646
 
1647
+
1647
1648
 
1648
1649
  constructor() {
1649
1650
  addLevelsTo(this);
@@ -1655,12 +1656,17 @@ class IssueReporter {
1655
1656
  this.bufferTimeout = null;
1656
1657
  this._boundProcessBuffer = this._processBuffer.bind(this);
1657
1658
  this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
1659
+ this._callback = null;
1658
1660
  }
1659
1661
 
1660
1662
  init() {
1661
1663
  this._catchConsole();
1662
1664
  }
1663
1665
 
1666
+ setCallback(cb ) {
1667
+ this._callback = cb;
1668
+ }
1669
+
1664
1670
  configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
1665
1671
  this.remoteClientConfiguration = configuration;
1666
1672
  }
@@ -1696,6 +1702,7 @@ class IssueReporter {
1696
1702
 
1697
1703
  // Handle category label
1698
1704
  let category = null;
1705
+ let skipSendToRemote = false;
1699
1706
  let extra = {};
1700
1707
  if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
1701
1708
  category = args[0].split('=')[1];
@@ -1711,6 +1718,7 @@ class IssueReporter {
1711
1718
  errorMessage: lastArg.message,
1712
1719
  errorStack: lastArg.stack,
1713
1720
  errorType: lastArg.constructor.name,
1721
+ skipSendToRemote: lastArg.skipSendToRemote,
1714
1722
  };
1715
1723
  } else {
1716
1724
  extra = lastArg;
@@ -1719,6 +1727,11 @@ class IssueReporter {
1719
1727
  args.splice(1, 1);
1720
1728
  }
1721
1729
 
1730
+ if (extra.skipSendToRemote) {
1731
+ skipSendToRemote = true;
1732
+ delete extra.skipSendToRemote;
1733
+ }
1734
+
1722
1735
  const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
1723
1736
  const message = args.join(', ');
1724
1737
  let consoleMessage = message;
@@ -1739,7 +1752,13 @@ class IssueReporter {
1739
1752
  const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
1740
1753
  oldMethod.apply(oldMethod, [date, consoleMessage]);
1741
1754
 
1742
- this._sendToRemoteLogger(level, { date, message, category, ...extra });
1755
+ if (this._callback) {
1756
+ this._callback(level, consoleMessage);
1757
+ }
1758
+
1759
+ if (!skipSendToRemote) {
1760
+ this._sendToRemoteLogger(level, { date, message, category, ...extra });
1761
+ }
1743
1762
  }
1744
1763
 
1745
1764
  logRequest(url , options , response , start ) {
@@ -1884,7 +1903,11 @@ class IssueReporter {
1884
1903
  },
1885
1904
  // $FlowFixMe
1886
1905
  body,
1887
- }).catch(() => {
1906
+ }).catch((e ) => {
1907
+ // $FlowFixMe
1908
+ e.skipSendToRemote = true;
1909
+ this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
1910
+
1888
1911
  setTimeout(() => {
1889
1912
  if (isArray) {
1890
1913
  payload = payload.map(message => {
@@ -1896,7 +1919,7 @@ class IssueReporter {
1896
1919
  payload._retry = retry + 1;
1897
1920
  }
1898
1921
 
1899
- this._sendDebugToGrafana(body, retry + 1);
1922
+ this._sendDebugToGrafana(payload, retry + 1);
1900
1923
  }, 5000 + retry * 1000);
1901
1924
  });
1902
1925
  }
@@ -2614,7 +2637,8 @@ class ExternalApp {
2614
2637
 
2615
2638
 
2616
2639
 
2617
-
2640
+
2641
+
2618
2642
 
2619
2643
 
2620
2644
  class Meeting {
@@ -2626,6 +2650,7 @@ class Meeting {
2626
2650
 
2627
2651
 
2628
2652
 
2653
+
2629
2654
 
2630
2655
 
2631
2656
  static parse(plain ) {
@@ -2637,14 +2662,28 @@ class Meeting {
2637
2662
  port: plain.port,
2638
2663
  uuid: plain.uuid,
2639
2664
  number: plain.number,
2665
+ persistent: plain.persistent,
2640
2666
  });
2641
2667
  }
2642
2668
 
2669
+ static parseMany(items ) {
2670
+ return items.map(plain => Meeting.parse(plain));
2671
+ }
2672
+
2643
2673
  static newFrom(meeting ) {
2644
2674
  return newFrom(meeting, Meeting);
2645
2675
  }
2646
2676
 
2647
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
2677
+ constructor({
2678
+ uuid,
2679
+ name,
2680
+ guestSipAuthorization,
2681
+ ownerUuids,
2682
+ port,
2683
+ uri,
2684
+ number,
2685
+ persistent,
2686
+ } = {}) {
2648
2687
  this.guestSipAuthorization = guestSipAuthorization;
2649
2688
  this.uri = uri;
2650
2689
  this.name = name;
@@ -2652,6 +2691,7 @@ class Meeting {
2652
2691
  this.port = port;
2653
2692
  this.uuid = uuid;
2654
2693
  this.number = number;
2694
+ this.persistent = persistent;
2655
2695
 
2656
2696
  // Useful to compare instead of instanceof with minified code
2657
2697
  this.type = 'Meeting';
@@ -2729,8 +2769,11 @@ var confdMethods = (client , baseUrl ) => ({
2729
2769
  }
2730
2770
  },
2731
2771
 
2732
- createMyMeeting: (name ) =>
2733
- client.post(`${baseUrl}/users/me/meetings`, { name }).then(Meeting.parse),
2772
+ getMyMeetings: () =>
2773
+ client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
2774
+
2775
+ createMyMeeting: (name , persistent ) =>
2776
+ client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
2734
2777
 
2735
2778
  deleteMyMeeting: (meetingUuid ) =>
2736
2779
  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
  });