@wazo/sdk 0.37.15 → 0.37.19

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 (114) hide show
  1. package/dist/wazo-sdk.js +3 -3
  2. package/esm/__tests__/api-client.test.js +9 -5
  3. package/esm/__tests__/web-rtc-client.test.js +117 -23
  4. package/esm/api/agentd.js +1 -1
  5. package/esm/api/amid.js +1 -1
  6. package/esm/api/application.js +1 -1
  7. package/esm/api/auth.js +1 -1
  8. package/esm/api/call-logd.js +3 -3
  9. package/esm/api/calld.js +1 -1
  10. package/esm/api/chatd.js +1 -1
  11. package/esm/api/confd.js +7 -3
  12. package/esm/api/ctid-ng.js +1 -1
  13. package/esm/api/dird.js +1 -1
  14. package/esm/api/webhookd.js +1 -1
  15. package/esm/api-client.js +9 -5
  16. package/esm/checker/Checker.js +117 -23
  17. package/esm/checker/checks/aor.js +9 -5
  18. package/esm/checker/checks/api.js +9 -5
  19. package/esm/checker/checks/index.js +117 -23
  20. package/esm/checker/checks/wazo-websocket.js +1 -1
  21. package/esm/checker/checks/webrtc-transport.js +117 -23
  22. package/esm/checker/checks/webrtc.js +117 -23
  23. package/esm/domain/AdHocAPIConference.js +9 -5
  24. package/esm/domain/CallLog.js +2 -2
  25. package/esm/domain/Features.js +9 -5
  26. package/esm/domain/Meeting.js +6 -2
  27. package/esm/domain/Phone/CTIPhone.js +9 -5
  28. package/esm/domain/Phone/WebRTCPhone.js +9 -2
  29. package/esm/domain/Recording.js +1 -1
  30. package/esm/domain/__tests__/CallLog.test.js +2 -2
  31. package/esm/index.js +125 -23
  32. package/esm/lib/WazoSessionDescriptionHandler.js +1 -1
  33. package/esm/service/CallApi.js +9 -5
  34. package/esm/service/IssueReporter.js +1 -1
  35. package/esm/service/__tests__/IssueReporter.test.js +1 -1
  36. package/esm/service/getApiClient.js +9 -5
  37. package/esm/simple/Auth.js +125 -23
  38. package/esm/simple/Configuration.js +125 -23
  39. package/esm/simple/Directory.js +9 -5
  40. package/esm/simple/Phone.js +125 -23
  41. package/esm/simple/Websocket.js +1 -1
  42. package/esm/simple/index.js +125 -23
  43. package/esm/simple/room/LocalParticipant.js +125 -23
  44. package/esm/simple/room/Participant.js +125 -23
  45. package/esm/simple/room/RemoteParticipant.js +125 -23
  46. package/esm/simple/room/Room.js +125 -23
  47. package/esm/simple/room/SipRoom.js +125 -23
  48. package/esm/simple/room/Stream.js +125 -23
  49. package/esm/simple/room/__tests__/RemoteParticipant.test.js +125 -23
  50. package/esm/simple/utils.js +125 -23
  51. package/esm/utils/__tests__/api-requester.test.js +1 -1
  52. package/esm/utils/api-requester.js +1 -1
  53. package/esm/web-rtc-client.js +117 -23
  54. package/esm/websocket-client.js +1 -1
  55. package/lib/__tests__/api-client.test.js +9 -5
  56. package/lib/__tests__/web-rtc-client.test.js +117 -23
  57. package/lib/api/agentd.js +1 -1
  58. package/lib/api/amid.js +1 -1
  59. package/lib/api/application.js +1 -1
  60. package/lib/api/auth.js +1 -1
  61. package/lib/api/call-logd.js +3 -3
  62. package/lib/api/calld.js +1 -1
  63. package/lib/api/chatd.js +1 -1
  64. package/lib/api/confd.js +7 -3
  65. package/lib/api/ctid-ng.js +1 -1
  66. package/lib/api/dird.js +1 -1
  67. package/lib/api/webhookd.js +1 -1
  68. package/lib/api-client.js +9 -5
  69. package/lib/checker/Checker.js +117 -23
  70. package/lib/checker/checks/aor.js +9 -5
  71. package/lib/checker/checks/api.js +9 -5
  72. package/lib/checker/checks/index.js +117 -23
  73. package/lib/checker/checks/wazo-websocket.js +1 -1
  74. package/lib/checker/checks/webrtc-transport.js +117 -23
  75. package/lib/checker/checks/webrtc.js +117 -23
  76. package/lib/domain/AdHocAPIConference.js +9 -5
  77. package/lib/domain/CallLog.js +2 -2
  78. package/lib/domain/Features.js +9 -5
  79. package/lib/domain/Meeting.js +6 -2
  80. package/lib/domain/Phone/CTIPhone.js +9 -5
  81. package/lib/domain/Phone/WebRTCPhone.js +9 -1
  82. package/lib/domain/Recording.js +1 -1
  83. package/lib/domain/__tests__/CallLog.test.js +2 -2
  84. package/lib/index.js +125 -23
  85. package/lib/lib/WazoSessionDescriptionHandler.js +1 -1
  86. package/lib/service/CallApi.js +9 -5
  87. package/lib/service/IssueReporter.js +1 -1
  88. package/lib/service/__tests__/IssueReporter.test.js +1 -1
  89. package/lib/service/getApiClient.js +9 -5
  90. package/lib/simple/Auth.js +125 -23
  91. package/lib/simple/Configuration.js +125 -23
  92. package/lib/simple/Directory.js +9 -5
  93. package/lib/simple/Phone.js +125 -23
  94. package/lib/simple/Websocket.js +1 -1
  95. package/lib/simple/index.js +125 -23
  96. package/lib/simple/room/LocalParticipant.js +125 -23
  97. package/lib/simple/room/Participant.js +125 -23
  98. package/lib/simple/room/RemoteParticipant.js +125 -23
  99. package/lib/simple/room/Room.js +125 -23
  100. package/lib/simple/room/SipRoom.js +125 -23
  101. package/lib/simple/room/Stream.js +125 -23
  102. package/lib/simple/room/__tests__/RemoteParticipant.test.js +125 -23
  103. package/lib/simple/utils.js +125 -23
  104. package/lib/utils/__tests__/api-requester.test.js +1 -1
  105. package/lib/utils/api-requester.js +1 -1
  106. package/lib/web-rtc-client.js +117 -23
  107. package/lib/websocket-client.js +1 -1
  108. package/package.json +1 -1
  109. package/src/domain/CallLog.js +1 -1
  110. package/src/domain/Meeting.js +6 -2
  111. package/src/domain/Phone/WebRTCPhone.js +7 -0
  112. package/src/domain/Recording.js +1 -1
  113. package/src/service/IssueReporter.js +1 -1
  114. package/src/web-rtc-client.js +108 -18
