@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
@@ -1646,6 +1646,7 @@ class IssueReporter {
1646
1646
 
1647
1647
 
1648
1648
 
1649
+
1649
1650
 
1650
1651
  constructor() {
1651
1652
  addLevelsTo(this);
@@ -1657,12 +1658,17 @@ class IssueReporter {
1657
1658
  this.bufferTimeout = null;
1658
1659
  this._boundProcessBuffer = this._processBuffer.bind(this);
1659
1660
  this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
1661
+ this._callback = null;
1660
1662
  }
1661
1663
 
1662
1664
  init() {
1663
1665
  this._catchConsole();
1664
1666
  }
1665
1667
 
1668
+ setCallback(cb ) {
1669
+ this._callback = cb;
1670
+ }
1671
+
1666
1672
  configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
1667
1673
  this.remoteClientConfiguration = configuration;
1668
1674
  }
@@ -1698,6 +1704,7 @@ class IssueReporter {
1698
1704
 
1699
1705
  // Handle category label
1700
1706
  let category = null;
1707
+ let skipSendToRemote = false;
1701
1708
  let extra = {};
1702
1709
  if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
1703
1710
  category = args[0].split('=')[1];
@@ -1713,6 +1720,7 @@ class IssueReporter {
1713
1720
  errorMessage: lastArg.message,
1714
1721
  errorStack: lastArg.stack,
1715
1722
  errorType: lastArg.constructor.name,
1723
+ skipSendToRemote: lastArg.skipSendToRemote,
1716
1724
  };
1717
1725
  } else {
1718
1726
  extra = lastArg;
@@ -1721,6 +1729,11 @@ class IssueReporter {
1721
1729
  args.splice(1, 1);
1722
1730
  }
1723
1731
 
1732
+ if (extra.skipSendToRemote) {
1733
+ skipSendToRemote = true;
1734
+ delete extra.skipSendToRemote;
1735
+ }
1736
+
1724
1737
  const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
1725
1738
  const message = args.join(', ');
1726
1739
  let consoleMessage = message;
@@ -1741,7 +1754,13 @@ class IssueReporter {
1741
1754
  const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
1742
1755
  oldMethod.apply(oldMethod, [date, consoleMessage]);
1743
1756
 
1744
- this._sendToRemoteLogger(level, { date, message, category, ...extra });
1757
+ if (this._callback) {
1758
+ this._callback(level, consoleMessage);
1759
+ }
1760
+
1761
+ if (!skipSendToRemote) {
1762
+ this._sendToRemoteLogger(level, { date, message, category, ...extra });
1763
+ }
1745
1764
  }
1746
1765
 
1747
1766
  logRequest(url , options , response , start ) {
@@ -1886,7 +1905,11 @@ class IssueReporter {
1886
1905
  },
1887
1906
  // $FlowFixMe
1888
1907
  body,
1889
- }).catch(() => {
1908
+ }).catch((e ) => {
1909
+ // $FlowFixMe
1910
+ e.skipSendToRemote = true;
1911
+ this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
1912
+
1890
1913
  setTimeout(() => {
1891
1914
  if (isArray) {
1892
1915
  payload = payload.map(message => {
@@ -1898,7 +1921,7 @@ class IssueReporter {
1898
1921
  payload._retry = retry + 1;
1899
1922
  }
1900
1923
 
1901
- this._sendDebugToGrafana(body, retry + 1);
1924
+ this._sendDebugToGrafana(payload, retry + 1);
1902
1925
  }, 5000 + retry * 1000);
1903
1926
  });
1904
1927
  }
@@ -2616,7 +2639,8 @@ class ExternalApp {
2616
2639
 
2617
2640
 
2618
2641
 
2619
-
2642
+
2643
+
2620
2644
 
2621
2645
 
2622
2646
  class Meeting {
@@ -2628,6 +2652,7 @@ class Meeting {
2628
2652
 
2629
2653
 
2630
2654
 
2655
+
2631
2656
 
2632
2657
 
2633
2658
  static parse(plain ) {
@@ -2639,14 +2664,28 @@ class Meeting {
2639
2664
  port: plain.port,
2640
2665
  uuid: plain.uuid,
2641
2666
  number: plain.number,
2667
+ persistent: plain.persistent,
2642
2668
  });
2643
2669
  }
2644
2670
 
2671
+ static parseMany(items ) {
2672
+ return items.map(plain => Meeting.parse(plain));
2673
+ }
2674
+
2645
2675
  static newFrom(meeting ) {
2646
2676
  return newFrom(meeting, Meeting);
2647
2677
  }
2648
2678
 
2649
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
2679
+ constructor({
2680
+ uuid,
2681
+ name,
2682
+ guestSipAuthorization,
2683
+ ownerUuids,
2684
+ port,
2685
+ uri,
2686
+ number,
2687
+ persistent,
2688
+ } = {}) {
2650
2689
  this.guestSipAuthorization = guestSipAuthorization;
2651
2690
  this.uri = uri;
2652
2691
  this.name = name;
@@ -2654,6 +2693,7 @@ class Meeting {
2654
2693
  this.port = port;
2655
2694
  this.uuid = uuid;
2656
2695
  this.number = number;
2696
+ this.persistent = persistent;
2657
2697
 
2658
2698
  // Useful to compare instead of instanceof with minified code
2659
2699
  this.type = 'Meeting';
@@ -2731,8 +2771,11 @@ var confdMethods = (client , baseUrl ) => ({
2731
2771
  }
2732
2772
  },
2733
2773
 
2734
- createMyMeeting: (name ) =>
2735
- client.post(`${baseUrl}/users/me/meetings`, { name }).then(Meeting.parse),
2774
+ getMyMeetings: () =>
2775
+ client.get(`${baseUrl}/users/me/meetings`).then(response => Meeting.parseMany(response.items)),
2776
+
2777
+ createMyMeeting: (name , persistent ) =>
2778
+ client.post(`${baseUrl}/users/me/meetings`, { name, persistent }).then(Meeting.parse),
2736
2779
 
2737
2780
  deleteMyMeeting: (meetingUuid ) =>
2738
2781
  client.delete(`${baseUrl}/users/me/meetings/${meetingUuid}`, null),
@@ -3588,7 +3631,7 @@ class Recording {
3588
3631
 
3589
3632
 
3590
3633
 
3591
- static parseMany(recordings ) {
3634
+ static parseMany(recordings = []) {
3592
3635
  return recordings.map(item => Recording.parse(item));
3593
3636
  }
3594
3637
 
@@ -3714,7 +3757,7 @@ class CallLog {
3714
3757
  duration: (plain.duration || 0) * 1000, // duration is in seconds
3715
3758
  start: moment__default['default'](plain.start).toDate(),
3716
3759
  end: plain.end ? moment__default['default'](plain.end).toDate() : null,
3717
- recordings: Recording.parseMany(plain.recordings),
3760
+ recordings: Recording.parseMany(plain.recordings || []),
3718
3761
  });
3719
3762
  }
3720
3763
 
@@ -6295,6 +6338,7 @@ const ON_REINVITE$1 = 'reinvite';
6295
6338
  const ON_ERROR = 'onError';
6296
6339
  const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
6297
6340
  const ON_NETWORK_STATS$1 = 'onNetworkStats';
6341
+ const ON_DISCONNECTED$1 = 'onDisconnected';
6298
6342
 
6299
6343
  const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
6300
6344
  const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
@@ -6371,6 +6415,7 @@ class WebRTCClient extends Emitter {
6371
6415
 
6372
6416
 
6373
6417
 
6418
+
6374
6419
 
6375
6420
  static isAPrivateIp(ip ) {
6376
6421
  const regex = /^(?:10|127|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\..*/;
@@ -6436,6 +6481,7 @@ class WebRTCClient extends Emitter {
6436
6481
  this.ON_ERROR = ON_ERROR;
6437
6482
  this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
6438
6483
  this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
6484
+ this.ON_DISCONNECTED = ON_DISCONNECTED$1;
6439
6485
  }
6440
6486
 
6441
6487
  configureMedia(media ) {
@@ -6701,7 +6747,9 @@ class WebRTCClient extends Emitter {
6701
6747
  const inviteOptions = {
6702
6748
  requestDelegate: {
6703
6749
  onAccept: (response ) => {
6704
- session.sessionDescriptionHandler.peerConnection.sfu = conference;
6750
+ if (session.sessionDescriptionHandler.peerConnection) {
6751
+ session.sessionDescriptionHandler.peerConnection.sfu = conference;
6752
+ }
6705
6753
  this._onAccepted(session, response.session, true);
6706
6754
  },
6707
6755
  onReject: (response ) => {
@@ -7037,7 +7085,7 @@ class WebRTCClient extends Emitter {
7037
7085
  // We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
7038
7086
  const transceivers = pc.getTransceivers();
7039
7087
  const transceiverIdx = lastIndexOf(transceivers, transceiver =>
7040
- transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
7088
+ transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
7041
7089
 
7042
7090
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7043
7091
  } else {
@@ -7573,6 +7621,16 @@ class WebRTCClient extends Emitter {
7573
7621
  return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
7574
7622
  }
7575
7623
 
7624
+ // Useful in a react-native environment when remoteMediaStream is not updated
7625
+ getRemoteVideoStreamFromPc(sessionId ) {
7626
+ const pc = this.getPeerConnection(sessionId);
7627
+ if (!pc) {
7628
+ return null;
7629
+ }
7630
+
7631
+ return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
7632
+ }
7633
+
7576
7634
  hasVideo(sessionId ) {
7577
7635
  return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
7578
7636
  }
@@ -8062,6 +8120,7 @@ class WebRTCClient extends Emitter {
8062
8120
 
8063
8121
  this.updateRemoteStream(this.getSipSessionId(session));
8064
8122
 
8123
+ const pc = session.sessionDescriptionHandler.peerConnection;
8065
8124
  const onTrack = (event ) => {
8066
8125
  const isAudioOnly = this._isAudioOnly(session);
8067
8126
  const { kind, label, readyState, id, muted } = event.track;
@@ -8081,6 +8140,12 @@ class WebRTCClient extends Emitter {
8081
8140
 
8082
8141
  session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
8083
8142
 
8143
+ pc.oniceconnectionstatechange = () => {
8144
+ if (pc.iceConnectionState === 'disconnected') {
8145
+ this.eventEmitter.emit(ON_DISCONNECTED$1);
8146
+ }
8147
+ };
8148
+
8084
8149
  if (withEvent) {
8085
8150
  this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
8086
8151
  }
@@ -8300,6 +8365,7 @@ class WebRTCClient extends Emitter {
8300
8365
  let videoBytesReceived = 0;
8301
8366
  let transportSent = 0;
8302
8367
  let transportReceived = 0;
8368
+ let packetsLost = 0;
8303
8369
 
8304
8370
  stats.forEach(report => {
8305
8371
  if (report.type === 'outbound-rtp' && report.kind === 'audio') {
@@ -8312,7 +8378,7 @@ class WebRTCClient extends Emitter {
8312
8378
  videoBytesSent += report.bytesSent + report.headerBytesSent;
8313
8379
  }
8314
8380
  if (report.type === 'inbound-rtp' && report.kind === 'audio') {
8315
- networkStats.packetsLost = report.packetsLost;
8381
+ packetsLost += report.packetsLost;
8316
8382
  networkStats.packetsReceived = report.packetsReceived;
8317
8383
  audioBytesReceived += report.bytesReceived + report.headerBytesReceived;
8318
8384
  }
@@ -8329,27 +8395,36 @@ class WebRTCClient extends Emitter {
8329
8395
  }
8330
8396
  }
8331
8397
  if (report.type === 'remote-inbound-rtp' && report.kind === 'audio') {
8398
+ packetsLost += report.packetsLost;
8332
8399
  networkStats.roundTripTime = report.roundTripTime;
8333
8400
  networkStats.jitter = report.jitter;
8334
8401
  }
8402
+ if (report.type === 'remote-inbound-rtp' && report.kind === 'video') {
8403
+ packetsLost += report.packetsLost;
8404
+ }
8335
8405
  if (report.type === 'transport') {
8336
8406
  transportSent += report.bytesSent;
8337
8407
  transportReceived += report.bytesReceived;
8338
8408
  }
8339
8409
  });
8340
8410
 
8341
- networkStats.audioBytesSent = audioBytesSent;
8411
+ networkStats.packetsLost = packetsLost;
8412
+ networkStats.totalAudioBytesSent = audioBytesSent;
8413
+ networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
8414
+ networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
8342
8415
  networkStats.audioBytesReceived = audioBytesReceived;
8343
- networkStats.videoBytesSent = videoBytesSent;
8344
- networkStats.videoBytesReceived = videoBytesReceived;
8416
+ networkStats.totalVideoBytesSent = videoBytesSent;
8417
+ networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
8418
+ networkStats.totalVideoBytesReceived = videoBytesReceived;
8419
+ networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
8420
+ networkStats.totalTransportSent = transportSent - lastTransportSent;
8345
8421
  networkStats.transportSent = transportSent;
8346
- networkStats.transportReceived = transportReceived;
8422
+ networkStats.totalTransportReceived = transportReceived;
8423
+ networkStats.transportReceived = transportReceived - lastTransportReceived;
8347
8424
 
8348
- const bandwidth = (networkStats.audioBytesSent - lastAudioSent) + (networkStats.videoBytesSent - lastVideoSent)
8349
- + (networkStats.audioBytesReceived - lastAudioReceived) + (networkStats.videoBytesReceived - lastVideoReceived)
8350
- + (networkStats.transportReceived - lastTransportReceived) + (networkStats.transportSent - lastTransportSent);
8351
-
8352
- networkStats.bandwidth = bandwidth;
8425
+ networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
8426
+ + networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
8427
+ + networkStats.transportSent;
8353
8428
 
8354
8429
  this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
8355
8430
  this.sessionNetworkStats[sessionId].push(networkStats);
@@ -8398,6 +8473,7 @@ const ON_MESSAGE_TRACK_UPDATED = 'onTrackUpdated';
8398
8473
  const ON_NETWORK_STATS = 'onNetworkStats';
8399
8474
  const ON_CHAT = 'phone/ON_CHAT';
8400
8475
  const ON_SIGNAL = 'phone/ON_SIGNAL';
8476
+ const ON_DISCONNECTED = 'onDisconnected';
8401
8477
 
8402
8478
  const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
8403
8479
  const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
@@ -8437,6 +8513,7 @@ const events = [
8437
8513
  ON_CHAT,
8438
8514
  ON_SIGNAL,
8439
8515
  ON_NETWORK_STATS,
8516
+ ON_DISCONNECTED,
8440
8517
  ];
8441
8518
 
8442
8519
  const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
@@ -8758,9 +8835,11 @@ class WebRTCPhone extends Emitter {
8758
8835
  case sessionState.SessionState.Terminated: {
8759
8836
  logger$8.info('WebRTC phone - call terminated', { sipId: sipSession.id });
8760
8837
 
8838
+ // Should be called before `_onCallTerminated` or the callCount will not decrement...
8839
+ const callSession = this._createCallSession(sipSession);
8761
8840
  const wasCurrentSession = this._onCallTerminated(sipSession);
8762
8841
 
8763
- return this.eventEmitter.emit(ON_CALL_ENDED, this._createCallSession(sipSession), wasCurrentSession);
8842
+ return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
8764
8843
  }
8765
8844
  }
8766
8845
  });
@@ -9708,6 +9787,10 @@ class WebRTCPhone extends Emitter {
9708
9787
  return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
9709
9788
  }
9710
9789
 
9790
+ getRemoteVideoStreamFromPc(callSession ) {
9791
+ return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
9792
+ }
9793
+
9711
9794
  hasRemoteVideo(callSession ) {
9712
9795
  return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
9713
9796
  }
@@ -9789,6 +9872,11 @@ class WebRTCPhone extends Emitter {
9789
9872
  this.eventEmitter.emit(ON_UNREGISTERED);
9790
9873
  });
9791
9874
 
9875
+ this.client.on(this.client.ON_DISCONNECTED, () => {
9876
+ logger$8.info('WebRTC disconnected');
9877
+ this.eventEmitter.emit(ON_DISCONNECTED);
9878
+ });
9879
+
9792
9880
  this.client.on(this.client.REGISTERED, () => {
9793
9881
  logger$8.info('WebRTC registered', {
9794
9882
  shouldSendReinvite: this.shouldSendReinvite,
@@ -10045,6 +10133,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
10045
10133
  ON_NETWORK_STATS: ON_NETWORK_STATS,
10046
10134
  ON_CHAT: ON_CHAT,
10047
10135
  ON_SIGNAL: ON_SIGNAL,
10136
+ ON_DISCONNECTED: ON_DISCONNECTED,
10048
10137
  MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
10049
10138
  MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
10050
10139
  events: events,
@@ -10385,6 +10474,11 @@ class Phone extends Emitter {
10385
10474
  return this.getRemoteVideoStream(callSession);
10386
10475
  }
10387
10476
 
10477
+ // Useful in a react-native environment when remoteMediaStream is not updated
10478
+ getRemoteVideoStreamFromPc(callSession ) {
10479
+ return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
10480
+ }
10481
+
10388
10482
  hasVideo(callSession ) {
10389
10483
  return this.phone ? this.phone.hasVideo(callSession) : false;
10390
10484
  }
@@ -10544,6 +10638,7 @@ const AGENT_PAUSED = 'agent_paused';
10544
10638
  const AGENT_UNPAUSED = 'agent_unpaused';
10545
10639
  const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
10546
10640
  const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
10641
+ const MEETING_USER_PROGRESS = 'meeting_user_progress';
10547
10642
 
10548
10643
  const BLACKLIST_EVENTS = [
10549
10644
  CHAT_MESSAGE_SENT,
@@ -10894,6 +10989,7 @@ WebSocketClient.eventLists = [
10894
10989
  AGENT_UNPAUSED,
10895
10990
  CONFERENCE_ADHOC_PARTICIPANT_LEFT,
10896
10991
  CONFERENCE_ADHOC_DELETED,
10992
+ MEETING_USER_PROGRESS,
10897
10993
  ];
10898
10994
 
10899
10995
  var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
@@ -10964,6 +11060,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
10964
11060
  AGENT_UNPAUSED: AGENT_UNPAUSED,
10965
11061
  CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
10966
11062
  CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
11063
+ MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
10967
11064
  HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
10968
11065
  'default': WebSocketClient
10969
11066
  });