sip-connector 18.0.0 → 19.0.1
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/README.md +123 -29
- package/dist/{@SipConnector-UTHCoMXw.js → @SipConnector-DC8z6npa.js} +835 -473
- package/dist/@SipConnector-eNxG0NqG.cjs +1 -0
- package/dist/AutoConnectorManager/@AutoConnectorManager.d.ts +41 -0
- package/dist/AutoConnectorManager/AttemptsState.d.ts +21 -0
- package/dist/AutoConnectorManager/CheckTelephonyRequester.d.ts +19 -0
- package/dist/AutoConnectorManager/PingServerIfNotActiveCallRequester.d.ts +18 -0
- package/dist/AutoConnectorManager/PingServerRequester.d.ts +13 -0
- package/dist/AutoConnectorManager/RegistrationFailedOutOfCallSubscriber.d.ts +18 -0
- package/dist/AutoConnectorManager/eventNames.d.ts +18 -0
- package/dist/AutoConnectorManager/index.d.ts +3 -0
- package/dist/AutoConnectorManager/types.d.ts +22 -0
- package/dist/AutoConnectorManager/utils/errors.d.ts +2 -0
- package/dist/AutoConnectorManager/utils/index.d.ts +1 -0
- package/dist/CallManager/@CallManager.d.ts +3 -0
- package/dist/CallManager/eventNames.d.ts +6 -2
- package/dist/ConnectionManager/@ConnectionManager.d.ts +11 -1
- package/dist/ConnectionManager/eventNames.d.ts +6 -2
- package/dist/ConnectionManager/index.d.ts +1 -0
- package/dist/ConnectionManager/utils/errors.d.ts +2 -0
- package/dist/ConnectionManager/utils/index.d.ts +2 -0
- package/dist/ConnectionManager/utils/resolveParameters.d.ts +2 -0
- package/dist/ConnectionQueueManager/@ConnectionQueueManager.d.ts +1 -7
- package/dist/ConnectionQueueManager/index.d.ts +1 -0
- package/dist/SipConnector/@SipConnector.d.ts +8 -4
- package/dist/SipConnector/eventNames.d.ts +1 -1
- package/dist/SipConnectorFacade/@SipConnectorFacade.d.ts +16 -10
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +227 -213
- package/package.json +10 -10
- package/dist/@SipConnector-CFYT0HQB.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import "events-constructor";
|
|
2
|
-
import { E as
|
|
3
|
-
import {
|
|
4
|
-
import { isCanceledError as
|
|
5
|
-
import { hasCanceledError as
|
|
6
|
-
import { debounce as
|
|
7
|
-
import { UAParser as
|
|
8
|
-
import { sequentPromises as
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { E as p, l as o, p as j, s as K, a as X, r as Y, h as G } from "./@SipConnector-DC8z6npa.js";
|
|
3
|
+
import { f as Le, b as Ve, S as Be, g as $e, j as He, d as We, e as je, i as Ke, c as Xe } from "./@SipConnector-DC8z6npa.js";
|
|
4
|
+
import { isCanceledError as V } from "@krivega/cancelable-promise";
|
|
5
|
+
import { hasCanceledError as q } from "repeated-calls";
|
|
6
|
+
import { debounce as z } from "ts-debounce";
|
|
7
|
+
import { UAParser as J } from "ua-parser-js";
|
|
8
|
+
import { sequentPromises as Q } from "sequent-promises";
|
|
9
|
+
import { isPromiseIsNotActualError as Ge } from "stack-promises";
|
|
10
|
+
import "@krivega/timeout-requester";
|
|
11
|
+
const Z = (n) => n instanceof Object && ("originator" in n || "cause" in n), Fe = (n) => {
|
|
12
|
+
if (V(n))
|
|
11
13
|
return !0;
|
|
12
|
-
if (!
|
|
14
|
+
if (!Z(n))
|
|
13
15
|
return !1;
|
|
14
16
|
const { originator: e, cause: t } = n;
|
|
15
|
-
return typeof t == "string" ? t ===
|
|
16
|
-
},
|
|
17
|
-
const n = new
|
|
17
|
+
return typeof t == "string" ? t === p.REQUEST_TIMEOUT || t === p.REJECTED || e === "local" && (t === p.CANCELED || t === p.BYE) : !1;
|
|
18
|
+
}, ee = () => globalThis.process?.versions?.electron !== void 0, B = () => {
|
|
19
|
+
const n = new J(), { name: e } = n.getBrowser(), t = ee();
|
|
18
20
|
return {
|
|
19
21
|
isChrome: e === "Chrome" || t
|
|
20
22
|
};
|
|
21
23
|
}, D = (n) => {
|
|
22
24
|
const { url: e, cause: t } = n;
|
|
23
25
|
let r = e;
|
|
24
|
-
return (t ===
|
|
26
|
+
return (t === p.BAD_MEDIA_DESCRIPTION || t === p.NOT_FOUND) && (r = `${n.message.to.uri.user}@${n.message.to.uri.host}`), r;
|
|
25
27
|
};
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
+
var $ = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))($ || {});
|
|
29
|
+
const ne = new Error("Unknown error"), te = (n = ne) => {
|
|
28
30
|
const { cause: e, socket: t } = n;
|
|
29
31
|
let r = "CONNECT_SERVER_FAILED";
|
|
30
32
|
switch (e) {
|
|
@@ -32,11 +34,11 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
32
34
|
r = "WRONG_USER_OR_PASSWORD";
|
|
33
35
|
break;
|
|
34
36
|
}
|
|
35
|
-
case
|
|
37
|
+
case p.BAD_MEDIA_DESCRIPTION: {
|
|
36
38
|
r = "BAD_MEDIA_ERROR";
|
|
37
39
|
break;
|
|
38
40
|
}
|
|
39
|
-
case
|
|
41
|
+
case p.NOT_FOUND: {
|
|
40
42
|
r = "NOT_FOUND_ERROR";
|
|
41
43
|
break;
|
|
42
44
|
}
|
|
@@ -44,7 +46,7 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
44
46
|
t !== void 0 && t._ws?.readyState === 3 ? r = "WS_CONNECTION_FAILED" : D(n) !== void 0 && D(n) !== "" && (r = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
45
47
|
}
|
|
46
48
|
return r;
|
|
47
|
-
},
|
|
49
|
+
}, oe = (n) => {
|
|
48
50
|
let e = "";
|
|
49
51
|
try {
|
|
50
52
|
e = JSON.stringify(n);
|
|
@@ -52,117 +54,117 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
52
54
|
o("failed to stringify message", t);
|
|
53
55
|
}
|
|
54
56
|
return e;
|
|
55
|
-
},
|
|
56
|
-
const { code: e, cause: t, message: r } = n,
|
|
57
|
-
return typeof r == "object" && r !== null ?
|
|
58
|
-
},
|
|
57
|
+
}, re = new Error("Unknown error"), se = (n = re) => {
|
|
58
|
+
const { code: e, cause: t, message: r } = n, s = D(n), a = { code: "", cause: "", message: "" };
|
|
59
|
+
return typeof r == "object" && r !== null ? a.message = oe(r) : r && (a.message = String(r)), s !== void 0 && s !== "" && (a.link = s), e !== void 0 && e !== "" && (a.code = e), t !== void 0 && t !== "" && (a.cause = t), a;
|
|
60
|
+
}, ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
59
61
|
__proto__: null,
|
|
60
|
-
EErrorTypes:
|
|
62
|
+
EErrorTypes: $,
|
|
61
63
|
getLinkError: D,
|
|
62
|
-
getTypeFromError:
|
|
63
|
-
getValuesFromError:
|
|
64
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
64
|
+
getTypeFromError: te,
|
|
65
|
+
getValuesFromError: se
|
|
66
|
+
}, Symbol.toStringTag, { value: "Module" })), ce = ({
|
|
65
67
|
sessionId: n,
|
|
66
68
|
remoteAddress: e,
|
|
67
69
|
isMutedAudio: t,
|
|
68
70
|
isMutedVideo: r,
|
|
69
|
-
isRegistered:
|
|
70
|
-
isPresentationCall:
|
|
71
|
+
isRegistered: s,
|
|
72
|
+
isPresentationCall: a
|
|
71
73
|
}) => {
|
|
72
74
|
const c = [], u = t ? "0" : "1", l = r ? "0" : "1";
|
|
73
|
-
return c.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${l}`), (
|
|
74
|
-
},
|
|
75
|
+
return c.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${l}`), (s === !1 || s === void 0) && c.push("X-Vinteo-Purgatory-Call: yes"), n !== void 0 && n !== "" && c.push(`X-Vinteo-Session: ${n}`), a === !0 && c.push("X-Vinteo-Presentation-Call: yes"), e !== void 0 && e !== "" && c.push(`X-Vinteo-Remote: ${e}`), c;
|
|
76
|
+
}, ie = "[@*!|]", ue = "_", le = (n) => {
|
|
75
77
|
let e = n;
|
|
76
|
-
return e = e.replaceAll(new RegExp(
|
|
77
|
-
},
|
|
78
|
+
return e = e.replaceAll(new RegExp(ie, "g"), ue), e;
|
|
79
|
+
}, de = ({
|
|
78
80
|
appName: n,
|
|
79
81
|
appVersion: e,
|
|
80
82
|
browserName: t,
|
|
81
83
|
browserVersion: r
|
|
82
84
|
}) => {
|
|
83
|
-
const
|
|
84
|
-
return `ChromeNew - ${t === void 0 ?
|
|
85
|
-
},
|
|
85
|
+
const a = `${le(n)} ${e}`;
|
|
86
|
+
return `ChromeNew - ${t === void 0 ? a : `${t} ${r}, ${a}`}`;
|
|
87
|
+
}, me = ({
|
|
86
88
|
isUnifiedSdpSemantic: n,
|
|
87
89
|
appVersion: e,
|
|
88
90
|
browserName: t,
|
|
89
91
|
browserVersion: r,
|
|
90
|
-
appName:
|
|
91
|
-
}) => n ?
|
|
92
|
+
appName: s
|
|
93
|
+
}) => n ? de({ appVersion: e, browserName: t, browserVersion: r, appName: s }) : "Chrome", H = "purgatory", F = (n) => n === H, Se = (n) => (e) => [...e].map((r) => async () => n(r)), fe = async ({
|
|
92
94
|
accumulatedKeys: n,
|
|
93
95
|
sendKey: e,
|
|
94
96
|
canRunTask: t
|
|
95
97
|
}) => {
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
},
|
|
99
|
-
const e = (
|
|
100
|
-
if (
|
|
101
|
-
|
|
98
|
+
const s = Se(e)(n);
|
|
99
|
+
return Q(s, t);
|
|
100
|
+
}, Ce = (n) => (t) => (o("onStartMainCam"), n.on("api:admin-start-main-cam", t)), pe = (n) => (t) => (o("onStartMic"), n.on("api:admin-start-mic", t)), he = (n) => (t) => (o("onStopMainCam"), n.on("api:admin-stop-main-cam", t)), Re = (n) => (t) => (o("onStopMic"), n.on("api:admin-stop-mic", t)), Ee = ({ sipConnector: n }) => {
|
|
101
|
+
const e = (d, S) => ({ isSyncForced: m }) => {
|
|
102
|
+
if (m === !0) {
|
|
103
|
+
d();
|
|
102
104
|
return;
|
|
103
105
|
}
|
|
104
|
-
|
|
105
|
-
}, t =
|
|
106
|
-
let c, u, l,
|
|
107
|
-
const
|
|
108
|
-
onStartMainCamForced:
|
|
109
|
-
onStartMainCamNotForced:
|
|
110
|
-
onStopMainCamForced:
|
|
111
|
-
onStopMainCamNotForced:
|
|
112
|
-
onStartMicForced:
|
|
113
|
-
onStartMicNotForced:
|
|
114
|
-
onStopMicForced:
|
|
106
|
+
S();
|
|
107
|
+
}, t = Ce(n), r = he(n), s = pe(n), a = Re(n);
|
|
108
|
+
let c, u, l, C;
|
|
109
|
+
const h = ({
|
|
110
|
+
onStartMainCamForced: d,
|
|
111
|
+
onStartMainCamNotForced: S,
|
|
112
|
+
onStopMainCamForced: m,
|
|
113
|
+
onStopMainCamNotForced: E,
|
|
114
|
+
onStartMicForced: v,
|
|
115
|
+
onStartMicNotForced: y,
|
|
116
|
+
onStopMicForced: O,
|
|
115
117
|
onStopMicNotForced: T
|
|
116
118
|
}) => {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
const P = e(
|
|
120
|
+
d,
|
|
121
|
+
S
|
|
120
122
|
);
|
|
121
|
-
c = t(
|
|
123
|
+
c = t(P);
|
|
122
124
|
const M = e(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
m,
|
|
126
|
+
E
|
|
125
127
|
);
|
|
126
128
|
u = r(M);
|
|
127
|
-
const
|
|
128
|
-
l =
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
c?.(), u?.(), l?.(),
|
|
129
|
+
const N = e(v, y);
|
|
130
|
+
l = s(N);
|
|
131
|
+
const f = e(O, T);
|
|
132
|
+
C = a(f);
|
|
133
|
+
}, R = () => {
|
|
134
|
+
c?.(), u?.(), l?.(), C?.();
|
|
133
135
|
};
|
|
134
136
|
return {
|
|
135
|
-
start: (
|
|
136
|
-
|
|
137
|
+
start: (d) => {
|
|
138
|
+
h(d);
|
|
137
139
|
},
|
|
138
140
|
stop: () => {
|
|
139
|
-
|
|
141
|
+
R();
|
|
140
142
|
}
|
|
141
143
|
};
|
|
142
|
-
},
|
|
144
|
+
}, we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
143
145
|
__proto__: null,
|
|
144
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
145
|
-
createSyncMediaState:
|
|
146
|
-
createUaParser:
|
|
147
|
-
error:
|
|
148
|
-
getExtraHeaders:
|
|
149
|
-
getUserAgent:
|
|
146
|
+
PURGATORY_CONFERENCE_NUMBER: H,
|
|
147
|
+
createSyncMediaState: Ee,
|
|
148
|
+
createUaParser: B,
|
|
149
|
+
error: ae,
|
|
150
|
+
getExtraHeaders: ce,
|
|
151
|
+
getUserAgent: me,
|
|
150
152
|
hasPurgatory: F,
|
|
151
|
-
prepareMediaStream:
|
|
152
|
-
sendDtmfAccumulated:
|
|
153
|
-
setEncodingsToSender:
|
|
154
|
-
setParametersToSender:
|
|
155
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
156
|
-
if (!
|
|
153
|
+
prepareMediaStream: j,
|
|
154
|
+
sendDtmfAccumulated: fe,
|
|
155
|
+
setEncodingsToSender: K,
|
|
156
|
+
setParametersToSender: X
|
|
157
|
+
}, Symbol.toStringTag, { value: "Module" })), Ie = () => B().isChrome, ge = (n) => {
|
|
158
|
+
if (!V(n) && !q(n) && !G(n))
|
|
157
159
|
throw n;
|
|
158
160
|
return { isSuccessful: !1 };
|
|
159
|
-
},
|
|
161
|
+
}, be = ({ kind: n, readyState: e }) => n === "video" && e === "live", k = (n, e, { onEnterPurgatory: t, onEnterConference: r }) => {
|
|
160
162
|
F(n) ? t && t() : r && r({ isSuccessProgressCall: e });
|
|
161
|
-
},
|
|
163
|
+
}, x = (n, e) => {
|
|
162
164
|
n(), e && e();
|
|
163
|
-
},
|
|
165
|
+
}, L = (n, e, t) => {
|
|
164
166
|
throw n && n(), e(), t;
|
|
165
|
-
},
|
|
167
|
+
}, ve = /* @__PURE__ */ new Set([
|
|
166
168
|
"on",
|
|
167
169
|
"once",
|
|
168
170
|
"onceRace",
|
|
@@ -175,11 +177,13 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
175
177
|
"checkTelephony",
|
|
176
178
|
"waitChannels",
|
|
177
179
|
"ping",
|
|
180
|
+
"startAutoConnect",
|
|
181
|
+
"stopAutoConnect",
|
|
178
182
|
"connection",
|
|
179
183
|
"isConfigured",
|
|
180
184
|
"isRegistered"
|
|
181
185
|
]);
|
|
182
|
-
class
|
|
186
|
+
class Ue {
|
|
183
187
|
// @ts-expect-error: proxy method
|
|
184
188
|
on;
|
|
185
189
|
// @ts-expect-error: proxy method
|
|
@@ -204,6 +208,10 @@ class Fe {
|
|
|
204
208
|
waitChannels;
|
|
205
209
|
// @ts-expect-error: proxy method
|
|
206
210
|
ping;
|
|
211
|
+
// @ts-expect-error: proxy method
|
|
212
|
+
startAutoConnect;
|
|
213
|
+
// @ts-expect-error: proxy method
|
|
214
|
+
stopAutoConnect;
|
|
207
215
|
// proxy method
|
|
208
216
|
connection;
|
|
209
217
|
// @ts-expect-error: proxy method
|
|
@@ -213,122 +221,126 @@ class Fe {
|
|
|
213
221
|
sipConnector;
|
|
214
222
|
constructor(e) {
|
|
215
223
|
return this.sipConnector = e, new Proxy(this, {
|
|
216
|
-
get: (t, r,
|
|
217
|
-
if (typeof r == "string" &&
|
|
224
|
+
get: (t, r, s) => {
|
|
225
|
+
if (typeof r == "string" && ve.has(r) && r in this.sipConnector) {
|
|
218
226
|
const c = Reflect.get(this.sipConnector, r, this.sipConnector);
|
|
219
227
|
return typeof c == "function" ? c.bind(this.sipConnector) : c;
|
|
220
228
|
}
|
|
221
|
-
const
|
|
222
|
-
return typeof
|
|
229
|
+
const a = Reflect.get(t, r, s);
|
|
230
|
+
return typeof a == "function" ? a.bind(t) : a;
|
|
223
231
|
}
|
|
224
232
|
});
|
|
225
233
|
}
|
|
226
|
-
connectToServer = async (e) => {
|
|
227
|
-
const {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
234
|
+
connectToServer = async (e, t) => {
|
|
235
|
+
const r = async () => {
|
|
236
|
+
const s = await Y(e);
|
|
237
|
+
o("connectToServer", s);
|
|
238
|
+
const {
|
|
239
|
+
userAgent: a,
|
|
240
|
+
sipWebSocketServerURL: c,
|
|
241
|
+
sipServerUrl: u,
|
|
242
|
+
remoteAddress: l,
|
|
243
|
+
displayName: C,
|
|
244
|
+
name: h,
|
|
245
|
+
password: R,
|
|
246
|
+
isRegisteredUser: b
|
|
247
|
+
} = s;
|
|
248
|
+
return {
|
|
249
|
+
userAgent: a,
|
|
250
|
+
sipWebSocketServerURL: c,
|
|
251
|
+
sipServerUrl: u,
|
|
252
|
+
remoteAddress: l,
|
|
253
|
+
displayName: C,
|
|
254
|
+
password: R,
|
|
255
|
+
user: h,
|
|
256
|
+
register: b
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
return this.sipConnector.connect(r, t).then((s) => (o("connectToServer then"), { ua: s, isSuccessful: !0 })).catch(async (s) => (o("connectToServer catch: error", s), ge(s)));
|
|
248
260
|
};
|
|
249
261
|
callToServer = async (e) => {
|
|
250
262
|
const {
|
|
251
263
|
conference: t,
|
|
252
264
|
mediaStream: r,
|
|
253
|
-
extraHeaders:
|
|
254
|
-
iceServers:
|
|
265
|
+
extraHeaders: s,
|
|
266
|
+
iceServers: a,
|
|
255
267
|
contentHint: c,
|
|
256
268
|
degradationPreference: u,
|
|
257
269
|
sendEncodings: l,
|
|
258
|
-
offerToReceiveAudio:
|
|
259
|
-
offerToReceiveVideo:
|
|
260
|
-
directionVideo:
|
|
261
|
-
directionAudio:
|
|
262
|
-
setRemoteStreams:
|
|
263
|
-
onBeforeProgressCall:
|
|
264
|
-
onSuccessProgressCall:
|
|
265
|
-
onEnterPurgatory:
|
|
266
|
-
onEnterConference:
|
|
267
|
-
onFailProgressCall:
|
|
268
|
-
onFinishProgressCall:
|
|
269
|
-
onEndedCall:
|
|
270
|
+
offerToReceiveAudio: C,
|
|
271
|
+
offerToReceiveVideo: h,
|
|
272
|
+
directionVideo: R,
|
|
273
|
+
directionAudio: b,
|
|
274
|
+
setRemoteStreams: _,
|
|
275
|
+
onBeforeProgressCall: d,
|
|
276
|
+
onSuccessProgressCall: S,
|
|
277
|
+
onEnterPurgatory: m,
|
|
278
|
+
onEnterConference: E,
|
|
279
|
+
onFailProgressCall: v,
|
|
280
|
+
onFinishProgressCall: y,
|
|
281
|
+
onEndedCall: O,
|
|
270
282
|
onAddedTransceiver: T
|
|
271
|
-
} = e,
|
|
272
|
-
onReadyRemoteStreams:
|
|
283
|
+
} = e, P = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
284
|
+
onReadyRemoteStreams: _
|
|
273
285
|
}), M = this.resolveHandleReadyRemoteStreams({
|
|
274
286
|
onReadyRemoteStreams: () => {
|
|
275
|
-
|
|
287
|
+
P().catch(o);
|
|
276
288
|
}
|
|
277
289
|
});
|
|
278
290
|
o("callToServer", e);
|
|
279
|
-
const
|
|
291
|
+
const N = async () => (o("startCall"), this.sipConnector.call({
|
|
280
292
|
mediaStream: r,
|
|
281
|
-
extraHeaders:
|
|
282
|
-
iceServers:
|
|
293
|
+
extraHeaders: s,
|
|
294
|
+
iceServers: a,
|
|
283
295
|
contentHint: c,
|
|
284
|
-
offerToReceiveAudio:
|
|
285
|
-
offerToReceiveVideo:
|
|
286
|
-
directionVideo:
|
|
287
|
-
directionAudio:
|
|
296
|
+
offerToReceiveAudio: C,
|
|
297
|
+
offerToReceiveVideo: h,
|
|
298
|
+
directionVideo: R,
|
|
299
|
+
directionAudio: b,
|
|
288
300
|
degradationPreference: u,
|
|
289
301
|
onAddedTransceiver: T,
|
|
290
302
|
sendEncodings: l,
|
|
291
303
|
number: t,
|
|
292
304
|
ontrack: M
|
|
293
305
|
}));
|
|
294
|
-
let
|
|
295
|
-
const
|
|
296
|
-
o("enterRoom", { _room: i, isSuccessProgressCall:
|
|
297
|
-
onEnterPurgatory:
|
|
298
|
-
onEnterConference:
|
|
306
|
+
let f = !1, g;
|
|
307
|
+
const A = (o("subscribeEnterConference: onEnterConference", E), this.sipConnector.on("api:enterRoom", ({ room: i }) => {
|
|
308
|
+
o("enterRoom", { _room: i, isSuccessProgressCall: f }), g = i, (m ?? E) && k(g, f, {
|
|
309
|
+
onEnterPurgatory: m,
|
|
310
|
+
onEnterConference: E
|
|
299
311
|
});
|
|
300
|
-
})), w = (i) => (o("onSuccess"),
|
|
301
|
-
|
|
302
|
-
}), i), I = (i) => (o("onFail"),
|
|
303
|
-
o("onFinish"),
|
|
312
|
+
})), w = (i) => (o("onSuccess"), f = !0, P().catch(o), S && S({ isPurgatory: F(g) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
|
|
313
|
+
x(A, O);
|
|
314
|
+
}), i), I = (i) => (o("onFail"), L(v, A, i)), U = () => {
|
|
315
|
+
o("onFinish"), y && y();
|
|
304
316
|
};
|
|
305
|
-
return o("onBeforeProgressCall"),
|
|
317
|
+
return o("onBeforeProgressCall"), d && d(t), N().then(w).catch((i) => I(i)).finally(U);
|
|
306
318
|
};
|
|
307
319
|
disconnectFromServer = async () => this.sipConnector.disconnect().then(() => (o("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (o("disconnectFromServer: catch", e), { isSuccessful: !1 }));
|
|
308
320
|
answerToIncomingCall = async (e) => {
|
|
309
321
|
const {
|
|
310
322
|
mediaStream: t,
|
|
311
323
|
extraHeaders: r,
|
|
312
|
-
iceServers:
|
|
313
|
-
contentHint:
|
|
324
|
+
iceServers: s,
|
|
325
|
+
contentHint: a,
|
|
314
326
|
degradationPreference: c,
|
|
315
327
|
sendEncodings: u,
|
|
316
328
|
offerToReceiveAudio: l,
|
|
317
|
-
offerToReceiveVideo:
|
|
318
|
-
directionVideo:
|
|
319
|
-
directionAudio:
|
|
320
|
-
setRemoteStreams:
|
|
321
|
-
onBeforeProgressCall:
|
|
322
|
-
onSuccessProgressCall:
|
|
323
|
-
onEnterPurgatory:
|
|
324
|
-
onEnterConference:
|
|
325
|
-
onFailProgressCall:
|
|
326
|
-
onFinishProgressCall:
|
|
327
|
-
onEndedCall:
|
|
328
|
-
onAddedTransceiver:
|
|
329
|
+
offerToReceiveVideo: C,
|
|
330
|
+
directionVideo: h,
|
|
331
|
+
directionAudio: R,
|
|
332
|
+
setRemoteStreams: b,
|
|
333
|
+
onBeforeProgressCall: _,
|
|
334
|
+
onSuccessProgressCall: d,
|
|
335
|
+
onEnterPurgatory: S,
|
|
336
|
+
onEnterConference: m,
|
|
337
|
+
onFailProgressCall: E,
|
|
338
|
+
onFinishProgressCall: v,
|
|
339
|
+
onEndedCall: y,
|
|
340
|
+
onAddedTransceiver: O
|
|
329
341
|
} = e, T = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
330
|
-
onReadyRemoteStreams:
|
|
331
|
-
}),
|
|
342
|
+
onReadyRemoteStreams: b
|
|
343
|
+
}), P = this.resolveHandleReadyRemoteStreams({
|
|
332
344
|
onReadyRemoteStreams: () => {
|
|
333
345
|
T().catch(o);
|
|
334
346
|
}
|
|
@@ -337,34 +349,34 @@ class Fe {
|
|
|
337
349
|
const M = async () => this.sipConnector.answerToIncomingCall({
|
|
338
350
|
mediaStream: t,
|
|
339
351
|
extraHeaders: r,
|
|
340
|
-
iceServers:
|
|
341
|
-
contentHint:
|
|
352
|
+
iceServers: s,
|
|
353
|
+
contentHint: a,
|
|
342
354
|
offerToReceiveAudio: l,
|
|
343
|
-
offerToReceiveVideo:
|
|
344
|
-
directionVideo:
|
|
345
|
-
directionAudio:
|
|
355
|
+
offerToReceiveVideo: C,
|
|
356
|
+
directionVideo: h,
|
|
357
|
+
directionAudio: R,
|
|
346
358
|
degradationPreference: c,
|
|
347
|
-
onAddedTransceiver:
|
|
359
|
+
onAddedTransceiver: O,
|
|
348
360
|
sendEncodings: u,
|
|
349
|
-
ontrack:
|
|
350
|
-
}),
|
|
361
|
+
ontrack: P
|
|
362
|
+
}), N = () => {
|
|
351
363
|
const { remoteCallerData: i } = this.sipConnector;
|
|
352
364
|
return i.incomingNumber;
|
|
353
365
|
};
|
|
354
|
-
let
|
|
355
|
-
const
|
|
356
|
-
o("enterRoom", { _room: i, isSuccessProgressCall:
|
|
357
|
-
onEnterPurgatory:
|
|
358
|
-
onEnterConference:
|
|
366
|
+
let f = !1, g;
|
|
367
|
+
const A = (o("subscribeEnterConference: onEnterConference", m), this.sipConnector.on("api:enterRoom", (i) => {
|
|
368
|
+
o("enterRoom", { _room: i, isSuccessProgressCall: f }), g = i, (S ?? m) && k(g, f, {
|
|
369
|
+
onEnterPurgatory: S,
|
|
370
|
+
onEnterConference: m
|
|
359
371
|
});
|
|
360
|
-
})), w = (i) => (o("onSuccess"),
|
|
361
|
-
|
|
362
|
-
}), i), I = (i) => (o("onFail"),
|
|
363
|
-
o("onFinish"),
|
|
372
|
+
})), w = (i) => (o("onSuccess"), f = !0, T().catch(o), d && d({ isPurgatory: F(g) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
|
|
373
|
+
x(A, y);
|
|
374
|
+
}), i), I = (i) => (o("onFail"), L(E, A, i)), U = () => {
|
|
375
|
+
o("onFinish"), v && v();
|
|
364
376
|
};
|
|
365
|
-
if (o("onBeforeProgressCall"),
|
|
366
|
-
const i =
|
|
367
|
-
|
|
377
|
+
if (o("onBeforeProgressCall"), _) {
|
|
378
|
+
const i = N();
|
|
379
|
+
_(i);
|
|
368
380
|
}
|
|
369
381
|
return M().then(w).catch((i) => I(i)).finally(U);
|
|
370
382
|
};
|
|
@@ -372,31 +384,31 @@ class Fe {
|
|
|
372
384
|
mediaStream: e,
|
|
373
385
|
isP2P: t,
|
|
374
386
|
contentHint: r,
|
|
375
|
-
degradationPreference:
|
|
376
|
-
sendEncodings:
|
|
387
|
+
degradationPreference: s,
|
|
388
|
+
sendEncodings: a,
|
|
377
389
|
onAddedTransceiver: c
|
|
378
390
|
}) => (o("updatePresentation"), this.sipConnector.updatePresentation(e, {
|
|
379
391
|
isP2P: t,
|
|
380
392
|
contentHint: r,
|
|
381
|
-
degradationPreference:
|
|
393
|
+
degradationPreference: s,
|
|
382
394
|
onAddedTransceiver: c,
|
|
383
|
-
sendEncodings:
|
|
395
|
+
sendEncodings: a
|
|
384
396
|
}));
|
|
385
397
|
startPresentation = async ({
|
|
386
398
|
mediaStream: e,
|
|
387
399
|
isP2P: t,
|
|
388
400
|
contentHint: r,
|
|
389
|
-
degradationPreference:
|
|
390
|
-
sendEncodings:
|
|
401
|
+
degradationPreference: s,
|
|
402
|
+
sendEncodings: a,
|
|
391
403
|
callLimit: c,
|
|
392
404
|
onAddedTransceiver: u
|
|
393
405
|
}) => (o("startPresentation"), this.sipConnector.startPresentation(e, {
|
|
394
406
|
isP2P: t,
|
|
395
407
|
contentHint: r,
|
|
396
408
|
callLimit: c,
|
|
397
|
-
degradationPreference:
|
|
409
|
+
degradationPreference: s,
|
|
398
410
|
onAddedTransceiver: u,
|
|
399
|
-
sendEncodings:
|
|
411
|
+
sendEncodings: a
|
|
400
412
|
}));
|
|
401
413
|
stopShareSipConnector = async ({ isP2P: e = !1 } = {}) => (o("stopShareSipConnector"), this.sipConnector.stopPresentation({
|
|
402
414
|
isP2P: e
|
|
@@ -422,16 +434,16 @@ class Fe {
|
|
|
422
434
|
replaceMediaStream = async (e, {
|
|
423
435
|
deleteExisting: t,
|
|
424
436
|
addMissing: r,
|
|
425
|
-
forceRenegotiation:
|
|
426
|
-
contentHint:
|
|
437
|
+
forceRenegotiation: s,
|
|
438
|
+
contentHint: a,
|
|
427
439
|
degradationPreference: c,
|
|
428
440
|
sendEncodings: u,
|
|
429
441
|
onAddedTransceiver: l
|
|
430
442
|
}) => (o("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
|
|
431
443
|
deleteExisting: t,
|
|
432
444
|
addMissing: r,
|
|
433
|
-
forceRenegotiation:
|
|
434
|
-
contentHint:
|
|
445
|
+
forceRenegotiation: s,
|
|
446
|
+
contentHint: a,
|
|
435
447
|
degradationPreference: c,
|
|
436
448
|
onAddedTransceiver: l,
|
|
437
449
|
sendEncodings: u
|
|
@@ -441,7 +453,7 @@ class Fe {
|
|
|
441
453
|
};
|
|
442
454
|
resolveHandleReadyRemoteStreamsDebounced = ({
|
|
443
455
|
onReadyRemoteStreams: e
|
|
444
|
-
}) =>
|
|
456
|
+
}) => z(() => {
|
|
445
457
|
const t = this.sipConnector.getRemoteStreams();
|
|
446
458
|
o("remoteStreams", t), t && e(t);
|
|
447
459
|
}, 200);
|
|
@@ -449,7 +461,7 @@ class Fe {
|
|
|
449
461
|
resolveHandleReadyRemoteStreams = ({
|
|
450
462
|
onReadyRemoteStreams: e
|
|
451
463
|
}) => ({ track: t }) => {
|
|
452
|
-
|
|
464
|
+
be(t) && e();
|
|
453
465
|
};
|
|
454
466
|
getRemoteStreams = () => (o("getRemoteStreams"), this.sipConnector.getRemoteStreams());
|
|
455
467
|
onUseLicense = (e) => (o("onUseLicense"), this.sipConnector.on("api:useLicense", e));
|
|
@@ -461,20 +473,22 @@ class Fe {
|
|
|
461
473
|
o("offStats"), this.sipConnector.off("stats:collected", e);
|
|
462
474
|
};
|
|
463
475
|
}
|
|
464
|
-
var
|
|
476
|
+
var ye = /* @__PURE__ */ ((n) => (n.VP8 = "video/VP8", n.VP9 = "video/VP9", n.H264 = "video/H264", n.AV1 = "video/AV1", n.rtx = "video/rtx", n.red = "video/red", n.flexfec03 = "video/flexfec-03", n))(ye || {});
|
|
465
477
|
export {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
478
|
+
p as ECallCause,
|
|
479
|
+
ye as EMimeTypesVideoCodecs,
|
|
480
|
+
Le as EStatsTypes,
|
|
481
|
+
Ve as EUseLicense,
|
|
482
|
+
Be as SipConnector,
|
|
483
|
+
Ue as SipConnectorFacade,
|
|
484
|
+
$e as StatsPeerConnection,
|
|
485
|
+
He as createParametersNotExistError,
|
|
486
|
+
We as disableDebug,
|
|
487
|
+
je as enableDebug,
|
|
488
|
+
Ke as getCodecFromSender,
|
|
489
|
+
Ie as hasAvailableStats,
|
|
490
|
+
Fe as hasCanceledCallError,
|
|
491
|
+
Xe as hasCanceledStartPresentationError,
|
|
492
|
+
Ge as hasConnectionPromiseIsNotActualError,
|
|
493
|
+
we as tools
|
|
480
494
|
};
|