@@ -388,7 +388,7 @@ class IssueReporter {
388
388
  payload._retry = retry + 1;
389
389
  }
390
390
 
391
- this._sendDebugToGrafana(body, retry + 1);
391
+ this._sendDebugToGrafana(payload, retry + 1);
392
392
  }, 5000 + retry * 1000);
393
393
  });
394
394
  }
@@ -2591,7 +2591,8 @@ class ExternalApp {
2591
2591
 
2592
2592
 
2593
2593
 
2594
-
2594
+
2595
+
2595
2596
 
2596
2597
 
2597
2598
  class Meeting {
@@ -2603,6 +2604,7 @@ class Meeting {
2603
2604
 
2604
2605
 
2605
2606
 
2607
+
2606
2608
 
2607
2609
 
2608
2610
  static parse(plain ) {
@@ -2614,6 +2616,7 @@ class Meeting {
2614
2616
  port: plain.port,
2615
2617
  uuid: plain.uuid,
2616
2618
  number: plain.number,
2619
+ persistent: plain.persistent,
2617
2620
  });
2618
2621
  }
2619
2622
 
@@ -2621,7 +2624,7 @@ class Meeting {
2621
2624
  return newFrom(meeting, Meeting);
2622
2625
  }
2623
2626
 
2624
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
2627
+ constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
2625
2628
  this.guestSipAuthorization = guestSipAuthorization;
2626
2629
  this.uri = uri;
2627
2630
  this.name = name;
@@ -2629,6 +2632,7 @@ class Meeting {
2629
2632
  this.port = port;
2630
2633
  this.uuid = uuid;
2631
2634
  this.number = number;
2635
+ this.persistent = persistent;
2632
2636
 
2633
2637
  // Useful to compare instead of instanceof with minified code
2634
2638
  this.type = 'Meeting';
@@ -3192,7 +3196,7 @@ class Recording {
3192
3196
 
3193
3197
 
3194
3198
 
3195
- static parseMany(recordings ) {
3199
+ static parseMany(recordings = []) {
3196
3200
  return recordings.map(item => Recording.parse(item));
3197
3201
  }
3198
3202
 
@@ -3318,7 +3322,7 @@ class CallLog {
3318
3322
  duration: (plain.duration || 0) * 1000, // duration is in seconds
3319
3323
  start: moment__default['default'](plain.start).toDate(),
3320
3324
  end: plain.end ? moment__default['default'](plain.end).toDate() : null,
3321
- recordings: Recording.parseMany(plain.recordings),
3325
+ recordings: Recording.parseMany(plain.recordings || []),
3322
3326
  });
3323
3327
  }
3324
3328
 
@@ -973,7 +973,7 @@ class IssueReporter {
973
973
  payload._retry = retry + 1;
974
974
  }
975
975
 
976
- this._sendDebugToGrafana(body, retry + 1);
976
+ this._sendDebugToGrafana(payload, retry + 1);
977
977
  }, 5000 + retry * 1000);
978
978
  });
