@16x/webphone-sdk 3.1.1 → 3.1.2

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.
@@ -42,12 +42,12 @@ function t(e) {
42
42
  }
43
43
  //#endregion
44
44
  //#region src/sip/JsSipAdapter.ts
45
- var n = 300, r = 25;
46
- function i(e) {
45
+ var n = 300, r = 25, i = 2;
46
+ function a(e) {
47
47
  let t = Math.floor(Number(e.sip.registerExpires));
48
48
  return Number.isFinite(t) && t > 0 ? t : n;
49
49
  }
50
- var a = class {
50
+ var o = class {
51
51
  factory;
52
52
  transportBaseUrl;
53
53
  keepaliveSeconds;
@@ -84,14 +84,14 @@ var a = class {
84
84
  this.assertNotDisposed(), this.disconnect(this.registrationError("SIP connection replaced"));
85
85
  try {
86
86
  let e = this.factory.createUa({
87
- sockets: l(this.factory.createSocket(this.withoutTicket(this.resolveWssUrl(t.transport.wssUrl)), t.transport.ticket)),
87
+ sockets: u(this.factory.createSocket(this.withoutTicket(this.resolveWssUrl(t.transport.wssUrl)), t.transport.ticket)),
88
88
  uri: t.sip.uri,
89
89
  password: t.sip.registerTicket,
90
90
  registrar_server: t.sip.registrar,
91
91
  register: !0,
92
- register_expires: i(t)
92
+ register_expires: a(t)
93
93
  });
94
- return this.ua = e, this.registerExpiresSeconds = i(t), this.iceServers = t.iceServers, this.uaListeners = [], this.startRegistration(e);
94
+ return this.ua = e, this.registerExpiresSeconds = a(t), this.iceServers = t.iceServers, this.uaListeners = [], this.startRegistration(e);
95
95
  } catch (t) {
96
96
  let n = t instanceof e && t.code === "CONFIG_INVALID" ? t : this.transportError(t);
97
97
  return this.disconnect(n), Promise.reject(n);
@@ -112,17 +112,23 @@ var a = class {
112
112
  video: !1
113
113
  },
114
114
  sessionTimersExpires: 1800,
115
- pcConfig: { iceServers: this.iceServers }
115
+ pcConfig: {
116
+ iceServers: this.iceServers,
117
+ iceCandidatePoolSize: i
118
+ }
116
119
  } : {
117
120
  mediaConstraints: {
118
121
  audio: !0,
119
122
  video: !1
120
123
  },
121
124
  sessionTimersExpires: 1800,
122
- pcConfig: { iceServers: [...n.iceServers] },
125
+ pcConfig: {
126
+ iceServers: [...n.iceServers],
127
+ iceCandidatePoolSize: i
128
+ },
123
129
  extraHeaders: [...n.extraHeaders, ...n.type === "extension" ? ["X-XCall-Destination-Type: extension"] : []]
124
130
  };
125
- return new o(r.call(t, e));
131
+ return new s(r.call(t, e));
126
132
  } catch (t) {
127
133
  throw new e("CALL_OPERATION_NOT_ALLOWED", "call", !1, { cause: t });
128
134
  }
@@ -145,10 +151,10 @@ var a = class {
145
151
  };
146
152
  }
147
153
  handleIncoming(e) {
148
- if (!s(e)) return;
154
+ if (!c(e)) return;
149
155
  let t = e.session;
150
156
  if (t === void 0) return;
151
- let n = new o(t);
157
+ let n = new s(t);
152
158
  this.incomingHandlers?.forEach((e) => e(n));
153
159
  }
154
160
  startRegistration(e) {
@@ -209,7 +215,7 @@ var a = class {
209
215
  return n.protocol === "http:" && (n.protocol = "ws:"), n.protocol === "https:" && (n.protocol = "wss:"), this.assertAllowedWssUrl(n), n.toString();
210
216
  }
211
217
  assertAllowedWssUrl(t) {
212
- if (t.protocol !== "wss:" && !(t.protocol === "ws:" && u(t.hostname))) throw new e("CONFIG_INVALID", "configuration", !1, { cause: t.origin });
218
+ if (t.protocol !== "wss:" && !(t.protocol === "ws:" && d(t.hostname))) throw new e("CONFIG_INVALID", "configuration", !1, { cause: t.origin });
213
219
  }
214
220
  withoutTicket(e) {
215
221
  let t = new URL(e);
@@ -231,7 +237,7 @@ var a = class {
231
237
  registrationFailureCause(e) {
232
238
  return typeof e == "object" && e && "cause" in e ? e.cause : e;
233
239
  }
234
- }, o = class {
240
+ }, s = class {
235
241
  session;
236
242
  pendingHoldReject;
237
243
  mediaRegistration;
@@ -243,7 +249,7 @@ var a = class {
243
249
  return this.session.id;
244
250
  }
245
251
  get from() {
246
- return this.session.from ?? d(this.session.remote_identity);
252
+ return this.session.from ?? f(this.session.remote_identity);
247
253
  }
248
254
  getMediaRegistration() {
249
255
  let e = this.session.connection;
@@ -311,22 +317,22 @@ var a = class {
311
317
  });
312
318
  }
313
319
  };
314
- function s(e) {
320
+ function c(e) {
315
321
  if (typeof e != "object" || !e) return !1;
316
322
  let t = e;
317
- return t.originator === "remote" && c(t.session);
323
+ return t.originator === "remote" && l(t.session);
318
324
  }
319
- function c(e) {
325
+ function l(e) {
320
326
  return typeof e == "object" && !!e && "id" in e;
321
327
  }
322
- function l(e) {
328
+ function u(e) {
323
329
  return typeof e == "object" && e && (e.via_transport = "WSS"), e;
324
330
  }
325
- function u(e) {
331
+ function d(e) {
326
332
  let t = e.replace(/^\[|\]$/g, "").toLowerCase();
327
333
  return t === "localhost" || t === "127.0.0.1" || t === "::1" || t === "0:0:0:0:0:0:0:1";
328
334
  }
329
- function d(e) {
335
+ function f(e) {
330
336
  let t = e?.uri;
331
337
  if (t == null) return;
332
338
  if (typeof t.user == "string" && t.user !== "") return t.user;
@@ -334,4 +340,4 @@ function d(e) {
334
340
  return n.match(/^sips?:([^@;>]+)/i)?.[1] ?? (n === "" ? void 0 : n);
335
341
  }
336
342
  //#endregion
337
- export { a as JsSipAdapter };
343
+ export { o as JsSipAdapter };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-BXKjfW9h.cjs"),t=require("../redact-Bq26pObO.cjs");require("../createJsSipFactory-Dr8HbLl-.cjs"),exports.Diagnostics=e.t,exports.RingBuffer=e.n,exports.diagnosticsVersion=e.r,exports.redactText=t.t,exports.redactValue=t.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-BIK-fe3F.cjs"),t=require("../redact-Bq26pObO.cjs");require("../createJsSipFactory-Dr8HbLl-.cjs"),exports.Diagnostics=e.t,exports.RingBuffer=e.n,exports.diagnosticsVersion=e.r,exports.redactText=t.t,exports.redactValue=t.n;
@@ -1,3 +1,3 @@
1
- import { n as e, r as t, t as n } from "../Diagnostics-Hb2Y9WsN.js";
1
+ import { n as e, r as t, t as n } from "../Diagnostics-B0AJ4g-B.js";
2
2
  import { n as r, t as i } from "../redact-DB3CMbsK.js";
3
3
  export { n as Diagnostics, e as RingBuffer, t as diagnosticsVersion, i as redactText, r as redactValue };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SharedWorkerProtocol-39dch6xL.cjs"),t=require("./CCBarClient-BaO_GM1u.cjs"),n=require("./Diagnostics-BXKjfW9h.cjs"),r=require("./redact-Bq26pObO.cjs");require("./diagnostics/index.cjs"),require("./createJsSipFactory-Dr8HbLl-.cjs");function i(e){if(e.code!==`OK`)throw TypeError(`Unexpected session response code: ${e.code}`);if(e.data===void 0||e.data===null)throw TypeError(`Unexpected session response: missing data`);return e.data}function a(e={}){return{version:`0.1.0`,options:e}}var o=`0.1.0`;exports.CCBarCall=t.a,exports.CCBarClient=t.t,exports.CCBarError=e.i,exports.CallManager=t.i,exports.CallStateError=t.c,exports.Diagnostics=n.t,exports.RingBuffer=n.n,exports.TokenManager=t.s,exports.TypedEventBus=t.p,exports.WebPhoneApi=t.o,exports.assertCallTransition=t.l,exports.canTransition=t.u,exports.createSdk=a,exports.createSharedWorkerSelection=t.n,exports.diagnosticsVersion=n.r,exports.parseSessionResponse=i,exports.redactText=r.t,exports.redactValue=r.n,exports.resolveWorkerUrl=t.r,exports.transition=t.d,exports.transitions=t.f,exports.version=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SharedWorkerProtocol-39dch6xL.cjs"),t=require("./CCBarClient-CEybNVKb.cjs"),n=require("./Diagnostics-BIK-fe3F.cjs"),r=require("./redact-Bq26pObO.cjs");require("./diagnostics/index.cjs"),require("./createJsSipFactory-Dr8HbLl-.cjs");function i(e){if(e.code!==`OK`)throw TypeError(`Unexpected session response code: ${e.code}`);if(e.data===void 0||e.data===null)throw TypeError(`Unexpected session response: missing data`);return e.data}function a(e={}){return{version:`0.1.0`,options:e}}var o=`0.1.0`;exports.CCBarCall=t.a,exports.CCBarClient=t.t,exports.CCBarError=e.i,exports.CallManager=t.i,exports.CallStateError=t.c,exports.Diagnostics=n.t,exports.RingBuffer=n.n,exports.TokenManager=t.s,exports.TypedEventBus=t.p,exports.WebPhoneApi=t.o,exports.assertCallTransition=t.l,exports.canTransition=t.u,exports.createSdk=a,exports.createSharedWorkerSelection=t.n,exports.diagnosticsVersion=n.r,exports.parseSessionResponse=i,exports.redactText=r.t,exports.redactValue=r.n,exports.resolveWorkerUrl=t.r,exports.transition=t.d,exports.transitions=t.f,exports.version=o;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as e } from "./SharedWorkerProtocol-DKVQ5-po.js";
2
- import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./CCBarClient-BCWPbFNX.js";
3
- import { n as m, r as h, t as g } from "./Diagnostics-Hb2Y9WsN.js";
2
+ import { a as t, c as n, d as r, f as i, i as a, l as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "./CCBarClient-BsVx2U72.js";
3
+ import { n as m, r as h, t as g } from "./Diagnostics-B0AJ4g-B.js";
4
4
  import { n as _, t as v } from "./redact-DB3CMbsK.js";
5
5
  import "./diagnostics/index.js";
6
6
  //#region src/api/contracts.ts