opensips-js-vue 0.1.36 → 0.1.37

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.
package/library/super.mjs CHANGED
@@ -20148,7 +20148,8 @@ const O1 = [
20148
20148
  //'originalStream',
20149
20149
  "localMuted",
20150
20150
  "autoAnswer",
20151
- "putOnHoldTimestamp"
20151
+ "putOnHoldTimestamp",
20152
+ "_remote_party_display_name"
20152
20153
  ], k1 = [
20153
20154
  //'roomId',
20154
20155
  "_cancel_reason",
@@ -20189,17 +20190,23 @@ function D1(o, n, r, a) {
20189
20190
  c.id = n._id, c.className = "audioTag", c.srcObject = o, c.setSinkId(r), c.volume = a, c.play(), n.audioTag = c;
20190
20191
  }
20191
20192
  function N1(o) {
20193
+ if (!o)
20194
+ return null;
20195
+ const n = o.match(/^\s*"((?:[^"\\]|\\.)*)"/);
20196
+ return n ? n[1].replace(/\\(.)/g, "$1") : null;
20197
+ }
20198
+ function M1(o) {
20192
20199
  if (o && typeof o.log == "function" && typeof o.warn == "function" && typeof o.error == "function")
20193
20200
  return !0;
20194
20201
  }
20195
20202
  function tb() {
20196
20203
  return /Mobi|react-native|Android|iPhone/i.test(navigator.userAgent);
20197
20204
  }
