@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.
- package/CHANGELOG.md +6 -0
- package/README.md +60 -6
- package/dist/{CCBarClient-BCWPbFNX.js → CCBarClient-BsVx2U72.js} +2 -2
- package/dist/{CCBarClient-BaO_GM1u.cjs → CCBarClient-CEybNVKb.cjs} +1 -1
- package/dist/{Diagnostics-Hb2Y9WsN.js → Diagnostics-B0AJ4g-B.js} +1 -1
- package/dist/{Diagnostics-BXKjfW9h.cjs → Diagnostics-BIK-fe3F.cjs} +1 -1
- package/dist/JsSipAdapter-56sHLkSX.cjs +1 -0
- package/dist/{JsSipAdapter-BoxqJZsR.js → JsSipAdapter-BPNEN6Qc.js} +27 -21
- package/dist/diagnostics/index.cjs +1 -1
- package/dist/diagnostics/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.js +2 -2
- package/dist/legacy/index.cjs +1 -1
- package/dist/legacy/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/JsSipAdapter-915kI1VH.cjs +0 -1
|
@@ -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
|
|
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
|
|
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:
|
|
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:
|
|
92
|
+
register_expires: a(t)
|
|
93
93
|
});
|
|
94
|
-
return this.ua = e, this.registerExpiresSeconds =
|
|
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: {
|
|
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: {
|
|
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
|
|
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 (!
|
|
154
|
+
if (!c(e)) return;
|
|
149
155
|
let t = e.session;
|
|
150
156
|
if (t === void 0) return;
|
|
151
|
-
let n = new
|
|
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:" &&
|
|
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
|
-
},
|
|
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 ??
|
|
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
|
|
320
|
+
function c(e) {
|
|
315
321
|
if (typeof e != "object" || !e) return !1;
|
|
316
322
|
let t = e;
|
|
317
|
-
return t.originator === "remote" &&
|
|
323
|
+
return t.originator === "remote" && l(t.session);
|
|
318
324
|
}
|
|
319
|
-
function
|
|
325
|
+
function l(e) {
|
|
320
326
|
return typeof e == "object" && !!e && "id" in e;
|
|
321
327
|
}
|
|
322
|
-
function
|
|
328
|
+
function u(e) {
|
|
323
329
|
return typeof e == "object" && e && (e.via_transport = "WSS"), e;
|
|
324
330
|
}
|
|
325
|
-
function
|
|
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
|
|
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 {
|
|
343
|
+
export { o as JsSipAdapter };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
-
import { n as m, r as h, t as g } from "./Diagnostics-
|
|
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
|