sip-connector 20.4.1 → 20.6.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/README.md +18 -1264
- package/dist/@SipConnector-BVCkiu8l.cjs +1 -0
- package/dist/{@SipConnector-FYEV5h4G.js → @SipConnector-nmoTV9l_.js} +758 -719
- package/dist/ApiManager/events.d.ts +0 -1
- package/dist/ApiManager/index.d.ts +2 -2
- package/dist/AutoConnectorManager/index.d.ts +2 -1
- package/dist/CallManager/CallStateMachine.d.ts +0 -7
- package/dist/CallManager/events.d.ts +3 -3
- package/dist/CallManager/index.d.ts +2 -2
- package/dist/ConferenceStateManager/events.d.ts +0 -1
- package/dist/ConferenceStateManager/index.d.ts +2 -3
- package/dist/ConnectionManager/ConnectionStateMachine.d.ts +20 -17
- package/dist/ConnectionManager/events.d.ts +0 -1
- package/dist/ConnectionManager/index.d.ts +1 -1
- package/dist/IncomingCallManager/@IncomingCallManager.d.ts +1 -1
- package/dist/IncomingCallManager/events.d.ts +3 -4
- package/dist/IncomingCallManager/index.d.ts +2 -2
- package/dist/MainStreamHealthMonitor/index.d.ts +2 -0
- package/dist/PresentationManager/events.d.ts +0 -1
- package/dist/PresentationManager/index.d.ts +2 -1
- package/dist/SessionManager/@SessionManager.d.ts +30 -0
- package/dist/SessionManager/events.d.ts +14 -0
- package/dist/SessionManager/index.d.ts +6 -0
- package/dist/{session → SessionManager}/selectors.d.ts +2 -1
- package/dist/SessionManager/types.d.ts +40 -0
- package/dist/SipConnector/@SipConnector.d.ts +5 -4
- package/dist/SipConnector/events.d.ts +15 -13
- package/dist/SipConnector/index.d.ts +1 -1
- package/dist/SipConnectorFacade/@SipConnectorFacade.d.ts +3 -3
- package/dist/StatsManager/@StatsManager.d.ts +12 -8
- package/dist/StatsManager/constants.d.ts +1 -0
- package/dist/StatsManager/events.d.ts +2 -2
- package/dist/StatsManager/index.d.ts +2 -1
- package/dist/StatsPeerConnection/index.d.ts +2 -2
- package/dist/VideoSendingBalancerManager/events.d.ts +0 -1
- package/dist/VideoSendingBalancerManager/index.d.ts +2 -2
- package/dist/__fixtures__/eventNames.d.ts +1 -1
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +213 -186
- package/package.json +1 -1
- package/dist/@SipConnector-DB4bLDI5.cjs +0 -1
- package/dist/session/createSession.d.ts +0 -26
- package/dist/session/index.d.ts +0 -5
- package/dist/session/types.d.ts +0 -20
package/dist/index.js
CHANGED
|
@@ -1,44 +1,70 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
import {
|
|
1
|
+
import { E as h, a as R, b as p, c as j, l as r, p as K, s as X, d as q, e as z, h as J } from "./@SipConnector-nmoTV9l_.js";
|
|
2
|
+
import { o as je, k as Ke, f as Xe, S as qe, m as ze, g as Je, i as Qe, n as Ze, j as en } from "./@SipConnector-nmoTV9l_.js";
|
|
3
3
|
import "events-constructor";
|
|
4
|
-
import { isCanceledError as
|
|
5
|
-
import { hasCanceledError as
|
|
6
|
-
import { debounce as
|
|
7
|
-
import { UAParser as
|
|
8
|
-
import { sequentPromises as
|
|
9
|
-
import { isPromiseIsNotActualError as
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
4
|
+
import { isCanceledError as B } from "@krivega/cancelable-promise";
|
|
5
|
+
import { hasCanceledError as Q } from "repeated-calls";
|
|
6
|
+
import { debounce as Z } from "ts-debounce";
|
|
7
|
+
import { UAParser as ee } from "ua-parser-js";
|
|
8
|
+
import { sequentPromises as ne } from "sequent-promises";
|
|
9
|
+
import { isPromiseIsNotActualError as tn } from "stack-promises";
|
|
10
|
+
const te = (e) => e instanceof Object && ("originator" in e || "cause" in e), Ve = (e) => {
|
|
11
|
+
if (B(e))
|
|
12
12
|
return !0;
|
|
13
|
-
if (!
|
|
13
|
+
if (!te(e))
|
|
14
14
|
return !1;
|
|
15
15
|
const { originator: n, cause: t } = e;
|
|
16
|
-
return typeof t == "string" ? t ===
|
|
17
|
-
}
|
|
18
|
-
|
|
16
|
+
return typeof t == "string" ? t === h.REQUEST_TIMEOUT || t === h.REJECTED || n === "local" && (t === h.CANCELED || t === h.BYE) : !1;
|
|
17
|
+
};
|
|
18
|
+
var f = /* @__PURE__ */ ((e) => (e.DISCONNECTED = "system:disconnected", e.CONNECTING = "system:connecting", e.READY_TO_CALL = "system:readyToCall", e.CALL_CONNECTING = "system:callConnecting", e.CALL_ACTIVE = "system:callActive", e.CONNECTION_FAILED = "system:connectionFailed", e.CALL_FAILED = "system:callFailed", e))(f || {});
|
|
19
|
+
const G = (e) => e.connection.value, k = (e) => e.call.value, oe = (e) => e.incoming.value, re = (e) => {
|
|
20
|
+
if (e.incoming.value !== j.IDLE)
|
|
19
21
|
return e.incoming.context.remoteCallerData;
|
|
20
|
-
},
|
|
21
|
-
const n =
|
|
22
|
-
return n ===
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
}, se = (e) => e.presentation.value, ae = (e) => {
|
|
23
|
+
const n = k(e);
|
|
24
|
+
return n === p.IN_CALL || n === p.ACCEPTED;
|
|
25
|
+
}, ce = (e) => {
|
|
26
|
+
const n = G(e), t = k(e);
|
|
27
|
+
if (n === R.IDLE || n === R.DISCONNECTED)
|
|
28
|
+
return f.DISCONNECTED;
|
|
29
|
+
if (n === R.FAILED)
|
|
30
|
+
return f.CONNECTION_FAILED;
|
|
31
|
+
if (n === R.PREPARING || n === R.CONNECTING || n === R.CONNECTED || n === R.REGISTERED)
|
|
32
|
+
return f.CONNECTING;
|
|
33
|
+
switch (t) {
|
|
34
|
+
case p.IDLE:
|
|
35
|
+
return f.READY_TO_CALL;
|
|
36
|
+
case p.CONNECTING:
|
|
37
|
+
return f.CALL_CONNECTING;
|
|
38
|
+
case p.ACCEPTED:
|
|
39
|
+
case p.IN_CALL:
|
|
40
|
+
return f.CALL_ACTIVE;
|
|
41
|
+
case p.ENDED:
|
|
42
|
+
return f.READY_TO_CALL;
|
|
43
|
+
case p.FAILED:
|
|
44
|
+
return f.CALL_FAILED;
|
|
45
|
+
default:
|
|
46
|
+
return f.READY_TO_CALL;
|
|
47
|
+
}
|
|
48
|
+
}, $e = {
|
|
49
|
+
selectConnectionStatus: G,
|
|
50
|
+
selectCallStatus: k,
|
|
51
|
+
selectIncomingStatus: oe,
|
|
52
|
+
selectIncomingRemoteCaller: re,
|
|
53
|
+
selectPresentationStatus: se,
|
|
54
|
+
selectIsInCall: ae,
|
|
55
|
+
selectSystemStatus: ce
|
|
56
|
+
}, ie = () => globalThis.process?.versions?.electron !== void 0, W = () => {
|
|
57
|
+
const e = new ee(), { name: n } = e.getBrowser(), t = ie();
|
|
32
58
|
return {
|
|
33
59
|
isChrome: n === "Chrome" || t
|
|
34
60
|
};
|
|
35
|
-
},
|
|
61
|
+
}, M = (e) => {
|
|
36
62
|
const { url: n, cause: t } = e;
|
|
37
63
|
let o = n;
|
|
38
|
-
return (t ===
|
|
64
|
+
return (t === h.BAD_MEDIA_DESCRIPTION || t === h.NOT_FOUND) && (o = `${e.message.to.uri.user}@${e.message.to.uri.host}`), o;
|
|
39
65
|
};
|
|
40
|
-
var
|
|
41
|
-
const
|
|
66
|
+
var H = /* @__PURE__ */ ((e) => (e.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", e.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", e.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", e.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", e.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", e.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", e))(H || {});
|
|
67
|
+
const ue = new Error("Unknown error"), le = (e = ue) => {
|
|
42
68
|
const { cause: n, socket: t } = e;
|
|
43
69
|
let o = "CONNECT_SERVER_FAILED";
|
|
44
70
|
switch (n) {
|
|
@@ -46,19 +72,19 @@ const ae = new Error("Unknown error"), ce = (e = ae) => {
|
|
|
46
72
|
o = "WRONG_USER_OR_PASSWORD";
|
|
47
73
|
break;
|
|
48
74
|
}
|
|
49
|
-
case
|
|
75
|
+
case h.BAD_MEDIA_DESCRIPTION: {
|
|
50
76
|
o = "BAD_MEDIA_ERROR";
|
|
51
77
|
break;
|
|
52
78
|
}
|
|
53
|
-
case
|
|
79
|
+
case h.NOT_FOUND: {
|
|
54
80
|
o = "NOT_FOUND_ERROR";
|
|
55
81
|
break;
|
|
56
82
|
}
|
|
57
83
|
default:
|
|
58
|
-
t !== void 0 && t._ws?.readyState === 3 ? o = "WS_CONNECTION_FAILED" :
|
|
84
|
+
t !== void 0 && t._ws?.readyState === 3 ? o = "WS_CONNECTION_FAILED" : M(e) !== void 0 && M(e) !== "" && (o = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
59
85
|
}
|
|
60
86
|
return o;
|
|
61
|
-
},
|
|
87
|
+
}, Ce = (e) => {
|
|
62
88
|
let n = "";
|
|
63
89
|
try {
|
|
64
90
|
n = JSON.stringify(e);
|
|
@@ -66,16 +92,16 @@ const ae = new Error("Unknown error"), ce = (e = ae) => {
|
|
|
66
92
|
r("failed to stringify message", t);
|
|
67
93
|
}
|
|
68
94
|
return n;
|
|
69
|
-
},
|
|
70
|
-
const { code: n, cause: t, message: o } = e, a =
|
|
71
|
-
return typeof o == "object" && o !== null ? s.message =
|
|
72
|
-
},
|
|
95
|
+
}, de = new Error("Unknown error"), fe = (e = de) => {
|
|
96
|
+
const { code: n, cause: t, message: o } = e, a = M(e), s = { code: "", cause: "", message: "" };
|
|
97
|
+
return typeof o == "object" && o !== null ? s.message = Ce(o) : o && (s.message = String(o)), a !== void 0 && a !== "" && (s.link = a), n !== void 0 && n !== "" && (s.code = n), t !== void 0 && t !== "" && (s.cause = t), s;
|
|
98
|
+
}, me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
73
99
|
__proto__: null,
|
|
74
|
-
EErrorTypes:
|
|
75
|
-
getLinkError:
|
|
76
|
-
getTypeFromError:
|
|
77
|
-
getValuesFromError:
|
|
78
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
100
|
+
EErrorTypes: H,
|
|
101
|
+
getLinkError: M,
|
|
102
|
+
getTypeFromError: le,
|
|
103
|
+
getValuesFromError: fe
|
|
104
|
+
}, Symbol.toStringTag, { value: "Module" })), Se = ({
|
|
79
105
|
sessionId: e,
|
|
80
106
|
remoteAddress: n,
|
|
81
107
|
isMutedAudio: t,
|
|
@@ -83,101 +109,101 @@ const ae = new Error("Unknown error"), ce = (e = ae) => {
|
|
|
83
109
|
isRegistered: a,
|
|
84
110
|
isPresentationCall: s
|
|
85
111
|
}) => {
|
|
86
|
-
const c = [], u = t ? "0" : "1",
|
|
87
|
-
return c.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${
|
|
88
|
-
},
|
|
112
|
+
const c = [], u = t ? "0" : "1", C = o ? "0" : "1";
|
|
113
|
+
return c.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${C}`), (a === !1 || a === void 0) && c.push("X-Vinteo-Purgatory-Call: yes"), e !== void 0 && e !== "" && c.push(`X-Vinteo-Session: ${e}`), s === !0 && c.push("X-Vinteo-Presentation-Call: yes"), n !== void 0 && n !== "" && c.push(`X-Vinteo-Remote: ${n}`), c;
|
|
114
|
+
}, Ee = "[@*!|]", pe = "_", he = (e) => {
|
|
89
115
|
let n = e;
|
|
90
|
-
return n = n.replaceAll(new RegExp(
|
|
91
|
-
},
|
|
116
|
+
return n = n.replaceAll(new RegExp(Ee, "g"), pe), n;
|
|
117
|
+
}, ge = ({
|
|
92
118
|
appName: e,
|
|
93
119
|
appVersion: n,
|
|
94
120
|
browserName: t,
|
|
95
121
|
browserVersion: o
|
|
96
122
|
}) => {
|
|
97
|
-
const s = `${
|
|
123
|
+
const s = `${he(e)} ${n}`;
|
|
98
124
|
return `ChromeNew - ${t === void 0 ? s : `${t} ${o}, ${s}`}`;
|
|
99
|
-
},
|
|
125
|
+
}, Re = ({
|
|
100
126
|
isUnifiedSdpSemantic: e,
|
|
101
127
|
appVersion: n,
|
|
102
128
|
browserName: t,
|
|
103
129
|
browserVersion: o,
|
|
104
130
|
appName: a
|
|
105
|
-
}) => e ?
|
|
131
|
+
}) => e ? ge({ appVersion: n, browserName: t, browserVersion: o, appName: a }) : "Chrome", Y = "purgatory", y = (e) => e === Y, Ne = (e) => (n) => [...n].map((o) => async () => e(o)), Te = async ({
|
|
106
132
|
accumulatedKeys: e,
|
|
107
133
|
sendKey: n,
|
|
108
134
|
canRunTask: t
|
|
109
135
|
}) => {
|
|
110
|
-
const a =
|
|
111
|
-
return
|
|
112
|
-
},
|
|
113
|
-
const n = (l,
|
|
114
|
-
if (
|
|
136
|
+
const a = Ne(n)(e);
|
|
137
|
+
return ne(a, t);
|
|
138
|
+
}, _e = (e) => (t) => (r("onStartMainCam"), e.on("api:admin-start-main-cam", t)), Oe = (e) => (t) => (r("onStartMic"), e.on("api:admin-start-mic", t)), Ae = (e) => (t) => (r("onStopMainCam"), e.on("api:admin-stop-main-cam", t)), ve = (e) => (t) => (r("onStopMic"), e.on("api:admin-stop-mic", t)), be = ({ sipConnector: e }) => {
|
|
139
|
+
const n = (l, d) => ({ isSyncForced: m }) => {
|
|
140
|
+
if (m === !0) {
|
|
115
141
|
l();
|
|
116
142
|
return;
|
|
117
143
|
}
|
|
118
|
-
|
|
119
|
-
}, t =
|
|
120
|
-
let c, u,
|
|
121
|
-
const
|
|
144
|
+
d();
|
|
145
|
+
}, t = _e(e), o = Ae(e), a = Oe(e), s = ve(e);
|
|
146
|
+
let c, u, C, N;
|
|
147
|
+
const A = ({
|
|
122
148
|
onStartMainCamForced: l,
|
|
123
|
-
onStartMainCamNotForced:
|
|
124
|
-
onStopMainCamForced:
|
|
125
|
-
onStopMainCamNotForced:
|
|
126
|
-
onStartMicForced:
|
|
127
|
-
onStartMicNotForced:
|
|
128
|
-
onStopMicForced:
|
|
129
|
-
onStopMicNotForced:
|
|
149
|
+
onStartMainCamNotForced: d,
|
|
150
|
+
onStopMainCamForced: m,
|
|
151
|
+
onStopMainCamNotForced: _,
|
|
152
|
+
onStartMicForced: O,
|
|
153
|
+
onStartMicNotForced: P,
|
|
154
|
+
onStopMicForced: D,
|
|
155
|
+
onStopMicNotForced: I
|
|
130
156
|
}) => {
|
|
131
|
-
const
|
|
157
|
+
const S = n(
|
|
132
158
|
l,
|
|
133
|
-
|
|
159
|
+
d
|
|
134
160
|
);
|
|
135
|
-
c = t(
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
161
|
+
c = t(S);
|
|
162
|
+
const E = n(
|
|
163
|
+
m,
|
|
164
|
+
_
|
|
139
165
|
);
|
|
140
|
-
u = o(
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
c?.(), u?.(),
|
|
166
|
+
u = o(E);
|
|
167
|
+
const L = n(O, P);
|
|
168
|
+
C = a(L);
|
|
169
|
+
const g = n(D, I);
|
|
170
|
+
N = s(g);
|
|
171
|
+
}, v = () => {
|
|
172
|
+
c?.(), u?.(), C?.(), N?.();
|
|
147
173
|
};
|
|
148
174
|
return {
|
|
149
175
|
start: (l) => {
|
|
150
|
-
|
|
176
|
+
A(l);
|
|
151
177
|
},
|
|
152
178
|
stop: () => {
|
|
153
|
-
|
|
179
|
+
v();
|
|
154
180
|
}
|
|
155
181
|
};
|
|
156
|
-
},
|
|
182
|
+
}, Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
157
183
|
__proto__: null,
|
|
158
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
159
|
-
createSyncMediaState:
|
|
160
|
-
createUaParser:
|
|
161
|
-
error:
|
|
162
|
-
getExtraHeaders:
|
|
163
|
-
getUserAgent:
|
|
164
|
-
hasPurgatory:
|
|
165
|
-
prepareMediaStream:
|
|
166
|
-
sendDtmfAccumulated:
|
|
167
|
-
sendOffer:
|
|
168
|
-
setEncodingsToSender:
|
|
169
|
-
setParametersToSender:
|
|
170
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
171
|
-
if (!
|
|
184
|
+
PURGATORY_CONFERENCE_NUMBER: Y,
|
|
185
|
+
createSyncMediaState: be,
|
|
186
|
+
createUaParser: W,
|
|
187
|
+
error: me,
|
|
188
|
+
getExtraHeaders: Se,
|
|
189
|
+
getUserAgent: Re,
|
|
190
|
+
hasPurgatory: y,
|
|
191
|
+
prepareMediaStream: K,
|
|
192
|
+
sendDtmfAccumulated: Te,
|
|
193
|
+
sendOffer: X,
|
|
194
|
+
setEncodingsToSender: q,
|
|
195
|
+
setParametersToSender: z
|
|
196
|
+
}, Symbol.toStringTag, { value: "Module" })), Ge = () => W().isChrome, Pe = (e) => {
|
|
197
|
+
if (!B(e) && !Q(e) && !J(e))
|
|
172
198
|
throw e;
|
|
173
199
|
return { configuration: void 0, isSuccessful: !1 };
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
},
|
|
200
|
+
}, De = ({ kind: e, readyState: n }) => e === "video" && n === "live", x = (e, n, { onEnterPurgatory: t, onEnterConference: o }) => {
|
|
201
|
+
y(e) ? t && t() : o && o({ isSuccessProgressCall: n });
|
|
202
|
+
}, V = (e, n) => {
|
|
177
203
|
e(), n && n();
|
|
178
|
-
},
|
|
204
|
+
}, $ = (e, n, t) => {
|
|
179
205
|
throw e && e(), n(), t;
|
|
180
|
-
},
|
|
206
|
+
}, Ie = /* @__PURE__ */ new Set([
|
|
181
207
|
"on",
|
|
182
208
|
"once",
|
|
183
209
|
"onceRace",
|
|
@@ -196,7 +222,7 @@ const ae = new Error("Unknown error"), ce = (e = ae) => {
|
|
|
196
222
|
"isConfigured",
|
|
197
223
|
"isRegistered"
|
|
198
224
|
]);
|
|
199
|
-
class
|
|
225
|
+
class We {
|
|
200
226
|
// @ts-expect-error: proxy method
|
|
201
227
|
on;
|
|
202
228
|
// @ts-expect-error: proxy method
|
|
@@ -235,7 +261,7 @@ class Be {
|
|
|
235
261
|
constructor(n) {
|
|
236
262
|
return this.sipConnector = n, new Proxy(this, {
|
|
237
263
|
get: (t, o, a) => {
|
|
238
|
-
if (typeof o == "string" &&
|
|
264
|
+
if (typeof o == "string" && Ie.has(o) && o in this.sipConnector) {
|
|
239
265
|
const c = Reflect.get(this.sipConnector, o, this.sipConnector);
|
|
240
266
|
return typeof c == "function" ? c.bind(this.sipConnector) : c;
|
|
241
267
|
}
|
|
@@ -244,7 +270,7 @@ class Be {
|
|
|
244
270
|
}
|
|
245
271
|
});
|
|
246
272
|
}
|
|
247
|
-
connectToServer = async (n, t) => this.sipConnector.connect(n, t).then((o) => (r("connectToServer then"), { configuration: o, isSuccessful: !0 })).catch(async (o) => (r("connectToServer catch: error", o),
|
|
273
|
+
connectToServer = async (n, t) => this.sipConnector.connect(n, t).then((o) => (r("connectToServer then"), { configuration: o, isSuccessful: !0 })).catch(async (o) => (r("connectToServer catch: error", o), Pe(o)));
|
|
248
274
|
callToServer = async (n) => {
|
|
249
275
|
const {
|
|
250
276
|
conference: t,
|
|
@@ -253,47 +279,47 @@ class Be {
|
|
|
253
279
|
iceServers: s,
|
|
254
280
|
contentHint: c,
|
|
255
281
|
degradationPreference: u,
|
|
256
|
-
sendEncodings:
|
|
257
|
-
offerToReceiveAudio:
|
|
258
|
-
offerToReceiveVideo:
|
|
259
|
-
directionVideo:
|
|
260
|
-
directionAudio:
|
|
261
|
-
onBeforeProgressCall:
|
|
282
|
+
sendEncodings: C,
|
|
283
|
+
offerToReceiveAudio: N,
|
|
284
|
+
offerToReceiveVideo: A,
|
|
285
|
+
directionVideo: v,
|
|
286
|
+
directionAudio: b,
|
|
287
|
+
onBeforeProgressCall: T,
|
|
262
288
|
onSuccessProgressCall: l,
|
|
263
|
-
onEnterPurgatory:
|
|
264
|
-
onEnterConference:
|
|
265
|
-
onFailProgressCall:
|
|
266
|
-
onFinishProgressCall:
|
|
267
|
-
onEndedCall:
|
|
268
|
-
onAddedTransceiver:
|
|
289
|
+
onEnterPurgatory: d,
|
|
290
|
+
onEnterConference: m,
|
|
291
|
+
onFailProgressCall: _,
|
|
292
|
+
onFinishProgressCall: O,
|
|
293
|
+
onEndedCall: P,
|
|
294
|
+
onAddedTransceiver: D
|
|
269
295
|
} = n;
|
|
270
296
|
r("callToServer", n);
|
|
271
|
-
const
|
|
297
|
+
const I = async () => (r("startCall"), this.sipConnector.call({
|
|
272
298
|
mediaStream: o,
|
|
273
299
|
extraHeaders: a,
|
|
274
300
|
iceServers: s,
|
|
275
301
|
contentHint: c,
|
|
276
|
-
offerToReceiveAudio:
|
|
277
|
-
offerToReceiveVideo:
|
|
278
|
-
directionVideo:
|
|
279
|
-
directionAudio:
|
|
302
|
+
offerToReceiveAudio: N,
|
|
303
|
+
offerToReceiveVideo: A,
|
|
304
|
+
directionVideo: v,
|
|
305
|
+
directionAudio: b,
|
|
280
306
|
degradationPreference: u,
|
|
281
|
-
onAddedTransceiver:
|
|
282
|
-
sendEncodings:
|
|
307
|
+
onAddedTransceiver: D,
|
|
308
|
+
sendEncodings: C,
|
|
283
309
|
number: t
|
|
284
310
|
}));
|
|
285
|
-
let
|
|
286
|
-
const
|
|
287
|
-
r("enterRoom", { _room: i, isSuccessProgressCall:
|
|
288
|
-
onEnterPurgatory:
|
|
289
|
-
onEnterConference:
|
|
311
|
+
let S = !1, E;
|
|
312
|
+
const g = (r("subscribeEnterConference: onEnterConference", m), this.sipConnector.on("api:enterRoom", ({ room: i }) => {
|
|
313
|
+
r("enterRoom", { _room: i, isSuccessProgressCall: S }), E = i, (d ?? m) && x(E, S, {
|
|
314
|
+
onEnterPurgatory: d,
|
|
315
|
+
onEnterConference: m
|
|
290
316
|
});
|
|
291
|
-
})),
|
|
292
|
-
|
|
293
|
-
}), i),
|
|
294
|
-
r("onFinish"),
|
|
317
|
+
})), F = (i) => (r("onSuccess"), S = !0, l && l({ isPurgatory: y(E) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
|
|
318
|
+
V(g, P);
|
|
319
|
+
}), i), w = (i) => (r("onFail"), $(_, g, i)), U = () => {
|
|
320
|
+
r("onFinish"), O && O();
|
|
295
321
|
};
|
|
296
|
-
return r("onBeforeProgressCall"),
|
|
322
|
+
return r("onBeforeProgressCall"), T && T(t), I().then(F).catch((i) => w(i)).finally(U);
|
|
297
323
|
};
|
|
298
324
|
disconnectFromServer = async () => this.sipConnector.disconnect().then(() => (r("disconnectFromServer: then"), { isSuccessful: !0 })).catch((n) => (r("disconnectFromServer: catch", n), { isSuccessful: !1 }));
|
|
299
325
|
answerToIncomingCall = async (n) => {
|
|
@@ -304,52 +330,52 @@ class Be {
|
|
|
304
330
|
contentHint: s,
|
|
305
331
|
degradationPreference: c,
|
|
306
332
|
sendEncodings: u,
|
|
307
|
-
offerToReceiveAudio:
|
|
308
|
-
offerToReceiveVideo:
|
|
309
|
-
directionVideo:
|
|
310
|
-
directionAudio:
|
|
311
|
-
onBeforeProgressCall:
|
|
312
|
-
onSuccessProgressCall:
|
|
333
|
+
offerToReceiveAudio: C,
|
|
334
|
+
offerToReceiveVideo: N,
|
|
335
|
+
directionVideo: A,
|
|
336
|
+
directionAudio: v,
|
|
337
|
+
onBeforeProgressCall: b,
|
|
338
|
+
onSuccessProgressCall: T,
|
|
313
339
|
onEnterPurgatory: l,
|
|
314
|
-
onEnterConference:
|
|
315
|
-
onFailProgressCall:
|
|
316
|
-
onFinishProgressCall:
|
|
317
|
-
onEndedCall:
|
|
318
|
-
onAddedTransceiver:
|
|
340
|
+
onEnterConference: d,
|
|
341
|
+
onFailProgressCall: m,
|
|
342
|
+
onFinishProgressCall: _,
|
|
343
|
+
onEndedCall: O,
|
|
344
|
+
onAddedTransceiver: P
|
|
319
345
|
} = n;
|
|
320
346
|
r("answerToIncomingCall", n);
|
|
321
|
-
const
|
|
347
|
+
const D = async () => this.sipConnector.answerToIncomingCall({
|
|
322
348
|
mediaStream: t,
|
|
323
349
|
extraHeaders: o,
|
|
324
350
|
iceServers: a,
|
|
325
351
|
contentHint: s,
|
|
326
|
-
offerToReceiveAudio:
|
|
327
|
-
offerToReceiveVideo:
|
|
328
|
-
directionVideo:
|
|
329
|
-
directionAudio:
|
|
352
|
+
offerToReceiveAudio: C,
|
|
353
|
+
offerToReceiveVideo: N,
|
|
354
|
+
directionVideo: A,
|
|
355
|
+
directionAudio: v,
|
|
330
356
|
degradationPreference: c,
|
|
331
|
-
onAddedTransceiver:
|
|
357
|
+
onAddedTransceiver: P,
|
|
332
358
|
sendEncodings: u
|
|
333
|
-
}),
|
|
359
|
+
}), I = () => {
|
|
334
360
|
const { remoteCallerData: i } = this.sipConnector;
|
|
335
361
|
return i.incomingNumber;
|
|
336
362
|
};
|
|
337
|
-
let
|
|
338
|
-
const
|
|
339
|
-
r("enterRoom", { room: i.room, isSuccessProgressCall:
|
|
363
|
+
let S = !1, E;
|
|
364
|
+
const g = (r("subscribeEnterConference: onEnterConference", d), this.sipConnector.on("api:enterRoom", (i) => {
|
|
365
|
+
r("enterRoom", { room: i.room, isSuccessProgressCall: S }), E = i.room, (l ?? d) && x(E, S, {
|
|
340
366
|
onEnterPurgatory: l,
|
|
341
|
-
onEnterConference:
|
|
367
|
+
onEnterConference: d
|
|
342
368
|
});
|
|
343
|
-
})),
|
|
344
|
-
|
|
345
|
-
}), i),
|
|
346
|
-
r("onFinish"),
|
|
369
|
+
})), F = (i) => (r("onSuccess"), S = !0, T && T({ isPurgatory: y(E) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
|
|
370
|
+
V(g, O);
|
|
371
|
+
}), i), w = (i) => (r("onFail"), $(m, g, i)), U = () => {
|
|
372
|
+
r("onFinish"), _ && _();
|
|
347
373
|
};
|
|
348
|
-
if (r("onBeforeProgressCall"),
|
|
349
|
-
const i =
|
|
350
|
-
|
|
374
|
+
if (r("onBeforeProgressCall"), b) {
|
|
375
|
+
const i = I();
|
|
376
|
+
b(i);
|
|
351
377
|
}
|
|
352
|
-
return
|
|
378
|
+
return D().then(F).catch((i) => w(i)).finally(U);
|
|
353
379
|
};
|
|
354
380
|
updatePresentation = async ({
|
|
355
381
|
mediaStream: n,
|
|
@@ -409,14 +435,14 @@ class Be {
|
|
|
409
435
|
contentHint: s,
|
|
410
436
|
degradationPreference: c,
|
|
411
437
|
sendEncodings: u,
|
|
412
|
-
onAddedTransceiver:
|
|
438
|
+
onAddedTransceiver: C
|
|
413
439
|
}) => (r("replaceMediaStream"), this.sipConnector.replaceMediaStream(n, {
|
|
414
440
|
deleteExisting: t,
|
|
415
441
|
addMissing: o,
|
|
416
442
|
forceRenegotiation: a,
|
|
417
443
|
contentHint: s,
|
|
418
444
|
degradationPreference: c,
|
|
419
|
-
onAddedTransceiver:
|
|
445
|
+
onAddedTransceiver: C,
|
|
420
446
|
sendEncodings: u
|
|
421
447
|
}));
|
|
422
448
|
askPermissionToEnableCam = async () => {
|
|
@@ -424,7 +450,7 @@ class Be {
|
|
|
424
450
|
};
|
|
425
451
|
resolveHandleReadyRemoteStreamsDebounced = ({
|
|
426
452
|
onReadyRemoteStreams: n
|
|
427
|
-
}) =>
|
|
453
|
+
}) => Z(() => {
|
|
428
454
|
const t = this.sipConnector.getRemoteStreams();
|
|
429
455
|
r("remoteStreams", t), n(t);
|
|
430
456
|
}, 200);
|
|
@@ -432,7 +458,7 @@ class Be {
|
|
|
432
458
|
resolveHandleReadyRemoteStreams = ({
|
|
433
459
|
onReadyRemoteStreams: n
|
|
434
460
|
}) => ({ track: t }) => {
|
|
435
|
-
|
|
461
|
+
De(t) && n();
|
|
436
462
|
};
|
|
437
463
|
getRemoteStreams = () => (r("getRemoteStreams"), this.sipConnector.getRemoteStreams());
|
|
438
464
|
onUseLicense = (n) => (r("onUseLicense"), this.sipConnector.on("api:useLicense", n));
|
|
@@ -444,26 +470,27 @@ class Be {
|
|
|
444
470
|
r("offStats"), this.sipConnector.off("stats:collected", n);
|
|
445
471
|
};
|
|
446
472
|
}
|
|
447
|
-
var
|
|
473
|
+
var Me = /* @__PURE__ */ ((e) => (e.VP8 = "video/VP8", e.VP9 = "video/VP9", e.H264 = "video/H264", e.AV1 = "video/AV1", e.rtx = "video/rtx", e.red = "video/red", e.flexfec03 = "video/flexfec-03", e))(Me || {});
|
|
448
474
|
export {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
475
|
+
h as ECallCause,
|
|
476
|
+
p as ECallStatus,
|
|
477
|
+
R as EConnectionStatus,
|
|
478
|
+
j as EIncomingStatus,
|
|
479
|
+
Me as EMimeTypesVideoCodecs,
|
|
454
480
|
je as EPresentationStatus,
|
|
455
481
|
Ke as EStatsTypes,
|
|
482
|
+
f as ESystemStatus,
|
|
456
483
|
Xe as EUseLicense,
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
484
|
+
qe as SipConnector,
|
|
485
|
+
We as SipConnectorFacade,
|
|
486
|
+
ze as StatsPeerConnection,
|
|
487
|
+
Je as disableDebug,
|
|
488
|
+
Qe as enableDebug,
|
|
489
|
+
Ze as getCodecFromSender,
|
|
490
|
+
Ge as hasAvailableStats,
|
|
491
|
+
Ve as hasCanceledCallError,
|
|
492
|
+
en as hasCanceledStartPresentationError,
|
|
493
|
+
tn as hasConnectionPromiseIsNotActualError,
|
|
494
|
+
$e as sessionSelectors,
|
|
495
|
+
Be as tools
|
|
469
496
|
};
|