20198
- const M1 = yn, U1 = ns(), tr = new M1("WebSocketInterface");
20199
- var P1 = class {
20205
+ const U1 = yn, P1 = ns(), tr = new U1("WebSocketInterface");
20206
+ var L1 = class {
20200
20207
  constructor(o) {
20201
20208
  tr.debug('new() [url:"%s"]', o), this._url = o, this._sip_uri = null, this._via_transport = null, this._ws = null;
20202
- const n = U1.parse(o, "absoluteURI");
20209
+ const n = P1.parse(o, "absoluteURI");
20203
20210
  if (n === -1)
20204
20211
  throw tr.warn(`invalid WebSocket URI: ${o}`), new TypeError(`Invalid argument: ${o}`);
20205
20212
  if (n.scheme !== "wss" && n.scheme !== "ws")
@@ -20265,17 +20272,17 @@ var P1 = class {
20265
20272
  tr.warn(`WebSocket ${this._url} error: `, o);
20266
20273
  }
20267
20274
  };
20268
- const Sh = Zu, L1 = bt, q1 = si, H1 = zn(), z1 = eb, F1 = ri(), B1 = Mh(), V1 = ns(), j1 = P1, G1 = Io("JsSIP");
20269
- G1("version %s", Sh.version);
20270
- var W1 = {
20271
- C: L1,
20272
- Exceptions: q1,
20273
- Utils: H1,
20274
- UA: z1,
20275
- URI: F1,
20276
- NameAddrHeader: B1,
20277
- WebSocketInterface: j1,
20278
- Grammar: V1,
20275
+ const Sh = Zu, q1 = bt, H1 = si, z1 = zn(), F1 = eb, B1 = ri(), V1 = Mh(), j1 = ns(), G1 = L1, W1 = Io("JsSIP");
20276
+ W1("version %s", Sh.version);
20277
+ var K1 = {
20278
+ C: q1,
20279
+ Exceptions: H1,
20280
+ Utils: z1,
20281
+ UA: F1,
20282
+ URI: B1,
20283
+ NameAddrHeader: V1,
20284
+ WebSocketInterface: G1,
20285
+ Grammar: j1,
20279
20286
  // Expose the debug module.
20280
20287
  debug: Io,
20281
20288
  get name() {
@@ -20285,11 +20292,11 @@ var W1 = {
20285
20292
  return Sh.version;
20286
20293
  }
20287
20294
  };
20288
- const K1 = /* @__PURE__ */ tn(W1);
20295
+ const Y1 = /* @__PURE__ */ tn(K1);
20289
20296
  function Zd(o) {
20290
20297
  return o < 10 ? `0${o}` : `${o}`;
20291
20298
  }
20292
- function Y1(o) {
20299
+ function X1(o) {
20293
20300
  let n = o.hours || 0, r = o.minutes || 0, a = o.seconds || 0;
20294
20301
  a++, a === 60 && (a = 0, r++, r === 60 && (r = 0, n++));
20295
20302
  const c = `${Zd(n)}:${Zd(r)}:${Zd(a)}`;
@@ -20300,13 +20307,13 @@ function Y1(o) {
20300
20307
  formatted: c
20301
20308
  };
20302
20309
  }
20303
- function X1(o) {
20310
+ function J1(o) {
20304
20311
  let n = 0;
20305
20312
  for (let r = 0; r < o.length; r++)
20306
20313
  n += o[r] * o[r];
20307
20314
  return Math.sqrt(n / o.length);
20308
20315
  }
20309
- async function J1(o, n, r = 150) {
20316
+ async function Q1(o, n, r = 150) {
20310
20317
  const a = n.createMediaStreamSource(o), c = n.createDelay();
20311
20318
  c.delayTime.value = r / 1e3;
20312
20319
  const e = n.createGain();
@@ -20452,8 +20459,8 @@ var nb = {};
20452
20459
  };
20453
20460
  });
20454
20461
  })(nb);
20455
- const Q1 = Fn, Z1 = nb;
20456
- var eI = Object.assign(Q1, { instanceMethods: Z1 });
20462
+ const Z1 = Fn, eI = nb;
20463
+ var tI = Object.assign(Z1, { instanceMethods: eI });
20457
20464
  const es = {
20458
20465
  NEW_CALL: "new_call",
20459
20466
  CALL_CONFIRMED: "confirmed",
@@ -20484,7 +20491,7 @@ const es = {
20484
20491
  BUSY_EVERYWHERE: 600,
20485
20492
  DECLINE: 603
20486
20493
  };
20487
- var tI = { exports: {} };
20494
+ var nI = { exports: {} };
20488
20495
  (function(o) {
20489
20496
  var n = function(r) {
20490
20497
  var a = Object.prototype, c = a.hasOwnProperty, e = Object.defineProperty || function(Ce, fe, ie) {
@@ -20828,7 +20835,7 @@ var tI = { exports: {} };
20828
20835
  } catch {
20829
20836
  typeof globalThis == "object" ? globalThis.regeneratorRuntime = n : Function("r", "regeneratorRuntime = r")(n);
20830
20837
  }
20831
- })(tI);
20838
+ })(nI);
20832
20839
  var rb = { exports: {} };
20833
20840
  (function(o) {
20834
20841
  (function(n, r) {
@@ -20974,9 +20981,9 @@ var rb = { exports: {} };
20974
20981
  var Kn = rb.exports;
20975
20982
  const ei = () => `${(/* @__PURE__ */ new Date()).toISOString()} | metrics`, ti = (o, n, r) => `${o} | ${n} | ${r}`;
20976
20983
  Kn.setDefaultLevel(Kn.levels.TRACE);
20977
- const nI = (o) => {
20984
+ const rI = (o) => {
20978
20985
  Kn.info(ti(ei(), "log ", `set log level to ${o ? "verbose" : "info"}`)), Kn.setLevel(o ? Kn.levels.TRACE : Kn.levels.INFO);
20979
- }, rI = (o) => {
20986
+ }, sI = (o) => {
20980
20987
  const n = [...Object.keys(Kn.levels)];
20981
20988
  n.includes(o) ? (Kn.info(ti(ei(), "log ", `update log level to ${o.toLowerCase()}`)), Kn.setLevel(o)) : Kn.warn(ti(ei(), "log ", "Incorrect log level please choose one of "), n);
20982
20989
  }, $t = (o, n, r) => {
@@ -20990,7 +20997,7 @@ const nI = (o) => {
20990
20997
  }, So = (o, n) => {
20991
20998
  Kn.error(ti(ei(), o, n));
20992
20999
  };
20993
- function sI(o) {
21000
+ function iI(o) {
20994
21001
  return Math.floor(Math.random() * o).toString();
20995
21002
  }
20996
21003
  function My(o, n) {
@@ -20999,13 +21006,13 @@ function My(o, n) {
20999
21006
  r = r.replace(a, "");
21000
21007
  }), r;
21001
21008
  }
21002
- function iI(o, n) {
21009
+ function aI(o, n) {
21003
21010
  let r = "";
21004
21011
  for (let a = 0; a < n; a += 1)
21005
- r += o[sI(o.length)];
21012
+ r += o[iI(o.length)];
21006
21013
  return r;
21007
21014
  }
21008
- function aI({
21015
+ function oI({
21009
21016
  length: o = 20,
21010
21017
  useLetters: n = !0,
21011
21018
  useNumbers: r = !0,
@@ -21013,10 +21020,10 @@ function aI({
21013
21020
  excludeSymbols: c = []
21014
21021
  } = {}) {
21015
21022
  let e = "abcdefghijklmnopqrstuvwxyz", _ = "0123456789", g = [], d = [], C = [];
21016
- return n && (c.length && (e = My(c, e)), d = e.split("")), r && (c.length && (_ = My(c, _)), C = _.split("")), g = [...d, ...C, ...a], iI(g, o);
21023
+ return n && (c.length && (e = My(c, e)), d = e.split("")), r && (c.length && (_ = My(c, _)), C = _.split("")), g = [...d, ...C, ...a], aI(g, o);
21017
21024
  }
21018
- var oI = aI;
21019
- const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3", Ft = {
21025
+ var lI = oI;
21026
+ const _l = /* @__PURE__ */ tn(lI), uI = () => "WebRTCMetrics", cI = () => "5.0.3", Ft = {
21020
21027
  INBOUND: "inbound",
21021
21028
  OUTBOUND: "outbound"
21022
21029
  }, Qs = {
@@ -21031,7 +21038,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21031
21038
  DISCONNECTED: "disconnected",
21032
21039
  FAILED: "failed",
21033
21040
  CLOSED: "closed"
21034
- }, cI = () => ({
21041
+ }, dI = () => ({
21035
21042
  delta_time_to_measure_probes_ms: 0,
21036
21043
  // Total time to measure all probes
21037
21044
  delta_time_consumed_to_measure_ms: 0,
@@ -21132,7 +21139,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21132
21139
  timestamp_out: null,
21133
21140
  ssrc: "",
21134
21141
  direction: Ft.OUTBOUND
21135
- }, dI = (o) => {
21142
+ }, hI = (o) => {
21136
21143
  const n = {
21137
21144
  pname: "",
21138
21145
  call_id: "",
@@ -21191,7 +21198,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21191
21198
  network: { ...n.network },
21192
21199
  experimental: { ...n.experimental }
21193
21200
  };
21194
- }, hI = {
21201
+ }, pI = {
21195
21202
  refreshEvery: 2e3,
21196
21203
  // Default - generate a report every 2s (in ms). Min 1s.
21197
21204
  startAfter: 0,
@@ -21294,12 +21301,12 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21294
21301
  VIDEO: "video",
21295
21302
  NETWORK: "network",
21296
21303
  DATA: "data"
21297
- }, nh = "config ", pI = (o, n = {}, r) => {
21304
+ }, nh = "config ", _I = (o, n = {}, r) => {
21298
21305
  const a = { ...r, ...n };
21299
21306
  return n.pname || qu(nh, `Argument [String] 'cfg.pname' for the peerConnection name or id is missing - use generated '${r.pname}'`), n.cid || qu(nh, `Argument [String] 'cfg.cid' for the call name or id is missing - use generated '${r.cid}'`), n.uid || qu(nh, `Argument [String] 'cfg.uid' for the user name or id is missing - use generated '${r.uid}'`), a.pc = o, a;
21300
- }, _I = (o = {}) => {
21301
- const n = { ...hI, ...o };
21302
- return n.name = lI(), n.version = uI(), n;
21307
+ }, fI = (o = {}) => {
21308
+ const n = { ...pI, ...o };
21309
+ return n.name = uI(), n.version = cI(), n;
21303
21310
  }, Nl = (o, n, r, a = !1, c) => {
21304
21311
  let e = o.map((_) => {
21305
21312
  if (!r)
@@ -21310,7 +21317,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21310
21317
  return g ? g[r] : null;
21311
21318
  });
21312
21319
  return e = e.filter((_) => a ? Number.isFinite(_) && _ > 0 : Number.isFinite(_)), e.length === 0 ? [] : e;
21313
- }, la = (o) => o.reduce((n, r) => n + r, 0) / o.length, fI = () => `probe-${_l()}`, mI = () => `coltr-${_l()}`, Uy = (o) => new Promise((n) => setTimeout(n, o)), Eh = (o, n, r) => {
21320
+ }, la = (o) => o.reduce((n, r) => n + r, 0) / o.length, mI = () => `probe-${_l()}`, gI = () => `coltr-${_l()}`, Uy = (o) => new Promise((n) => setTimeout(n, o)), Eh = (o, n, r) => {
21314
21321
  n ? o.call(n, r) : o(r);
21315
21322
  }, Qt = (o, n, r, a) => {
21316
21323
  const c = Nl(o, n, r, !0, a);
@@ -21337,7 +21344,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21337
21344
  return c[n][r];
21338
21345
  const e = c[n][a];
21339
21346
  return e ? e[r] : null;
21340
- }, gI = (o) => o.slice().pop(), Sn = (o, n, r) => {
21347
+ }, vI = (o) => o.slice().pop(), Sn = (o, n, r) => {
21341
21348
  if (!n)
21342
21349
  return null;
21343
21350
  const a = {};
@@ -21345,7 +21352,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21345
21352
  c || (c = r === Ft.INBOUND ? { ...sb } : { ...ib }), a[ae.AUDIO] = c;
21346
21353
  let e = n[ae.VIDEO][o];
21347
21354
  return e || (e = r === Ft.INBOUND ? { ...ab } : { ...ob }), a[ae.VIDEO] = e, a;
21348
- }, ul = "exporter ", vI = "2.0", Py = (o, n, r) => {
21355
+ }, ul = "exporter ", yI = "2.0", Py = (o, n, r) => {
21349
21356
  if (!o || o.length === 0)
21350
21357
  return 0;
21351
21358
  const a = o[o.length - 1];
@@ -21357,7 +21364,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21357
21364
  return !_ || !e ? an(o, n, "delta_rtt_ms_out", !1, r) : Number(e / _);
21358
21365
  }
21359
21366
  return null;
21360
- }, yI = (o, n) => {
21367
+ }, TI = (o, n) => {
21361
21368
  if (!o || o.length === 0)
21362
21369
  return 0;
21363
21370
  const r = o[o.length - 1];
@@ -21369,7 +21376,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21369
21376
  n,
21370
21377
  "delta_rtt_connectivity_ms"
21371
21378
  ) : Number(a / c);
21372
- }, TI = (o) => Mn(
21379
+ }, bI = (o) => Mn(
21373
21380
  o,
21374
21381
  "network",
21375
21382
  "local_candidate_type"
@@ -21381,7 +21388,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21381
21388
  o,
21382
21389
  "network",
21383
21390
  "local_candidate_relay_protocol"
21384
- )}`, bI = (o) => {
21391
+ )}`, wI = (o) => {
21385
21392
  const n = Mn(
21386
21393
  o,
21387
21394
  "network",
@@ -21393,7 +21400,7 @@ const _l = /* @__PURE__ */ tn(oI), lI = () => "WebRTCMetrics", uI = () => "5.0.3
21393
21400
  );
21394
21401
  return n !== "relay" ? `direct/${r}` : `turn/${r}`;
21395
21402
  };
21396
- class wI {
21403
+ class SI {
21397
21404
  constructor(n) {
21398
21405
  this._start = null, this._end = null, this._cfg = n, this._referenceReport = null, this._reports = [], this._events = [];
21399
21406
  }
@@ -21443,7 +21450,7 @@ class wI {
21443
21450
  this._reports,
21444
21451
  "video",
21445
21452
  "total_packets_in"
21446
- ), e = {}, _ = gI(this._reports);
21453
+ ), e = {}, _ = vI(this._reports);
21447
21454
  return _ && (Object.keys(_[ae.AUDIO]).forEach((g) => {
21448
21455
  const d = _[ae.AUDIO][g];
21449
21456
  if (e[d.ssrc] = {
@@ -22020,7 +22027,7 @@ class wI {
22020
22027
  e[g].jitter = C, e[g].rtt = k, e[g].traffic = R, e[g].bitrate = S, e[g].loss = G;
22021
22028
  }
22022
22029
  })), {
22023
- version: vI,
22030
+ version: yI,
22024
22031
  configuration: {
22025
22032
  frequency: this._cfg.refreshEvery
22026
22033
  },
@@ -22043,7 +22050,7 @@ class wI {
22043
22050
  ssrc: e,
22044
22051
  data: {
22045
22052
  rtt: {
22046
- avg: yI(this._reports, "data"),
22053
+ avg: TI(this._reports, "data"),
22047
22054
  min: Zt(
22048
22055
  this._reports,
22049
22056
  "data",
@@ -22146,8 +22153,8 @@ class wI {
22146
22153
  }
22147
22154
  },
22148
22155
  network: {
22149
- localConnection: TI(this._reports),
22150
- remoteConnection: bI(this._reports)
22156
+ localConnection: bI(this._reports),
22157
+ remoteConnection: wI(this._reports)
22151
22158
  }
22152
22159
  }
22153
22160
  };
@@ -22185,7 +22192,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22185
22192
  totalRTT: R,
22186
22193
  totalRTTMeasurements: k
22187
22194
  };
22188
- }, SI = (o, n, r, a) => {
22195
+ }, EI = (o, n, r, a) => {
22189
22196
  if (!Object.prototype.hasOwnProperty.call(
22190
22197
  o,
22191
22198
  ve.CURRENT_ROUND_TRIP_TIME
@@ -22202,7 +22209,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22202
22209
  totalRTT: e,
22203
22210
  totalRTTMeasurements: _
22204
22211
  };
22205
- }, wu = (o, n, r) => o[ve.TIMESTAMP] === r[n].timestamp_out || !Object.prototype.hasOwnProperty.call(o, ve.JITTER) ? null : 1e3 * (Number(o[ve.JITTER]) || 0), EI = (o, n) => {
22212
+ }, wu = (o, n, r) => o[ve.TIMESTAMP] === r[n].timestamp_out || !Object.prototype.hasOwnProperty.call(o, ve.JITTER) ? null : 1e3 * (Number(o[ve.JITTER]) || 0), CI = (o, n) => {
22206
22213
  if (!Object.prototype.hasOwnProperty.call(o, ve.FRAMES_DECODED) || !Object.prototype.hasOwnProperty.call(o, ve.TOTAL_DECODE_TIME))
22207
22214
  return {
22208
22215
  delta_ms_decode_frame: n[ae.VIDEO].delta_ms_decode_frame_in,
@@ -22215,7 +22222,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22215
22222
  frames_decoded: r,
22216
22223
  total_decode_time: a
22217
22224
  };
22218
- }, CI = (o, n) => {
22225
+ }, AI = (o, n) => {
22219
22226
  if (!Object.prototype.hasOwnProperty.call(o, ve.FRAMES_ENCODED) || !Object.prototype.hasOwnProperty.call(o, ve.TOTAL_ENCODE_TIME))
22220
22227
  return {
22221
22228
  delta_ms_encode_frame: n[ae.VIDEO].delta_ms_encode_frame_out,
@@ -22275,7 +22282,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22275
22282
  deltaKBytesReceived: S,
22276
22283
  kbsReceived: G
22277
22284
  };
22278
- }, AI = (o) => o[ve.CANDIDATE_TYPE] !== "relay" ? "" : o[ve.RELAY_PROTOCOL] || "", II = (o) => {
22285
+ }, II = (o) => o[ve.CANDIDATE_TYPE] !== "relay" ? "" : o[ve.RELAY_PROTOCOL] || "", RI = (o) => {
22279
22286
  if (!Object.prototype.hasOwnProperty.call(o, ve.NETWORK_TYPE))
22280
22287
  return ll.WIFI;
22281
22288
  switch (o[ve.NETWORK_TYPE]) {
@@ -22292,7 +22299,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22292
22299
  width: o[ve.FRAME_WIDTH] || null,
22293
22300
  height: o[ve.FRAME_HEIGHT] || null,
22294
22301
  framerate: o[ve.FRAMES_PER_SECOND]
22295
- }, RI = (o) => {
22302
+ }, xI = (o) => {
22296
22303
  const n = Object.prototype.hasOwnProperty.call(
22297
22304
  o,
22298
22305
  ve.QUALITY_LIMITATION_REASON
@@ -22306,7 +22313,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22306
22313
  return a && Object.keys(a).forEach((c) => {
22307
22314
  a[c] > 1e3 && (a[c] = Number(a[c] / 1e3));
22308
22315
  }), { reason: n, durations: a, resolutionChanges: r };
22309
- }, xI = (o, n, r) => {
22316
+ }, $I = (o, n, r) => {
22310
22317
  if (!Object.prototype.hasOwnProperty.call(o, ve.PLI) || !Object.prototype.hasOwnProperty.call(o, ve.NACK))
22311
22318
  return {
22312
22319
  pliCount: n.total_pli_sent_in,
@@ -22321,7 +22328,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22321
22328
  deltaPliCount: a - n[ae.VIDEO].total_pli_sent_in,
22322
22329
  deltaNackCount: c - n[ae.VIDEO].total_nack_sent_in
22323
22330
  };
22324
- }, $I = (o, n, r) => {
22331
+ }, OI = (o, n, r) => {
22325
22332
  if (!Object.prototype.hasOwnProperty.call(o, ve.PLI) || !Object.prototype.hasOwnProperty.call(o, ve.NACK))
22326
22333
  return {
22327
22334
  pliCount: n.total_pli_received_out,
@@ -22336,15 +22343,15 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22336
22343
  deltaPliCount: a - n[ae.VIDEO].total_pli_received_out,
22337
22344
  deltaNackCount: c - n[ae.VIDEO].total_nack_received_out
22338
22345
  };
22339
- }, OI = (o) => ({
22346
+ }, kI = (o) => ({
22340
22347
  channels: o[ve.CHANNELS] || null,
22341
22348
  clock_rate: o[ve.CLOCK_RATE] || null,
22342
22349
  mime_type: o[ve.MIME_TYPE] || null,
22343
22350
  sdp_fmtp_line: o[ve.SDP_FMTP_LINE] || null
22344
- }), kI = (o) => ({
22351
+ }), DI = (o) => ({
22345
22352
  clock_rate: o[ve.CLOCK_RATE] || null,
22346
22353
  mime_type: o[ve.MIME_TYPE] || null
22347
- }), DI = (o, n, r) => {
22354
+ }), NI = (o, n, r) => {
22348
22355
  const a = (o[ve.BYTES_RECEIVED] || 0) / 1024 - (r ? r.data.total_KBytes_in : 0), c = (o[ve.BYTES_SENT] || 0) / 1024 - (r ? r.data.total_KBytes_out : 0), e = o[ve.TIMESTAMP] || Date.now(), _ = a - n.data.total_KBytes_in, g = c - n.data.total_KBytes_out, d = r ? r.timestamp : null;
22349
22356
  let C = n.timestamp;
22350
22357
  !C && d && (C = d);
@@ -22357,13 +22364,13 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22357
22364
  kbs_speed_received: R,
22358
22365
  kbs_speed_sent: k
22359
22366
  };
22360
- }, NI = (o) => {
22367
+ }, MI = (o) => {
22361
22368
  const n = o[ve.AVAILABLE_INCOMING_BITRATE] / 1024 || 0, r = o[ve.AVAILABLE_OUTGOING_BITRATE] / 1024 || 0;
22362
22369
  return {
22363
22370
  kbs_incoming_bandwidth: n,
22364
22371
  kbs_outgoing_bandwidth: r
22365
22372
  };
22366
- }, MI = (o, n, r, a) => {
22373
+ }, UI = (o, n, r, a) => {
22367
22374
  if (!o)
22368
22375
  return [];
22369
22376
  switch (o[ve.TYPE]) {
@@ -22374,11 +22381,11 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22374
22381
  `analyze() - got stats ${o[ve.TYPE]} for ${r}`,
22375
22382
  o
22376
22383
  ), ve.SELECTED in o && !o[ve.SELECTED] && (c = !1)), c) {
22377
- const _ = o[ve.LOCAL_CANDIDATE_ID], g = o[ve.REMOTE_CANDIDATE_ID], d = DI(
22384
+ const _ = o[ve.LOCAL_CANDIDATE_ID], g = o[ve.REMOTE_CANDIDATE_ID], d = NI(
22378
22385
  o,
22379
22386
  n,
22380
22387
  a
22381
- ), C = NI(o), S = SI(
22388
+ ), C = MI(o), S = EI(
22382
22389
  o,
22383
22390
  "data",
22384
22391
  a,
@@ -22449,7 +22456,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22449
22456
  return [
22450
22457
  {
22451
22458
  type: Ue.NETWORK,
22452
- value: { infrastructure: II(o) }
22459
+ value: { infrastructure: RI(o) }
22453
22460
  },
22454
22461
  {
22455
22462
  type: Ue.NETWORK,
@@ -22464,7 +22471,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22464
22471
  {
22465
22472
  type: Ue.NETWORK,
22466
22473
  value: {
22467
- local_candidate_relay_protocol: AI(o)
22474
+ local_candidate_relay_protocol: II(o)
22468
22475
  }
22469
22476
  }
22470
22477
  ];
@@ -22556,12 +22563,12 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22556
22563
  ];
22557
22564
  }
22558
22565
  if (o[ve.MEDIA_TYPE] === ae.VIDEO) {
22559
- const C = EI(o, g), S = zy(
22566
+ const C = CI(o, g), S = zy(
22560
22567
  o,
22561
22568
  ae.VIDEO,
22562
22569
  g,
22563
22570
  d
22564
- ), R = wu(o, ae.VIDEO, g), k = o[ve.DECODER_IMPLEMENTATION] || null, L = o[ve.CODEC_ID] || null, V = Fy(o), G = xI(
22571
+ ), R = wu(o, ae.VIDEO, g), k = o[ve.DECODER_IMPLEMENTATION] || null, L = o[ve.CODEC_ID] || null, V = Fy(o), G = $I(
22565
22572
  o,
22566
22573
  g,
22567
22574
  d
@@ -22711,7 +22718,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22711
22718
  ];
22712
22719
  }
22713
22720
  if (o[ve.MEDIA_TYPE] === ae.VIDEO) {
22714
- const C = o[ve.ENCODER_IMPLEMENTATION] || null, S = o[ve.CODEC_ID] || null, R = CI(o, g), k = Fy(o), L = RI(o), V = $I(
22721
+ const C = o[ve.ENCODER_IMPLEMENTATION] || null, S = o[ve.CODEC_ID] || null, R = AI(o, g), k = Fy(o), L = xI(o), V = OI(
22715
22722
  o,
22716
22723
  g,
22717
22724
  d
@@ -22827,7 +22834,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22827
22834
  `analyze() - got stats ${o[ve.TYPE]} for ${r}`,
22828
22835
  o
22829
22836
  );
22830
- const d = OI(o);
22837
+ const d = kI(o);
22831
22838
  o[ve.ID] === g.codec_id_in ? e.push({ ssrc: g.ssrc, type: Ue.AUDIO, value: { codec_in: d } }) : e.push({ ssrc: g.ssrc, type: Ue.AUDIO, value: { codec_out: d } });
22832
22839
  }
22833
22840
  }), Object.keys(n[ae.VIDEO]).forEach((_) => {
@@ -22838,7 +22845,7 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22838
22845
  `analyze() - got stats ${o[ve.TYPE]} for ${r}`,
22839
22846
  o
22840
22847
  );
22841
- const d = kI(o);
22848
+ const d = DI(o);
22842
22849
  o[ve.ID] === g.codec_id_in ? e.push({ ssrc: g.ssrc, type: Ue.VIDEO, value: { codec_in: d } }) : e.push({ ssrc: g.ssrc, type: Ue.VIDEO, value: { codec_out: d } });
22843
22850
  }
22844
22851
  }), e;
@@ -22953,40 +22960,40 @@ const sa = "extractor ", Ly = (o, n, r, a) => {
22953
22960
  }
22954
22961
  }
22955
22962
  return [];
22956
- }, oc = (o) => o < 0 ? 1 : o > 100 ? 4.5 : 1 + 0.035 * o + 7 / 1e6 * o * (o - 60) * (100 - o), UI = (o, n = ae.AUDIO, r, a, c) => {
22963
+ }, oc = (o) => o < 0 ? 1 : o > 100 ? 4.5 : 1 + 0.035 * o + 7 / 1e6 * o * (o - 60) * (100 - o), PI = (o, n = ae.AUDIO, r, a, c) => {
22957
22964
  const e = Sn(c, o, Ft.INBOUND), _ = Sn(c, r, Ft.INBOUND), g = Sn(c, a, Ft.INBOUND), d = [], C = [], S = e[n].percent_packets_lost_in, R = e[n].delta_jitter_ms_in, k = _ && _[n].delta_jitter_ms_in || null, L = g && g[n].delta_jitter_ms_in || null, V = o.data.delta_rtt_connectivity_ms, G = r && r.data.delta_rtt_connectivity_ms || null, K = a && a.data.delta_rtt_connectivity_ms || null;
22958
22965
  V && d.push(V), G && d.push(G), K && d.push(K), R && C.push(R), r && k && C.push(k), a && L && C.push(L);
22959
22966
  const Q = d.length > 0 ? la(d) : 100, ee = C.length > 0 ? la(C) : 10, $e = 93.2 - S, X = 0.18 * $e * $e - 27.9 * $e + 1126.62, re = (Q + ee) / 2, ye = re - 177.3 < 0 ? 0 : 1, Ie = 0.024 * re + 0.11 * (re - 177.3) * ye, Z = X - Ie;
22960
22967
  return oc(Z);
22961
- }, PI = (o, n = ae.AUDIO, r, a, c) => {
22968
+ }, LI = (o, n = ae.AUDIO, r, a, c) => {
22962
22969
  const e = Sn(c, o, Ft.OUTBOUND), _ = Sn(c, r, Ft.OUTBOUND), g = Sn(c, a, Ft.OUTBOUND), d = [], C = [], S = e[n].percent_packets_lost_out, R = e[n].delta_rtt_ms_out, k = _ && _[n].delta_rtt_ms_out || null, L = g && g[n].delta_rtt_ms_out || null, V = e[n].delta_jitter_ms_out, G = _ && _[n].delta_jitter_ms_out || null, K = g && g[n].delta_jitter_ms_out || null, Q = o.data.delta_rtt_connectivity_ms, ee = r && r.data.delta_rtt_connectivity_ms || null, $e = a && a.data.delta_rtt_connectivity_ms || null;
22963
22970
  R ? d.push(R) : Q && d.push(Q), k ? d.push(k) : ee && d.push(ee), L ? d.push(L) : $e && d.push($e), V && C.push(V), r && G && C.push(G), a && K && C.push(K);
22964
22971
  const X = d.length > 0 ? la(d) : 100, re = C.length > 0 ? la(C) : 10, ye = 93.2 - S, Ie = 0.18 * ye * ye - 27.9 * ye + 1126.62, Z = (X + re) / 2, oe = Z - 177.3 < 0 ? 0 : 1, pe = 0.024 * Z + 0.11 * (Z - 177.3) * oe, _e = Ie - pe;
22965
22972
  return oc(_e);
22966
- }, LI = (o, n = ae.AUDIO, r, a, c) => {
22973
+ }, qI = (o, n = ae.AUDIO, r, a, c) => {
22967
22974
  const e = Sn(c, o, Ft.INBOUND), _ = Sn(c, r, Ft.INBOUND), g = Sn(c, a, Ft.INBOUND), d = [], C = [], S = e[n].percent_packets_lost_in / 100, R = e[n].delta_jitter_ms_in, k = _ && _[n].delta_jitter_ms_in || null, L = g && g[n].delta_jitter_ms_in || null, V = o.data.delta_rtt_connectivity_ms, G = r && r.data.delta_rtt_connectivity_ms || null, K = a && a.data.delta_rtt_connectivity_ms || null;
22968
22975
  V && d.push(V), G && d.push(G), K && d.push(K), R && C.push(R), _ && k && C.push(k), g && L && C.push(L);
22969
22976
  const Q = d.length > 0 ? la(d) : 100, ee = C.length > 0 ? la(C) : 10, $e = 0, X = 19.8, re = 29.7, ye = 30, Ie = (Q + ee) / 2 + ye, Z = Ie - 177.3 < 0 ? 0 : 1, oe = 0.024 * Ie + 0.11 * (Ie - 177.3) * Z, pe = 93.2 - ($e + X * Math.log(1 + re * S) + oe);
22970
22977
  return oc(pe);
22971
- }, qI = (o, n = ae.AUDIO, r, a, c) => {
22978
+ }, HI = (o, n = ae.AUDIO, r, a, c) => {
22972
22979
  const e = Sn(c, o, Ft.OUTBOUND), _ = Sn(c, r, Ft.OUTBOUND), g = Sn(c, a, Ft.OUTBOUND), d = [], C = [], S = e[n].percent_packets_lost_out / 100, R = e[n].delta_rtt_ms_out, k = _ && _[n].delta_rtt_ms_out || null, L = g && g[n].delta_rtt_ms_out || null, V = e[n].delta_jitter_ms_out, G = _ && _[n].delta_jitter_ms_out || null, K = g && g[n].delta_jitter_ms_out || null, Q = o.data.delta_rtt_connectivity_ms, ee = r && r.data.delta_rtt_connectivity_ms || null, $e = a && a.data.delta_rtt_connectivity_ms || null;
22973
22980
  R ? d.push(R) : Q && d.push(Q), k ? d.push(k) : ee && d.push(ee), L ? d.push(L) : $e && d.push($e), V && C.push(V), _ && G && C.push(G), g && K && C.push(K);
22974
22981
  const X = d.length > 0 ? la(d) : 100, re = C.length > 0 ? la(C) : 10, ye = 0, Ie = 19.8, Z = 29.7, oe = 30, pe = (X + re) / 2 + oe, _e = pe - 177.3 < 0 ? 0 : 1, le = 0.024 * pe + 0.11 * (pe - 177.3) * _e, ge = 93.2 - (ye + Ie * Math.log(1 + Z * S) + le);
22975
22982
  return oc(ge);
22976
22983
  };
22977
- class HI {
22984
+ class zI {
22978
22985
  constructor(n, r) {
22979
22986
  this._callbacks = {
22980
22987
  onreport: null,
22981
22988
  onticket: null
22982
- }, this._id = mI(), this._moduleName = this._id, this._probeId = r, this._config = n, this._exporter = new wI(n), this._state = Qs.IDLE, this.registerToPCEvents(), Ha(this._moduleName, `new collector created for probe ${this._probeId}`);
22989
+ }, this._id = gI(), this._moduleName = this._id, this._probeId = r, this._config = n, this._exporter = new SI(n), this._state = Qs.IDLE, this.registerToPCEvents(), Ha(this._moduleName, `new collector created for probe ${this._probeId}`);
22983
22990
  }
22984
22991
  analyze(n, r, a, c) {
22985
- const e = (d, C) => d === ae.AUDIO ? C === Zr.INBOUND_RTP ? { ...sb } : { ...ib } : C === Zr.INBOUND_RTP ? { ...ab } : { ...ob }, _ = dI(r);
22992
+ const e = (d, C) => d === ae.AUDIO ? C === Zr.INBOUND_RTP ? { ...sb } : { ...ib } : C === Zr.INBOUND_RTP ? { ...ab } : { ...ob }, _ = hI(r);
22986
22993
  _.pname = this._config.pname, _.call_id = this._config.cid, _.user_id = this._config.uid, _.count = r ? r.count + 1 : 1;
22987
22994
  let g = null;
22988
22995
  return n.forEach((d) => {
22989
- !g && d.timestamp && (g = d.timestamp), MI(d, _, _.pname, c).forEach((C) => {
22996
+ !g && d.timestamp && (g = d.timestamp), UI(d, _, _.pname, c).forEach((C) => {
22990
22997
  if (C.value && C.type)
22991
22998
  if (C.ssrc) {
22992
22999
  let S = _[C.type][C.ssrc];
@@ -23000,25 +23007,25 @@ class HI {
23000
23007
  });
23001
23008
  }), _.timestamp = g, Object.keys(_[ae.AUDIO]).forEach((d) => {
23002
23009
  const C = _[ae.AUDIO][d];
23003
- C.direction === Ft.INBOUND ? (C.mos_emodel_in = UI(
23010
+ C.direction === Ft.INBOUND ? (C.mos_emodel_in = PI(
23004
23011
  _,
23005
23012
  ae.AUDIO,
23006
23013
  r,
23007
23014
  a,
23008
23015
  C.ssrc
23009
- ), C.mos_in = LI(
23016
+ ), C.mos_in = qI(
23010
23017
  _,
23011
23018
  ae.AUDIO,
23012
23019
  r,
23013
23020
  a,
23014
23021
  C.ssrc
23015
- )) : (C.mos_emodel_out = PI(
23022
+ )) : (C.mos_emodel_out = LI(
23016
23023
  _,
23017
23024
  ae.AUDIO,
23018
23025
  r,
23019
23026
  a,
23020
23027
  C.ssrc
23021
- ), C.mos_out = qI(
23028
+ ), C.mos_out = HI(
23022
23029
  _,
23023
23030
  ae.AUDIO,
23024
23031
  r,
@@ -23200,9 +23207,9 @@ class HI {
23200
23207
  }
23201
23208
  }
23202
23209
  }
23203
- class zI {
23210
+ class FI {
23204
23211
  constructor(n) {
23205
- this._id = n.pname && n.pname.substr(0, 12).padEnd(12, " ") || fI(), this._moduleName = this._id, Ha(this._moduleName, "probe created"), this._config = n, this._collector = new HI(this._config, this._id);
23212
+ this._id = n.pname && n.pname.substr(0, 12).padEnd(12, " ") || mI(), this._moduleName = this._id, Ha(this._moduleName, "probe created"), this._config = n, this._collector = new zI(this._config, this._id);
23206
23213
  }
23207
23214
  /**
23208
23215
  * Register a callback to 'onreport'
@@ -23312,7 +23319,7 @@ class zI {
23312
23319
  }
23313
23320
  }
23314
23321
  const Gn = "engine ";
23315
- class FI {
23322
+ class BI {
23316
23323
  constructor(n) {
23317
23324
  this._config = n, this._probes = [], this._startedTime = null, this._callbacks = {
23318
23325
  onresult: null
@@ -23330,7 +23337,7 @@ class FI {
23330
23337
  addNewProbe(n, r) {
23331
23338
  if (!n)
23332
23339
  throw new Error("undefined peer connection");
23333
- const a = pI(n, r, this._config), c = new zI(a);
23340
+ const a = _I(n, r, this._config), c = new FI(a);
23334
23341
  return this._probes.push(c), $t(Gn, `${this._probes.length} probes registered`), c;
23335
23342
  }
23336
23343
  removeExistingProbe(n) {
@@ -23342,7 +23349,7 @@ class FI {
23342
23349
  const n = () => {
23343
23350
  this._probes.forEach((e) => e.start());
23344
23351
  }, r = async () => Promise.all(this._probes.map((e) => e.takeReferenceStats())), a = () => this.isIdle ? !1 : !this._config.stopAfter || this._config.stopAfter < 0 ? !0 : Date.now() < this._startedTime + this._config.stopAfter, c = async () => {
23345
- const e = cI(), _ = this._probes.filter((g) => g.isRunning);
23352
+ const e = dI(), _ = this._probes.filter((g) => g.isRunning);
23346
23353
  for (const g of _) {
23347
23354
  const d = await g.collectStats();
23348
23355
  d && e.probes.push(d), $t(Gn, `got probe ${g.id}`), await Uy(0);
@@ -23377,17 +23384,17 @@ class FI {
23377
23384
  this._callbacks.onresult && n.probes.length > 0 && Eh(this._callbacks.onresult.callback, this._callbacks.onresult.context, n);
23378
23385
  }
23379
23386
  }
23380
- const BI = "interface ";
23381
- class VI {
23387
+ const VI = "interface ";
23388
+ class jI {
23382
23389
  constructor(n) {
23383
- this._config = _I(n), Ha(BI, `welcome to ${this._config.name} version ${this._config.version}`), nI(this._config.verbose || !1), this._engine = new FI(this._config);
23390
+ this._config = fI(n), Ha(VI, `welcome to ${this._config.name} version ${this._config.version}`), rI(this._config.verbose || !1), this._engine = new BI(this._config);
23384
23391
  }
23385
23392
  /**
23386
23393
  * Change log level manually
23387
23394
  * @param {string} level - The level of logs. Can be one of 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'SILENT'
23388
23395
  */
23389
23396
  setupLogLevel(n) {
23390
- rI(n);
23397
+ sI(n);
23391
23398
  }
23392
23399
  /**
23393
23400
  * Get the version
@@ -23452,7 +23459,7 @@ class VI {
23452
23459
  n ? this._engine.registerCallback("onresult", n) : this._engine.unregisterCallback("onresult");
23453
23460
  }
23454
23461
  }
23455
- function jI(o, n) {
23462
+ function GI(o, n) {
23456
23463
  return Object.keys(o).filter((r) => n.includes(r)).reduce((r, a) => {
23457
23464
  const c = a;
23458
23465
  return {
@@ -23461,14 +23468,14 @@ function jI(o, n) {
23461
23468
  };
23462
23469
  }, {});
23463
23470
  }
23464
- const GI = ["mos_in", "codec_in", "delta_KBytes_in", "delta_kbs_in", "delta_jitter_ms_in", "delta_packets_lost_in"], WI = {
23471
+ const WI = ["mos_in", "codec_in", "delta_KBytes_in", "delta_kbs_in", "delta_jitter_ms_in", "delta_packets_lost_in"], KI = {
23465
23472
  positiveSpeechThreshold: 0.6,
23466
23473
  negativeSpeechThreshold: 0.3,
23467
23474
  preSpeechPadMs: 150,
23468
23475
  redemptionMs: 1500,
23469
23476
  minSpeechMs: 50
23470
23477
  };
23471
- class KI {
23478
+ class YI {
23472
23479
  constructor(n) {
23473
23480
  this.intervals = {}, this.analysers = {}, this.emitInterval = n.emitInterval || 200, this.onChangeFunction = n.onChangeFunction;
23474
23481
  }
@@ -23501,7 +23508,7 @@ class KI {
23501
23508
  }, this.emitInterval);
23502
23509
  }
23503
23510
  }
23504
- class YI {
23511
+ class XI {
23505
23512
  constructor() {
23506
23513
  this.resumePromise = null, this.context = new AudioContext(), this.setupErrorHandling();
23507
23514
  }
@@ -23538,14 +23545,14 @@ class YI {
23538
23545
  const Su = {
23539
23546
  SELECTED_INPUT_DEVICE: "OpensipsJSInputDevice",
23540
23547
  SELECTED_OUTPUT_DEVICE: "OpensipsJSOutputDevice"
23541
- }, XI = 0;
23548
+ }, JI = 0;
23542
23549
  function rh(o, n) {
23543
23550
  const r = new AudioContext(), a = r.createMediaStreamSource(o), c = r.createMediaStreamSource(
23544
23551
  new MediaStream([n])
23545
23552
  ), e = r.createMediaStreamDestination();
23546
23553
  return a.connect(e), c.connect(e), e.stream;
23547
23554
  }
23548
- class JI {
23555
+ class QI {
23549
23556
  constructor(n) {
23550
23557
  var r;
23551
23558
  this.isAutoAnswer = !1, this.muteWhenJoinEnabled = !1, this.isDNDEnabled = !1, this.isCallWaitingEnabled = !0, this.muted = !1, this.microphoneInputLevelValue = 1, this.speakerVolumeValue = 1, this.activeRooms = {}, this.activeCalls = {}, this.extendedCalls = {}, this.conferenceNodes = {}, this.availableMediaDevices = [], this.selectedMediaDevices = {
@@ -23556,10 +23563,10 @@ class JI {
23556
23563
  }, this.activeStreamValue = null, this.initialStreamValue = null, this.vadSession = null, this.vadSessionState = {
23557
23564
  currentMode: "clean",
23558
23565
  isSpeaking: !1
23559
- }, this.vadInterval = null, this.vadMrsInterval = null, this.vadSessionGeneration = 0, this.ringbackTimers = {}, this.ringbackAudioContexts = {}, this.ringbackSessionProgressReceived = {}, this.hangupBeepContext = null, this.managedAudioContext = new YI(), this.context = n, this.context.on(
23566
+ }, this.vadInterval = null, this.vadMrsInterval = null, this.vadSessionGeneration = 0, this.ringbackTimers = {}, this.ringbackAudioContexts = {}, this.ringbackSessionProgressReceived = {}, this.hangupBeepContext = null, this.managedAudioContext = new XI(), this.context = n, this.context.on(
23560
23567
  this.context.newRTCSessionEventName,
23561
23568
  this.newRTCSessionCallback.bind(this)
23562
- ), this.VUMeter = new KI({
23569
+ ), this.VUMeter = new YI({
23563
23570
  onChangeFunction: this.emitVolumeChange.bind(this)
23564
23571
  }), this.initializeMediaDevices(), this.processVADConfiguration(((r = this.context.options.configuration) == null ? void 0 : r.noiseReductionOptions) || {}), this.setupVADInstance();
23565
23572
  }
@@ -23901,7 +23908,7 @@ class JI {
23901
23908
  });
23902
23909
  }
23903
23910
  cancelAllOutgoingUnanswered() {
23904
- Object.values(this.getActiveCalls).filter((n) => n.direction === "outgoing" && n.status === XI).forEach((n) => this.terminateCall(n._id));
23911
+ Object.values(this.getActiveCalls).filter((n) => n.direction === "outgoing" && n.status === JI).forEach((n) => this.terminateCall(n._id));
23905
23912
  }
23906
23913
  answerCall(n) {
23907
23914
  const r = this.extendedCalls[n];
@@ -24070,7 +24077,7 @@ class JI {
24070
24077
  const R = [];
24071
24078
  this.vadInterval && (clearInterval(this.vadInterval), this.vadInterval = null), this.vadMrsInterval && (clearInterval(this.vadMrsInterval), this.vadMrsInterval = null), this.vadMrsInterval = setInterval(() => {
24072
24079
  C.getFloatTimeDomainData(S);
24073
- const k = X1(S);
24080
+ const k = J1(S);
24074
24081
  R.push(k);
24075
24082
  const L = Math.ceil(
24076
24083
  this.noiseReduction.noiseCheckInterval / this.noiseReduction.checkEveryMs
@@ -24101,7 +24108,7 @@ class JI {
24101
24108
  const _ = await this.managedAudioContext.getContext();
24102
24109
  if (e())
24103
24110
  return;
24104
- const g = await J1(a, _, 150);
24111
+ const g = await Q1(a, _, 150);
24105
24112
  if (e())
24106
24113
  return;
24107
24114
  let d = !1;
@@ -24110,7 +24117,7 @@ class JI {
24110
24117
  pauseStream: async () => {
24111
24118
  },
24112
24119
  resumeStream: async (R) => R,
24113
- ...WI,
24120
+ ...KI,
24114
24121
  ...this.noiseReduction.vadConfig,
24115
24122
  baseAssetPath: this.noiseReduction.baseAssetPath,
24116
24123
  onnxWASMBasePath: this.noiseReduction.onnxWASMBasePath,
@@ -24292,7 +24299,7 @@ class JI {
24292
24299
  console.log("[doConference] - No session or RTC connection, session:", Q), (re = this.context.logger) == null || re.log("[doConference] - No session or RTC connection, session:", Q);
24293
24300
  }), await this.setupActiveStream();
24294
24301
  const K = {};
24295
- await eI.forEach(n, async (Q, ee) => {
24302
+ await tI.forEach(n, async (Q, ee) => {
24296
24303
  var $e, X, re, ye, Ie;
24297
24304
  if (!Q || !Q.connection) {
24298
24305
  console.log("[doConference] - Return because of no session or connection, session:", Q), ($e = this.context.logger) == null || $e.log("[doConference] - Return because of no session or connection, session:", Q);
@@ -24575,7 +24582,7 @@ class JI {
24575
24582
  };
24576
24583
  this.setCallTime(r);
24577
24584
  const a = setInterval(() => {
24578
- const c = { ...this.callTime[n] }, e = Y1(c);
24585
+ const c = { ...this.callTime[n] }, e = X1(c);
24579
24586
  this.setCallTime({
24580
24587
  callId: n,
24581
24588
  ...e
@@ -24670,7 +24677,7 @@ class JI {
24670
24677
  }
24671
24678
  async newRTCSessionCallback(n) {
24672
24679
  const r = n.session;
24673
- if (this.shouldTerminateNewSession(n)) {
24680
+ if (r._remote_party_display_name = r.direction === "incoming" ? N1(n.request.getHeader("Remote-Party-ID")) : null, this.shouldTerminateNewSession(n)) {
24674
24681
  r.terminate({
24675
24682
  status_code: 486,
24676
24683
  reason_phrase: "Do Not Disturb"
@@ -24779,7 +24786,7 @@ class JI {
24779
24786
  }, this.context.emit("changeCallMetrics", this.callMetrics);
24780
24787
  }
24781
24788
  getCallQuality(n) {
24782
- const r = new VI(this.metricConfig), a = r.createProbe(n.connection, {
24789
+ const r = new jI(this.metricConfig), a = r.createProbe(n.connection, {
24783
24790
  cid: n._id
24784
24791
  }), c = [];
24785
24792
  let e;
@@ -24790,7 +24797,7 @@ class JI {
24790
24797
  const g = _.audio[e];
24791
24798
  if (!g)
24792
24799
  return;
24793
- const d = jI(g, GI);
24800
+ const d = GI(g, WI);
24794
24801
  d.callId = n._id, this.setCallMetrics(d);
24795
24802
  }, this.context.subscribe(es.CALL_ENDED, (_) => {
24796
24803
  _._id === n._id && r.stopAllProbes();
@@ -24857,7 +24864,7 @@ class JI {
24857
24864
  a.roomId = r, this.updateCall(a), await this.roomReconfigure(c), await this.roomReconfigure(r);
24858
24865
  }
24859
24866
  }
24860
- class QI {
24867
+ class ZI {
24861
24868
  constructor(n) {
24862
24869
  this.context = n;
24863
24870
  }
@@ -24903,7 +24910,7 @@ class QI {
24903
24910
  this.context.stopBlur();
24904
24911
  }
24905
24912
  }
24906
- class ZI {
24913
+ class eR {
24907
24914
  constructor(n) {
24908
24915
  this.activeMessages = {}, this.extendedMessages = {}, this.msrpHistory = {}, this.context = n, this.context.on(
24909
24916
  this.context.newMSRPSessionEventName,
@@ -25090,7 +25097,7 @@ class lb {
25090
25097
  this.opensips.kill(this.name);
25091
25098
  }
25092
25099
  }
25093
- class eR extends lb {
25100
+ class tR extends lb {
25094
25101
  constructor(n, r) {
25095
25102
  super(n), this._candidates = [], this._subscribeSent = !1, this._configureSent = !1, this._lastTrickleReceived = !1, this.type = r;
25096
25103
  }
@@ -25273,7 +25280,7 @@ class eR extends lb {
25273
25280
  throw new Error("generateStream method is not implemented");
25274
25281
  }
25275
25282
  }
25276
- class tR extends lb {
25283
+ class nR extends lb {
25277
25284
  constructor(n, r, a = {}) {
25278
25285
  super(n), this.stream = null, this.running = !1, this.immediate = !1, this.type = "video", this.immediate = a.immediate || !1, this.type = r;
25279
25286
  }
@@ -25300,15 +25307,15 @@ class tR extends lb {
25300
25307
  this.stop(), this.running = !1, await this.session.resyncPlugins(this.type);
25301
25308
  }
25302
25309
  }
25303
- class nR extends A1 {
25310
+ class rR extends A1 {
25304
25311
  constructor(n, r) {
25305
25312
  if (!n.modules.length)
25306
25313
  throw new Error("options.modules should include at least 1 module");
25307
25314
  const a = {
25308
25315
  ...n.configuration,
25309
- sockets: n.socketInterfaces.map((c) => new K1.WebSocketInterface(c))
25316
+ sockets: n.socketInterfaces.map((c) => new Y1.WebSocketInterface(c))
25310
25317
  };
25311
- super(a), this.initialized = !1, this.connected = !1, this.logger = console, this.newRTCSessionEventName = "newRTCSession", this.registeredEventName = "registered", this.unregisteredEventName = "unregistered", this.disconnectedEventName = "disconnected", this.connectedEventName = "connected", this.newMSRPSessionEventName = "newMSRPSession", this.isReconnecting = !1, this.activeConnection = !1, this.waitingForSessionHangup = !1, this.waitingForSessionTimeout = null, this.reconnectionAttemptsLimit = 1 / 0, this.reconnectionAttemptsCounter = 0, this.audio = null, this.msrp = null, this.video = null, this.listenersList = {}, this.modules = [], n.pnExtraHeaders && Object.keys(n.pnExtraHeaders).length && this.registrator().setExtraContactUriParams(n.pnExtraHeaders), this.options = n, this.modules = n.modules, n.configuration.reconnectionAttemptsLimit && (this.reconnectionAttemptsLimit = n.configuration.reconnectionAttemptsLimit), r && N1(r) && (this.logger = r);
25318
+ super(a), this.initialized = !1, this.connected = !1, this.logger = console, this.newRTCSessionEventName = "newRTCSession", this.registeredEventName = "registered", this.unregisteredEventName = "unregistered", this.disconnectedEventName = "disconnected", this.connectedEventName = "connected", this.newMSRPSessionEventName = "newMSRPSession", this.isReconnecting = !1, this.activeConnection = !1, this.waitingForSessionHangup = !1, this.waitingForSessionTimeout = null, this.reconnectionAttemptsLimit = 1 / 0, this.reconnectionAttemptsCounter = 0, this.audio = null, this.msrp = null, this.video = null, this.listenersList = {}, this.modules = [], n.pnExtraHeaders && Object.keys(n.pnExtraHeaders).length && this.registrator().setExtraContactUriParams(n.pnExtraHeaders), this.options = n, this.modules = n.modules, n.configuration.reconnectionAttemptsLimit && (this.reconnectionAttemptsLimit = n.configuration.reconnectionAttemptsLimit), r && M1(r) && (this.logger = r);
25312
25319
  }
25313
25320
  /*public setWaitingForSessionHangup (value: boolean) {
25314
25321
  this.waitingForSessionHangup = value
@@ -25337,9 +25344,9 @@ class nR extends A1 {
25337
25344
  use(n) {
25338
25345
  if (this.newStreamPlugins.find((r) => r.name === n.name) || this.processStreamPlugins.find((r) => r.name === n.name))
25339
25346
  throw new Error(`Plugin with name ${n.name} already exists`);
25340
- if (n instanceof eR)
25347
+ if (n instanceof tR)
25341
25348
  n.setOpensips(this), this.newStreamPlugins.push(n);
25342
- else if (n instanceof tR)
25349
+ else if (n instanceof nR)
25343
25350
  n.setOpensips(this), this.processStreamPlugins.push(n);
25344
25351
  else
25345
25352
  throw new Error("Wrong plugin instance");
@@ -25359,7 +25366,7 @@ class nR extends A1 {
25359
25366
  console.error("Connection is already established");
25360
25367
  return;
25361
25368
  }
25362
- return this.modules.includes(Eu.AUDIO) && (this.audio = new JI(this)), this.modules.includes(Eu.MSRP) && (this.msrp = new ZI(this)), this.modules.includes(Eu.VIDEO) && (this.video = new QI(this)), this.on(
25369
+ return this.modules.includes(Eu.AUDIO) && (this.audio = new QI(this)), this.modules.includes(Eu.MSRP) && (this.msrp = new eR(this)), this.modules.includes(Eu.VIDEO) && (this.video = new ZI(this)), this.on(
25363
25370
  this.registeredEventName,
25364
25371
  () => {
25365
25372
  this.logger.log("Successfully registered to", this.options.socketInterfaces[0]), this.setInitialized(!0);
@@ -26544,21 +26551,21 @@ class nR extends A1 {
26544
26551
  }*/
26545
26552
  }
26546
26553
  var Wn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
26547
- function rR(o) {
26554
+ function sR(o) {
26548
26555
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
26549
26556
  }
26550
26557
  var Fh = {}, Ml = {};
26551
26558
  Object.defineProperty(Ml, "__esModule", { value: !0 });
26552
26559
  Ml.baseAssetPath = void 0;
26553
- const sR = typeof window < "u" && typeof window.document < "u", By = sR ? window.document.currentScript : null;
26560
+ const iR = typeof window < "u" && typeof window.document < "u", By = iR ? window.document.currentScript : null;
26554
26561
  let ub = "/";
26555
26562
  By && (ub = By.src.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"));
26556
26563
  Ml.baseAssetPath = ub;
26557
26564
  var $o = {};
26558
26565
  Object.defineProperty($o, "__esModule", { value: !0 });
26559
26566
  $o.defaultModelFetcher = void 0;
26560
- const iR = (o) => fetch(o).then((n) => n.arrayBuffer());
26561
- $o.defaultModelFetcher = iR;
26567
+ const aR = (o) => fetch(o).then((n) => n.arrayBuffer());
26568
+ $o.defaultModelFetcher = aR;
26562
26569
  var Rs = {}, Oo = {};
26563
26570
  (function(o) {
26564
26571
  Object.defineProperty(o, "__esModule", { value: !0 }), o.log = o.LOG_PREFIX = void 0, o.LOG_PREFIX = "[VAD]";
@@ -26589,10 +26596,10 @@ Rs.defaultFrameProcessorOptions = {
26589
26596
  minSpeechMs: 400,
26590
26597
  submitUserSpeechOnPause: !1
26591
26598
  };
26592
- function aR(o) {
26599
+ function oR(o) {
26593
26600
  (o.positiveSpeechThreshold < 0 || o.positiveSpeechThreshold > 1) && cl.log.error("positiveSpeechThreshold should be a number between 0 and 1"), (o.negativeSpeechThreshold < 0 || o.negativeSpeechThreshold > o.positiveSpeechThreshold) && cl.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"), o.preSpeechPadMs < 0 && cl.log.error("preSpeechPadMs should be positive"), o.redemptionMs < 0 && cl.log.error("redemptionMs should be positive"), o.minSpeechMs < 0 && cl.log.error("minSpeechMs should be positive");
26594
26601
  }
26595
- Rs.validateOptions = aR;
26602
+ Rs.validateOptions = oR;
26596
26603
  const jy = (o) => {
26597
26604
  const n = o.reduce((a, c) => (a.push(a.at(-1) + c.length), a), [0]), r = new Float32Array(n.at(-1));
26598
26605
  return o.forEach((a, c) => {
@@ -26600,7 +26607,7 @@ const jy = (o) => {
26600
26607
  r.set(a, e);
26601
26608
  }), r;
26602
26609
  };
26603
- class oR {
26610
+ class lR {
26604
26611
  constructor(n, r, a, c) {
26605
26612
  this.modelProcessFunc = n, this.modelResetFunc = r, this.options = a, this.msPerFrame = c, this.speaking = !1, this.redemptionCounter = 0, this.speechFrameCount = 0, this.active = !1, this.speechRealStartFired = !1, this.reset = () => {
26606
26613
  this.speaking = !1, this.speechRealStartFired = !1, this.audioBuffer = [], this.modelResetFunc(), this.redemptionCounter = 0, this.speechFrameCount = 0;
@@ -26643,7 +26650,7 @@ class oR {
26643
26650
  }, this.audioBuffer = [], this.redemptionFrames = Math.floor(a.redemptionMs / this.msPerFrame), this.preSpeechPadFrames = Math.floor(a.preSpeechPadMs / this.msPerFrame), this.minSpeechFrames = Math.floor(a.minSpeechMs / this.msPerFrame), this.reset();
26644
26651
  }
26645
26652
  }
26646
- Rs.FrameProcessor = oR;
26653
+ Rs.FrameProcessor = lR;
26647
26654
  var cb = {};
26648
26655
  function To(o) {
26649
26656
  throw new Error('Could not dynamically require "' + o + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
@@ -35238,8 +35245,8 @@ jh.new = async (o, n) => {
35238
35245
  var Ul = {};
35239
35246
  Object.defineProperty(Ul, "__esModule", { value: !0 });
35240
35247
  Ul.Resampler = void 0;
35241
- const lR = Oo;
35242
- class uR {
35248
+ const uR = Oo;
35249
+ class cR {
35243
35250
  constructor(n) {
35244
35251
  this.options = n, this.process = (r) => {
35245
35252
  const a = [];
@@ -35249,7 +35256,7 @@ class uR {
35249
35256
  a.push(e);
35250
35257
  }
35251
35258
  return a;
35252
- }, n.nativeSampleRate < 16e3 && lR.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"), this.inputBuffer = [];
35259
+ }, n.nativeSampleRate < 16e3 && uR.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"), this.inputBuffer = [];
35253
35260
  }
35254
35261
  async *stream(n) {
35255
35262
  for (const r of n)
@@ -35273,7 +35280,7 @@ class uR {
35273
35280
  return this.inputBuffer = this.inputBuffer.slice(a), n;
35274
35281
  }
35275
35282
  }
35276
- Ul.Resampler = uR;
35283
+ Ul.Resampler = cR;
35277
35284
  (function(o) {
35278
35285
  var n = Wn && Wn.__createBinding || (Object.create ? function(k, L, V, G) {
35279
35286
  G === void 0 && (G = V);
@@ -35366,11 +35373,11 @@ Ul.Resampler = uR;
35366
35373
  var Cs = {};
35367
35374
  Object.defineProperty(Cs, "__esModule", { value: !0 });
35368
35375
  Cs.audioFileToArray = Cs.encodeWAV = Cs.arrayBufferToBase64 = Cs.minFramesForTargetMS = void 0;
35369
- function cR(o, n, r = 16e3) {
35376
+ function dR(o, n, r = 16e3) {
35370
35377
  return Math.ceil(o * r / 1e3 / n);
35371
35378
  }
35372
- Cs.minFramesForTargetMS = cR;
35373
- function dR(o) {
35379
+ Cs.minFramesForTargetMS = dR;
35380
+ function hR(o) {
35374
35381
  const n = new Uint8Array(o), r = n.byteLength, a = new Array(r);
35375
35382
  for (var c = 0; c < r; c++) {
35376
35383
  const e = n[c];
@@ -35380,17 +35387,17 @@ function dR(o) {
35380
35387
  }
35381
35388
  return btoa(a.join(""));
35382
35389
  }
35383
- Cs.arrayBufferToBase64 = dR;
35384
- function hR(o, n = 3, r = 16e3, a = 1, c = 32) {
35390
+ Cs.arrayBufferToBase64 = hR;
35391
+ function pR(o, n = 3, r = 16e3, a = 1, c = 32) {
35385
35392
  var e = c / 8, _ = a * e, g = new ArrayBuffer(44 + o.length * e), d = new DataView(g);
35386
- return Cu(d, 0, "RIFF"), d.setUint32(4, 36 + o.length * e, !0), Cu(d, 8, "WAVE"), Cu(d, 12, "fmt "), d.setUint32(16, 16, !0), d.setUint16(20, n, !0), d.setUint16(22, a, !0), d.setUint32(24, r, !0), d.setUint32(28, r * _, !0), d.setUint16(32, _, !0), d.setUint16(34, c, !0), Cu(d, 36, "data"), d.setUint32(40, o.length * e, !0), n === 1 ? _R(d, 44, o) : pR(d, 44, o), g;
35393
+ return Cu(d, 0, "RIFF"), d.setUint32(4, 36 + o.length * e, !0), Cu(d, 8, "WAVE"), Cu(d, 12, "fmt "), d.setUint32(16, 16, !0), d.setUint16(20, n, !0), d.setUint16(22, a, !0), d.setUint32(24, r, !0), d.setUint32(28, r * _, !0), d.setUint16(32, _, !0), d.setUint16(34, c, !0), Cu(d, 36, "data"), d.setUint32(40, o.length * e, !0), n === 1 ? fR(d, 44, o) : _R(d, 44, o), g;
35387
35394
  }
35388
- Cs.encodeWAV = hR;
35389
- function pR(o, n, r) {
35395
+ Cs.encodeWAV = pR;
35396
+ function _R(o, n, r) {
35390
35397
  for (var a = 0; a < r.length; a++, n += 4)
35391
35398
  o.setFloat32(n, r[a], !0);
35392
35399
  }
35393
- function _R(o, n, r) {
35400
+ function fR(o, n, r) {
35394
35401
  for (var a = 0; a < r.length; a++, n += 2) {
35395
35402
  var c = Math.max(-1, Math.min(1, r[a]));
35396
35403
  o.setInt16(n, c < 0 ? c * 32768 : c * 32767, !0);
@@ -35400,7 +35407,7 @@ function Cu(o, n, r) {
35400
35407
  for (var a = 0; a < r.length; a++)
35401
35408
  o.setUint8(n + a, r.charCodeAt(a));
35402
35409
  }
35403
- async function fR(o) {
35410
+ async function mR(o) {
35404
35411
  const n = new OfflineAudioContext(1, 1, 44100), r = new FileReader();
35405
35412
  let a = null;
35406
35413
  if (await new Promise((_) => {
@@ -35424,7 +35431,7 @@ async function fR(o) {
35424
35431
  e[_] += c.getChannelData(g)[_];
35425
35432
  return { audio: e, sampleRate: c.sampleRate };
35426
35433
  }
35427
- Cs.audioFileToArray = fR;
35434
+ Cs.audioFileToArray = mR;
35428
35435
  var yb = {};
35429
35436
  (function(o) {
35430
35437
  var n = Wn && Wn.__createBinding || (Object.create ? function(Q, ee, $e, X) {
@@ -35691,9 +35698,9 @@ var yb = {};
35691
35698
  return g.getDefaultRealTimeVADOptions;
35692
35699
  } });
35693
35700
  })(Fh);
35694
- const mR = /* @__PURE__ */ rR(Fh), Ky = /* @__PURE__ */ b0({
35701
+ const gR = /* @__PURE__ */ sR(Fh), Ky = /* @__PURE__ */ b0({
35695
35702
  __proto__: null,
35696
- default: mR
35703
+ default: gR
35697
35704
  }, [Fh]);
35698
35705
  let Ct;
35699
35706
  const Yy = Yt(!1), Xy = Yt(!1), Jy = Yt(!1), Tb = Yt({}), Qy = Yt({}), Zy = Yt(!1), eT = Yt(void 0), zu = Yt({}), sh = Yt({}), Qu = Yt([]), tT = Yt("default"), nT = Yt("default"), rT = Yt(!1), sT = Yt(!1), iT = Yt(!0), aT = Yt(!1), oT = Yt(null), bl = Yt(void 0), lT = Yt(!1), uT = Yt(2), cT = Yt(1), Ch = Yt({}), dT = Yt({}), hT = Yt({}), pT = Yt(!1), Gh = wl(() => {
@@ -35701,17 +35708,17 @@ const Yy = Yt(!1), Xy = Yt(!1), Jy = Yt(!1), Tb = Yt({}), Qy = Yt({}), Zy = Yt(!
35701
35708
  return Object.entries(Tb.value).forEach(([n, r]) => {
35702
35709
  Ch.value[n]?.isTransferred || (o[n] = r);
35703
35710
  }), o;
35704
- }), gR = wl(() => {
35711
+ }), vR = wl(() => {
35705
35712
  const o = {}, n = Object.values(Gh.value).map((r) => r.roomId);
35706
35713
  return Object.entries(zu.value).forEach(([r, a]) => {
35707
35714
  n.includes(a.roomId) && (o[r] = a);
35708
35715
  }), o;
35709
- }), vR = wl(() => Qu.value.filter((o) => o.kind === "audioinput").map((o) => ({
35716
+ }), yR = wl(() => Qu.value.filter((o) => o.kind === "audioinput").map((o) => ({
35710
35717
  deviceId: o.deviceId,
35711
35718
  kind: o.kind,
35712
35719
  groupId: o.groupId,
35713
35720
  label: o.label
35714
- }))), yR = wl(() => Qu.value.filter((o) => o.kind === "audiooutput").map((o) => ({
35721
+ }))), TR = wl(() => Qu.value.filter((o) => o.kind === "audiooutput").map((o) => ({
35715
35722
  deviceId: o.deviceId,
35716
35723
  kind: o.kind,
35717
35724
  groupId: o.groupId,
@@ -35730,11 +35737,11 @@ const _T = {
35730
35737
  activeMessages: Qy,
35731
35738
  addCallToCurrentRoom: Zy,
35732
35739
  callAddingInProgress: eT,
35733
- activeRooms: gR,
35740
+ activeRooms: vR,
35734
35741
  msrpHistory: sh,
35735
35742
  availableMediaDevices: Qu,
35736
- inputMediaDeviceList: vR,
35737
- outputMediaDeviceList: yR,
35743
+ inputMediaDeviceList: yR,
35744
+ outputMediaDeviceList: TR,
35738
35745
  selectedOutputDevice: tT,
35739
35746
  selectedInputDevice: nT,
35740
35747
  muteWhenJoin: rT,
@@ -35770,7 +35777,7 @@ const _T = {
35770
35777
  vadModule: Ky
35771
35778
  }, o.authorization_jwt && (_.authorization_jwt = o.authorization_jwt);
35772
35779
  const g = {};
35773
- o.msrpDomain && (g.msrpDomain = o.msrpDomain), o.msrpWs && (g.msrpWs = o.msrpWs), Ct = new nR({
35780
+ o.msrpDomain && (g.msrpDomain = o.msrpDomain), o.msrpWs && (g.msrpWs = o.msrpWs), Ct = new rR({
35774
35781
  configuration: _,
35775
35782
  socketInterfaces: [`wss://${o.domain}`],
35776
35783
  sipDomain: `${o.domain}`,
@@ -35935,21 +35942,21 @@ const _T = {
35935
35942
  }
35936
35943
  }
35937
35944
  }, wb = Symbol();
35938
- function bR() {
35945
+ function wR() {
35939
35946
  return y0(
35940
35947
  wb,
35941
35948
  _T
35942
35949
  ), _T;
35943
35950
  }
35944
- function wR() {
35951
+ function SR() {
35945
35952
  const o = T0(wb);
35946
35953
  if (!o)
35947
35954
  throw new Error("useVsipInject() is called without provider, please call useVsipProvide() first");
35948
35955
  return o;
35949
35956
  }
35950
35957
  export {
35951
- wR as useVsipInject,
35952
- bR as useVsipProvide,
35958
+ SR as useVsipInject,
35959
+ wR as useVsipProvide,
35953
35960
  _T as vsipAPI
35954
35961
  };
35955
35962
  //# sourceMappingURL=super.mjs.map