979
979
  }
@@ -3165,7 +3165,8 @@ class ExternalApp {
3165
3165
 
3166
3166
 
3167
3167
 
3168
-
3168
+
3169
+
3169
3170
 
3170
3171
 
3171
3172
  class Meeting {
@@ -3177,6 +3178,7 @@ class Meeting {
3177
3178
 
3178
3179
 
3179
3180
 
3181
+
3180
3182
 
3181
3183
 
3182
3184
  static parse(plain ) {
@@ -3188,6 +3190,7 @@ class Meeting {
3188
3190
  port: plain.port,
3189
3191
  uuid: plain.uuid,
3190
3192
  number: plain.number,
3193
+ persistent: plain.persistent,
3191
3194
  });
3192
3195
  }
3193
3196
 
@@ -3195,7 +3198,7 @@ class Meeting {
3195
3198
  return newFrom(meeting, Meeting);
3196
3199
  }
3197
3200
 
3198
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
3201
+ constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
3199
3202
  this.guestSipAuthorization = guestSipAuthorization;
3200
3203
  this.uri = uri;
3201
3204
  this.name = name;
@@ -3203,6 +3206,7 @@ class Meeting {
3203
3206
  this.port = port;
3204
3207
  this.uuid = uuid;
3205
3208
  this.number = number;
3209
+ this.persistent = persistent;
3206
3210
 
3207
3211
  // Useful to compare instead of instanceof with minified code
3208
3212
  this.type = 'Meeting';
@@ -3586,7 +3590,7 @@ class Recording {
3586
3590
 
3587
3591
 
3588
3592
 
3589
- static parseMany(recordings ) {
3593
+ static parseMany(recordings = []) {
3590
3594
  return recordings.map(item => Recording.parse(item));
3591
3595
  }
3592
3596
 
@@ -3712,7 +3716,7 @@ class CallLog {
3712
3716
  duration: (plain.duration || 0) * 1000, // duration is in seconds
3713
3717
  start: moment__default['default'](plain.start).toDate(),
3714
3718
  end: plain.end ? moment__default['default'](plain.end).toDate() : null,
3715
- recordings: Recording.parseMany(plain.recordings),
3719
+ recordings: Recording.parseMany(plain.recordings || []),
3716
3720
  });
3717
3721
  }
3718
3722
 
@@ -6293,6 +6297,7 @@ const ON_REINVITE$1 = 'reinvite';
6293
6297
  const ON_ERROR = 'onError';
6294
6298
  const ON_SCREEN_SHARING_REINVITE = 'onScreenSharingReinvite';
6295
6299
  const ON_NETWORK_STATS$1 = 'onNetworkStats';
6300
+ const ON_DISCONNECTED$1 = 'onDisconnected';
6296
6301
 
6297
6302
  const events$1 = [REGISTERED, UNREGISTERED, REGISTRATION_FAILED, INVITE];
6298
6303
  const transportEvents = [CONNECTED, DISCONNECTED, TRANSPORT_ERROR, MESSAGE];
@@ -6369,6 +6374,7 @@ class WebRTCClient extends Emitter {
6369
6374
 
6370
6375
 
6371
6376
 
6377
+
6372
6378
 
6373
6379
  static isAPrivateIp(ip ) {
6374
6380
  const regex = /^(?:10|127|172\.(?:1[6-9]|2[0-9]|3[01])|192\.168)\..*/;
@@ -6434,6 +6440,7 @@ class WebRTCClient extends Emitter {
6434
6440
  this.ON_ERROR = ON_ERROR;
6435
6441
  this.ON_SCREEN_SHARING_REINVITE = ON_SCREEN_SHARING_REINVITE;
6436
6442
  this.ON_NETWORK_STATS = ON_NETWORK_STATS$1;
6443
+ this.ON_DISCONNECTED = ON_DISCONNECTED$1;
6437
6444
  }
6438
6445
 
6439
6446
  configureMedia(media ) {
@@ -7035,7 +7042,7 @@ class WebRTCClient extends Emitter {
7035
7042
  // We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
7036
7043
  const transceivers = pc.getTransceivers();
7037
7044
  const transceiverIdx = lastIndexOf(transceivers, transceiver =>
7038
- transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
7045
+ transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
7039
7046
 
7040
7047
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7041
7048
  } else {
@@ -7281,10 +7288,13 @@ class WebRTCClient extends Emitter {
7281
7288
  return null;
7282
7289
  }
7283
7290
 
7284
- // let's update the local value
7285
- if (this.audio && this.audio.deviceId) {
7286
- // $FlowFixMe
7287
- this.audio.deviceId.exact = id;
7291
+ // let's update the local audio value
7292
+ if (this.audio) {
7293
+ this.audio = {
7294
+ deviceId: {
7295
+ exact: id,
7296
+ },
7297
+ };
7288
7298
  }
7289
7299
 
7290
7300
  if (session) {
@@ -7297,6 +7307,9 @@ class WebRTCClient extends Emitter {
7297
7307
  const sender = pc && pc.getSenders().find(s => audioTrack && s && s.track && s.track.kind === audioTrack.kind);
7298
7308
 
7299
7309
  if (sender) {
7310
+ if (sender.track) {
7311
+ audioTrack.enabled = sender.track.enabled;
7312
+ }
7300
7313
  sender.replaceTrack(audioTrack);
7301
7314
  }
7302
7315
 
@@ -7321,7 +7334,7 @@ class WebRTCClient extends Emitter {
7321
7334
  return null;
7322
7335
  }
7323
7336
 
7324
- // let's update the local value
7337
+ // let's update the local video value
7325
7338
  if (this.video) {
7326
7339
  this.video = {
7327
7340
  deviceId: {
@@ -7356,12 +7369,21 @@ class WebRTCClient extends Emitter {
7356
7369
  return navigator.mediaDevices.getUserMedia(constraints).then(async stream => {
7357
7370
  const videoTrack = stream.getVideoTracks()[0];
7358
7371
  let sender = pc && pc.getSenders().find(s => videoTrack && s && s.track && s.track.kind === videoTrack.kind);
7372
+ let wasTrackEnabled = false;
7359
7373
  if (!sender) {
7360
7374
  sender = pc && pc.getSenders().find(s => !s.track);
7361
7375
  }
7362
7376
 
7363
7377
  if (sender) {
7364
- sender.replaceTrack(videoTrack);
7378
+ // No video track means video not enabled
7379
+ wasTrackEnabled = sender.track ? sender.track.enabled : false;
7380
+ videoTrack.enabled = wasTrackEnabled;
7381
+
7382
+ if (!wasTrackEnabled) {
7383
+ videoTrack.stop();
7384
+ }
7385
+
7386
+ sender.replaceTrack(wasTrackEnabled ? videoTrack : null);
7365
7387
  }
7366
7388
 
7367
7389
  // let's update the local stream
@@ -8045,6 +8067,7 @@ class WebRTCClient extends Emitter {
8045
8067
 
8046
8068
  this.updateRemoteStream(this.getSipSessionId(session));
8047
8069
 
8070
+ const pc = session.sessionDescriptionHandler.peerConnection;
8048
8071
  const onTrack = (event ) => {
8049
8072
  const isAudioOnly = this._isAudioOnly(session);
8050
8073
  const { kind, label, readyState, id, muted } = event.track;
@@ -8064,6 +8087,12 @@ class WebRTCClient extends Emitter {
8064
8087
 
8065
8088
  session.sessionDescriptionHandler.remoteMediaStream.onaddtrack = onTrack;
8066
8089
 
8090
+ pc.oniceconnectionstatechange = () => {
8091
+ if (pc.iceConnectionState === 'disconnected') {
8092
+ this.eventEmitter.emit(ON_DISCONNECTED$1);
8093
+ }
8094
+ };
8095
+
8067
8096
  if (withEvent) {
8068
8097
  this.eventEmitter.emit(ACCEPTED, session, sessionDialog);
8069
8098
  }
@@ -8259,24 +8288,89 @@ class WebRTCClient extends Emitter {
8259
8288
  const session = this.getSipSession(sessionId);
8260
8289
 
8261
8290
  const stats = session ? await this.getStats(session) : null;
8262
- if (!stats) {
8291
+ if (!stats || !(sessionId in this.sessionNetworkStats)) {
8263
8292
  return;
8264
8293
  }
8265
8294
 
8266
- stats.forEach(report => {
8267
- if (report.type === 'inbound-rtp') {
8268
- if (report.kind === 'audio') {
8269
- const networkStats = {
8270
- packetsLost: report.packetsLost,
8271
- packetsReceived: report.packetsReceived,
8272
- jitter: report.jitter,
8273
- };
8295
+ const networkStats = {
8296
+ audioBytesSent: 0,
8297
+ videoBytesSent: 0,
8298
+ videoBytesReceived: 0,
8299
+ audioBytesReceived: 0,
8300
+ };
8301
+ const nbStats = this.sessionNetworkStats[sessionId].length;
8302
+ const lastNetworkStats = this.sessionNetworkStats[sessionId][nbStats - 1];
8303
+ const lastAudioSent = lastNetworkStats ? lastNetworkStats.audioBytesSent : 0;
8304
+ const lastVideoSent = lastNetworkStats ? lastNetworkStats.videoBytesSent : 0;
8305
+ const lastAudioReceived = lastNetworkStats ? lastNetworkStats.audioBytesReceived : 0;
8306
+ const lastVideoReceived = lastNetworkStats ? lastNetworkStats.videoBytesReceived : 0;
8307
+ const lastTransportSent = lastNetworkStats ? lastNetworkStats.transportSent : 0;
8308
+ const lastTransportReceived = lastNetworkStats ? lastNetworkStats.transportReceived : 0;
8309
+ let audioBytesSent = 0;
8310
+ let audioBytesReceived = 0;
8311
+ let videoBytesSent = 0;
8312
+ let videoBytesReceived = 0;
8313
+ let transportSent = 0;
8314
+ let transportReceived = 0;
8315
+ let packetsLost = 0;
8274
8316
 
8275
- this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
8276
- this.sessionNetworkStats[sessionId].push(networkStats);
8317
+ stats.forEach(report => {
8318
+ if (report.type === 'outbound-rtp' && report.kind === 'audio') {
8319
+ audioBytesSent += report.bytesSent + report.headerBytesSent;
8320
+ }
8321
+ if (report.type === 'remote-outbound-rtp' && report.kind === 'audio') {
8322
+ audioBytesSent += report.bytesSent;
8323
+ }
8324
+ if (report.type === 'outbound-rtp' && report.kind === 'video') {
8325
+ videoBytesSent += report.bytesSent + report.headerBytesSent;
8326
+ }
8327
+ if (report.type === 'inbound-rtp' && report.kind === 'audio') {
8328
+ packetsLost += report.packetsLost;
8329
+ networkStats.packetsReceived = report.packetsReceived;
8330
+ audioBytesReceived += report.bytesReceived + report.headerBytesReceived;
8331
+ }
8332
+ if (report.type === 'inbound-rtp' && report.kind === 'video') {
8333
+ videoBytesReceived += report.bytesReceived + report.headerBytesReceived;
8334
+ }
8335
+ if (report.type === 'outbound-rtp' && report.kind === 'video') {
8336
+ if ('framesPerSecond' in report) {
8337
+ networkStats.framesPerSecond = report.framesPerSecond;
8338
+ }
8339
+ if ('framerateMean' in report) {
8340
+ // framerateMean is only available in FF
8341
+ networkStats.framesPerSecond = Math.round(report.framerateMean);
8277
8342
  }
8278
8343
  }
8344
+ if (report.type === 'remote-inbound-rtp' && report.kind === 'audio') {
8345
+ packetsLost += report.packetsLost;
8346
+ networkStats.roundTripTime = report.roundTripTime;
8347
+ networkStats.jitter = report.jitter;
8348
+ }
8349
+ if (report.type === 'remote-inbound-rtp' && report.kind === 'video') {
8350
+ packetsLost += report.packetsLost;
8351
+ }
8352
+ if (report.type === 'transport') {
8353
+ transportSent += report.bytesSent;
8354
+ transportReceived += report.bytesReceived;
8355
+ }
8279
8356
  });
8357
+
8358
+ networkStats.packetsLost = packetsLost;
8359
+ networkStats.audioBytesSent = audioBytesSent;
8360
+ networkStats.audioBytesReceived = audioBytesReceived;
8361
+ networkStats.videoBytesSent = videoBytesSent;
8362
+ networkStats.videoBytesReceived = videoBytesReceived;
8363
+ networkStats.transportSent = transportSent;
8364
+ networkStats.transportReceived = transportReceived;
8365
+
8366
+ const bandwidth = (networkStats.audioBytesSent - lastAudioSent) + (networkStats.videoBytesSent - lastVideoSent)
8367
+ + (networkStats.audioBytesReceived - lastAudioReceived) + (networkStats.videoBytesReceived - lastVideoReceived)
8368
+ + (networkStats.transportReceived - lastTransportReceived) + (networkStats.transportSent - lastTransportSent);
8369
+
8370
+ networkStats.bandwidth = bandwidth;
8371
+
8372
+ this.eventEmitter.emit(ON_NETWORK_STATS$1, session, networkStats, this.sessionNetworkStats[sessionId]);
8373
+ this.sessionNetworkStats[sessionId].push(networkStats);
8280
8374
  }
8281
8375
 
8282
8376
  }
@@ -8322,6 +8416,7 @@ const ON_MESSAGE_TRACK_UPDATED = 'onTrackUpdated';
8322
8416
  const ON_NETWORK_STATS = 'onNetworkStats';
8323
8417
  const ON_CHAT = 'phone/ON_CHAT';
8324
8418
  const ON_SIGNAL = 'phone/ON_SIGNAL';
8419
+ const ON_DISCONNECTED = 'onDisconnected';
8325
8420
 
8326
8421
  const MESSAGE_TYPE_CHAT = 'message/TYPE_CHAT';
8327
8422
  const MESSAGE_TYPE_SIGNAL = 'message/TYPE_SIGNAL';
@@ -8361,6 +8456,7 @@ const events = [
8361
8456
  ON_CHAT,
8362
8457
  ON_SIGNAL,
8363
8458
  ON_NETWORK_STATS,
8459
+ ON_DISCONNECTED,
8364
8460
  ];
8365
8461
 
8366
8462
  const logger$8 = IssueReporter$1.loggerFor('webrtc-phone');
@@ -9713,6 +9809,11 @@ class WebRTCPhone extends Emitter {
9713
9809
  this.eventEmitter.emit(ON_UNREGISTERED);
9714
9810
  });
9715
9811
 
9812
+ this.client.on(this.client.ON_DISCONNECTED, () => {
9813
+ logger$8.info('WebRTC disconnected');
9814
+ this.eventEmitter.emit(ON_DISCONNECTED);
9815
+ });
9816
+
9716
9817
  this.client.on(this.client.REGISTERED, () => {
9717
9818
  logger$8.info('WebRTC registered', {
9718
9819
  shouldSendReinvite: this.shouldSendReinvite,
@@ -9969,6 +10070,7 @@ var PHONE_EVENTS = /*#__PURE__*/Object.freeze({
9969
10070
  ON_NETWORK_STATS: ON_NETWORK_STATS,
9970
10071
  ON_CHAT: ON_CHAT,
9971
10072
  ON_SIGNAL: ON_SIGNAL,
10073
+ ON_DISCONNECTED: ON_DISCONNECTED,
9972
10074
  MESSAGE_TYPE_CHAT: MESSAGE_TYPE_CHAT,
9973
10075
  MESSAGE_TYPE_SIGNAL: MESSAGE_TYPE_SIGNAL,
9974
10076
  events: events,
@@ -381,7 +381,7 @@ class IssueReporter {
381
381
  payload._retry = retry + 1;
382
382
  }
383
383
 
384
- this._sendDebugToGrafana(body, retry + 1);
384
+ this._sendDebugToGrafana(payload, retry + 1);
385
385
  }, 5000 + retry * 1000);
386
386
  });
387
387
  }