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