@wazo/sdk 0.37.18 → 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 (158) hide show
  1. package/dist/wazo-sdk.js +13 -5
  2. package/esm/__tests__/api-client.test.js +9 -5
  3. package/esm/__tests__/web-rtc-client.test.js +10 -6
  4. package/esm/api/agentd.js +2 -2
  5. package/esm/api/amid.js +2 -2
  6. package/esm/api/application.js +2 -2
  7. package/esm/api/auth.js +4 -3
  8. package/esm/api/call-logd.js +4 -4
  9. package/esm/api/calld.js +2 -2
  10. package/esm/api/chatd.js +2 -2
  11. package/esm/api/confd.js +8 -4
  12. package/esm/api/ctid-ng.js +2 -2
  13. package/esm/api/dird.js +2 -2
  14. package/esm/api/webhookd.js +2 -2
  15. package/esm/api-client.js +11 -7
  16. package/esm/checker/Checker.js +11 -7
  17. package/esm/checker/checks/aor.js +11 -7
  18. package/esm/checker/checks/api.js +11 -7
  19. package/esm/checker/checks/ice-ipv4.js +1 -1
  20. package/esm/checker/checks/index.js +12 -8
  21. package/esm/checker/checks/symmetric-nat.js +1 -1
  22. package/esm/checker/checks/wazo-websocket.js +2 -2
  23. package/esm/checker/checks/webrtc-transport.js +12 -8
  24. package/esm/checker/checks/webrtc.js +12 -8
  25. package/esm/domain/AdHocAPIConference.js +11 -7
  26. package/esm/domain/Agent.js +1 -1
  27. package/esm/domain/BadResponse.js +1 -1
  28. package/esm/domain/Call.js +1 -1
  29. package/esm/domain/CallLog.js +3 -3
  30. package/esm/domain/CallSession.js +1 -1
  31. package/esm/domain/ChatMessage.js +1 -1
  32. package/esm/domain/ChatRoom.js +1 -1
  33. package/esm/domain/Contact.js +2 -1
  34. package/esm/domain/Country.js +1 -1
  35. package/esm/domain/Device/DebugDevice.js +1 -1
  36. package/esm/domain/ExternalApp.js +1 -1
  37. package/esm/domain/Features.js +11 -6
  38. package/esm/domain/ForwardOption.js +2 -1
  39. package/esm/domain/IndirectTransfer.js +1 -1
  40. package/esm/domain/Line.js +1 -1
  41. package/esm/domain/Meeting.js +7 -3
  42. package/esm/domain/NotificationOptions.js +1 -1
  43. package/esm/domain/Phone/CTIPhone.js +12 -7
  44. package/esm/domain/Phone/WebRTCPhone.js +3 -2
  45. package/esm/domain/Profile.js +2 -1
  46. package/esm/domain/Recording.js +2 -2
  47. package/esm/domain/Relocation.js +1 -1
  48. package/esm/domain/Room.js +1 -1
  49. package/esm/domain/ServerError.js +1 -1
  50. package/esm/domain/Session.js +2 -2
  51. package/esm/domain/SipLine.js +1 -1
  52. package/esm/domain/Subscription.js +1 -1
  53. package/esm/domain/SwitchboardCall.js +1 -1
  54. package/esm/domain/Voicemail.js +1 -1
  55. package/esm/domain/__tests__/CallLog.test.js +2 -2
  56. package/esm/index.js +12 -8
  57. package/esm/lib/WazoSessionDescriptionHandler.js +3 -2
  58. package/esm/service/CallApi.js +11 -7
  59. package/esm/service/IssueReporter.js +2 -2
  60. package/esm/service/__tests__/IssueReporter.test.js +1 -1
  61. package/esm/service/getApiClient.js +12 -7
  62. package/esm/simple/Auth.js +12 -7
  63. package/esm/simple/Configuration.js +11 -7
  64. package/esm/simple/Directory.js +10 -6
  65. package/esm/simple/Phone.js +11 -7
  66. package/esm/simple/Websocket.js +2 -2
  67. package/esm/simple/index.js +11 -7
  68. package/esm/simple/room/LocalParticipant.js +24 -24
  69. package/esm/simple/room/Participant.js +23 -21
  70. package/esm/simple/room/RemoteParticipant.js +25 -25
  71. package/esm/simple/room/Room.js +24 -21
  72. package/esm/simple/room/SipRoom.js +12 -10
  73. package/esm/simple/room/Stream.js +12 -10
  74. package/esm/simple/room/__tests__/RemoteParticipant.test.js +10 -6
  75. package/esm/simple/utils.js +10 -6
  76. package/esm/utils/Emitter.js +1 -1
  77. package/esm/utils/Heartbeat.js +1 -1
  78. package/esm/utils/__tests__/api-requester.test.js +1 -1
  79. package/esm/utils/api-requester.js +3 -2
  80. package/esm/utils/compare-version.js +1 -1
  81. package/esm/utils/isMobile.js +1 -1
  82. package/esm/utils/new-from.js +1 -1
  83. package/esm/utils/once.js +1 -1
  84. package/esm/utils/update-from.js +1 -1
  85. package/esm/web-rtc-client.js +13 -8
  86. package/esm/websocket-client.js +3 -2
  87. package/lib/__tests__/api-client.test.js +18 -14
  88. package/lib/__tests__/web-rtc-client.test.js +27 -23
  89. package/lib/api/agentd.js +2 -2
  90. package/lib/api/amid.js +2 -2
  91. package/lib/api/application.js +2 -2
  92. package/lib/api/auth.js +3 -3
  93. package/lib/api/call-logd.js +9 -9
  94. package/lib/api/calld.js +5 -5
  95. package/lib/api/chatd.js +3 -3
  96. package/lib/api/confd.js +8 -4
  97. package/lib/api/ctid-ng.js +5 -5
  98. package/lib/api/dird.js +2 -2
  99. package/lib/api/webhookd.js +2 -2
  100. package/lib/api-client.js +18 -14
  101. package/lib/checker/Checker.js +28 -24
  102. package/lib/checker/checks/aor.js +18 -14
  103. package/lib/checker/checks/api.js +18 -14
  104. package/lib/checker/checks/index.js +28 -24
  105. package/lib/checker/checks/wazo-websocket.js +4 -4
  106. package/lib/checker/checks/webrtc-transport.js +27 -23
  107. package/lib/checker/checks/webrtc.js +27 -23
  108. package/lib/domain/AdHocAPIConference.js +18 -14
  109. package/lib/domain/Call.js +1 -1
  110. package/lib/domain/CallLog.js +7 -7
  111. package/lib/domain/ChatMessage.js +1 -1
  112. package/lib/domain/Contact.js +1 -1
  113. package/lib/domain/Features.js +19 -15
  114. package/lib/domain/ForwardOption.js +1 -1
  115. package/lib/domain/Meeting.js +6 -2
  116. package/lib/domain/Phone/CTIPhone.js +20 -16
  117. package/lib/domain/Phone/WebRTCPhone.js +4 -4
  118. package/lib/domain/Profile.js +1 -1
  119. package/lib/domain/Recording.js +3 -3
  120. package/lib/domain/Voicemail.js +1 -1
  121. package/lib/domain/__tests__/Call.test.js +1 -1
  122. package/lib/domain/__tests__/CallLog.test.js +13 -13
  123. package/lib/domain/__tests__/Voicemail.test.js +1 -1
  124. package/lib/index.js +31 -27
  125. package/lib/lib/WazoSessionDescriptionHandler.js +7 -7
  126. package/lib/service/CallApi.js +18 -14
  127. package/lib/service/IssueReporter.js +2 -2
  128. package/lib/service/__tests__/IssueReporter.test.js +2 -2
  129. package/lib/service/getApiClient.js +19 -15
  130. package/lib/simple/Auth.js +30 -26
  131. package/lib/simple/Configuration.js +29 -25
  132. package/lib/simple/Directory.js +18 -14
  133. package/lib/simple/Phone.js +29 -25
  134. package/lib/simple/Websocket.js +4 -4
  135. package/lib/simple/index.js +29 -25
  136. package/lib/simple/room/LocalParticipant.js +43 -43
  137. package/lib/simple/room/Participant.js +41 -39
  138. package/lib/simple/room/RemoteParticipant.js +44 -44
  139. package/lib/simple/room/Room.js +42 -40
  140. package/lib/simple/room/SipRoom.js +31 -29
  141. package/lib/simple/room/Stream.js +31 -29
  142. package/lib/simple/room/__tests__/RemoteParticipant.test.js +29 -25
  143. package/lib/simple/utils.js +29 -25
  144. package/lib/utils/Emitter.js +1 -1
  145. package/lib/utils/PhoneNumberUtil.js +2 -2
  146. package/lib/utils/__tests__/PhoneNumberUtil.test.js +2 -2
  147. package/lib/utils/__tests__/api-requester.test.js +2 -2
  148. package/lib/utils/__tests__/sdp.test.js +12 -12
  149. package/lib/utils/api-requester.js +3 -3
  150. package/lib/utils/sdp.js +10 -10
  151. package/lib/web-rtc-client.js +28 -24
  152. package/lib/websocket-client.js +5 -5
  153. package/package.json +1 -1
  154. package/src/domain/CallLog.js +1 -1
  155. package/src/domain/Meeting.js +6 -2
  156. package/src/domain/Recording.js +1 -1
  157. package/src/service/IssueReporter.js +1 -1
  158. package/src/web-rtc-client.js +1 -1
