@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
@@ -161,6 +161,7 @@ class IssueReporter {
161
161
 
162
162
 
163
163
 
164
+
164
165
 
165
166
  constructor() {
166
167
  addLevelsTo(this);
@@ -172,12 +173,17 @@ class IssueReporter {
172
173
  this.bufferTimeout = null;
173
174
  this._boundProcessBuffer = this._processBuffer.bind(this);
174
175
  this._boundParseLoggerBody = this._parseLoggerBody.bind(this);
176
+ this._callback = null;
175
177
  }
176
178
 
177
179
  init() {
178
180
  this._catchConsole();
179
181
  }
180
182
 
183
+ setCallback(cb ) {
184
+ this._callback = cb;
185
+ }
186
+
181
187
  configureRemoteClient(configuration = { tag: 'wazo-sdk', host: null, port: null, level: null, extra: {} }) {
182
188
  this.remoteClientConfiguration = configuration;
183
189
  }
@@ -213,6 +219,7 @@ class IssueReporter {
213
219
 
214
220
  // Handle category label
215
221
  let category = null;
222
+ let skipSendToRemote = false;
216
223
  let extra = {};
217
224
  if (args[0].indexOf(CATEGORY_PREFIX) === 0) {
218
225
  category = args[0].split('=')[1];
@@ -228,6 +235,7 @@ class IssueReporter {
228
235
  errorMessage: lastArg.message,
229
236
  errorStack: lastArg.stack,
230
237
  errorType: lastArg.constructor.name,
238
+ skipSendToRemote: lastArg.skipSendToRemote,
231
239
  };
232
240
  } else {
233
241
  extra = lastArg;
@@ -236,6 +244,11 @@ class IssueReporter {
236
244
  args.splice(1, 1);
237
245
  }
238
246
 
247
+ if (extra.skipSendToRemote) {
248
+ skipSendToRemote = true;
249
+ delete extra.skipSendToRemote;
250
+ }
251
+
239
252
  const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
240
253
  const message = args.join(', ');
241
254
  let consoleMessage = message;
@@ -256,7 +269,13 @@ class IssueReporter {
256
269
  const oldMethod = this.oldConsoleMethods[consoleLevel] || this.oldConsoleMethods.log;
257
270
  oldMethod.apply(oldMethod, [date, consoleMessage]);
258
271
 
259
- this._sendToRemoteLogger(level, { date, message, category, ...extra });
272
+ if (this._callback) {
273
+ this._callback(level, consoleMessage);
274
+ }
275
+
276
+ if (!skipSendToRemote) {
277
+ this._sendToRemoteLogger(level, { date, message, category, ...extra });
278
+ }
260
279
  }
261
280
 
262
281
  logRequest(url , options , response , start ) {
@@ -401,7 +420,11 @@ class IssueReporter {
401
420
  },
402
421
  // $FlowFixMe
403
422
  body,
404
- }).catch(() => {
423
+ }).catch((e ) => {
424
+ // $FlowFixMe
425
+ e.skipSendToRemote = true;
426
+ this.log('error', this._makeCategory('grafana'), 'Sending log to grafana, error', e);
427
+
405
428
  setTimeout(() => {
406
429
  if (isArray) {
407
430
  payload = payload.map(message => {
@@ -413,7 +436,7 @@ class IssueReporter {
413
436
  payload._retry = retry + 1;
414
437
  }
415
438
 
416
- this._sendDebugToGrafana(body, retry + 1);
439
+ this._sendDebugToGrafana(payload, retry + 1);
417
440
  }, 5000 + retry * 1000);
418
441
  });
419
442
  }
@@ -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
 
@@ -6559,6 +6602,7 @@ const ON_REINVITE$1 = 'reinvite';
6559
6602
  const ON_ERROR = 'onError';
6560
6603
  const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
6561
6604
  const ON_NETWORK_STATS$1 = 'onNetworkStats';
6605
+ const ON_DISCONNECTED$1 = 'onDisconnected';
6562
6606
 
6563
6607
  const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
6564
6608
  const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
@@ -6635,6 +6679,7 @@ class WebRTCClient extends Emitter {
6635
6679
 
6636
6680
 
6637
6681
 
6682
+
6638
6683
 
6639
6684
  static isAPrivateIp(ip ) {
6640
6685
  const regex = /^(?:10|127|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\..*/;
@@ -6700,6 +6745,7 @@ class WebRTCClient extends Emitter {
6700
6745
  this.ON_ERROR = ON_ERROR;
6701
6746
  this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
6702
6747
  this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
6748
+ this.ON_DISCONNECTED = ON_DISCONNECTED$1;
6703
6749
  }
6704
6750
 
6705
6751
  configureMedia(media ) {
@@ -6965,7 +7011,9 @@ class WebRTCClient extends Emitter {
6965
7011
  const inviteOptions = {
6966
7012
  requestDelegate: {
6967
7013
  onAccept: (response ) => {
6968
- session.sessionDescriptionHandler.peerConnection.sfu = conference;
7014
+ if (session.sessionDescriptionHandler.peerConnection) {
7015
+ session.sessionDescriptionHandler.peerConnection.sfu = conference;
7016
+ }
6969
7017
  this._onAccepted(session, response.session, true);
6970
7018
  },
6971
7019
  onReject: (response ) => {
@@ -7301,7 +7349,7 @@ class WebRTCClient extends Emitter {
7301
7349
  // We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
7302
7350
  const transceivers = pc.getTransceivers();
7303
7351
  const transceiverIdx = lastIndexOf(transceivers, transceiver =>
7304
- transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
7352
+ transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
7305
7353
 
7306
7354
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7307
7355
  } else {
@@ -7837,6 +7885,16 @@ class WebRTCClient extends Emitter {
7837
7885
  return this.hasRemoteVideo(sessionId) ? this.getRemoteStream(sessionId) : null;
7838
7886
  }
7839
7887
 
7888
+ // Useful in a react-native environment when remoteMediaStream is not updated
7889
+ getRemoteVideoStreamFromPc(sessionId ) {
7890
+ const pc = this.getPeerConnection(sessionId);
7891
+ if (!pc) {
7892
+ return null;
7893
+ }
7894
+
7895
+ return pc.getRemoteStreams().find(stream => !!stream.getVideoTracks().length);
7896
+ }
7897
+
7840
7898
  hasVideo(sessionId ) {
7841
7899
  return this.hasLocalVideo(sessionId) || this.hasRemoteVideo(sessionId);
7842
7900
  }
@@ -8326,6 +8384,7 @@ class WebRTCClient extends Emitter {
8326
8384
 
8327
8385
  this.updateRemoteStream(this.getSipSessionId(session));
8328
8386
 
8387
+ const pc = session.sessionDescriptionHandler.peerConnection;
8329
8388
  const onTrack = (event ) => {
8330
8389
  const isAudioOnly = this._isAudioOnly(session);
8331
8390
  const { kind, label, readyState, id, muted } = event.track;
@@ -8345,6 +8404,12 @@ class WebRTCClient extends Emitter {
8345
8404
 
8346
8405
  session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
8347
8406
 
8407
+ pc.oniceconnectionstatechange = () => {
8408
+ if (pc.iceConnectionState === 'disconnected') {
8409
+ this.eventEmitter.emit(ON_DISCONNECTED$1);
8410
+ }
8411
+ };
8412
+
8348
8413
  if (withEvent) {
8349
8414
  this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
8350
8415
  }
@@ -8564,6 +8629,7 @@ class WebRTCClient extends Emitter {
8564
8629
  let videoBytesReceived = 0;
8565
8630
  let transportSent = 0;
8566
8631
  let transportReceived = 0;
8632
+ let packetsLost = 0;
8567
8633
 
8568
8634
  stats.forEach(report => {
8569
8635
  if (report.type === 'outbound-rtp' && report.kind === 'audio') {
@@ -8576,7 +8642,7 @@ class WebRTCClient extends Emitter {
8576
8642
  videoBytesSent += report.bytesSent + report.headerBytesSent;
8577
8643
  }
8578
8644
  if (report.type === 'inbound-rtp' && report.kind === 'audio') {
8579
- networkStats.packetsLost = report.packetsLost;
8645
+ packetsLost += report.packetsLost;
8580
8646
  networkStats.packetsReceived = report.packetsReceived;
8581
8647
  audioBytesReceived += report.bytesReceived + report.headerBytesReceived;
8582
8648
  }
@@ -8593,27 +8659,36 @@ class WebRTCClient extends Emitter {
8593
8659
  }
8594
8660
  }
8595
8661
  if (report.type === 'remote-inbound-rtp' && report.kind === 'audio') {
8662
+ packetsLost += report.packetsLost;
8596
8663
  networkStats.roundTripTime = report.roundTripTime;
8597
8664
  networkStats.jitter = report.jitter;
8598
8665
  }
8666
+ if (report.type === 'remote-inbound-rtp' && report.kind === 'video') {
8667
+ packetsLost += report.packetsLost;
8668
+ }
8599
8669
  if (report.type === 'transport') {
8600
8670
  transportSent += report.bytesSent;
8601
8671
  transportReceived += report.bytesReceived;
8602
8672
  }
8603
8673
  });
8604
8674
 
8605
- networkStats.audioBytesSent = audioBytesSent;
8675
+ networkStats.packetsLost = packetsLost;
8676
+ networkStats.totalAudioBytesSent = audioBytesSent;
8677
+ networkStats.audioBytesSent = audioBytesSent - lastAudioSent;
8678
+ networkStats.totalAudioBytesReceived = audioBytesReceived - lastAudioReceived;
8606
8679
  networkStats.audioBytesReceived = audioBytesReceived;
8607
- networkStats.videoBytesSent = videoBytesSent;
8608
- networkStats.videoBytesReceived = videoBytesReceived;
8680
+ networkStats.totalVideoBytesSent = videoBytesSent;
8681
+ networkStats.videoBytesSent = videoBytesSent - lastVideoSent;
8682
+ networkStats.totalVideoBytesReceived = videoBytesReceived;
8683
+ networkStats.videoBytesReceived = videoBytesReceived - lastVideoReceived;
8684
+ networkStats.totalTransportSent = transportSent - lastTransportSent;
8609
8685
  networkStats.transportSent = transportSent;
8610
- networkStats.transportReceived = transportReceived;
8686
+ networkStats.totalTransportReceived = transportReceived;
8687
+ networkStats.transportReceived = transportReceived - lastTransportReceived;
8611
8688
 
8612
- const bandwidth = (networkStats.audioBytesSent - lastAudioSent) + (networkStats.videoBytesSent - lastVideoSent)
8613
- + (networkStats.audioBytesReceived - lastAudioReceived) + (networkStats.videoBytesReceived - lastVideoReceived)
8614
- + (networkStats.transportReceived - lastTransportReceived) + (networkStats.transportSent - lastTransportSent);
8615
-
8616
- networkStats.bandwidth = bandwidth;
8689
+ networkStats.bandwidth = networkStats.audioBytesSent + networkStats.audioBytesReceived
8690
+ + networkStats.videoBytesSent + networkStats.videoBytesReceived + networkStats.transportReceived
8691
+ + networkStats.transportSent;
8617
8692
 
8618
8693
  this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
8619
8694
  this.sessionNetworkStats[sessionId].push(networkStats);
@@ -8662,6 +8737,7 @@ const ON_MESSAGE_TRACK_UPDATED = 'onTrackUpdated';
8662
8737
  const ON_NETWORK_STATS = 'onNetworkStats';
8663
8738
  const ON_CHAT = 'phone/ON_CHAT';
8664
8739
  const ON_SIGNAL = 'phone/ON_SIGNAL';
8740
+ const ON_DISCONNECTED = 'onDisconnected';
8665
8741
 
8666
8742
  const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
8667
8743
  const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
@@ -8701,6 +8777,7 @@ const events = [
8701
8777
  ON_CHAT,
8702
8778
  ON_SIGNAL,
8703
8779
  ON_NETWORK_STATS,
8780
+ ON_DISCONNECTED,
8704
8781
  ];
8705
8782
 
8706
8783
  const logger$7 = IssueReporter$1.loggerFor('webrtc-phone');
@@ -9022,9 +9099,11 @@ class WebRTCPhone extends Emitter {
9022
9099
  case sessionState.SessionState.Terminated: {
9023
9100
  logger$7.info('WebRTC phone - call terminated', { sipId: sipSession.id });
9024
9101
 
9102
+ // Should be called before `_onCallTerminated` or the callCount will not decrement...
9103
+ const callSession = this._createCallSession(sipSession);
9025
9104
  const wasCurrentSession = this._onCallTerminated(sipSession);
9026
9105
 
9027
- return this.eventEmitter.emit(ON_CALL_ENDED, this._createCallSession(sipSession), wasCurrentSession);
9106
+ return this.eventEmitter.emit(ON_CALL_ENDED, callSession, wasCurrentSession);
9028
9107
  }
9029
9108
  }
9030
9109
  });
@@ -9972,6 +10051,10 @@ class WebRTCPhone extends Emitter {
9972
10051
  return callSession ? this.client.getRemoteVideoStream(callSession.sipCallId) : null;
9973
10052
  }
9974
10053
 
10054
+ getRemoteVideoStreamFromPc(callSession ) {
10055
+ return callSession ? this.client.getRemoteVideoStreamFromPc(callSession.sipCallId) : null;
10056
+ }
10057
+
9975
10058
  hasRemoteVideo(callSession ) {
9976
10059
  return callSession ? this.client.hasRemoteVideo(callSession.sipCallId) : false;
9977
10060
  }
@@ -10053,6 +10136,11 @@ class WebRTCPhone extends Emitter {
10053
10136
  this.eventEmitter.emit(ON_UNREGISTERED);
10054
10137
  });
10055
10138
 
10139
+ this.client.on(this.client.ON_DISCONNECTED, () => {
10140
+ logger$7.info('WebRTC disconnected');
10141
+ this.eventEmitter.emit(ON_DISCONNECTED);
10142
+ });
10143
+
10056
10144
  this.client.on(this.client.REGISTERED, () => {
10057
10145
  logger$7.info('WebRTC registered', {
10058
10146
  shouldSendReinvite: this.shouldSendReinvite,
@@ -10309,6 +10397,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
10309
10397
  ON_NETWORK_STATS: ON_NETWORK_STATS,
10310
10398
  ON_CHAT: ON_CHAT,
10311
10399
  ON_SIGNAL: ON_SIGNAL,
10400
+ ON_DISCONNECTED: ON_DISCONNECTED,
10312
10401
  MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
10313
10402
  MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
10314
10403
  events: events,
@@ -10649,6 +10738,11 @@ class Phone extends Emitter {
10649
10738
  return this.getRemoteVideoStream(callSession);
10650
10739
  }
10651
10740
 
10741
+ // Useful in a react-native environment when remoteMediaStream is not updated
10742
+ getRemoteVideoStreamFromPc(callSession ) {
10743
+ return this.phone ? this.phone.getRemoteVideoStreamFromPc(callSession) : false;
10744
+ }
10745
+
10652
10746
  hasVideo(callSession ) {
10653
10747
  return this.phone ? this.phone.hasVideo(callSession) : false;
10654
10748
  }
@@ -10808,6 +10902,7 @@ const AGENT_PAUSED = 'agent_paused';
10808
10902
  const AGENT_UNPAUSED = 'agent_unpaused';
10809
10903
  const CONFERENCE_ADHOC_PARTICIPANT_LEFT = 'conference_adhoc_participant_left';
10810
10904
  const CONFERENCE_ADHOC_DELETED = 'conference_adhoc_deleted';
10905
+ const MEETING_USER_PROGRESS = 'meeting_user_progress';
10811
10906
 
10812
10907
  const BLACKLIST_EVENTS = [
10813
10908
  CHAT_MESSAGE_SENT,
@@ -11158,6 +11253,7 @@ WebSocketClient.eventLists = [
11158
11253
  AGENT_UNPAUSED,
11159
11254
  CONFERENCE_ADHOC_PARTICIPANT_LEFT,
11160
11255
  CONFERENCE_ADHOC_DELETED,
11256
+ MEETING_USER_PROGRESS,
11161
11257
  ];
11162
11258
 
11163
11259
  var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
@@ -11228,6 +11324,7 @@ var WebSocketClient$1 = /*#__PURE__*/Object.freeze({
11228
11324
  AGENT_UNPAUSED: AGENT_UNPAUSED,
11229
11325
  CONFERENCE_ADHOC_PARTICIPANT_LEFT: CONFERENCE_ADHOC_PARTICIPANT_LEFT,
11230
11326
  CONFERENCE_ADHOC_DELETED: CONFERENCE_ADHOC_DELETED,
11327
+ MEETING_USER_PROGRESS: MEETING_USER_PROGRESS,
11231
11328
  HEARTBEAT_ENGINE_VERSION: HEARTBEAT_ENGINE_VERSION,
11232
11329
  'default': WebSocketClient
11233
11330
  });