@@ -234,7 +234,7 @@ class IssueReporter {
234
234
  args.splice(1, 1);
235
235
  }
236
236
 
237
- const date = moment__default["default"]().format('YYYY-MM-DD HH:mm:ss.SSS');
237
+ const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
238
238
  const message = args.join(', ');
239
239
  let consoleMessage = message;
240
240
 
@@ -411,7 +411,7 @@ class IssueReporter {
411
411
  payload._retry = retry + 1;
412
412
  }
413
413
 
414
- this._sendDebugToGrafana(body, retry + 1);
414
+ this._sendDebugToGrafana(payload, retry + 1);
415
415
  }, 5000 + retry * 1000);
416
416
  });
417
417
  }
@@ -2614,7 +2614,8 @@ class ExternalApp {
2614
2614
 
2615
2615
 
2616
2616
 
2617
-
2617
+
2618
+
2618
2619
 
2619
2620
 
2620
2621
  class Meeting {
@@ -2626,6 +2627,7 @@ class Meeting {
2626
2627
 
2627
2628
 
2628
2629
 
2630
+
2629
2631
 
2630
2632
 
2631
2633
  static parse(plain ) {
@@ -2637,6 +2639,7 @@ class Meeting {
2637
2639
  port: plain.port,
2638
2640
  uuid: plain.uuid,
2639
2641
  number: plain.number,
2642
+ persistent: plain.persistent,
2640
2643
  });
2641
2644
  }
2642
2645
 
@@ -2644,7 +2647,7 @@ class Meeting {
2644
2647
  return newFrom(meeting, Meeting);
2645
2648
  }
2646
2649
 
2647
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
2650
+ constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
2648
2651
  this.guestSipAuthorization = guestSipAuthorization;
2649
2652
  this.uri = uri;
2650
2653
  this.name = name;
@@ -2652,6 +2655,7 @@ class Meeting {
2652
2655
  this.port = port;
2653
2656
  this.uuid = uuid;
2654
2657
  this.number = number;
2658
+ this.persistent = persistent;
2655
2659
 
2656
2660
  // Useful to compare instead of instanceof with minified code
2657
2661
  this.type = 'Meeting';
@@ -2832,7 +2836,7 @@ class ChatMessage {
2832
2836
  static parse(plain ) {
2833
2837
  return new ChatMessage({
2834
2838
  uuid: plain.uuid,
2835
- date: moment__default["default"](plain.created_at).toDate(),
2839
+ date: moment__default['default'](plain.created_at).toDate(),
2836
2840
  content: plain.content,
2837
2841
  alias: plain.alias,
2838
2842
  userUuid: plain.user_uuid,
@@ -2924,7 +2928,7 @@ class Voicemail {
2924
2928
  static parse(plain ) {
2925
2929
  return new Voicemail({
2926
2930
  id: plain.id,
2927
- date: moment__default["default"](plain.timestamp * 1000).toDate(),
2931
+ date: moment__default['default'](plain.timestamp * 1000).toDate(),
2928
2932
  duration: plain.duration * 1000,
2929
2933
  caller: {
2930
2934
  name: plain.caller_id_name,
@@ -3061,7 +3065,7 @@ class Call {
3061
3065
  onHold: plain.on_hold,
3062
3066
  status: plain.status,
3063
3067
  lineId: plain.line_id,
3064
- startingTime: moment__default["default"](plain.creation_time).toDate(),
3068
+ startingTime: moment__default['default'](plain.creation_time).toDate(),
3065
3069
  talkingToIds: Object.keys(plain.talking_to || {}),
3066
3070
  recording: plain.record_state === RECORD_STATE_ACTIVE,
3067
3071
  });
@@ -3541,7 +3545,7 @@ class Emitter {
3541
3545
 
3542
3546
 
3543
3547
  constructor() {
3544
- this.eventEmitter = new EventEmitter__default["default"]();
3548
+ this.eventEmitter = new EventEmitter__default['default']();
3545
3549
  }
3546
3550
 
3547
3551
  on(event , callback ) {
@@ -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
 
@@ -3594,8 +3598,8 @@ class Recording {
3594
3598
  return new Recording({
3595
3599
  deleted: plain.deleted,
3596
3600
  fileName: plain.filename,
3597
- end: plain.end_time ? moment__default["default"](plain.end_time).toDate() : null,
3598
- start: moment__default["default"](plain.start_time).toDate(),
3601
+ end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
3602
+ start: moment__default['default'](plain.start_time).toDate(),
3599
3603
  uuid: plain.uuid,
3600
3604
  });
3601
3605
  }
@@ -3693,7 +3697,7 @@ class CallLog {
3693
3697
 
3694
3698
  static parse(plain ) {
3695
3699
  return new CallLog({
3696
- answer: plain.answer ? moment__default["default"](plain.answer).toDate() : null,
3700
+ answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
3697
3701
  answered: plain.answered,
3698
3702
  callDirection: plain.call_direction,
3699
3703
  destination: {
@@ -3710,9 +3714,9 @@ class CallLog {
3710
3714
  },
3711
3715
  id: plain.id,
3712
3716
  duration: (plain.duration || 0) * 1000, // duration is in seconds
3713
- start: moment__default["default"](plain.start).toDate(),
3714
- end: plain.end ? moment__default["default"](plain.end).toDate() : null,
3715
- recordings: Recording.parseMany(plain.recordings),
3717
+ start: moment__default['default'](plain.start).toDate(),
3718
+ end: plain.end ? moment__default['default'](plain.end).toDate() : null,
3719
+ recordings: Recording.parseMany(plain.recordings || []),
3716
3720
  });
3717
3721
  }
3718
3722
 
@@ -5886,7 +5890,7 @@ const parseCandidate$1 = (candidate ) => {
5886
5890
  if (!candidate) {
5887
5891
  return null;
5888
5892
  }
5889
- const result = sdpParser__default["default"].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
5893
+ const result = sdpParser__default['default'].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
5890
5894
 
5891
5895
  return result.candidates ? result.candidates[0] : null;
5892
5896
  };
@@ -5900,7 +5904,7 @@ const areCandidateValid = (candidates ) =>
5900
5904
  .length > 0;
5901
5905
 
5902
5906
  const getVideoDirection = (sdp ) => {
5903
- const parsedSdp = sdpParser__default["default"].parse(sdp);
5907
+ const parsedSdp = sdpParser__default['default'].parse(sdp);
5904
5908
  const videoMedia = parsedSdp.media.find(media => media.type === 'video');
5905
5909
  if (!videoMedia) {
5906
5910
  return null;
@@ -5914,14 +5918,14 @@ const hasAnActiveVideo = (sdp ) => {
5914
5918
  return false;
5915
5919
  }
5916
5920
 
5917
- const parsedSdp = sdpParser__default["default"].parse(sdp);
5921
+ const parsedSdp = sdpParser__default['default'].parse(sdp);
5918
5922
 
5919
5923
  return !!parsedSdp.media.find(media =>
5920
5924
  media.type === 'video' && media.port > 10 && (!media.direction || media.direction !== 'inactive'));
5921
5925
  };
5922
5926
 
5923
5927
  const fixSdp = (sdp , candidates , forcePort = true) => {
5924
- const parsedSdp = sdpParser__default["default"].parse(sdp);
5928
+ const parsedSdp = sdpParser__default['default'].parse(sdp);
5925
5929
  const mainCandidate = getSrflxOrRelay(candidates)[0];
5926
5930
  const ip = mainCandidate ? mainCandidate.ip : null;
5927
5931
 
@@ -5939,7 +5943,7 @@ const fixSdp = (sdp , candidates , forcePort = true)
5939
5943
  };
5940
5944
  });
5941
5945
 
5942
- let fixed = sdpParser__default["default"].write(parsedSdp);
5946
+ let fixed = sdpParser__default['default'].write(parsedSdp);
5943
5947
 
5944
5948
  if (ip) {
5945
5949
  fixed = fixed.replace(/IN IP4 0.0.0.0/g, `IN IP4 ${ip}`);
@@ -5985,7 +5989,7 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
5985
5989
  ) {
5986
5990
  super(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration);
5987
5991
 
5988
- this.eventEmitter = new EventEmitter__default["default"]();
5992
+ this.eventEmitter = new EventEmitter__default['default']();
5989
5993
  this.isWeb = isWeb;
5990
5994
  this.session = session;
5991
5995
  }
@@ -7302,7 +7306,7 @@ class WebRTCClient extends Emitter {
7302
7306
  // We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
7303
7307
  const transceivers = pc.getTransceivers();
7304
7308
  const transceiverIdx = lastIndexOf(transceivers, transceiver =>
7305
- transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
7309
+ transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
7306
7310
 
7307
7311
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7308
7312
  } else {
@@ -8507,7 +8511,7 @@ class WebRTCClient extends Emitter {
8507
8511
  }
8508
8512
  const sessionId = this.getSipSessionId(session);
8509
8513
 
8510
- getStats__default["default"](pc, (result ) => {
8514
+ getStats__default['default'](pc, (result ) => {
8511
8515
  const { results, internal, nomore, ...stats } = result;
8512
8516
  this.statsIntervals[sessionId] = nomore;
8513
8517
 
@@ -10889,7 +10893,7 @@ class WebSocketClient extends Emitter {
10889
10893
 
10890
10894
  connect() {
10891
10895
  logger$5.info('connect method started', { host: this.host, token: this.token });
10892
- this.socket = new ReconnectingWebSocket__default["default"](this._getUrl.bind(this), [], this.options);
10896
+ this.socket = new ReconnectingWebSocket__default['default'](this._getUrl.bind(this), [], this.options);
10893
10897
  if (this.options.binaryType) {
10894
10898
  this.socket.binaryType = this.options.binaryType;
10895
10899
  }
@@ -11341,7 +11345,7 @@ var Websocket$1 = global.wazoWebsocketInstance;
11341
11345
 
11342
11346
  const logger$3 = IssueReporter$1.loggerFor('sdk-sip-room');
11343
11347
 
11344
- class SipRoom extends Room$1 {
11348
+ class SipRoom extends Room {
11345
11349
 
11346
11350
  static async connect({ extension, constraints, audioOnly = false, extra, room } ) {
11347
11351
  logger$3.info('connecting to sip room', { extension, audioOnly, room: !!room });
@@ -11955,7 +11959,7 @@ class NotificationOptions {
11955
11959
 
11956
11960
 
11957
11961
  // Represents a conference room, like `9000`.
11958
- class Room$2 {
11962
+ class Room$1 {
11959
11963
 
11960
11964
 
11961
11965
 
@@ -11976,7 +11980,7 @@ class Room$2 {
11976
11980
  }
11977
11981
 
11978
11982
  connect(callSession ) {
11979
- return new Room$2({ ...this, connectedCallSession: callSession });
11983
+ return new Room$1({ ...this, connectedCallSession: callSession });
11980
11984
  }
11981
11985
 
11982
11986
  has(callSession ) {
@@ -11985,7 +11989,7 @@ class Room$2 {
11985
11989
 
11986
11990
  addParticipant(uuid , extension , talking = null) {
11987
11991
  if (!this.participants.some(participant => participant.uuid === uuid || participant.extension === extension)) {
11988
- return new Room$2({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
11992
+ return new Room$1({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
11989
11993
  }
11990
11994
 
11991
11995
  return this;
@@ -12004,7 +12008,7 @@ class Room$2 {
12004
12008
  updatedParticipants.push(participant);
12005
12009
  }
12006
12010
 
12007
- return new Room$2({ ...this, participants: updatedParticipants });
12011
+ return new Room$1({ ...this, participants: updatedParticipants });
12008
12012
  }
12009
12013
 
12010
12014
  updateParticipantByExtension(extension , participant , shouldAdd = false) {
@@ -12020,7 +12024,7 @@ class Room$2 {
12020
12024
  updatedParticipants.push(participant);
12021
12025
  }
12022
12026
 
12023
- return new Room$2({ ...this, participants: updatedParticipants });
12027
+ return new Room$1({ ...this, participants: updatedParticipants });
12024
12028
  }
12025
12029
 
12026
12030
  hasCallWithId(id ) {
@@ -12028,18 +12032,18 @@ class Room$2 {
12028
12032
  }
12029
12033
 
12030
12034
  disconnect() {
12031
- return new Room$2({ ...this, connectedCallSession: null });
12035
+ return new Room$1({ ...this, connectedCallSession: null });
12032
12036
  }
12033
12037
 
12034
12038
  removeParticipantWithUUID(uuid ) {
12035
- return new Room$2({
12039
+ return new Room$1({
12036
12040
  ...this,
12037
12041
  participants: this.participants.filter(participant => participant.uuid !== uuid),
12038
12042
  });
12039
12043
  }
12040
12044
 
12041
12045
  removeParticipantWithExtension(extension ) {
12042
- return new Room$2({
12046
+ return new Room$1({
12043
12047
  ...this,
12044
12048
  participants: this.participants.filter(participant => participant.extension !== extension),
12045
12049
  });
@@ -12050,7 +12054,7 @@ class Room$2 {
12050
12054
  }
12051
12055
 
12052
12056
  static newFrom(room ) {
12053
- return newFrom(room, Room$2);
12057
+ return newFrom(room, Room$1);
12054
12058
  }
12055
12059
  }
12056
12060
 
@@ -12721,9 +12725,9 @@ const Wazo = {
12721
12725
  Auth: Auth$1,
12722
12726
  Phone: Phone$1,
12723
12727
  Websocket: Websocket$1,
12724
- Room: Room$1,
12728
+ Room,
12725
12729
  SipRoom,
12726
- RemoteParticipant: RemoteParticipant$1,
12730
+ RemoteParticipant,
12727
12731
  LocalParticipant,
12728
12732
  Stream,
12729
12733
  createLocalVideoStream,
@@ -12754,7 +12758,7 @@ const Wazo = {
12754
12758
  Session,
12755
12759
  Voicemail,
12756
12760
  Relocation,
12757
- ConferenceRoom: Room$2,
12761
+ ConferenceRoom: Room$1,
12758
12762
  CallSession,
12759
12763
  IndirectTransfer,
12760
12764
  SwitchboardCall,
@@ -13287,7 +13291,7 @@ class Room extends Emitter {
13287
13291
  }
13288
13292
 
13289
13293
  _mapMsid(rawSdp ) {
13290
- const sdp = sdpParser__default["default"].parse(rawSdp);
13294
+ const sdp = sdpParser__default['default'].parse(rawSdp);
13291
13295
  const labelMsidArray = sdp.media.filter(media => !!media.label).map(({ label, msid }) => ({
13292
13296
  label: String(label),
13293
13297
  streamId: msid.split(' ')[0],
@@ -13495,7 +13499,7 @@ class Room extends Emitter {
13495
13499
  _isParticipantJoining(participant ) {
13496
13500
  this.__associateStreams(participant);
13497
13501
  // @VALIDATE: no need to publicize ourselves, no?
13498
- if (participant instanceof RemoteParticipant$1) {
13502
+ if (participant instanceof RemoteParticipant) {
13499
13503
  this.eventEmitter.emit(this.CONFERENCE_USER_PARTICIPANT_JOINED, participant);
13500
13504
  }
13501
13505
  }
@@ -13624,8 +13628,6 @@ class Room extends Emitter {
13624
13628
  }
13625
13629
  }
13626
13630
 
13627
- var Room$1 = Room;
13628
-
13629
13631
  //
13630
13632
 
13631
13633
  class RemoteParticipant extends Participant {
@@ -13637,6 +13639,4 @@ class RemoteParticipant extends Participant {
13637
13639
  }
13638
13640
  }
13639
13641
 
13640
- var RemoteParticipant$1 = RemoteParticipant;
13641
-
13642
- module.exports = RemoteParticipant$1;
13642
+ module.exports = RemoteParticipant;
@@ -236,7 +236,7 @@ class IssueReporter {
236
236
  args.splice(1, 1);
237
237
  }
238
238
 
239
- const date = moment__default["default"]().format('YYYY-MM-DD HH:mm:ss.SSS');
239
+ const date = moment__default['default']().format('YYYY-MM-DD HH:mm:ss.SSS');
240
240
  const message = args.join(', ');
241
241
  let consoleMessage = message;
242
242
 
@@ -413,7 +413,7 @@ class IssueReporter {
413
413
  payload._retry = retry + 1;
414
414
  }
415
415
 
416
- this._sendDebugToGrafana(body, retry + 1);
416
+ this._sendDebugToGrafana(payload, retry + 1);
417
417
  }, 5000 + retry * 1000);
418
418
  });
419
419
  }
@@ -2616,7 +2616,8 @@ class ExternalApp {
2616
2616
 
2617
2617
 
2618
2618
 
2619
-
2619
+
2620
+
2620
2621
 
2621
2622
 
2622
2623
  class Meeting {
@@ -2628,6 +2629,7 @@ class Meeting {
2628
2629
 
2629
2630
 
2630
2631
 
2632
+
2631
2633
 
2632
2634
 
2633
2635
  static parse(plain ) {
@@ -2639,6 +2641,7 @@ class Meeting {
2639
2641
  port: plain.port,
2640
2642
  uuid: plain.uuid,
2641
2643
  number: plain.number,
2644
+ persistent: plain.persistent,
2642
2645
  });
2643
2646
  }
2644
2647
 
@@ -2646,7 +2649,7 @@ class Meeting {
2646
2649
  return newFrom(meeting, Meeting);
2647
2650
  }
2648
2651
 
2649
- constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number } = {}) {
2652
+ constructor({ uuid, name, guestSipAuthorization, ownerUuids, port, uri, number, persistent } = {}) {
2650
2653
  this.guestSipAuthorization = guestSipAuthorization;
2651
2654
  this.uri = uri;
2652
2655
  this.name = name;
@@ -2654,6 +2657,7 @@ class Meeting {
2654
2657
  this.port = port;
2655
2658
  this.uuid = uuid;
2656
2659
  this.number = number;
2660
+ this.persistent = persistent;
2657
2661
 
2658
2662
  // Useful to compare instead of instanceof with minified code
2659
2663
  this.type = 'Meeting';
@@ -2834,7 +2838,7 @@ class ChatMessage {
2834
2838
  static parse(plain ) {
2835
2839
  return new ChatMessage({
2836
2840
  uuid: plain.uuid,
2837
- date: moment__default["default"](plain.created_at).toDate(),
2841
+ date: moment__default['default'](plain.created_at).toDate(),
2838
2842
  content: plain.content,
2839
2843
  alias: plain.alias,
2840
2844
  userUuid: plain.user_uuid,
@@ -2926,7 +2930,7 @@ class Voicemail {
2926
2930
  static parse(plain ) {
2927
2931
  return new Voicemail({
2928
2932
  id: plain.id,
2929
- date: moment__default["default"](plain.timestamp * 1000).toDate(),
2933
+ date: moment__default['default'](plain.timestamp * 1000).toDate(),
2930
2934
  duration: plain.duration * 1000,
2931
2935
  caller: {
2932
2936
  name: plain.caller_id_name,
@@ -3063,7 +3067,7 @@ class Call {
3063
3067
  onHold: plain.on_hold,
3064
3068
  status: plain.status,
3065
3069
  lineId: plain.line_id,
3066
- startingTime: moment__default["default"](plain.creation_time).toDate(),
3070
+ startingTime: moment__default['default'](plain.creation_time).toDate(),
3067
3071
  talkingToIds: Object.keys(plain.talking_to || {}),
3068
3072
  recording: plain.record_state === RECORD_STATE_ACTIVE,
3069
3073
  });
@@ -3543,7 +3547,7 @@ class Emitter {
3543
3547
 
3544
3548
 
3545
3549
  constructor() {
3546
- this.eventEmitter = new EventEmitter__default["default"]();
3550
+ this.eventEmitter = new EventEmitter__default['default']();
3547
3551
  }
3548
3552
 
3549
3553
  on(event , callback ) {
@@ -3588,7 +3592,7 @@ class Recording {
3588
3592
 
3589
3593
 
3590
3594
 
3591
- static parseMany(recordings ) {
3595
+ static parseMany(recordings = []) {
3592
3596
  return recordings.map(item => Recording.parse(item));
3593
3597
  }
3594
3598
 
@@ -3596,8 +3600,8 @@ class Recording {
3596
3600
  return new Recording({
3597
3601
  deleted: plain.deleted,
3598
3602
  fileName: plain.filename,
3599
- end: plain.end_time ? moment__default["default"](plain.end_time).toDate() : null,
3600
- start: moment__default["default"](plain.start_time).toDate(),
3603
+ end: plain.end_time ? moment__default['default'](plain.end_time).toDate() : null,
3604
+ start: moment__default['default'](plain.start_time).toDate(),
3601
3605
  uuid: plain.uuid,
3602
3606
  });
3603
3607
  }
@@ -3695,7 +3699,7 @@ class CallLog {
3695
3699
 
3696
3700
  static parse(plain ) {
3697
3701
  return new CallLog({
3698
- answer: plain.answer ? moment__default["default"](plain.answer).toDate() : null,
3702
+ answer: plain.answer ? moment__default['default'](plain.answer).toDate() : null,
3699
3703
  answered: plain.answered,
3700
3704
  callDirection: plain.call_direction,
3701
3705
  destination: {
@@ -3712,9 +3716,9 @@ class CallLog {
3712
3716
  },
3713
3717
  id: plain.id,
3714
3718
  duration: (plain.duration || 0) * 1000, // duration is in seconds
3715
- start: moment__default["default"](plain.start).toDate(),
3716
- end: plain.end ? moment__default["default"](plain.end).toDate() : null,
3717
- recordings: Recording.parseMany(plain.recordings),
3719
+ start: moment__default['default'](plain.start).toDate(),
3720
+ end: plain.end ? moment__default['default'](plain.end).toDate() : null,
3721
+ recordings: Recording.parseMany(plain.recordings || []),
3718
3722
  });
3719
3723
  }
3720
3724
 
@@ -5888,7 +5892,7 @@ const parseCandidate$1 = (candidate ) => {
5888
5892
  if (!candidate) {
5889
5893
  return null;
5890
5894
  }
5891
- const result = sdpParser__default["default"].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
5895
+ const result = sdpParser__default['default'].parse(candidate.indexOf('a=') === 0 ? candidate : `a=${candidate}`);
5892
5896
 
5893
5897
  return result.candidates ? result.candidates[0] : null;
5894
5898
  };
@@ -5902,7 +5906,7 @@ const areCandidateValid = (candidates ) =>
5902
5906
  .length > 0;
5903
5907
 
5904
5908
  const getVideoDirection = (sdp ) => {
5905
- const parsedSdp = sdpParser__default["default"].parse(sdp);
5909
+ const parsedSdp = sdpParser__default['default'].parse(sdp);
5906
5910
  const videoMedia = parsedSdp.media.find(media => media.type === 'video');
5907
5911
  if (!videoMedia) {
5908
5912
  return null;
@@ -5916,14 +5920,14 @@ const hasAnActiveVideo = (sdp ) => {
5916
5920
  return false;
5917
5921
  }
5918
5922
 
5919
- const parsedSdp = sdpParser__default["default"].parse(sdp);
5923
+ const parsedSdp = sdpParser__default['default'].parse(sdp);
5920
5924
 
5921
5925
  return !!parsedSdp.media.find(media =>
5922
5926
  media.type === 'video' && media.port > 10 && (!media.direction || media.direction !== 'inactive'));
5923
5927
  };
5924
5928
 
5925
5929
  const fixSdp = (sdp , candidates , forcePort = true) => {
5926
- const parsedSdp = sdpParser__default["default"].parse(sdp);
5930
+ const parsedSdp = sdpParser__default['default'].parse(sdp);
5927
5931
  const mainCandidate = getSrflxOrRelay(candidates)[0];
5928
5932
  const ip = mainCandidate ? mainCandidate.ip : null;
5929
5933
 
@@ -5941,7 +5945,7 @@ const fixSdp = (sdp , candidates , forcePort = true)
5941
5945
  };
5942
5946
  });
5943
5947
 
5944
- let fixed = sdpParser__default["default"].write(parsedSdp);
5948
+ let fixed = sdpParser__default['default'].write(parsedSdp);
5945
5949
 
5946
5950
  if (ip) {
5947
5951
  fixed = fixed.replace(/IN IP4 0.0.0.0/g, `IN IP4 ${ip}`);
@@ -5987,7 +5991,7 @@ class WazoSessionDescriptionHandler extends sessionDescriptionHandler.SessionDes
5987
5991
  ) {
5988
5992
  super(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration);
5989
5993
 
5990
- this.eventEmitter = new EventEmitter__default["default"]();
5994
+ this.eventEmitter = new EventEmitter__default['default']();
5991
5995
  this.isWeb = isWeb;
5992
5996
  this.session = session;
5993
5997
  }
@@ -7304,7 +7308,7 @@ class WebRTCClient extends Emitter {
7304
7308
  // We search for the last transceiver without `video-` in the mid (video- means remote transceiver)
7305
7309
  const transceivers = pc.getTransceivers();
7306
7310
  const transceiverIdx = lastIndexOf(transceivers, transceiver =>
7307
- transceiver.sender.track === null && transceiver.mid.indexOf('video') === -1);
7311
+ transceiver.sender.track === null && transceiver.mid && transceiver.mid.indexOf('video') === -1);
7308
7312
 
7309
7313
  videoSender = transceiverIdx !== -1 ? transceivers[transceiverIdx].sender : null;
7310
7314
  } else {
@@ -8509,7 +8513,7 @@ class WebRTCClient extends Emitter {
8509
8513
  }
8510
8514
  const sessionId = this.getSipSessionId(session);
8511
8515
 
8512
- getStats__default["default"](pc, (result ) => {
8516
+ getStats__default['default'](pc, (result ) => {
8513
8517
  const { results, internal, nomore, ...stats } = result;
8514
8518
  this.statsIntervals[sessionId] = nomore;
8515
8519
 
@@ -10891,7 +10895,7 @@ class WebSocketClient extends Emitter {
10891
10895
 
10892
10896
  connect() {
10893
10897
  logger$5.info('connect method started', { host: this.host, token: this.token });
10894
- this.socket = new ReconnectingWebSocket__default["default"](this._getUrl.bind(this), [], this.options);
10898
+ this.socket = new ReconnectingWebSocket__default['default'](this._getUrl.bind(this), [], this.options);
10895
10899
  if (this.options.binaryType) {
10896
10900
  this.socket.binaryType = this.options.binaryType;
10897
10901
  }
@@ -11343,7 +11347,7 @@ var Websocket$1 = global.wazoWebsocketInstance;
11343
11347
 
11344
11348
  const logger$3 = IssueReporter$1.loggerFor('sdk-sip-room');
11345
11349
 
11346
- class SipRoom extends Room$1 {
11350
+ class SipRoom extends Room {
11347
11351
 
11348
11352
  static async connect({ extension, constraints, audioOnly = false, extra, room } ) {
11349
11353
  logger$3.info('connecting to sip room', { extension, audioOnly, room: !!room });
@@ -11968,7 +11972,7 @@ class NotificationOptions {
11968
11972
 
11969
11973
 
11970
11974
  // Represents a conference room, like `9000`.
11971
- class Room$2 {
11975
+ class Room$1 {
11972
11976
 
11973
11977
 
11974
11978
 
@@ -11989,7 +11993,7 @@ class Room$2 {
11989
11993
  }
11990
11994
 
11991
11995
  connect(callSession ) {
11992
- return new Room$2({ ...this, connectedCallSession: callSession });
11996
+ return new Room$1({ ...this, connectedCallSession: callSession });
11993
11997
  }
11994
11998
 
11995
11999
  has(callSession ) {
@@ -11998,7 +12002,7 @@ class Room$2 {
11998
12002
 
11999
12003
  addParticipant(uuid , extension , talking = null) {
12000
12004
  if (!this.participants.some(participant => participant.uuid === uuid || participant.extension === extension)) {
12001
- return new Room$2({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
12005
+ return new Room$1({ ...this, participants: [...this.participants, { uuid, extension, talking }] });
12002
12006
  }
12003
12007
 
12004
12008
  return this;
@@ -12017,7 +12021,7 @@ class Room$2 {
12017
12021
  updatedParticipants.push(participant);
12018
12022
  }
12019
12023
 
12020
- return new Room$2({ ...this, participants: updatedParticipants });
12024
+ return new Room$1({ ...this, participants: updatedParticipants });
12021
12025
  }
12022
12026
 
12023
12027
  updateParticipantByExtension(extension , participant , shouldAdd = false) {
@@ -12033,7 +12037,7 @@ class Room$2 {
12033
12037
  updatedParticipants.push(participant);
12034
12038
  }
12035
12039
 
12036
- return new Room$2({ ...this, participants: updatedParticipants });
12040
+ return new Room$1({ ...this, participants: updatedParticipants });
12037
12041
  }
12038
12042
 
12039
12043
  hasCallWithId(id ) {
@@ -12041,18 +12045,18 @@ class Room$2 {
12041
12045
  }
12042
12046
 
12043
12047
  disconnect() {
12044
- return new Room$2({ ...this, connectedCallSession: null });
12048
+ return new Room$1({ ...this, connectedCallSession: null });
12045
12049
  }
12046
12050
 
12047
12051
  removeParticipantWithUUID(uuid ) {
12048
- return new Room$2({
12052
+ return new Room$1({
12049
12053
  ...this,
12050
12054
  participants: this.participants.filter(participant => participant.uuid !== uuid),
12051
12055
  });
12052
12056
  }
12053
12057
 
12054
12058
  removeParticipantWithExtension(extension ) {
12055
- return new Room$2({
12059
+ return new Room$1({
12056
12060
  ...this,
12057
12061
  participants: this.participants.filter(participant => participant.extension !== extension),
12058
12062
  });
@@ -12063,7 +12067,7 @@ class Room$2 {
12063
12067
  }
12064
12068
 
12065
12069
  static newFrom(room ) {
12066
- return newFrom(room, Room$2);
12070
+ return newFrom(room, Room$1);
12067
12071
  }
12068
12072
  }
12069
12073
 
@@ -12734,7 +12738,7 @@ const Wazo = {
12734
12738
  Auth: Auth$1,
12735
12739
  Phone: Phone$1,
12736
12740
  Websocket: Websocket$1,
12737
- Room: Room$1,
12741
+ Room,
12738
12742
  SipRoom,
12739
12743
  RemoteParticipant,
12740
12744
  LocalParticipant,
@@ -12767,7 +12771,7 @@ const Wazo = {
12767
12771
  Session,
12768
12772
  Voicemail,
12769
12773
  Relocation,
12770
- ConferenceRoom: Room$2,
12774
+ ConferenceRoom: Room$1,
12771
12775
  CallSession,
12772
12776
  IndirectTransfer,
12773
12777
  SwitchboardCall,
@@ -13300,7 +13304,7 @@ class Room extends Emitter {
13300
13304
  }
13301
13305
 
13302
13306
  _mapMsid(rawSdp ) {
13303
- const sdp = sdpParser__default["default"].parse(rawSdp);
13307
+ const sdp = sdpParser__default['default'].parse(rawSdp);
13304
13308
  const labelMsidArray = sdp.media.filter(media => !!media.label).map(({ label, msid }) => ({
13305
13309
  label: String(label),
13306
13310
  streamId: msid.split(' ')[0],
@@ -13637,8 +13641,6 @@ class Room extends Emitter {
13637
13641
  }
13638
13642
  }
13639
13643
 
13640
- var Room$1 = Room;
13641
-
13642
13644
  exports.SIGNAL_TYPE_PARTICIPANT_REQUEST = SIGNAL_TYPE_PARTICIPANT_REQUEST;
13643
13645
  exports.SIGNAL_TYPE_PARTICIPANT_UPDATE = SIGNAL_TYPE_PARTICIPANT_UPDATE;
13644
- exports["default"] = Room$1;
13646
+ exports.default = Room;