sip-connector 6.20.0 → 6.21.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-3317ff75.cjs +1 -0
- package/dist/SipConnector-abcad4a1.js +1098 -0
- package/dist/SipConnector.d.ts +1 -5
- package/dist/doMock.cjs +1 -0
- package/dist/doMock.d.ts +3 -0
- package/dist/doMock.js +629 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +263 -1801
- package/dist/tools/__tests-utils__/parseObject.d.ts +3 -1
- package/dist/tools/__tests-utils__/resolveParseArray.d.ts +1 -1
- package/dist/tools/resolveUpdateRemoteStreams.d.ts +4 -1
- package/package.json +11 -8
package/dist/index.js
CHANGED
|
@@ -1,1325 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { default as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ADDRESS_INCOMPLETE: _r,
|
|
13
|
-
AUTHENTICATION_ERROR: hr,
|
|
14
|
-
BAD_MEDIA_DESCRIPTION: Re,
|
|
15
|
-
BUSY: cr,
|
|
16
|
-
BYE: Xt,
|
|
17
|
-
CANCELED: zt,
|
|
18
|
-
CONNECTION_ERROR: or,
|
|
19
|
-
DIALOG_ERROR: mr,
|
|
20
|
-
EXPIRES: gr,
|
|
21
|
-
INCOMPATIBLE_SDP: dr,
|
|
22
|
-
INTERNAL_ERROR: ar,
|
|
23
|
-
MISSING_SDP: Er,
|
|
24
|
-
NOT_FOUND: Ce,
|
|
25
|
-
NO_ACK: Tr,
|
|
26
|
-
NO_ANSWER: Sr,
|
|
27
|
-
REDIRECTED: ur,
|
|
28
|
-
REJECTED: Yt,
|
|
29
|
-
REQUEST_TIMEOUT: Gt,
|
|
30
|
-
RTP_TIMEOUT: Rr,
|
|
31
|
-
SIP_FAILURE_CODE: ir,
|
|
32
|
-
UNAVAILABLE: lr,
|
|
33
|
-
USER_DENIED_MEDIA_ACCESS: Cr,
|
|
34
|
-
WEBRTC_ERROR: fr
|
|
35
|
-
}, Symbol.toStringTag, { value: "Module" })), Ne = "incomingCall", ve = "declinedIncomingCall", Ae = "failedIncomingCall", pe = "terminatedIncomingCall", ne = "connecting", V = "connected", w = "disconnected", q = "newRTCSession", F = "registered", be = "unregistered", k = "registrationFailed", Jt = "newMessage", ye = "sipEvent", Ie = "availableSecondRemoteStream", Oe = "notAvailableSecondRemoteStream", Me = "mustStopPresentation", G = "shareState", Pe = "enterRoom", De = "useLicense", we = "peerconnection:confirmed", $e = "peerconnection:ontrack", Y = "channels", Le = "channels:notify", Ue = "ended:fromserver", Fe = "main-cam-control", ke = "admin-stop-main-cam", Be = "admin-start-main-cam", xe = "admin-stop-mic", He = "admin-start-mic", X = "admin-force-sync-media-state", We = "participant:added-to-list-moderators", je = "participant:removed-from-list-moderators", Ve = "participant:move-request-to-conference", qe = "participant:move-request-to-stream", Ge = "participant:canceling-word-request", Ye = "webcast:started", Xe = "webcast:stopped", ze = "account:changed", Je = "account:deleted", Ke = "conference:participant-token-issued", B = "ended", Kt = "sending", Qt = "reinvite", Zt = "replaces", en = "refer", tn = "progress", nn = "accepted", z = "confirmed", J = "peerconnection", $ = "failed", rn = "muted", sn = "unmuted", Qe = "newDTMF", Ze = "newInfo", on = "hold", an = "unhold", cn = "update", un = "sdp", ln = "icecandidate", _n = "getusermediafailed", dn = "peerconnection:createofferfailed", En = "peerconnection:createanswerfailed", hn = "peerconnection:setlocaldescriptionfailed", fn = "peerconnection:setremotedescriptionfailed", Sn = "presentation:start", gn = "presentation:started", Tn = "presentation:end", et = "presentation:ended", K = "presentation:failed", Ml = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
36
|
-
__proto__: null,
|
|
37
|
-
ACCEPTED: nn,
|
|
38
|
-
ACCOUNT_CHANGED: ze,
|
|
39
|
-
ACCOUNT_DELETED: Je,
|
|
40
|
-
ADMIN_FORCE_SYNC_MEDIA_STATE: X,
|
|
41
|
-
ADMIN_START_MAIN_CAM: Be,
|
|
42
|
-
ADMIN_START_MIC: He,
|
|
43
|
-
ADMIN_STOP_MAIN_CAM: ke,
|
|
44
|
-
ADMIN_STOP_MIC: xe,
|
|
45
|
-
AVAILABLE_SECOND_REMOTE_STREAM_EVENT: Ie,
|
|
46
|
-
CHANNELS: Y,
|
|
47
|
-
CHANNELS_NOTIFY: Le,
|
|
48
|
-
CONFERENCE_PARTICIPANT_TOKEN_ISSUED: Ke,
|
|
49
|
-
CONFIRMED: z,
|
|
50
|
-
CONNECTED: V,
|
|
51
|
-
CONNECTING: ne,
|
|
52
|
-
DECLINED_INCOMING_CALL: ve,
|
|
53
|
-
DISCONNECTED: w,
|
|
54
|
-
ENDED: B,
|
|
55
|
-
ENDED_FROM_SERVER: Ue,
|
|
56
|
-
ENTER_ROOM: Pe,
|
|
57
|
-
FAILED: $,
|
|
58
|
-
FAILED_INCOMING_CALL: Ae,
|
|
59
|
-
GET_USER_MEDIA_FAILED: _n,
|
|
60
|
-
HOLD: on,
|
|
61
|
-
ICE_CANDIDATE: ln,
|
|
62
|
-
INCOMING_CALL: Ne,
|
|
63
|
-
MAIN_CAM_CONTROL: Fe,
|
|
64
|
-
MUST_STOP_PRESENTATION_EVENT: Me,
|
|
65
|
-
MUTED: rn,
|
|
66
|
-
NEW_DTMF: Qe,
|
|
67
|
-
NEW_INFO: Ze,
|
|
68
|
-
NEW_MESSAGE: Jt,
|
|
69
|
-
NEW_RTC_SESSION: q,
|
|
70
|
-
NOT_AVAILABLE_SECOND_REMOTE_STREAM_EVENT: Oe,
|
|
71
|
-
PARTICIPANT_ADDED_TO_LIST_MODERATORS: We,
|
|
72
|
-
PARTICIPANT_CANCELLING_WORD_REQUEST: Ge,
|
|
73
|
-
PARTICIPANT_MOVE_REQUEST_TO_CONFERENCE: Ve,
|
|
74
|
-
PARTICIPANT_MOVE_REQUEST_TO_STREAM: qe,
|
|
75
|
-
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: je,
|
|
76
|
-
PEER_CONNECTION: J,
|
|
77
|
-
PEER_CONNECTION_CONFIRMED: we,
|
|
78
|
-
PEER_CONNECTION_CREATE_ANSWER_FAILED: En,
|
|
79
|
-
PEER_CONNECTION_CREATE_OFFER_FAILED: dn,
|
|
80
|
-
PEER_CONNECTION_ONTRACK: $e,
|
|
81
|
-
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: hn,
|
|
82
|
-
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: fn,
|
|
83
|
-
PRESENTATION_END: Tn,
|
|
84
|
-
PRESENTATION_ENDED: et,
|
|
85
|
-
PRESENTATION_FAILED: K,
|
|
86
|
-
PRESENTATION_START: Sn,
|
|
87
|
-
PRESENTATION_STARTED: gn,
|
|
88
|
-
PROGRESS: tn,
|
|
89
|
-
REFER: en,
|
|
90
|
-
REGISTERED: F,
|
|
91
|
-
REGISTRATION_FAILED: k,
|
|
92
|
-
REINVITE: Qt,
|
|
93
|
-
REPLACES: Zt,
|
|
94
|
-
SDP: un,
|
|
95
|
-
SENDING: Kt,
|
|
96
|
-
SHARE_STATE: G,
|
|
97
|
-
SIP_EVENT: ye,
|
|
98
|
-
TERMINATED_INCOMING_CALL: pe,
|
|
99
|
-
UNHOLD: an,
|
|
100
|
-
UNMUTED: sn,
|
|
101
|
-
UNREGISTERED: be,
|
|
102
|
-
UPDATE: cn,
|
|
103
|
-
USE_LICENSE: De,
|
|
104
|
-
WEBCAST_STARTED: Ye,
|
|
105
|
-
WEBCAST_STOPPED: Xe
|
|
106
|
-
}, Symbol.toStringTag, { value: "Module" })), mn = [
|
|
107
|
-
Ne,
|
|
108
|
-
ve,
|
|
109
|
-
pe,
|
|
110
|
-
Ae,
|
|
111
|
-
Ge,
|
|
112
|
-
qe,
|
|
113
|
-
Ve,
|
|
114
|
-
Le,
|
|
115
|
-
Ke,
|
|
116
|
-
ze,
|
|
117
|
-
Je,
|
|
118
|
-
Ye,
|
|
119
|
-
Xe,
|
|
120
|
-
We,
|
|
121
|
-
je
|
|
122
|
-
], tt = [
|
|
123
|
-
ne,
|
|
124
|
-
V,
|
|
125
|
-
w,
|
|
126
|
-
q,
|
|
127
|
-
F,
|
|
128
|
-
be,
|
|
129
|
-
k,
|
|
130
|
-
Jt,
|
|
131
|
-
ye
|
|
132
|
-
], Cn = [
|
|
133
|
-
Ie,
|
|
134
|
-
Oe,
|
|
135
|
-
Me,
|
|
136
|
-
G,
|
|
137
|
-
Pe,
|
|
138
|
-
De,
|
|
139
|
-
we,
|
|
140
|
-
$e,
|
|
141
|
-
Y,
|
|
142
|
-
Ue,
|
|
143
|
-
Fe,
|
|
144
|
-
Be,
|
|
145
|
-
ke,
|
|
146
|
-
xe,
|
|
147
|
-
He,
|
|
148
|
-
X
|
|
149
|
-
], nt = [
|
|
150
|
-
B,
|
|
151
|
-
ne,
|
|
152
|
-
Kt,
|
|
153
|
-
Qt,
|
|
154
|
-
Zt,
|
|
155
|
-
en,
|
|
156
|
-
tn,
|
|
157
|
-
nn,
|
|
158
|
-
z,
|
|
159
|
-
J,
|
|
160
|
-
$,
|
|
161
|
-
rn,
|
|
162
|
-
sn,
|
|
163
|
-
Qe,
|
|
164
|
-
Ze,
|
|
165
|
-
on,
|
|
166
|
-
an,
|
|
167
|
-
cn,
|
|
168
|
-
un,
|
|
169
|
-
ln,
|
|
170
|
-
_n,
|
|
171
|
-
dn,
|
|
172
|
-
En,
|
|
173
|
-
hn,
|
|
174
|
-
fn,
|
|
175
|
-
Sn,
|
|
176
|
-
gn,
|
|
177
|
-
Tn,
|
|
178
|
-
et,
|
|
179
|
-
K
|
|
180
|
-
], Rn = [...tt, ...mn], Nn = [
|
|
181
|
-
...nt,
|
|
182
|
-
...Cn
|
|
183
|
-
], Pl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
184
|
-
__proto__: null,
|
|
185
|
-
SESSION_EVENT_NAMES: Nn,
|
|
186
|
-
SESSION_JSSIP_EVENT_NAMES: nt,
|
|
187
|
-
SESSION_SYNTHETICS_EVENT_NAMES: Cn,
|
|
188
|
-
UA_EVENT_NAMES: Rn,
|
|
189
|
-
UA_JSSIP_EVENT_NAMES: tt,
|
|
190
|
-
UA_SYNTHETICS_EVENT_NAMES: mn
|
|
191
|
-
}, Symbol.toStringTag, { value: "Module" })), Nr = (e) => {
|
|
192
|
-
const t = [];
|
|
193
|
-
return e && t.push(`X-Vinteo-Remote: ${e}`), t;
|
|
194
|
-
}, vr = "content-type", Ar = "x-webrtc-enter-room", ae = "application/vinteo.webrtc.sharedesktop", pr = "application/vinteo.webrtc.roomname", br = "application/vinteo.webrtc.channels", yr = "application/vinteo.webrtc.mediastate", Ir = "application/vinteo.webrtc.refusal", Et = "application/vinteo.webrtc.maincam", Or = "application/vinteo.webrtc.mic", Mr = "application/vinteo.webrtc.uselic", Pr = "X-WEBRTC-USE-LICENSE", ht = "X-WEBRTC-INPUT-CHANNELS", ft = "X-WEBRTC-OUTPUT-CHANNELS", Dr = "X-WEBRTC-MAINCAM", wr = "X-WEBRTC-MIC", St = "X-WEBRTC-SYNC", $r = "X-WEBRTC-MAINCAM-RESOLUTION", Lr = "X-WEBRTC-MEDIA-STATE", Ur = "X-Vinteo-Media-Type", Fr = "X-Vinteo-MainCam-State", kr = "X-Vinteo-Mic-State", Br = "application/vinteo.webrtc.notify", xr = "X-VINTEO-NOTIFY", H = "x-webrtc-share-state", Hr = `${H}: LETMESTARTPRESENTATION`, Wr = `${H}: STOPPRESENTATION`, vn = "YOUCANRECEIVECONTENT", An = "CONTENTEND", jr = "YOUMUSTSTOPSENDCONTENT", Vr = `${H}: ${vn}`, qr = `${H}: ${An}`, Gr = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", Yr = `${Gr}: LETMESTARTMAINCAM`, rt = "sip-connector", _ = me(rt), Dl = () => {
|
|
195
|
-
me.enable(`${rt}`);
|
|
196
|
-
}, wl = () => {
|
|
197
|
-
me.enable(`-${rt}`);
|
|
198
|
-
};
|
|
199
|
-
var M = /* @__PURE__ */ ((e) => (e.PAUSE_MAIN_CAM = "PAUSEMAINCAM", e.RESUME_MAIN_CAM = "RESUMEMAINCAM", e.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", e.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", e.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", e))(M || {}), he = /* @__PURE__ */ ((e) => (e.ADMIN_STOP_MIC = "ADMINSTOPMIC", e.ADMIN_START_MIC = "ADMINSTARTMIC", e))(he || {}), fe = /* @__PURE__ */ ((e) => (e.ADMIN_SYNC_FORCED = "1", e.ADMIN_SYNC_NOT_FORCED = "0", e))(fe || {}), Xr = /* @__PURE__ */ ((e) => (e.AUDIO = "AUDIO", e.VIDEO = "VIDEO", e.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", e))(Xr || {});
|
|
200
|
-
function zr(e) {
|
|
201
|
-
return (t) => `sip:${t}@${e}`;
|
|
202
|
-
}
|
|
203
|
-
const Jr = (e, t) => () => Math.floor(Math.random() * (t - e)) + e, gt = (e) => e.trim().replaceAll(" ", "_"), Kr = Jr(1e5, 99999999), ce = (e, {
|
|
204
|
-
videoMode: t,
|
|
205
|
-
audioMode: n
|
|
206
|
-
} = {}) => {
|
|
207
|
-
if (!e || t === "recvonly" && n === "recvonly")
|
|
208
|
-
return;
|
|
209
|
-
const r = n === "recvonly" ? [] : e.getAudioTracks(), s = t === "recvonly" ? [] : e.getVideoTracks(), o = [...r, ...s], i = new MediaStream(o);
|
|
210
|
-
return i.getTracks = () => [...i.getAudioTracks(), ...i.getVideoTracks()], i;
|
|
211
|
-
}, Qr = (e) => e.some((n) => {
|
|
212
|
-
const { kind: r } = n;
|
|
213
|
-
return r === "video";
|
|
214
|
-
}), Zr = "Error decline with 603", es = (e) => e.message === Zr, ts = (e, t) => e.find((n) => n.track && t.getTracks().includes(n.track)), pn = 1, bn = (e) => (t, n) => n !== void 0 && t !== n || n === void 0 && t !== e, ns = bn(
|
|
215
|
-
pn
|
|
216
|
-
), rs = (e, t) => {
|
|
217
|
-
const n = e === void 0 ? void 0 : Math.max(e, pn);
|
|
218
|
-
if (n !== void 0 && ns(
|
|
219
|
-
n,
|
|
220
|
-
t
|
|
221
|
-
))
|
|
222
|
-
return n;
|
|
223
|
-
}, ss = bn(), os = (e, t) => {
|
|
224
|
-
if (ss(e, t))
|
|
225
|
-
return e;
|
|
226
|
-
}, yn = async (e, t, n) => {
|
|
227
|
-
const r = e.getParameters();
|
|
228
|
-
(r.encodings === void 0 || r.encodings.length === 0) && (r.encodings = [{}]);
|
|
229
|
-
const [s] = r.encodings, o = s.scaleResolutionDownBy, i = rs(
|
|
230
|
-
t.scaleResolutionDownBy,
|
|
231
|
-
o
|
|
232
|
-
);
|
|
233
|
-
let a = !1;
|
|
234
|
-
i !== void 0 && (r.encodings[0].scaleResolutionDownBy = i, a = !0);
|
|
235
|
-
const u = s.maxBitrate, l = os(t.maxBitrate, u);
|
|
236
|
-
return l !== void 0 && (r.encodings[0].maxBitrate = l, a = !0), a ? (n && n(r), e.setParameters(r).then(() => ({ parameters: r, isChanged: a }))) : { parameters: r, isChanged: a };
|
|
237
|
-
}, is = async (e, t, n) => {
|
|
238
|
-
const r = ts(e, t);
|
|
239
|
-
if (r)
|
|
240
|
-
return yn(r, { maxBitrate: n });
|
|
241
|
-
}, as = 486, cs = 487, Se = "local", Tt = "remote", $l = (e = new Error()) => {
|
|
242
|
-
const { originator: t, cause: n } = e;
|
|
243
|
-
return qt(e) ? !0 : typeof n == "string" ? n === Gt || n === Yt || t === Se && (n === zt || n === Xt) : !1;
|
|
244
|
-
}, D = "SipConnector", us = "channels", ls = "WebcastStarted", _s = "WebcastStopped", ds = "accountChanged", Es = "accountDeleted", hs = "addedToListModerators", fs = "removedFromListModerators", Ss = "WebcastParticipationAccepted", gs = "WebcastParticipationRejected", Ts = "ParticipantMovedToWebcast", ms = "ConferenceParticipantTokenIssued";
|
|
245
|
-
class Ll {
|
|
246
|
-
constructor({ JsSIP: t }) {
|
|
247
|
-
c(this, "_isRegisterConfig", !1);
|
|
248
|
-
c(this, "_connectionConfiguration", {});
|
|
249
|
-
c(this, "_remoteStreams", {});
|
|
250
|
-
c(this, "JsSIP");
|
|
251
|
-
c(this, "_sessionEvents");
|
|
252
|
-
c(this, "_uaEvents");
|
|
253
|
-
c(this, "_cancelableConnect");
|
|
254
|
-
c(this, "_cancelableCreateUa");
|
|
255
|
-
c(this, "_cancelableDisconnect");
|
|
256
|
-
c(this, "_cancelableSet");
|
|
257
|
-
c(this, "_cancelableCall");
|
|
258
|
-
c(this, "_cancelableAnswer");
|
|
259
|
-
c(this, "_cancelableSendDTMF");
|
|
260
|
-
c(this, "getSipServerUrl", (t) => t);
|
|
261
|
-
c(this, "promisePendingStartPresentation");
|
|
262
|
-
c(this, "promisePendingStopPresentation");
|
|
263
|
-
c(this, "ua");
|
|
264
|
-
c(this, "session");
|
|
265
|
-
c(this, "incomingSession");
|
|
266
|
-
c(this, "_streamPresentationCurrent");
|
|
267
|
-
c(this, "socket");
|
|
268
|
-
c(this, "connect", async (t) => (this._cancelRequests(), this._cancelableConnect.request(t)));
|
|
269
|
-
c(this, "createUa", async (t) => this._cancelableCreateUa.request(t));
|
|
270
|
-
c(this, "set", async (t) => this._cancelableSet.request(t));
|
|
271
|
-
c(this, "call", async (t) => this._cancelableCall.request(t));
|
|
272
|
-
c(this, "disconnect", async () => (this._cancelRequests(), this._disconnectWithoutCancelRequests()));
|
|
273
|
-
c(this, "answerToIncomingCall", async (t) => this._cancelableAnswer.request(t));
|
|
274
|
-
c(this, "sendDTMF", async (t) => this._cancelableSendDTMF.request(t));
|
|
275
|
-
c(this, "hangUp", async () => (this._cancelRequests(), this._hangUpWithoutCancelRequests()));
|
|
276
|
-
c(this, "tryRegister", async () => {
|
|
277
|
-
if (!this.isRegisterConfig)
|
|
278
|
-
throw new Error("Config is not registered");
|
|
279
|
-
this._uaEvents.trigger(ne, void 0);
|
|
280
|
-
try {
|
|
281
|
-
await this.unregister();
|
|
282
|
-
} catch (t) {
|
|
283
|
-
_("tryRegister", t);
|
|
284
|
-
}
|
|
285
|
-
return this.register();
|
|
286
|
-
});
|
|
287
|
-
c(this, "declineToIncomingCall", async ({ statusCode: t = cs } = {}) => new Promise((n, r) => {
|
|
288
|
-
if (!this.isAvailableIncomingCall) {
|
|
289
|
-
r(new Error("no incomingSession"));
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
const s = this.incomingSession, o = this.remoteCallerData;
|
|
293
|
-
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(ve, o), n(s.terminate({ status_code: t }));
|
|
294
|
-
}));
|
|
295
|
-
c(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: as }));
|
|
296
|
-
c(this, "removeIncomingSession", () => {
|
|
297
|
-
delete this.incomingSession;
|
|
298
|
-
});
|
|
299
|
-
c(this, "handleNewRTCSession", ({ originator: t, session: n }) => {
|
|
300
|
-
if (t === Tt) {
|
|
301
|
-
this.incomingSession = n;
|
|
302
|
-
const r = this.remoteCallerData;
|
|
303
|
-
n.on($, (s) => {
|
|
304
|
-
this.removeIncomingSession(), s.originator === Se ? this._uaEvents.trigger(pe, r) : this._uaEvents.trigger(Ae, r);
|
|
305
|
-
}), this._uaEvents.trigger(Ne, r);
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
c(this, "_connect", async (t) => this.createUa(t).then(async () => this._start()));
|
|
309
|
-
c(this, "_createUa", async ({
|
|
310
|
-
displayName: t = "",
|
|
311
|
-
user: n,
|
|
312
|
-
password: r,
|
|
313
|
-
register: s = !1,
|
|
314
|
-
sipServerUrl: o,
|
|
315
|
-
sipWebSocketServerURL: i,
|
|
316
|
-
remoteAddress: a,
|
|
317
|
-
extraHeaders: u = [],
|
|
318
|
-
sdpSemantics: l = "plan-b",
|
|
319
|
-
sessionTimers: d = !1,
|
|
320
|
-
registerExpires: E = 60 * 5,
|
|
321
|
-
// 5 minutes in sec
|
|
322
|
-
connectionRecoveryMinInterval: h = 2,
|
|
323
|
-
connectionRecoveryMaxInterval: S = 6,
|
|
324
|
-
userAgent: g
|
|
325
|
-
}) => {
|
|
326
|
-
if (!o)
|
|
327
|
-
throw new Error("sipServerUrl is required");
|
|
328
|
-
if (!i)
|
|
329
|
-
throw new Error("sipWebSocketServerURL is required");
|
|
330
|
-
if (s && !n)
|
|
331
|
-
throw new Error("user is required for authorized connection");
|
|
332
|
-
if (s && !r)
|
|
333
|
-
throw new Error("password is required for authorized connection");
|
|
334
|
-
this._connectionConfiguration = {
|
|
335
|
-
sipServerUrl: o,
|
|
336
|
-
displayName: t,
|
|
337
|
-
register: s,
|
|
338
|
-
user: n,
|
|
339
|
-
password: r
|
|
340
|
-
}, this._init({ sipServerUrl: o, sipWebSocketServerURL: i });
|
|
341
|
-
const m = s && n ? n.trim() : `${Kr()}`, C = {
|
|
342
|
-
password: r,
|
|
343
|
-
register: s,
|
|
344
|
-
display_name: gt(t),
|
|
345
|
-
user_agent: g,
|
|
346
|
-
sdp_semantics: l,
|
|
347
|
-
sockets: [this.socket],
|
|
348
|
-
uri: this.getSipServerUrl(m),
|
|
349
|
-
session_timers: d,
|
|
350
|
-
register_expires: E,
|
|
351
|
-
connection_recovery_min_interval: h,
|
|
352
|
-
connection_recovery_max_interval: S
|
|
353
|
-
};
|
|
354
|
-
this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!C.register, this.ua = new this.JsSIP.UA(C), this._uaEvents.eachTriggers((N, v) => {
|
|
355
|
-
const y = tt.find((f) => f === v);
|
|
356
|
-
y && this.ua && this.ua.on(y, N);
|
|
357
|
-
});
|
|
358
|
-
const b = [...Nr(a), ...u];
|
|
359
|
-
return this.ua.registrator().setExtraHeaders(b), this.ua;
|
|
360
|
-
});
|
|
361
|
-
c(this, "_start", async () => new Promise((t, n) => {
|
|
362
|
-
const { ua: r } = this;
|
|
363
|
-
if (!r) {
|
|
364
|
-
n(new Error("this.ua is not initialized"));
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
const s = () => {
|
|
368
|
-
a(), t(r);
|
|
369
|
-
}, o = (u) => {
|
|
370
|
-
a(), n(u);
|
|
371
|
-
}, i = () => {
|
|
372
|
-
this.isRegisterConfig ? (this.on(F, s), this.on(k, o)) : this.on(V, s), this.on(w, o);
|
|
373
|
-
}, a = () => {
|
|
374
|
-
this.off(F, s), this.off(k, o), this.off(V, s), this.off(w, o);
|
|
375
|
-
};
|
|
376
|
-
i(), this.on(q, this.handleNewRTCSession), r.start();
|
|
377
|
-
}));
|
|
378
|
-
c(this, "_set", async ({ displayName: t, password: n }) => new Promise((r, s) => {
|
|
379
|
-
const { ua: o } = this;
|
|
380
|
-
if (!o) {
|
|
381
|
-
s(new Error("this.ua is not initialized"));
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
let i = !1, a = !1;
|
|
385
|
-
t !== void 0 && t !== this._connectionConfiguration.displayName && (i = o.set("display_name", gt(t)), this._connectionConfiguration.displayName = t), n !== void 0 && n !== this._connectionConfiguration.password && (a = o.set("password", n), this._connectionConfiguration.password = n);
|
|
386
|
-
const u = i || a;
|
|
387
|
-
a && this.isRegisterConfig ? this.register().then(() => {
|
|
388
|
-
r(u);
|
|
389
|
-
}).catch(s) : u ? r(u) : s(u);
|
|
390
|
-
}));
|
|
391
|
-
c(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
|
|
392
|
-
c(this, "_disconnect", async () => {
|
|
393
|
-
this.off(q, this.handleNewRTCSession);
|
|
394
|
-
const t = new Promise((n) => {
|
|
395
|
-
this.once(w, () => {
|
|
396
|
-
delete this.ua, n();
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(w, void 0)) : this._uaEvents.trigger(w, void 0), t;
|
|
400
|
-
});
|
|
401
|
-
c(this, "_call", async ({
|
|
402
|
-
number: t,
|
|
403
|
-
mediaStream: n,
|
|
404
|
-
extraHeaders: r = [],
|
|
405
|
-
ontrack: s,
|
|
406
|
-
iceServers: o,
|
|
407
|
-
videoMode: i,
|
|
408
|
-
audioMode: a,
|
|
409
|
-
degradationPreference: u,
|
|
410
|
-
offerToReceiveAudio: l = !0,
|
|
411
|
-
offerToReceiveVideo: d = !0
|
|
412
|
-
}) => new Promise((E, h) => {
|
|
413
|
-
const { ua: S } = this;
|
|
414
|
-
if (!S) {
|
|
415
|
-
h(new Error("this.ua is not initialized"));
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
this._connectionConfiguration.number = t, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: s }).then(E).catch(h), this.session = S.call(this.getSipServerUrl(t), {
|
|
419
|
-
extraHeaders: r,
|
|
420
|
-
mediaStream: ce(n, {
|
|
421
|
-
videoMode: i,
|
|
422
|
-
audioMode: a
|
|
423
|
-
}),
|
|
424
|
-
eventHandlers: this._sessionEvents.triggers,
|
|
425
|
-
videoMode: i,
|
|
426
|
-
audioMode: a,
|
|
427
|
-
degradationPreference: u,
|
|
428
|
-
pcConfig: {
|
|
429
|
-
iceServers: o
|
|
430
|
-
},
|
|
431
|
-
rtcOfferConstraints: {
|
|
432
|
-
offerToReceiveAudio: l,
|
|
433
|
-
offerToReceiveVideo: d
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
}));
|
|
437
|
-
c(this, "_answer", async ({
|
|
438
|
-
mediaStream: t,
|
|
439
|
-
ontrack: n,
|
|
440
|
-
extraHeaders: r = [],
|
|
441
|
-
iceServers: s,
|
|
442
|
-
videoMode: o,
|
|
443
|
-
audioMode: i,
|
|
444
|
-
degradationPreference: a
|
|
445
|
-
}) => new Promise((u, l) => {
|
|
446
|
-
if (!this.isAvailableIncomingCall) {
|
|
447
|
-
l(new Error("no incomingSession"));
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
this.session = this.incomingSession, this.removeIncomingSession();
|
|
451
|
-
const { session: d } = this;
|
|
452
|
-
if (!d) {
|
|
453
|
-
l(new Error("No session established"));
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
this._sessionEvents.eachTriggers((h, S) => {
|
|
457
|
-
const g = nt.find((m) => m === S);
|
|
458
|
-
g && d.on(g, h);
|
|
459
|
-
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = d.remote_identity.uri.user, this._handleCall({ ontrack: n }).then(u).catch(l);
|
|
460
|
-
const E = ce(t, {
|
|
461
|
-
videoMode: o,
|
|
462
|
-
audioMode: i
|
|
463
|
-
});
|
|
464
|
-
d.answer({
|
|
465
|
-
extraHeaders: r,
|
|
466
|
-
videoMode: o,
|
|
467
|
-
audioMode: i,
|
|
468
|
-
degradationPreference: a,
|
|
469
|
-
mediaStream: E,
|
|
470
|
-
pcConfig: {
|
|
471
|
-
iceServers: s
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
}));
|
|
475
|
-
c(this, "_handleCall", async ({ ontrack: t }) => new Promise((n, r) => {
|
|
476
|
-
const s = () => {
|
|
477
|
-
this.onSession(J, d), this.onSession(z, E);
|
|
478
|
-
}, o = () => {
|
|
479
|
-
this.offSession(J, d), this.offSession(z, E);
|
|
480
|
-
}, i = () => {
|
|
481
|
-
this.onSession($, u), this.onSession(B, u);
|
|
482
|
-
}, a = () => {
|
|
483
|
-
this.offSession($, u), this.offSession(B, u);
|
|
484
|
-
}, u = (h) => {
|
|
485
|
-
o(), a(), r(h);
|
|
486
|
-
};
|
|
487
|
-
let l;
|
|
488
|
-
const d = ({ peerconnection: h }) => {
|
|
489
|
-
l = h, l.ontrack = (S) => {
|
|
490
|
-
this._sessionEvents.trigger($e, l), t && t(S);
|
|
491
|
-
};
|
|
492
|
-
}, E = () => {
|
|
493
|
-
l && this._sessionEvents.trigger(we, l), o(), a(), n(l);
|
|
494
|
-
};
|
|
495
|
-
s(), i();
|
|
496
|
-
}));
|
|
497
|
-
c(this, "_restoreSession", () => {
|
|
498
|
-
this._resetPresentation(), delete this._connectionConfiguration.number, delete this.session, this._remoteStreams = {};
|
|
499
|
-
});
|
|
500
|
-
c(this, "_sendDTMF", async (t) => new Promise((n, r) => {
|
|
501
|
-
const { session: s } = this;
|
|
502
|
-
if (!s) {
|
|
503
|
-
r(new Error("No session established"));
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
this.onceSession(Qe, ({ originator: o }) => {
|
|
507
|
-
o === Se && n();
|
|
508
|
-
}), s.sendDTMF(t, {
|
|
509
|
-
duration: 120,
|
|
510
|
-
interToneGap: 600
|
|
511
|
-
});
|
|
512
|
-
}));
|
|
513
|
-
c(this, "_hangUpWithoutCancelRequests", async () => {
|
|
514
|
-
if (this.ua && this.session) {
|
|
515
|
-
const { session: t } = this;
|
|
516
|
-
this._streamPresentationCurrent && await this.stopPresentation(), this._restoreSession(), t.isEnded() || t.terminate();
|
|
517
|
-
}
|
|
518
|
-
});
|
|
519
|
-
c(this, "_handleShareState", (t) => {
|
|
520
|
-
switch (t) {
|
|
521
|
-
case vn: {
|
|
522
|
-
this._sessionEvents.trigger(Ie, void 0);
|
|
523
|
-
break;
|
|
524
|
-
}
|
|
525
|
-
case An: {
|
|
526
|
-
this._sessionEvents.trigger(Oe, void 0);
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
case jr: {
|
|
530
|
-
this._sessionEvents.trigger(Me, void 0);
|
|
531
|
-
break;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
c(this, "_maybeTriggerChannels", (t) => {
|
|
536
|
-
const n = t.getHeader(ht), r = t.getHeader(ft);
|
|
537
|
-
if (n && r) {
|
|
538
|
-
const s = {
|
|
539
|
-
inputChannels: n,
|
|
540
|
-
outputChannels: r
|
|
541
|
-
};
|
|
542
|
-
this._sessionEvents.trigger(Y, s);
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
c(this, "_handleNotify", (t) => {
|
|
546
|
-
switch (t.cmd) {
|
|
547
|
-
case us: {
|
|
548
|
-
const n = t;
|
|
549
|
-
this._triggerChannelsNotify(n);
|
|
550
|
-
break;
|
|
551
|
-
}
|
|
552
|
-
case ls: {
|
|
553
|
-
const n = t;
|
|
554
|
-
this._triggerWebcastStartedNotify(n);
|
|
555
|
-
break;
|
|
556
|
-
}
|
|
557
|
-
case _s: {
|
|
558
|
-
const n = t;
|
|
559
|
-
this._triggerWebcastStoppedNotify(n);
|
|
560
|
-
break;
|
|
561
|
-
}
|
|
562
|
-
case hs: {
|
|
563
|
-
const n = t;
|
|
564
|
-
this._triggerAddedToListModeratorsNotify(n);
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
case fs: {
|
|
568
|
-
const n = t;
|
|
569
|
-
this._triggerRemovedFromListModeratorsNotify(n);
|
|
570
|
-
break;
|
|
571
|
-
}
|
|
572
|
-
case Ss: {
|
|
573
|
-
const n = t;
|
|
574
|
-
this._triggerParticipantMoveRequestToConference(n);
|
|
575
|
-
break;
|
|
576
|
-
}
|
|
577
|
-
case gs: {
|
|
578
|
-
const n = t;
|
|
579
|
-
this._triggerParticipantCancelingWordRequest(n);
|
|
580
|
-
break;
|
|
581
|
-
}
|
|
582
|
-
case Ts: {
|
|
583
|
-
const n = t;
|
|
584
|
-
this._triggerParticipantMoveRequestToStream(n);
|
|
585
|
-
break;
|
|
586
|
-
}
|
|
587
|
-
case ds: {
|
|
588
|
-
this._triggerAccountChangedNotify();
|
|
589
|
-
break;
|
|
590
|
-
}
|
|
591
|
-
case Es: {
|
|
592
|
-
this._triggerAccountDeletedNotify();
|
|
593
|
-
break;
|
|
594
|
-
}
|
|
595
|
-
case ms: {
|
|
596
|
-
const n = t;
|
|
597
|
-
this._triggerConferenceParticipantTokenIssued(n);
|
|
598
|
-
break;
|
|
599
|
-
}
|
|
600
|
-
default:
|
|
601
|
-
_("unknown cmd", t.cmd);
|
|
602
|
-
}
|
|
603
|
-
});
|
|
604
|
-
c(this, "_triggerRemovedFromListModeratorsNotify", ({
|
|
605
|
-
conference: t
|
|
606
|
-
}) => {
|
|
607
|
-
const n = {
|
|
608
|
-
conference: t
|
|
609
|
-
};
|
|
610
|
-
this._uaEvents.trigger(
|
|
611
|
-
je,
|
|
612
|
-
n
|
|
613
|
-
);
|
|
614
|
-
});
|
|
615
|
-
c(this, "_triggerAddedToListModeratorsNotify", ({ conference: t }) => {
|
|
616
|
-
const n = {
|
|
617
|
-
conference: t
|
|
618
|
-
};
|
|
619
|
-
this._uaEvents.trigger(We, n);
|
|
620
|
-
});
|
|
621
|
-
c(this, "_triggerWebcastStartedNotify", ({ body: { conference: t, type: n } }) => {
|
|
622
|
-
const r = {
|
|
623
|
-
conference: t,
|
|
624
|
-
type: n
|
|
625
|
-
};
|
|
626
|
-
this._uaEvents.trigger(Ye, r);
|
|
627
|
-
});
|
|
628
|
-
c(this, "_triggerWebcastStoppedNotify", ({ body: { conference: t, type: n } }) => {
|
|
629
|
-
const r = {
|
|
630
|
-
conference: t,
|
|
631
|
-
type: n
|
|
632
|
-
};
|
|
633
|
-
this._uaEvents.trigger(Xe, r);
|
|
634
|
-
});
|
|
635
|
-
c(this, "_triggerAccountChangedNotify", () => {
|
|
636
|
-
this._uaEvents.trigger(ze, void 0);
|
|
637
|
-
});
|
|
638
|
-
c(this, "_triggerAccountDeletedNotify", () => {
|
|
639
|
-
this._uaEvents.trigger(Je, void 0);
|
|
640
|
-
});
|
|
641
|
-
c(this, "_triggerConferenceParticipantTokenIssued", ({
|
|
642
|
-
body: { conference: t, participant: n, jwt: r }
|
|
643
|
-
}) => {
|
|
644
|
-
const s = {
|
|
645
|
-
conference: t,
|
|
646
|
-
participant: n,
|
|
647
|
-
jwt: r
|
|
648
|
-
};
|
|
649
|
-
this._uaEvents.trigger(
|
|
650
|
-
Ke,
|
|
651
|
-
s
|
|
652
|
-
);
|
|
653
|
-
});
|
|
654
|
-
c(this, "_triggerChannelsNotify", (t) => {
|
|
655
|
-
const n = t.input, r = t.output, s = {
|
|
656
|
-
inputChannels: n,
|
|
657
|
-
outputChannels: r
|
|
658
|
-
};
|
|
659
|
-
this._uaEvents.trigger(Le, s);
|
|
660
|
-
});
|
|
661
|
-
c(this, "_triggerParticipantMoveRequestToConference", ({
|
|
662
|
-
body: { conference: t }
|
|
663
|
-
}) => {
|
|
664
|
-
const n = {
|
|
665
|
-
conference: t
|
|
666
|
-
};
|
|
667
|
-
this._uaEvents.trigger(Ve, n);
|
|
668
|
-
});
|
|
669
|
-
c(this, "_triggerParticipantCancelingWordRequest", ({
|
|
670
|
-
body: { conference: t }
|
|
671
|
-
}) => {
|
|
672
|
-
const n = {
|
|
673
|
-
conference: t
|
|
674
|
-
};
|
|
675
|
-
this._uaEvents.trigger(Ge, n);
|
|
676
|
-
});
|
|
677
|
-
c(this, "_triggerParticipantMoveRequestToStream", ({
|
|
678
|
-
body: { conference: t }
|
|
679
|
-
}) => {
|
|
680
|
-
const n = {
|
|
681
|
-
conference: t
|
|
682
|
-
};
|
|
683
|
-
this._uaEvents.trigger(qe, n);
|
|
684
|
-
});
|
|
685
|
-
c(this, "_triggerEnterRoom", (t) => {
|
|
686
|
-
const n = t.getHeader(Ar);
|
|
687
|
-
this._sessionEvents.trigger(Pe, n);
|
|
688
|
-
});
|
|
689
|
-
c(this, "_triggerShareState", (t) => {
|
|
690
|
-
const n = t.getHeader(H);
|
|
691
|
-
this._sessionEvents.trigger(G, n);
|
|
692
|
-
});
|
|
693
|
-
c(this, "_triggerMainCamControl", (t) => {
|
|
694
|
-
const n = t.getHeader(Dr), r = t.getHeader(St), s = r === fe.ADMIN_SYNC_FORCED;
|
|
695
|
-
if (n === M.ADMIN_START_MAIN_CAM)
|
|
696
|
-
this._sessionEvents.trigger(Be, { isSyncForced: s });
|
|
697
|
-
else if (n === M.ADMIN_STOP_MAIN_CAM)
|
|
698
|
-
this._sessionEvents.trigger(ke, { isSyncForced: s });
|
|
699
|
-
else if ((n === M.RESUME_MAIN_CAM || n === M.PAUSE_MAIN_CAM) && r)
|
|
700
|
-
this._sessionEvents.trigger(X, { isSyncForced: s });
|
|
701
|
-
else {
|
|
702
|
-
const o = t.getHeader($r);
|
|
703
|
-
this._sessionEvents.trigger(Fe, {
|
|
704
|
-
mainCam: n,
|
|
705
|
-
resolutionMainCam: o
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
c(this, "_triggerMicControl", (t) => {
|
|
710
|
-
const n = t.getHeader(wr), s = t.getHeader(St) === fe.ADMIN_SYNC_FORCED;
|
|
711
|
-
n === he.ADMIN_START_MIC ? this._sessionEvents.trigger(He, { isSyncForced: s }) : n === he.ADMIN_STOP_MIC && this._sessionEvents.trigger(xe, { isSyncForced: s });
|
|
712
|
-
});
|
|
713
|
-
c(this, "_triggerUseLicense", (t) => {
|
|
714
|
-
const n = t.getHeader(Pr);
|
|
715
|
-
this._sessionEvents.trigger(De, n);
|
|
716
|
-
});
|
|
717
|
-
c(this, "_handleNewInfo", (t) => {
|
|
718
|
-
const { originator: n } = t;
|
|
719
|
-
if (n !== "remote")
|
|
720
|
-
return;
|
|
721
|
-
const { request: r } = t, s = r.getHeader(vr);
|
|
722
|
-
if (s)
|
|
723
|
-
switch (s) {
|
|
724
|
-
case pr: {
|
|
725
|
-
this._triggerEnterRoom(r), this._maybeTriggerChannels(r);
|
|
726
|
-
break;
|
|
727
|
-
}
|
|
728
|
-
case Br: {
|
|
729
|
-
this._maybeHandleNotify(r);
|
|
730
|
-
break;
|
|
731
|
-
}
|
|
732
|
-
case ae: {
|
|
733
|
-
this._triggerShareState(r);
|
|
734
|
-
break;
|
|
735
|
-
}
|
|
736
|
-
case Et: {
|
|
737
|
-
this._triggerMainCamControl(r);
|
|
738
|
-
break;
|
|
739
|
-
}
|
|
740
|
-
case Or: {
|
|
741
|
-
this._triggerMicControl(r);
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
case Mr: {
|
|
745
|
-
this._triggerUseLicense(r);
|
|
746
|
-
break;
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
});
|
|
750
|
-
c(this, "_handleSipEvent", ({ request: t }) => {
|
|
751
|
-
this._maybeHandleNotify(t);
|
|
752
|
-
});
|
|
753
|
-
c(this, "_maybeHandleNotify", (t) => {
|
|
754
|
-
const n = t.getHeader(xr);
|
|
755
|
-
if (n) {
|
|
756
|
-
const r = JSON.parse(n);
|
|
757
|
-
this._handleNotify(r);
|
|
758
|
-
}
|
|
759
|
-
});
|
|
760
|
-
c(this, "_handleEnded", (t) => {
|
|
761
|
-
const { originator: n } = t;
|
|
762
|
-
n === Tt && this._sessionEvents.trigger(Ue, t), this._restoreSession();
|
|
763
|
-
});
|
|
764
|
-
this.JsSIP = t, this._sessionEvents = new dt(Nn), this._uaEvents = new dt(Rn), this._cancelableConnect = new P(
|
|
765
|
-
this._connect,
|
|
766
|
-
{
|
|
767
|
-
moduleName: D,
|
|
768
|
-
afterCancelRequest: () => {
|
|
769
|
-
this._cancelableCreateUa.cancelRequest(), this._cancelableDisconnect.cancelRequest();
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
), this._cancelableCreateUa = new P(this._createUa, { moduleName: D }), this._cancelableDisconnect = new P(
|
|
773
|
-
this._disconnect,
|
|
774
|
-
{ moduleName: D }
|
|
775
|
-
), this._cancelableSet = new P(this._set, {
|
|
776
|
-
moduleName: D
|
|
777
|
-
}), this._cancelableCall = new P(
|
|
778
|
-
this._call,
|
|
779
|
-
{ moduleName: D }
|
|
780
|
-
), this._cancelableAnswer = new P(this._answer, { moduleName: D }), this._cancelableSendDTMF = new P(this._sendDTMF, { moduleName: D }), this.onSession(G, this._handleShareState), this.onSession(Ze, this._handleNewInfo), this.on(ye, this._handleSipEvent), this.onSession($, this._handleEnded), this.onSession(B, this._handleEnded);
|
|
781
|
-
}
|
|
782
|
-
async register() {
|
|
783
|
-
return new Promise((t, n) => {
|
|
784
|
-
this.isRegisterConfig && this.ua ? (this.ua.on(F, t), this.ua.on(k, n), this.ua.register()) : n(new Error("Config is not registered"));
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
async unregister() {
|
|
788
|
-
return new Promise((t, n) => {
|
|
789
|
-
this.isRegistered && this.ua ? (this.ua.on(be, t), this.ua.unregister()) : n(new Error("ua is not registered"));
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
async sendOptions(t, n, r) {
|
|
793
|
-
if (!this.ua)
|
|
794
|
-
throw new Error("is not connected");
|
|
795
|
-
return new Promise((s, o) => {
|
|
796
|
-
try {
|
|
797
|
-
this.ua.sendOptions(t, n, {
|
|
798
|
-
extraHeaders: r,
|
|
799
|
-
eventHandlers: {
|
|
800
|
-
succeeded: () => {
|
|
801
|
-
s();
|
|
802
|
-
},
|
|
803
|
-
failed: o
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
} catch (i) {
|
|
807
|
-
o(i);
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
}
|
|
811
|
-
async ping(t, n) {
|
|
812
|
-
var s;
|
|
813
|
-
if (!((s = this.ua) != null && s.configuration.uri))
|
|
814
|
-
throw new Error("is not connected");
|
|
815
|
-
const r = this.ua.configuration.uri;
|
|
816
|
-
return this.sendOptions(r, t, n);
|
|
817
|
-
}
|
|
818
|
-
async replaceMediaStream(t, n) {
|
|
819
|
-
if (!this.session)
|
|
820
|
-
throw new Error("No session established");
|
|
821
|
-
return this.session.replaceMediaStream(t, n);
|
|
822
|
-
}
|
|
823
|
-
async askPermissionToEnableCam(t = {}) {
|
|
824
|
-
if (!this.session)
|
|
825
|
-
throw new Error("No session established");
|
|
826
|
-
const n = [Yr];
|
|
827
|
-
return this.session.sendInfo(Et, void 0, {
|
|
828
|
-
noTerminateWhenError: !0,
|
|
829
|
-
...t,
|
|
830
|
-
extraHeaders: n
|
|
831
|
-
}).catch((r) => {
|
|
832
|
-
if (es(r))
|
|
833
|
-
throw r;
|
|
834
|
-
});
|
|
835
|
-
}
|
|
836
|
-
get isPendingPresentation() {
|
|
837
|
-
return !!this.promisePendingStartPresentation || !!this.promisePendingStopPresentation;
|
|
838
|
-
}
|
|
839
|
-
async _sendPresentation(t, n, {
|
|
840
|
-
maxBitrate: r,
|
|
841
|
-
degradationPreference: s,
|
|
842
|
-
isNeedReinvite: o = !0,
|
|
843
|
-
isP2P: i = !1
|
|
844
|
-
}) {
|
|
845
|
-
const a = ce(n);
|
|
846
|
-
this._streamPresentationCurrent = a;
|
|
847
|
-
const u = i ? [Vr] : [Hr], l = t.sendInfo(ae, void 0, {
|
|
848
|
-
extraHeaders: u
|
|
849
|
-
}).then(async () => t.startPresentation(
|
|
850
|
-
a,
|
|
851
|
-
o,
|
|
852
|
-
s
|
|
853
|
-
)).then(async () => {
|
|
854
|
-
const { connection: d } = this;
|
|
855
|
-
if (!d || r === void 0)
|
|
856
|
-
return;
|
|
857
|
-
const E = d.getSenders();
|
|
858
|
-
return is(E, n, r);
|
|
859
|
-
}).then(() => n).catch((d) => {
|
|
860
|
-
throw this._sessionEvents.trigger(K, d), d;
|
|
861
|
-
});
|
|
862
|
-
return this.promisePendingStartPresentation = l, l.finally(() => {
|
|
863
|
-
this.promisePendingStartPresentation = void 0;
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
async startPresentation(t, {
|
|
867
|
-
isNeedReinvite: n = !0,
|
|
868
|
-
isP2P: r = !1,
|
|
869
|
-
maxBitrate: s,
|
|
870
|
-
degradationPreference: o
|
|
871
|
-
} = {}) {
|
|
872
|
-
const i = this.establishedSession;
|
|
873
|
-
if (!i)
|
|
874
|
-
throw new Error("No session established");
|
|
875
|
-
if (this._streamPresentationCurrent)
|
|
876
|
-
throw new Error("Presentation is already started");
|
|
877
|
-
return this._sendPresentation(i, t, {
|
|
878
|
-
isNeedReinvite: n,
|
|
879
|
-
isP2P: r,
|
|
880
|
-
maxBitrate: s,
|
|
881
|
-
degradationPreference: o
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
async stopPresentation({
|
|
885
|
-
isP2P: t = !1
|
|
886
|
-
} = {}) {
|
|
887
|
-
const n = this._streamPresentationCurrent;
|
|
888
|
-
let r = this.promisePendingStartPresentation ?? Promise.resolve();
|
|
889
|
-
const s = t ? [qr] : [Wr], o = this.establishedSession;
|
|
890
|
-
return o && n && (r = r.then(async () => o.sendInfo(ae, void 0, {
|
|
891
|
-
extraHeaders: s
|
|
892
|
-
})).then(async () => o.stopPresentation(n)).catch((i) => {
|
|
893
|
-
throw this._sessionEvents.trigger(K, i), i;
|
|
894
|
-
})), !o && n && this._sessionEvents.trigger(et, n), this.promisePendingStopPresentation = r, r.finally(() => {
|
|
895
|
-
this._resetPresentation();
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
async updatePresentation(t, {
|
|
899
|
-
isP2P: n = !1,
|
|
900
|
-
maxBitrate: r,
|
|
901
|
-
degradationPreference: s
|
|
902
|
-
} = {}) {
|
|
903
|
-
const o = this.establishedSession;
|
|
904
|
-
if (!o)
|
|
905
|
-
throw new Error("No session established");
|
|
906
|
-
if (!this._streamPresentationCurrent)
|
|
907
|
-
throw new Error("Presentation has not started yet");
|
|
908
|
-
return this.promisePendingStartPresentation && await this.promisePendingStartPresentation, this._sendPresentation(o, t, {
|
|
909
|
-
isP2P: n,
|
|
910
|
-
maxBitrate: r,
|
|
911
|
-
degradationPreference: s,
|
|
912
|
-
isNeedReinvite: !1
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
_resetPresentation() {
|
|
916
|
-
delete this._streamPresentationCurrent, this.promisePendingStartPresentation = void 0, this.promisePendingStopPresentation = void 0;
|
|
917
|
-
}
|
|
918
|
-
on(t, n) {
|
|
919
|
-
return this._uaEvents.on(t, n);
|
|
920
|
-
}
|
|
921
|
-
once(t, n) {
|
|
922
|
-
return this._uaEvents.once(t, n);
|
|
923
|
-
}
|
|
924
|
-
onceRace(t, n) {
|
|
925
|
-
return this._uaEvents.onceRace(t, n);
|
|
926
|
-
}
|
|
927
|
-
async wait(t) {
|
|
928
|
-
return this._uaEvents.wait(t);
|
|
929
|
-
}
|
|
930
|
-
off(t, n) {
|
|
931
|
-
this._uaEvents.off(t, n);
|
|
932
|
-
}
|
|
933
|
-
onSession(t, n) {
|
|
934
|
-
return this._sessionEvents.on(t, n);
|
|
935
|
-
}
|
|
936
|
-
onceSession(t, n) {
|
|
937
|
-
return this._sessionEvents.once(t, n);
|
|
938
|
-
}
|
|
939
|
-
onceRaceSession(t, n) {
|
|
940
|
-
return this._sessionEvents.onceRace(t, n);
|
|
941
|
-
}
|
|
942
|
-
async waitSession(t) {
|
|
943
|
-
return this._sessionEvents.wait(t);
|
|
944
|
-
}
|
|
945
|
-
offSession(t, n) {
|
|
946
|
-
this._sessionEvents.off(t, n);
|
|
947
|
-
}
|
|
948
|
-
isConfigured() {
|
|
949
|
-
return !!this.ua;
|
|
950
|
-
}
|
|
951
|
-
getConnectionConfiguration() {
|
|
952
|
-
return { ...this._connectionConfiguration };
|
|
953
|
-
}
|
|
954
|
-
getRemoteStreams() {
|
|
955
|
-
if (!this.connection)
|
|
956
|
-
return;
|
|
957
|
-
const n = this.connection.getReceivers().map(({ track: r }) => r);
|
|
958
|
-
return Qr(n) ? this._generateStreams(n) : this._generateAudioStreams(n);
|
|
959
|
-
}
|
|
960
|
-
get connection() {
|
|
961
|
-
var n;
|
|
962
|
-
return (n = this.session) == null ? void 0 : n.connection;
|
|
963
|
-
}
|
|
964
|
-
get remoteCallerData() {
|
|
965
|
-
var t, n, r, s, o, i;
|
|
966
|
-
return {
|
|
967
|
-
displayName: (n = (t = this.incomingSession) == null ? void 0 : t.remote_identity) == null ? void 0 : n.display_name,
|
|
968
|
-
host: (s = (r = this.incomingSession) == null ? void 0 : r.remote_identity) == null ? void 0 : s.uri.host,
|
|
969
|
-
incomingNumber: (i = (o = this.incomingSession) == null ? void 0 : o.remote_identity) == null ? void 0 : i.uri.user,
|
|
970
|
-
session: this.incomingSession
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
get requested() {
|
|
974
|
-
return this._cancelableConnect.requested || this._cancelableCreateUa.requested || this._cancelableCall.requested || this._cancelableAnswer.requested;
|
|
975
|
-
}
|
|
976
|
-
get establishedSession() {
|
|
977
|
-
return this.session && this.session.isEstablished() ? this.session : void 0;
|
|
978
|
-
}
|
|
979
|
-
get isRegistered() {
|
|
980
|
-
return !!this.ua && this.ua.isRegistered();
|
|
981
|
-
}
|
|
982
|
-
get isRegisterConfig() {
|
|
983
|
-
return !!this.ua && this._isRegisterConfig;
|
|
984
|
-
}
|
|
985
|
-
get isCallActive() {
|
|
986
|
-
return !!(this.ua && this.session);
|
|
987
|
-
}
|
|
988
|
-
get isAvailableIncomingCall() {
|
|
989
|
-
return !!this.incomingSession;
|
|
990
|
-
}
|
|
991
|
-
_init({
|
|
992
|
-
sipServerUrl: t,
|
|
993
|
-
sipWebSocketServerURL: n
|
|
994
|
-
}) {
|
|
995
|
-
this.getSipServerUrl = zr(t), this.socket = new this.JsSIP.WebSocketInterface(n);
|
|
996
|
-
}
|
|
997
|
-
_generateStream(t, n) {
|
|
998
|
-
const { id: r } = t, s = this._remoteStreams[r] || new MediaStream();
|
|
999
|
-
return n && s.addTrack(n), s.addTrack(t), this._remoteStreams[r] = s, s;
|
|
1000
|
-
}
|
|
1001
|
-
_generateAudioStream(t) {
|
|
1002
|
-
const { id: n } = t, r = this._remoteStreams[n] || new MediaStream();
|
|
1003
|
-
return r.addTrack(t), this._remoteStreams[n] = r, r;
|
|
1004
|
-
}
|
|
1005
|
-
_generateStreams(t) {
|
|
1006
|
-
const n = [];
|
|
1007
|
-
return t.forEach((r, s) => {
|
|
1008
|
-
if (r.kind === "audio")
|
|
1009
|
-
return;
|
|
1010
|
-
const o = r, i = t[s - 1];
|
|
1011
|
-
let a;
|
|
1012
|
-
i && i.kind === "audio" && (a = i);
|
|
1013
|
-
const u = this._generateStream(o, a);
|
|
1014
|
-
n.push(u);
|
|
1015
|
-
}), n;
|
|
1016
|
-
}
|
|
1017
|
-
_generateAudioStreams(t) {
|
|
1018
|
-
return t.map((r) => this._generateAudioStream(r));
|
|
1019
|
-
}
|
|
1020
|
-
_cancelRequests() {
|
|
1021
|
-
this._cancelActionsRequests(), this._cancelCallRequests(), this._cancelConnectRequests();
|
|
1022
|
-
}
|
|
1023
|
-
_cancelConnectRequests() {
|
|
1024
|
-
this._cancelableConnect.cancelRequest();
|
|
1025
|
-
}
|
|
1026
|
-
_cancelCallRequests() {
|
|
1027
|
-
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest();
|
|
1028
|
-
}
|
|
1029
|
-
_cancelActionsRequests() {
|
|
1030
|
-
this._cancelableAnswer.cancelRequest(), this._cancelableSendDTMF.cancelRequest();
|
|
1031
|
-
}
|
|
1032
|
-
async waitChannels() {
|
|
1033
|
-
return this.waitSession(Y);
|
|
1034
|
-
}
|
|
1035
|
-
async waitSyncMediaState() {
|
|
1036
|
-
return this.waitSession(X);
|
|
1037
|
-
}
|
|
1038
|
-
async sendChannels({ inputChannels: t, outputChannels: n }) {
|
|
1039
|
-
if (!this.session)
|
|
1040
|
-
throw new Error("No session established");
|
|
1041
|
-
const r = `${ht}: ${t}`, s = `${ft}: ${n}`, o = [
|
|
1042
|
-
r,
|
|
1043
|
-
s
|
|
1044
|
-
];
|
|
1045
|
-
return this.session.sendInfo(br, void 0, { extraHeaders: o });
|
|
1046
|
-
}
|
|
1047
|
-
async sendMediaState({ cam: t, mic: n }, r = {}) {
|
|
1048
|
-
if (!this.session)
|
|
1049
|
-
throw new Error("No session established");
|
|
1050
|
-
const s = `${Lr}: currentstate`, o = `${Fr}: ${Number(t)}`, i = `${kr}: ${Number(n)}`, a = [
|
|
1051
|
-
s,
|
|
1052
|
-
o,
|
|
1053
|
-
i
|
|
1054
|
-
];
|
|
1055
|
-
return this.session.sendInfo(yr, void 0, {
|
|
1056
|
-
noTerminateWhenError: !0,
|
|
1057
|
-
...r,
|
|
1058
|
-
extraHeaders: a
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
async _sendRefusalToTurnOn(t, n = {}) {
|
|
1062
|
-
if (!this.session)
|
|
1063
|
-
throw new Error("No session established");
|
|
1064
|
-
const a = [`${Ur}: ${t === "mic" ? 0 : 1}`];
|
|
1065
|
-
return this.session.sendInfo(Ir, void 0, {
|
|
1066
|
-
noTerminateWhenError: !0,
|
|
1067
|
-
...n,
|
|
1068
|
-
extraHeaders: a
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
async sendRefusalToTurnOnMic(t = {}) {
|
|
1072
|
-
if (!this.session)
|
|
1073
|
-
throw new Error("No session established");
|
|
1074
|
-
return this._sendRefusalToTurnOn("mic", { noTerminateWhenError: !0, ...t });
|
|
1075
|
-
}
|
|
1076
|
-
async sendRefusalToTurnOnCam(t = {}) {
|
|
1077
|
-
if (!this.session)
|
|
1078
|
-
throw new Error("No session established");
|
|
1079
|
-
return this._sendRefusalToTurnOn("cam", { noTerminateWhenError: !0, ...t });
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
const In = "purgatory", x = (e) => e === In, st = (e) => () => (_("getRemoteStreams"), e.getRemoteStreams()), Cs = ({ kind: e, readyState: t }) => e === "video" && t === "live", On = (e) => ({ track: t }) => {
|
|
1083
|
-
Cs(t) && e();
|
|
1084
|
-
};
|
|
1085
|
-
var j = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1086
|
-
function ot(e) {
|
|
1087
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1088
|
-
}
|
|
1089
|
-
function Rs(e) {
|
|
1090
|
-
var t = typeof e;
|
|
1091
|
-
return e != null && (t == "object" || t == "function");
|
|
1092
|
-
}
|
|
1093
|
-
var L = Rs, Ns = typeof j == "object" && j && j.Object === Object && j, Mn = Ns, vs = Mn, As = typeof self == "object" && self && self.Object === Object && self, ps = vs || As || Function("return this")(), re = ps, bs = re, ys = function() {
|
|
1094
|
-
return bs.Date.now();
|
|
1095
|
-
}, Is = ys, Os = /\s/;
|
|
1096
|
-
function Ms(e) {
|
|
1097
|
-
for (var t = e.length; t-- && Os.test(e.charAt(t)); )
|
|
1098
|
-
;
|
|
1099
|
-
return t;
|
|
1100
|
-
}
|
|
1101
|
-
var Ps = Ms, Ds = Ps, ws = /^\s+/;
|
|
1102
|
-
function $s(e) {
|
|
1103
|
-
return e && e.slice(0, Ds(e) + 1).replace(ws, "");
|
|
1104
|
-
}
|
|
1105
|
-
var Ls = $s, Us = re, Fs = Us.Symbol, se = Fs, mt = se, Pn = Object.prototype, ks = Pn.hasOwnProperty, Bs = Pn.toString, U = mt ? mt.toStringTag : void 0;
|
|
1106
|
-
function xs(e) {
|
|
1107
|
-
var t = ks.call(e, U), n = e[U];
|
|
1108
|
-
try {
|
|
1109
|
-
e[U] = void 0;
|
|
1110
|
-
var r = !0;
|
|
1111
|
-
} catch {
|
|
1112
|
-
}
|
|
1113
|
-
var s = Bs.call(e);
|
|
1114
|
-
return r && (t ? e[U] = n : delete e[U]), s;
|
|
1115
|
-
}
|
|
1116
|
-
var Hs = xs, Ws = Object.prototype, js = Ws.toString;
|
|
1117
|
-
function Vs(e) {
|
|
1118
|
-
return js.call(e);
|
|
1119
|
-
}
|
|
1120
|
-
var qs = Vs, Ct = se, Gs = Hs, Ys = qs, Xs = "[object Null]", zs = "[object Undefined]", Rt = Ct ? Ct.toStringTag : void 0;
|
|
1121
|
-
function Js(e) {
|
|
1122
|
-
return e == null ? e === void 0 ? zs : Xs : Rt && Rt in Object(e) ? Gs(e) : Ys(e);
|
|
1123
|
-
}
|
|
1124
|
-
var oe = Js;
|
|
1125
|
-
function Ks(e) {
|
|
1126
|
-
return e != null && typeof e == "object";
|
|
1127
|
-
}
|
|
1128
|
-
var W = Ks, Qs = oe, Zs = W, eo = "[object Symbol]";
|
|
1129
|
-
function to(e) {
|
|
1130
|
-
return typeof e == "symbol" || Zs(e) && Qs(e) == eo;
|
|
1131
|
-
}
|
|
1132
|
-
var Dn = to, no = Ls, Nt = L, ro = Dn, vt = 0 / 0, so = /^[-+]0x[0-9a-f]+$/i, oo = /^0b[01]+$/i, io = /^0o[0-7]+$/i, ao = parseInt;
|
|
1133
|
-
function co(e) {
|
|
1134
|
-
if (typeof e == "number")
|
|
1135
|
-
return e;
|
|
1136
|
-
if (ro(e))
|
|
1137
|
-
return vt;
|
|
1138
|
-
if (Nt(e)) {
|
|
1139
|
-
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
1140
|
-
e = Nt(t) ? t + "" : t;
|
|
1141
|
-
}
|
|
1142
|
-
if (typeof e != "string")
|
|
1143
|
-
return e === 0 ? e : +e;
|
|
1144
|
-
e = no(e);
|
|
1145
|
-
var n = oo.test(e);
|
|
1146
|
-
return n || io.test(e) ? ao(e.slice(2), n ? 2 : 8) : so.test(e) ? vt : +e;
|
|
1147
|
-
}
|
|
1148
|
-
var uo = co, lo = L, ue = Is, At = uo, _o = "Expected a function", Eo = Math.max, ho = Math.min;
|
|
1149
|
-
function fo(e, t, n) {
|
|
1150
|
-
var r, s, o, i, a, u, l = 0, d = !1, E = !1, h = !0;
|
|
1151
|
-
if (typeof e != "function")
|
|
1152
|
-
throw new TypeError(_o);
|
|
1153
|
-
t = At(t) || 0, lo(n) && (d = !!n.leading, E = "maxWait" in n, o = E ? Eo(At(n.maxWait) || 0, t) : o, h = "trailing" in n ? !!n.trailing : h);
|
|
1154
|
-
function S(f) {
|
|
1155
|
-
var R = r, p = s;
|
|
1156
|
-
return r = s = void 0, l = f, i = e.apply(p, R), i;
|
|
1157
|
-
}
|
|
1158
|
-
function g(f) {
|
|
1159
|
-
return l = f, a = setTimeout(A, t), d ? S(f) : i;
|
|
1160
|
-
}
|
|
1161
|
-
function m(f) {
|
|
1162
|
-
var R = f - u, p = f - l, O = t - R;
|
|
1163
|
-
return E ? ho(O, o - p) : O;
|
|
1164
|
-
}
|
|
1165
|
-
function C(f) {
|
|
1166
|
-
var R = f - u, p = f - l;
|
|
1167
|
-
return u === void 0 || R >= t || R < 0 || E && p >= o;
|
|
1168
|
-
}
|
|
1169
|
-
function A() {
|
|
1170
|
-
var f = ue();
|
|
1171
|
-
if (C(f))
|
|
1172
|
-
return b(f);
|
|
1173
|
-
a = setTimeout(A, m(f));
|
|
1174
|
-
}
|
|
1175
|
-
function b(f) {
|
|
1176
|
-
return a = void 0, h && r ? S(f) : (r = s = void 0, i);
|
|
1177
|
-
}
|
|
1178
|
-
function N() {
|
|
1179
|
-
a !== void 0 && clearTimeout(a), l = 0, r = u = s = a = void 0;
|
|
1180
|
-
}
|
|
1181
|
-
function v() {
|
|
1182
|
-
return a === void 0 ? i : b(ue());
|
|
1183
|
-
}
|
|
1184
|
-
function y() {
|
|
1185
|
-
var f = ue(), R = C(f);
|
|
1186
|
-
if (r = arguments, s = this, u = f, R) {
|
|
1187
|
-
if (a === void 0)
|
|
1188
|
-
return g(u);
|
|
1189
|
-
if (E)
|
|
1190
|
-
return clearTimeout(a), a = setTimeout(A, t), S(u);
|
|
1191
|
-
}
|
|
1192
|
-
return a === void 0 && (a = setTimeout(A, t)), i;
|
|
1193
|
-
}
|
|
1194
|
-
return y.cancel = N, y.flush = v, y;
|
|
1195
|
-
}
|
|
1196
|
-
var So = fo;
|
|
1197
|
-
const go = /* @__PURE__ */ ot(So), it = ({
|
|
1
|
+
import { l as o, B as V, N as $, E as B, s as z, S as He } from "./SipConnector-abcad4a1.js";
|
|
2
|
+
import { f as tn, g as rn, i as sn, c as on, a as an, d as cn, b as un, e as ln, h as Sn } from "./SipConnector-abcad4a1.js";
|
|
3
|
+
import { debounce as q } from "ts-debounce";
|
|
4
|
+
import { isCanceledError as J } from "@krivega/cancelable-promise";
|
|
5
|
+
import Q from "sequent-promises";
|
|
6
|
+
import Z from "stack-promises";
|
|
7
|
+
import { default as dn } from "debug";
|
|
8
|
+
import "events-constructor";
|
|
9
|
+
const x = "purgatory", A = (e) => e === x, D = (e) => () => (o("getRemoteStreams"), e.getRemoteStreams()), ee = ({ kind: e, readyState: t }) => e === "video" && t === "live", G = (e) => ({ track: t }) => {
|
|
10
|
+
ee(t) && e();
|
|
11
|
+
}, w = ({
|
|
1198
12
|
getRemoteStreams: e,
|
|
1199
13
|
setRemoteStreams: t
|
|
1200
|
-
}) =>
|
|
14
|
+
}) => q(() => {
|
|
1201
15
|
const n = e();
|
|
1202
|
-
|
|
1203
|
-
}, 200),
|
|
16
|
+
o("remoteStreams", n), n && t(n);
|
|
17
|
+
}, 200), ne = (e) => async (n) => {
|
|
1204
18
|
const {
|
|
1205
19
|
mediaStream: r,
|
|
1206
20
|
extraHeaders: s,
|
|
1207
|
-
iceServers:
|
|
1208
|
-
degradationPreference:
|
|
1209
|
-
setRemoteStreams:
|
|
1210
|
-
onBeforeProgressCall:
|
|
1211
|
-
onSuccessProgressCall:
|
|
21
|
+
iceServers: a,
|
|
22
|
+
degradationPreference: c,
|
|
23
|
+
setRemoteStreams: u,
|
|
24
|
+
onBeforeProgressCall: i,
|
|
25
|
+
onSuccessProgressCall: m,
|
|
1212
26
|
onEnterPurgatory: d,
|
|
1213
|
-
onEnterConference:
|
|
1214
|
-
onFailProgressCall:
|
|
1215
|
-
onFinishProgressCall:
|
|
1216
|
-
onEndedCall:
|
|
1217
|
-
} = n,
|
|
1218
|
-
setRemoteStreams:
|
|
1219
|
-
getRemoteStreams:
|
|
1220
|
-
}),
|
|
1221
|
-
|
|
1222
|
-
const
|
|
27
|
+
onEnterConference: l,
|
|
28
|
+
onFailProgressCall: R,
|
|
29
|
+
onFinishProgressCall: f,
|
|
30
|
+
onEndedCall: C
|
|
31
|
+
} = n, E = w({
|
|
32
|
+
setRemoteStreams: u,
|
|
33
|
+
getRemoteStreams: D(e)
|
|
34
|
+
}), _ = G(E);
|
|
35
|
+
o("answerIncomingCall", n);
|
|
36
|
+
const b = async () => e.answerToIncomingCall({
|
|
1223
37
|
mediaStream: r,
|
|
1224
38
|
extraHeaders: s,
|
|
1225
|
-
iceServers:
|
|
1226
|
-
degradationPreference:
|
|
1227
|
-
ontrack:
|
|
1228
|
-
}),
|
|
1229
|
-
const { remoteCallerData:
|
|
1230
|
-
return
|
|
39
|
+
iceServers: a,
|
|
40
|
+
degradationPreference: c,
|
|
41
|
+
ontrack: _
|
|
42
|
+
}), h = () => {
|
|
43
|
+
const { remoteCallerData: S } = e;
|
|
44
|
+
return S.incomingNumber;
|
|
1231
45
|
};
|
|
1232
|
-
let
|
|
1233
|
-
const
|
|
1234
|
-
|
|
46
|
+
let T = !1, M;
|
|
47
|
+
const y = (() => (o("subscribeEnterConference: onEnterConference", l), d ?? l ? e.onSession("enterRoom", (S) => {
|
|
48
|
+
o("enterRoom", { _room: S, isSuccessProgressCall: T }), M = S, A(M) ? d && d() : l && l({ isSuccessProgressCall: T });
|
|
1235
49
|
}) : () => {
|
|
1236
|
-
}))(),
|
|
1237
|
-
|
|
1238
|
-
}),
|
|
1239
|
-
throw
|
|
1240
|
-
},
|
|
1241
|
-
|
|
50
|
+
}))(), O = (S) => (o("onSuccess"), T = !0, E(), m && m({ isPurgatory: A(M) }), e.onceRaceSession(["ended", "failed"], () => {
|
|
51
|
+
y(), C && C();
|
|
52
|
+
}), S), v = (S) => {
|
|
53
|
+
throw o("onFail"), R && R(), y(), S;
|
|
54
|
+
}, N = () => {
|
|
55
|
+
o("onFinish"), f && f();
|
|
1242
56
|
};
|
|
1243
|
-
if (
|
|
1244
|
-
const
|
|
1245
|
-
|
|
57
|
+
if (o("onBeforeProgressCall"), i) {
|
|
58
|
+
const S = h();
|
|
59
|
+
i(S);
|
|
1246
60
|
}
|
|
1247
|
-
return
|
|
1248
|
-
},
|
|
61
|
+
return b().then(O).catch(v).finally(N);
|
|
62
|
+
}, te = (e) => async (n) => {
|
|
1249
63
|
const {
|
|
1250
64
|
conference: r,
|
|
1251
65
|
mediaStream: s,
|
|
1252
|
-
extraHeaders:
|
|
1253
|
-
iceServers:
|
|
1254
|
-
degradationPreference:
|
|
1255
|
-
setRemoteStreams:
|
|
1256
|
-
onBeforeProgressCall:
|
|
66
|
+
extraHeaders: a,
|
|
67
|
+
iceServers: c,
|
|
68
|
+
degradationPreference: u,
|
|
69
|
+
setRemoteStreams: i,
|
|
70
|
+
onBeforeProgressCall: m,
|
|
1257
71
|
onSuccessProgressCall: d,
|
|
1258
|
-
onEnterPurgatory:
|
|
1259
|
-
onEnterConference:
|
|
1260
|
-
onFailProgressCall:
|
|
1261
|
-
onFinishProgressCall:
|
|
1262
|
-
onEndedCall:
|
|
1263
|
-
} = n,
|
|
1264
|
-
setRemoteStreams:
|
|
1265
|
-
getRemoteStreams:
|
|
1266
|
-
}),
|
|
1267
|
-
|
|
1268
|
-
const
|
|
72
|
+
onEnterPurgatory: l,
|
|
73
|
+
onEnterConference: R,
|
|
74
|
+
onFailProgressCall: f,
|
|
75
|
+
onFinishProgressCall: C,
|
|
76
|
+
onEndedCall: E
|
|
77
|
+
} = n, _ = w({
|
|
78
|
+
setRemoteStreams: i,
|
|
79
|
+
getRemoteStreams: D(e)
|
|
80
|
+
}), b = G(_);
|
|
81
|
+
o("callToServer", n);
|
|
82
|
+
const h = async () => (o("startCall"), e.call({
|
|
1269
83
|
mediaStream: s,
|
|
1270
|
-
extraHeaders:
|
|
1271
|
-
iceServers:
|
|
1272
|
-
degradationPreference:
|
|
84
|
+
extraHeaders: a,
|
|
85
|
+
iceServers: c,
|
|
86
|
+
degradationPreference: u,
|
|
1273
87
|
number: r,
|
|
1274
|
-
ontrack:
|
|
88
|
+
ontrack: b
|
|
1275
89
|
}));
|
|
1276
|
-
let
|
|
1277
|
-
const
|
|
1278
|
-
|
|
90
|
+
let T = !1, M;
|
|
91
|
+
const y = (() => (o("subscribeEnterConference: onEnterConference", R), l ?? R ? e.onSession("enterRoom", (S) => {
|
|
92
|
+
o("enterRoom", { _room: S, isSuccessProgressCall: T }), M = S, A(M) ? l && l() : R && R({ isSuccessProgressCall: T });
|
|
1279
93
|
}) : () => {
|
|
1280
|
-
}))(),
|
|
1281
|
-
|
|
1282
|
-
}),
|
|
1283
|
-
throw
|
|
1284
|
-
},
|
|
1285
|
-
|
|
94
|
+
}))(), O = (S) => (o("onSuccess"), T = !0, _(), d && d({ isPurgatory: A(M) }), e.onceRaceSession(["ended", "failed"], () => {
|
|
95
|
+
y(), E && E();
|
|
96
|
+
}), S), v = (S) => {
|
|
97
|
+
throw o("onFail"), f && f(), y(), S;
|
|
98
|
+
}, N = () => {
|
|
99
|
+
o("onFinish"), C && C();
|
|
1286
100
|
};
|
|
1287
|
-
return
|
|
1288
|
-
},
|
|
1289
|
-
if (!
|
|
101
|
+
return o("onBeforeProgressCall"), m && m(r), h().then(O).catch(v).finally(N);
|
|
102
|
+
}, I = (e) => {
|
|
103
|
+
if (!J(e))
|
|
1290
104
|
throw e;
|
|
1291
105
|
return !1;
|
|
1292
|
-
},
|
|
106
|
+
}, re = (e) => async (n) => {
|
|
1293
107
|
const {
|
|
1294
108
|
userAgent: r,
|
|
1295
109
|
sipWebSocketServerURL: s,
|
|
1296
|
-
sipServerUrl:
|
|
1297
|
-
remoteAddress:
|
|
1298
|
-
displayName:
|
|
1299
|
-
name:
|
|
1300
|
-
password:
|
|
110
|
+
sipServerUrl: a,
|
|
111
|
+
remoteAddress: c,
|
|
112
|
+
displayName: u,
|
|
113
|
+
name: i,
|
|
114
|
+
password: m,
|
|
1301
115
|
isRegisteredUser: d,
|
|
1302
|
-
sdpSemantics:
|
|
1303
|
-
isDisconnectOnFail:
|
|
116
|
+
sdpSemantics: l,
|
|
117
|
+
isDisconnectOnFail: R
|
|
1304
118
|
} = n;
|
|
1305
|
-
return
|
|
119
|
+
return o("connectToServer", n), e.connect({
|
|
1306
120
|
userAgent: r,
|
|
1307
|
-
sdpSemantics:
|
|
121
|
+
sdpSemantics: l,
|
|
1308
122
|
sipWebSocketServerURL: s,
|
|
1309
|
-
sipServerUrl:
|
|
1310
|
-
remoteAddress:
|
|
1311
|
-
displayName:
|
|
1312
|
-
password:
|
|
1313
|
-
user:
|
|
123
|
+
sipServerUrl: a,
|
|
124
|
+
remoteAddress: c,
|
|
125
|
+
displayName: u,
|
|
126
|
+
password: m,
|
|
127
|
+
user: i,
|
|
1314
128
|
register: d
|
|
1315
|
-
}).then(() => (
|
|
1316
|
-
},
|
|
129
|
+
}).then(() => (o("connectToServer then"), !0)).catch(async (f) => (o("connectToServer catch: error", f), R === !0 ? e.disconnect().then(() => I(f)).catch(() => I(f)) : I(f)));
|
|
130
|
+
}, se = (e) => async () => (o("disconnectFromServer"), e.disconnect().then(() => (o("disconnectFromServer: then"), !1)).catch((t) => (o("disconnectFromServer: catch", t), !1))), F = (e) => {
|
|
1317
131
|
const { url: t, cause: n } = e;
|
|
1318
132
|
let r = t;
|
|
1319
|
-
return (n ===
|
|
133
|
+
return (n === V || n === $) && (r = `${e.message.to.uri.user}@${e.message.to.uri.host}`), r;
|
|
1320
134
|
};
|
|
1321
|
-
var
|
|
1322
|
-
const
|
|
135
|
+
var X = /* @__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))(X || {});
|
|
136
|
+
const oe = (e = new Error()) => {
|
|
1323
137
|
var s;
|
|
1324
138
|
const { cause: t, socket: n } = e;
|
|
1325
139
|
let r = "CONNECT_SERVER_FAILED";
|
|
@@ -1328,38 +142,38 @@ const No = (e = new Error()) => {
|
|
|
1328
142
|
r = "WRONG_USER_OR_PASSWORD";
|
|
1329
143
|
break;
|
|
1330
144
|
}
|
|
1331
|
-
case
|
|
145
|
+
case V: {
|
|
1332
146
|
r = "BAD_MEDIA_ERROR";
|
|
1333
147
|
break;
|
|
1334
148
|
}
|
|
1335
|
-
case
|
|
149
|
+
case $: {
|
|
1336
150
|
r = "NOT_FOUND_ERROR";
|
|
1337
151
|
break;
|
|
1338
152
|
}
|
|
1339
153
|
default:
|
|
1340
|
-
n && ((s = n == null ? void 0 : n._ws) == null ? void 0 : s.readyState) === 3 ? r = "WS_CONNECTION_FAILED" :
|
|
154
|
+
n && ((s = n == null ? void 0 : n._ws) == null ? void 0 : s.readyState) === 3 ? r = "WS_CONNECTION_FAILED" : F(e) && (r = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
1341
155
|
}
|
|
1342
156
|
return r;
|
|
1343
|
-
},
|
|
1344
|
-
const { code: t, cause: n, message: r } = e, s =
|
|
1345
|
-
return r && (
|
|
1346
|
-
},
|
|
157
|
+
}, ae = (e = new Error()) => {
|
|
158
|
+
const { code: t, cause: n, message: r } = e, s = F(e), a = {};
|
|
159
|
+
return r && (a.message = r), s && (a.link = s), t && (a.code = t), n && (a.cause = n), a;
|
|
160
|
+
}, ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1347
161
|
__proto__: null,
|
|
1348
|
-
EErrorTypes:
|
|
1349
|
-
getLinkError:
|
|
1350
|
-
getTypeFromError:
|
|
1351
|
-
getValuesFromError:
|
|
1352
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
162
|
+
EErrorTypes: X,
|
|
163
|
+
getLinkError: F,
|
|
164
|
+
getTypeFromError: oe,
|
|
165
|
+
getValuesFromError: ae
|
|
166
|
+
}, Symbol.toStringTag, { value: "Module" })), ie = ({
|
|
1353
167
|
sessionId: e,
|
|
1354
168
|
remoteAddress: t,
|
|
1355
169
|
isMutedAudio: n,
|
|
1356
170
|
isMutedVideo: r,
|
|
1357
171
|
isRegistered: s,
|
|
1358
|
-
isPresentationCall:
|
|
172
|
+
isPresentationCall: a
|
|
1359
173
|
}) => {
|
|
1360
|
-
const
|
|
1361
|
-
return
|
|
1362
|
-
},
|
|
174
|
+
const c = [], u = n ? "0" : "1", i = r ? "0" : "1";
|
|
175
|
+
return c.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${i}`), s || c.push("X-Vinteo-Purgatory-Call: yes"), e && c.push(`X-Vinteo-Session: ${e}`), a && c.push("X-Vinteo-Presentation-Call: yes"), t && c.push(`X-Vinteo-Remote: ${t}`), c;
|
|
176
|
+
}, ue = ({
|
|
1363
177
|
appName: e,
|
|
1364
178
|
appVersion: t,
|
|
1365
179
|
browserName: n,
|
|
@@ -1367,548 +181,196 @@ const No = (e = new Error()) => {
|
|
|
1367
181
|
}) => {
|
|
1368
182
|
const s = `${e} ${t}`;
|
|
1369
183
|
return `ChromeNew - ${n ? `${n} ${r}, ${s}` : s}`;
|
|
1370
|
-
},
|
|
184
|
+
}, le = ({
|
|
1371
185
|
isUnifiedSdpSemantic: e,
|
|
1372
186
|
appVersion: t,
|
|
1373
187
|
browserName: n,
|
|
1374
188
|
browserVersion: r,
|
|
1375
189
|
appName: s
|
|
1376
|
-
}) => e ?
|
|
190
|
+
}) => e ? ue({ appVersion: t, browserName: n, browserVersion: r, appName: s }) : "Chrome", Se = (e) => async () => {
|
|
1377
191
|
if (e.isCallActive)
|
|
1378
|
-
return
|
|
1379
|
-
},
|
|
192
|
+
return o("askPermissionToEnableCam"), e.askPermissionToEnableCam();
|
|
193
|
+
}, me = (e) => (n) => (o("onMustStopPresentation"), e.onSession("mustStopPresentation", n)), de = (e) => (n) => (o("onUseLicense"), e.onSession("useLicense", n)), fe = (e) => async ({
|
|
1380
194
|
isEnabledCam: n,
|
|
1381
195
|
isEnabledMic: r
|
|
1382
196
|
}) => {
|
|
1383
197
|
if (e.isCallActive)
|
|
1384
|
-
return
|
|
1385
|
-
},
|
|
198
|
+
return o("sendMediaState"), e.sendMediaState({ cam: n, mic: r });
|
|
199
|
+
}, Ce = (e) => async () => {
|
|
1386
200
|
if (e.isCallActive)
|
|
1387
|
-
return
|
|
1388
|
-
|
|
201
|
+
return o("sendRefusalToTurnOnCam"), e.sendRefusalToTurnOnCam().catch((n) => {
|
|
202
|
+
o("sendRefusalToTurnOnCam: error", n);
|
|
1389
203
|
});
|
|
1390
|
-
},
|
|
204
|
+
}, Re = (e) => async () => {
|
|
1391
205
|
if (e.isCallActive)
|
|
1392
|
-
return
|
|
1393
|
-
|
|
206
|
+
return o("sendRefusalToTurnOnMic"), e.sendRefusalToTurnOnMic().catch((n) => {
|
|
207
|
+
o("sendRefusalToTurnOnMic: error", n);
|
|
1394
208
|
});
|
|
1395
|
-
},
|
|
1396
|
-
maxBitrate: e =
|
|
209
|
+
}, ge = 1e6, Ee = ({
|
|
210
|
+
maxBitrate: e = ge,
|
|
1397
211
|
sipConnector: t
|
|
1398
212
|
}) => async ({
|
|
1399
213
|
mediaStream: r,
|
|
1400
214
|
isP2P: s = !1
|
|
1401
|
-
}) => (
|
|
215
|
+
}) => (o("startPresentation"), t.startPresentation(r, {
|
|
1402
216
|
isP2P: s,
|
|
1403
217
|
maxBitrate: e
|
|
1404
|
-
})),
|
|
218
|
+
})), Te = ({ sipConnector: e }) => async ({ isP2P: n = !1 } = {}) => (o("stopShareSipConnector"), e.stopPresentation({
|
|
1405
219
|
isP2P: n
|
|
1406
|
-
}).catch(
|
|
220
|
+
}).catch(o)), Me = 1e6, _e = ({
|
|
1407
221
|
sipConnector: e,
|
|
1408
|
-
maxBitrate: t =
|
|
222
|
+
maxBitrate: t = Me
|
|
1409
223
|
}) => async ({
|
|
1410
224
|
mediaStream: r,
|
|
1411
225
|
isP2P: s = !1
|
|
1412
|
-
}) => (
|
|
226
|
+
}) => (o("updatePresentation"), e.updatePresentation(r, {
|
|
1413
227
|
isP2P: s,
|
|
1414
228
|
maxBitrate: t
|
|
1415
|
-
}))
|
|
1416
|
-
var Bo = L, pt = Object.create, xo = function() {
|
|
1417
|
-
function e() {
|
|
1418
|
-
}
|
|
1419
|
-
return function(t) {
|
|
1420
|
-
if (!Bo(t))
|
|
1421
|
-
return {};
|
|
1422
|
-
if (pt)
|
|
1423
|
-
return pt(t);
|
|
1424
|
-
e.prototype = t;
|
|
1425
|
-
var n = new e();
|
|
1426
|
-
return e.prototype = void 0, n;
|
|
1427
|
-
};
|
|
1428
|
-
}(), $n = xo;
|
|
1429
|
-
function Ho() {
|
|
1430
|
-
}
|
|
1431
|
-
var ct = Ho, Wo = $n, jo = ct;
|
|
1432
|
-
function Q(e, t) {
|
|
1433
|
-
this.__wrapped__ = e, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = void 0;
|
|
1434
|
-
}
|
|
1435
|
-
Q.prototype = Wo(jo.prototype);
|
|
1436
|
-
Q.prototype.constructor = Q;
|
|
1437
|
-
var ut = Q;
|
|
1438
|
-
function Vo(e, t) {
|
|
1439
|
-
for (var n = -1, r = t.length, s = e.length; ++n < r; )
|
|
1440
|
-
e[s + n] = t[n];
|
|
1441
|
-
return e;
|
|
1442
|
-
}
|
|
1443
|
-
var qo = Vo, Go = oe, Yo = W, Xo = "[object Arguments]";
|
|
1444
|
-
function zo(e) {
|
|
1445
|
-
return Yo(e) && Go(e) == Xo;
|
|
1446
|
-
}
|
|
1447
|
-
var Jo = zo, bt = Jo, Ko = W, Ln = Object.prototype, Qo = Ln.hasOwnProperty, Zo = Ln.propertyIsEnumerable, ei = bt(function() {
|
|
1448
|
-
return arguments;
|
|
1449
|
-
}()) ? bt : function(e) {
|
|
1450
|
-
return Ko(e) && Qo.call(e, "callee") && !Zo.call(e, "callee");
|
|
1451
|
-
}, ti = ei, ni = Array.isArray, ie = ni, yt = se, ri = ti, si = ie, It = yt ? yt.isConcatSpreadable : void 0;
|
|
1452
|
-
function oi(e) {
|
|
1453
|
-
return si(e) || ri(e) || !!(It && e && e[It]);
|
|
1454
|
-
}
|
|
1455
|
-
var ii = oi, ai = qo, ci = ii;
|
|
1456
|
-
function Un(e, t, n, r, s) {
|
|
1457
|
-
var o = -1, i = e.length;
|
|
1458
|
-
for (n || (n = ci), s || (s = []); ++o < i; ) {
|
|
1459
|
-
var a = e[o];
|
|
1460
|
-
t > 0 && n(a) ? t > 1 ? Un(a, t - 1, n, r, s) : ai(s, a) : r || (s[s.length] = a);
|
|
1461
|
-
}
|
|
1462
|
-
return s;
|
|
1463
|
-
}
|
|
1464
|
-
var ui = Un, li = ui;
|
|
1465
|
-
function _i(e) {
|
|
1466
|
-
var t = e == null ? 0 : e.length;
|
|
1467
|
-
return t ? li(e, 1) : [];
|
|
1468
|
-
}
|
|
1469
|
-
var di = _i;
|
|
1470
|
-
function Ei(e, t, n) {
|
|
1471
|
-
switch (n.length) {
|
|
1472
|
-
case 0:
|
|
1473
|
-
return e.call(t);
|
|
1474
|
-
case 1:
|
|
1475
|
-
return e.call(t, n[0]);
|
|
1476
|
-
case 2:
|
|
1477
|
-
return e.call(t, n[0], n[1]);
|
|
1478
|
-
case 3:
|
|
1479
|
-
return e.call(t, n[0], n[1], n[2]);
|
|
1480
|
-
}
|
|
1481
|
-
return e.apply(t, n);
|
|
1482
|
-
}
|
|
1483
|
-
var hi = Ei, fi = hi, Ot = Math.max;
|
|
1484
|
-
function Si(e, t, n) {
|
|
1485
|
-
return t = Ot(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1486
|
-
for (var r = arguments, s = -1, o = Ot(r.length - t, 0), i = Array(o); ++s < o; )
|
|
1487
|
-
i[s] = r[t + s];
|
|
1488
|
-
s = -1;
|
|
1489
|
-
for (var a = Array(t + 1); ++s < t; )
|
|
1490
|
-
a[s] = r[s];
|
|
1491
|
-
return a[t] = n(i), fi(e, this, a);
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
var gi = Si;
|
|
1495
|
-
function Ti(e) {
|
|
1496
|
-
return function() {
|
|
1497
|
-
return e;
|
|
1498
|
-
};
|
|
1499
|
-
}
|
|
1500
|
-
var mi = Ti, Ci = oe, Ri = L, Ni = "[object AsyncFunction]", vi = "[object Function]", Ai = "[object GeneratorFunction]", pi = "[object Proxy]";
|
|
1501
|
-
function bi(e) {
|
|
1502
|
-
if (!Ri(e))
|
|
1503
|
-
return !1;
|
|
1504
|
-
var t = Ci(e);
|
|
1505
|
-
return t == vi || t == Ai || t == Ni || t == pi;
|
|
1506
|
-
}
|
|
1507
|
-
var Fn = bi, yi = re, Ii = yi["__core-js_shared__"], Oi = Ii, _e = Oi, Mt = function() {
|
|
1508
|
-
var e = /[^.]+$/.exec(_e && _e.keys && _e.keys.IE_PROTO || "");
|
|
1509
|
-
return e ? "Symbol(src)_1." + e : "";
|
|
1510
|
-
}();
|
|
1511
|
-
function Mi(e) {
|
|
1512
|
-
return !!Mt && Mt in e;
|
|
1513
|
-
}
|
|
1514
|
-
var Pi = Mi, Di = Function.prototype, wi = Di.toString;
|
|
1515
|
-
function $i(e) {
|
|
1516
|
-
if (e != null) {
|
|
1517
|
-
try {
|
|
1518
|
-
return wi.call(e);
|
|
1519
|
-
} catch {
|
|
1520
|
-
}
|
|
1521
|
-
try {
|
|
1522
|
-
return e + "";
|
|
1523
|
-
} catch {
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
return "";
|
|
1527
|
-
}
|
|
1528
|
-
var Li = $i, Ui = Fn, Fi = Pi, ki = L, Bi = Li, xi = /[\\^$.*+?()[\]{}|]/g, Hi = /^\[object .+?Constructor\]$/, Wi = Function.prototype, ji = Object.prototype, Vi = Wi.toString, qi = ji.hasOwnProperty, Gi = RegExp(
|
|
1529
|
-
"^" + Vi.call(qi).replace(xi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1530
|
-
);
|
|
1531
|
-
function Yi(e) {
|
|
1532
|
-
if (!ki(e) || Fi(e))
|
|
1533
|
-
return !1;
|
|
1534
|
-
var t = Ui(e) ? Gi : Hi;
|
|
1535
|
-
return t.test(Bi(e));
|
|
1536
|
-
}
|
|
1537
|
-
var Xi = Yi;
|
|
1538
|
-
function zi(e, t) {
|
|
1539
|
-
return e == null ? void 0 : e[t];
|
|
1540
|
-
}
|
|
1541
|
-
var Ji = zi, Ki = Xi, Qi = Ji;
|
|
1542
|
-
function Zi(e, t) {
|
|
1543
|
-
var n = Qi(e, t);
|
|
1544
|
-
return Ki(n) ? n : void 0;
|
|
1545
|
-
}
|
|
1546
|
-
var kn = Zi, ea = kn, ta = function() {
|
|
1547
|
-
try {
|
|
1548
|
-
var e = ea(Object, "defineProperty");
|
|
1549
|
-
return e({}, "", {}), e;
|
|
1550
|
-
} catch {
|
|
1551
|
-
}
|
|
1552
|
-
}(), na = ta;
|
|
1553
|
-
function ra(e) {
|
|
1554
|
-
return e;
|
|
1555
|
-
}
|
|
1556
|
-
var sa = ra, oa = mi, Pt = na, ia = sa, aa = Pt ? function(e, t) {
|
|
1557
|
-
return Pt(e, "toString", {
|
|
1558
|
-
configurable: !0,
|
|
1559
|
-
enumerable: !1,
|
|
1560
|
-
value: oa(t),
|
|
1561
|
-
writable: !0
|
|
1562
|
-
});
|
|
1563
|
-
} : ia, ca = aa, ua = 800, la = 16, _a = Date.now;
|
|
1564
|
-
function da(e) {
|
|
1565
|
-
var t = 0, n = 0;
|
|
1566
|
-
return function() {
|
|
1567
|
-
var r = _a(), s = la - (r - n);
|
|
1568
|
-
if (n = r, s > 0) {
|
|
1569
|
-
if (++t >= ua)
|
|
1570
|
-
return arguments[0];
|
|
1571
|
-
} else
|
|
1572
|
-
t = 0;
|
|
1573
|
-
return e.apply(void 0, arguments);
|
|
1574
|
-
};
|
|
1575
|
-
}
|
|
1576
|
-
var Ea = da, ha = ca, fa = Ea, Sa = fa(ha), ga = Sa, Ta = di, ma = gi, Ca = ga;
|
|
1577
|
-
function Ra(e) {
|
|
1578
|
-
return Ca(ma(e, void 0, Ta), e + "");
|
|
1579
|
-
}
|
|
1580
|
-
var Na = Ra, va = kn, Aa = re, pa = va(Aa, "WeakMap"), ba = pa, Dt = ba, ya = Dt && new Dt(), Ia = ya;
|
|
1581
|
-
function Oa() {
|
|
1582
|
-
}
|
|
1583
|
-
var Ma = Oa, wt = Ia, Pa = Ma, Da = wt ? function(e) {
|
|
1584
|
-
return wt.get(e);
|
|
1585
|
-
} : Pa, Bn = Da, wa = {}, $a = wa, $t = $a, La = Object.prototype, Ua = La.hasOwnProperty;
|
|
1586
|
-
function Fa(e) {
|
|
1587
|
-
for (var t = e.name + "", n = $t[t], r = Ua.call($t, t) ? n.length : 0; r--; ) {
|
|
1588
|
-
var s = n[r], o = s.func;
|
|
1589
|
-
if (o == null || o == e)
|
|
1590
|
-
return s.name;
|
|
1591
|
-
}
|
|
1592
|
-
return t;
|
|
1593
|
-
}
|
|
1594
|
-
var xn = Fa, ka = $n, Ba = ct, xa = 4294967295;
|
|
1595
|
-
function Z(e) {
|
|
1596
|
-
this.__wrapped__ = e, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = xa, this.__views__ = [];
|
|
1597
|
-
}
|
|
1598
|
-
Z.prototype = ka(Ba.prototype);
|
|
1599
|
-
Z.prototype.constructor = Z;
|
|
1600
|
-
var lt = Z;
|
|
1601
|
-
function Ha(e, t) {
|
|
1602
|
-
var n = -1, r = e.length;
|
|
1603
|
-
for (t || (t = Array(r)); ++n < r; )
|
|
1604
|
-
t[n] = e[n];
|
|
1605
|
-
return t;
|
|
1606
|
-
}
|
|
1607
|
-
var Wa = Ha, ja = lt, Va = ut, qa = Wa;
|
|
1608
|
-
function Ga(e) {
|
|
1609
|
-
if (e instanceof ja)
|
|
1610
|
-
return e.clone();
|
|
1611
|
-
var t = new Va(e.__wrapped__, e.__chain__);
|
|
1612
|
-
return t.__actions__ = qa(e.__actions__), t.__index__ = e.__index__, t.__values__ = e.__values__, t;
|
|
1613
|
-
}
|
|
1614
|
-
var Ya = Ga, Xa = lt, Lt = ut, za = ct, Ja = ie, Ka = W, Qa = Ya, Za = Object.prototype, ec = Za.hasOwnProperty;
|
|
1615
|
-
function ee(e) {
|
|
1616
|
-
if (Ka(e) && !Ja(e) && !(e instanceof Xa)) {
|
|
1617
|
-
if (e instanceof Lt)
|
|
1618
|
-
return e;
|
|
1619
|
-
if (ec.call(e, "__wrapped__"))
|
|
1620
|
-
return Qa(e);
|
|
1621
|
-
}
|
|
1622
|
-
return new Lt(e);
|
|
1623
|
-
}
|
|
1624
|
-
ee.prototype = za.prototype;
|
|
1625
|
-
ee.prototype.constructor = ee;
|
|
1626
|
-
var tc = ee, nc = lt, rc = Bn, sc = xn, oc = tc;
|
|
1627
|
-
function ic(e) {
|
|
1628
|
-
var t = sc(e), n = oc[t];
|
|
1629
|
-
if (typeof n != "function" || !(t in nc.prototype))
|
|
1630
|
-
return !1;
|
|
1631
|
-
if (e === n)
|
|
1632
|
-
return !0;
|
|
1633
|
-
var r = rc(n);
|
|
1634
|
-
return !!r && e === r[0];
|
|
1635
|
-
}
|
|
1636
|
-
var ac = ic, Ut = ut, cc = Na, uc = Bn, de = xn, lc = ie, Ft = ac, _c = "Expected a function", dc = 8, Ec = 32, hc = 128, fc = 256;
|
|
1637
|
-
function Sc(e) {
|
|
1638
|
-
return cc(function(t) {
|
|
1639
|
-
var n = t.length, r = n, s = Ut.prototype.thru;
|
|
1640
|
-
for (e && t.reverse(); r--; ) {
|
|
1641
|
-
var o = t[r];
|
|
1642
|
-
if (typeof o != "function")
|
|
1643
|
-
throw new TypeError(_c);
|
|
1644
|
-
if (s && !i && de(o) == "wrapper")
|
|
1645
|
-
var i = new Ut([], !0);
|
|
1646
|
-
}
|
|
1647
|
-
for (r = i ? r : n; ++r < n; ) {
|
|
1648
|
-
o = t[r];
|
|
1649
|
-
var a = de(o), u = a == "wrapper" ? uc(o) : void 0;
|
|
1650
|
-
u && Ft(u[0]) && u[1] == (hc | dc | Ec | fc) && !u[4].length && u[9] == 1 ? i = i[de(u[0])].apply(i, u[3]) : i = o.length == 1 && Ft(o) ? i[a]() : i.thru(o);
|
|
1651
|
-
}
|
|
1652
|
-
return function() {
|
|
1653
|
-
var l = arguments, d = l[0];
|
|
1654
|
-
if (i && l.length == 1 && lc(d))
|
|
1655
|
-
return i.plant(d).value();
|
|
1656
|
-
for (var E = 0, h = n ? t[E].apply(this, l) : d; ++E < n; )
|
|
1657
|
-
h = t[E].call(this, h);
|
|
1658
|
-
return h;
|
|
1659
|
-
};
|
|
1660
|
-
});
|
|
1661
|
-
}
|
|
1662
|
-
var gc = Sc, Tc = gc, mc = Tc(), Cc = mc;
|
|
1663
|
-
const Rc = /* @__PURE__ */ ot(Cc);
|
|
1664
|
-
function Nc(e, t) {
|
|
1665
|
-
for (var n = -1, r = e == null ? 0 : e.length, s = Array(r); ++n < r; )
|
|
1666
|
-
s[n] = t(e[n], n, e);
|
|
1667
|
-
return s;
|
|
1668
|
-
}
|
|
1669
|
-
var vc = Nc, kt = se, Ac = vc, pc = ie, bc = Dn, yc = 1 / 0, Bt = kt ? kt.prototype : void 0, xt = Bt ? Bt.toString : void 0;
|
|
1670
|
-
function Hn(e) {
|
|
1671
|
-
if (typeof e == "string")
|
|
1672
|
-
return e;
|
|
1673
|
-
if (pc(e))
|
|
1674
|
-
return Ac(e, Hn) + "";
|
|
1675
|
-
if (bc(e))
|
|
1676
|
-
return xt ? xt.call(e) : "";
|
|
1677
|
-
var t = e + "";
|
|
1678
|
-
return t == "0" && 1 / e == -yc ? "-0" : t;
|
|
1679
|
-
}
|
|
1680
|
-
var Wn = Hn;
|
|
1681
|
-
function Ic(e, t, n) {
|
|
1682
|
-
var r = -1, s = e.length;
|
|
1683
|
-
t < 0 && (t = -t > s ? 0 : s + t), n = n > s ? s : n, n < 0 && (n += s), s = t > n ? 0 : n - t >>> 0, t >>>= 0;
|
|
1684
|
-
for (var o = Array(s); ++r < s; )
|
|
1685
|
-
o[r] = e[r + t];
|
|
1686
|
-
return o;
|
|
1687
|
-
}
|
|
1688
|
-
var Oc = Ic, Mc = Oc;
|
|
1689
|
-
function Pc(e, t, n) {
|
|
1690
|
-
var r = e.length;
|
|
1691
|
-
return n = n === void 0 ? r : n, !t && n >= r ? e : Mc(e, t, n);
|
|
1692
|
-
}
|
|
1693
|
-
var Dc = Pc, wc = "\\ud800-\\udfff", $c = "\\u0300-\\u036f", Lc = "\\ufe20-\\ufe2f", Uc = "\\u20d0-\\u20ff", Fc = $c + Lc + Uc, kc = "\\ufe0e\\ufe0f", Bc = "\\u200d", xc = RegExp("[" + Bc + wc + Fc + kc + "]");
|
|
1694
|
-
function Hc(e) {
|
|
1695
|
-
return xc.test(e);
|
|
1696
|
-
}
|
|
1697
|
-
var jn = Hc;
|
|
1698
|
-
function Wc(e, t) {
|
|
1699
|
-
return e === t || e !== e && t !== t;
|
|
1700
|
-
}
|
|
1701
|
-
var jc = Wc, Vc = 9007199254740991;
|
|
1702
|
-
function qc(e) {
|
|
1703
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Vc;
|
|
1704
|
-
}
|
|
1705
|
-
var Gc = qc, Yc = Fn, Xc = Gc;
|
|
1706
|
-
function zc(e) {
|
|
1707
|
-
return e != null && Xc(e.length) && !Yc(e);
|
|
1708
|
-
}
|
|
1709
|
-
var Jc = zc, Kc = 9007199254740991, Qc = /^(?:0|[1-9]\d*)$/;
|
|
1710
|
-
function Zc(e, t) {
|
|
1711
|
-
var n = typeof e;
|
|
1712
|
-
return t = t ?? Kc, !!t && (n == "number" || n != "symbol" && Qc.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
1713
|
-
}
|
|
1714
|
-
var eu = Zc, tu = jc, nu = Jc, ru = eu, su = L;
|
|
1715
|
-
function ou(e, t, n) {
|
|
1716
|
-
if (!su(n))
|
|
1717
|
-
return !1;
|
|
1718
|
-
var r = typeof t;
|
|
1719
|
-
return (r == "number" ? nu(n) && ru(t, n.length) : r == "string" && t in n) ? tu(n[t], e) : !1;
|
|
1720
|
-
}
|
|
1721
|
-
var iu = ou, au = oe, cu = W, uu = "[object RegExp]";
|
|
1722
|
-
function lu(e) {
|
|
1723
|
-
return cu(e) && au(e) == uu;
|
|
1724
|
-
}
|
|
1725
|
-
var _u = lu;
|
|
1726
|
-
function du(e) {
|
|
1727
|
-
return function(t) {
|
|
1728
|
-
return e(t);
|
|
1729
|
-
};
|
|
1730
|
-
}
|
|
1731
|
-
var Eu = du, te = { exports: {} };
|
|
1732
|
-
te.exports;
|
|
1733
|
-
(function(e, t) {
|
|
1734
|
-
var n = Mn, r = t && !t.nodeType && t, s = r && !0 && e && !e.nodeType && e, o = s && s.exports === r, i = o && n.process, a = function() {
|
|
1735
|
-
try {
|
|
1736
|
-
var u = s && s.require && s.require("util").types;
|
|
1737
|
-
return u || i && i.binding && i.binding("util");
|
|
1738
|
-
} catch {
|
|
1739
|
-
}
|
|
1740
|
-
}();
|
|
1741
|
-
e.exports = a;
|
|
1742
|
-
})(te, te.exports);
|
|
1743
|
-
var hu = te.exports, fu = _u, Su = Eu, Ht = hu, Wt = Ht && Ht.isRegExp, gu = Wt ? Su(Wt) : fu, Tu = gu;
|
|
1744
|
-
function mu(e) {
|
|
1745
|
-
return e.split("");
|
|
1746
|
-
}
|
|
1747
|
-
var Cu = mu, Vn = "\\ud800-\\udfff", Ru = "\\u0300-\\u036f", Nu = "\\ufe20-\\ufe2f", vu = "\\u20d0-\\u20ff", Au = Ru + Nu + vu, pu = "\\ufe0e\\ufe0f", bu = "[" + Vn + "]", ge = "[" + Au + "]", Te = "\\ud83c[\\udffb-\\udfff]", yu = "(?:" + ge + "|" + Te + ")", qn = "[^" + Vn + "]", Gn = "(?:\\ud83c[\\udde6-\\uddff]){2}", Yn = "[\\ud800-\\udbff][\\udc00-\\udfff]", Iu = "\\u200d", Xn = yu + "?", zn = "[" + pu + "]?", Ou = "(?:" + Iu + "(?:" + [qn, Gn, Yn].join("|") + ")" + zn + Xn + ")*", Mu = zn + Xn + Ou, Pu = "(?:" + [qn + ge + "?", ge, Gn, Yn, bu].join("|") + ")", Du = RegExp(Te + "(?=" + Te + ")|" + Pu + Mu, "g");
|
|
1748
|
-
function wu(e) {
|
|
1749
|
-
return e.match(Du) || [];
|
|
1750
|
-
}
|
|
1751
|
-
var $u = wu, Lu = Cu, Uu = jn, Fu = $u;
|
|
1752
|
-
function ku(e) {
|
|
1753
|
-
return Uu(e) ? Fu(e) : Lu(e);
|
|
1754
|
-
}
|
|
1755
|
-
var Bu = ku, xu = Wn;
|
|
1756
|
-
function Hu(e) {
|
|
1757
|
-
return e == null ? "" : xu(e);
|
|
1758
|
-
}
|
|
1759
|
-
var Wu = Hu, ju = Wn, Vu = Dc, qu = jn, Gu = iu, Yu = Tu, Xu = Bu, zu = Wu, Ju = 4294967295;
|
|
1760
|
-
function Ku(e, t, n) {
|
|
1761
|
-
return n && typeof n != "number" && Gu(e, t, n) && (t = n = void 0), n = n === void 0 ? Ju : n >>> 0, n ? (e = zu(e), e && (typeof t == "string" || t != null && !Yu(t)) && (t = ju(t), !t && qu(e)) ? Vu(Xu(e), 0, n) : e.split(t, n)) : [];
|
|
1762
|
-
}
|
|
1763
|
-
var Qu = Ku;
|
|
1764
|
-
const Zu = /* @__PURE__ */ ot(Qu), el = (e) => Rc(
|
|
1765
|
-
(t) => Zu(t, ""),
|
|
1766
|
-
(t) => t.map((n) => async () => e(n))
|
|
1767
|
-
), tl = async ({
|
|
229
|
+
})), ye = (e) => (t) => [...t].map((r) => async () => e(r)), be = async ({
|
|
1768
230
|
accumulatedKeys: e,
|
|
1769
231
|
sendKey: t,
|
|
1770
232
|
canRunTask: n
|
|
1771
233
|
}) => {
|
|
1772
|
-
const s =
|
|
1773
|
-
return
|
|
1774
|
-
},
|
|
1775
|
-
const t = (
|
|
1776
|
-
if (
|
|
1777
|
-
|
|
234
|
+
const s = ye(t)(e);
|
|
235
|
+
return Q(s, n);
|
|
236
|
+
}, he = (e) => (n) => (o("onStartMainCam"), e.onSession("admin-start-main-cam", n)), Oe = (e) => (n) => (o("onStartMic"), e.onSession("admin-start-mic", n)), ve = (e) => (n) => (o("onStopMainCam"), e.onSession("admin-stop-main-cam", n)), Ne = (e) => (n) => (o("onStopMic"), e.onSession("admin-stop-mic", n)), Ae = ({ sipConnector: e }) => {
|
|
237
|
+
const t = (C, E) => ({ isSyncForced: _ = !1 }) => {
|
|
238
|
+
if (_) {
|
|
239
|
+
C();
|
|
1778
240
|
return;
|
|
1779
241
|
}
|
|
1780
|
-
|
|
1781
|
-
}, n =
|
|
1782
|
-
let
|
|
1783
|
-
}, a = () => {
|
|
242
|
+
E();
|
|
243
|
+
}, n = he(e), r = ve(e), s = Oe(e), a = Ne(e);
|
|
244
|
+
let c = () => {
|
|
1784
245
|
}, u = () => {
|
|
1785
|
-
},
|
|
246
|
+
}, i = () => {
|
|
247
|
+
}, m = () => {
|
|
1786
248
|
};
|
|
1787
249
|
const d = ({
|
|
1788
|
-
onStartMainCamForced:
|
|
1789
|
-
onStartMainCamNotForced:
|
|
1790
|
-
onStopMainCamForced:
|
|
1791
|
-
onStopMainCamNotForced:
|
|
1792
|
-
onStartMicForced:
|
|
1793
|
-
onStartMicNotForced:
|
|
1794
|
-
onStopMicForced:
|
|
1795
|
-
onStopMicNotForced:
|
|
250
|
+
onStartMainCamForced: C,
|
|
251
|
+
onStartMainCamNotForced: E,
|
|
252
|
+
onStopMainCamForced: _,
|
|
253
|
+
onStopMainCamNotForced: b,
|
|
254
|
+
onStartMicForced: h,
|
|
255
|
+
onStartMicNotForced: T,
|
|
256
|
+
onStopMicForced: M,
|
|
257
|
+
onStopMicNotForced: p
|
|
1796
258
|
}) => {
|
|
1797
|
-
const
|
|
1798
|
-
g,
|
|
1799
|
-
m
|
|
1800
|
-
);
|
|
1801
|
-
i = n(f);
|
|
1802
|
-
const R = t(
|
|
259
|
+
const y = t(
|
|
1803
260
|
C,
|
|
1804
|
-
|
|
261
|
+
E
|
|
262
|
+
);
|
|
263
|
+
c = n(y);
|
|
264
|
+
const O = t(
|
|
265
|
+
_,
|
|
266
|
+
b
|
|
1805
267
|
);
|
|
1806
|
-
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1809
|
-
const
|
|
1810
|
-
|
|
1811
|
-
},
|
|
1812
|
-
|
|
268
|
+
u = r(O);
|
|
269
|
+
const v = t(h, T);
|
|
270
|
+
i = s(v);
|
|
271
|
+
const N = t(M, p);
|
|
272
|
+
m = a(N);
|
|
273
|
+
}, l = () => {
|
|
274
|
+
c(), u(), i(), m();
|
|
1813
275
|
};
|
|
1814
276
|
return {
|
|
1815
|
-
start: (
|
|
1816
|
-
d(
|
|
277
|
+
start: (C) => {
|
|
278
|
+
d(C);
|
|
1817
279
|
},
|
|
1818
280
|
stop: () => {
|
|
1819
|
-
|
|
281
|
+
l();
|
|
1820
282
|
}
|
|
1821
283
|
};
|
|
1822
|
-
},
|
|
284
|
+
}, Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1823
285
|
__proto__: null,
|
|
1824
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
1825
|
-
createSyncMediaState:
|
|
1826
|
-
error:
|
|
1827
|
-
getExtraHeaders:
|
|
1828
|
-
getUserAgent:
|
|
1829
|
-
hasPurgatory:
|
|
1830
|
-
resolveAnswerIncomingCall:
|
|
1831
|
-
resolveAskPermissionToEnableCam:
|
|
1832
|
-
resolveCallToServer:
|
|
1833
|
-
resolveConnectToServer:
|
|
1834
|
-
resolveDisconnectFromServer:
|
|
1835
|
-
resolveGetRemoteStreams:
|
|
1836
|
-
resolveOnMustStopPresentation:
|
|
1837
|
-
resolveOnUseLicense:
|
|
1838
|
-
resolveSendMediaState:
|
|
1839
|
-
resolveSendRefusalToTurnOnCam:
|
|
1840
|
-
resolveSendRefusalToTurnOnMic:
|
|
1841
|
-
resolveStartPresentation:
|
|
1842
|
-
resolveStopShareSipConnector:
|
|
1843
|
-
resolveUpdatePresentation:
|
|
1844
|
-
resolveUpdateRemoteStreams:
|
|
1845
|
-
sendDTMFAccumulated:
|
|
1846
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1847
|
-
const n =
|
|
286
|
+
PURGATORY_CONFERENCE_NUMBER: x,
|
|
287
|
+
createSyncMediaState: Ae,
|
|
288
|
+
error: ce,
|
|
289
|
+
getExtraHeaders: ie,
|
|
290
|
+
getUserAgent: le,
|
|
291
|
+
hasPurgatory: A,
|
|
292
|
+
resolveAnswerIncomingCall: ne,
|
|
293
|
+
resolveAskPermissionToEnableCam: Se,
|
|
294
|
+
resolveCallToServer: te,
|
|
295
|
+
resolveConnectToServer: re,
|
|
296
|
+
resolveDisconnectFromServer: se,
|
|
297
|
+
resolveGetRemoteStreams: D,
|
|
298
|
+
resolveOnMustStopPresentation: me,
|
|
299
|
+
resolveOnUseLicense: de,
|
|
300
|
+
resolveSendMediaState: fe,
|
|
301
|
+
resolveSendRefusalToTurnOnCam: Ce,
|
|
302
|
+
resolveSendRefusalToTurnOnMic: Re,
|
|
303
|
+
resolveStartPresentation: Ee,
|
|
304
|
+
resolveStopShareSipConnector: Te,
|
|
305
|
+
resolveUpdatePresentation: _e,
|
|
306
|
+
resolveUpdateRemoteStreams: w,
|
|
307
|
+
sendDTMFAccumulated: be
|
|
308
|
+
}, Symbol.toStringTag, { value: "Module" })), pe = (e) => [...e.keys()].map((t) => e.get(t)), Be = (e, t) => pe(e).find((n) => n.type === t), Ie = async (e) => e.getStats().then((t) => {
|
|
309
|
+
const n = Be(t, "codec");
|
|
1848
310
|
return n == null ? void 0 : n.mimeType;
|
|
1849
|
-
}),
|
|
311
|
+
}), Pe = (e) => e.find((t) => {
|
|
1850
312
|
var n;
|
|
1851
313
|
return ((n = t == null ? void 0 : t.track) == null ? void 0 : n.kind) === "video";
|
|
1852
|
-
}),
|
|
1853
|
-
const n =
|
|
1854
|
-
return
|
|
1855
|
-
},
|
|
1856
|
-
|
|
1857
|
-
}),
|
|
314
|
+
}), K = (e, t) => e !== void 0 && t !== void 0 && e.toLowerCase().includes(t.toLowerCase()), De = 1e6, g = (e) => e * De, W = g(0.06), we = g(4), Fe = (e) => e <= 64 ? W : e <= 128 ? g(0.12) : e <= 256 ? g(0.25) : e <= 384 ? g(0.32) : e <= 426 ? g(0.38) : e <= 640 ? g(0.5) : e <= 848 ? g(0.7) : e <= 1280 ? g(1) : e <= 1920 ? g(2) : we, ke = "av1", Ue = (e) => K(e, ke), Le = 0.6, H = (e, t) => Ue(t) ? e * Le : e, Ve = (e) => H(W, e), j = (e, t) => {
|
|
315
|
+
const n = Fe(e);
|
|
316
|
+
return H(n, t);
|
|
317
|
+
}, Y = Z(), $e = async () => Y().catch((e) => {
|
|
318
|
+
o("videoSendingBalancer: error", e);
|
|
319
|
+
}), xe = async (e) => (Y.add(e), $e()), k = async ({
|
|
1858
320
|
sender: e,
|
|
1859
321
|
scaleResolutionDownBy: t,
|
|
1860
322
|
maxBitrate: n,
|
|
1861
323
|
onSetParameters: r
|
|
1862
|
-
}) =>
|
|
1863
|
-
const s =
|
|
1864
|
-
return
|
|
324
|
+
}) => xe(async () => z(e, { scaleResolutionDownBy: t, maxBitrate: n }, r)), Ge = async ({ sender: e, codec: t }, n) => {
|
|
325
|
+
const s = Ve(t);
|
|
326
|
+
return k({
|
|
1865
327
|
sender: e,
|
|
1866
328
|
maxBitrate: s,
|
|
1867
329
|
onSetParameters: n,
|
|
1868
330
|
scaleResolutionDownBy: 200
|
|
1869
331
|
});
|
|
1870
|
-
},
|
|
1871
|
-
const
|
|
1872
|
-
return
|
|
332
|
+
}, P = async ({ sender: e, track: t, codec: n }, r) => {
|
|
333
|
+
const c = t.getSettings().width, u = j(c, n);
|
|
334
|
+
return k({
|
|
1873
335
|
sender: e,
|
|
1874
|
-
maxBitrate:
|
|
336
|
+
maxBitrate: u,
|
|
1875
337
|
onSetParameters: r,
|
|
1876
338
|
scaleResolutionDownBy: 1
|
|
1877
339
|
});
|
|
1878
|
-
},
|
|
340
|
+
}, Xe = async ({
|
|
1879
341
|
sender: e,
|
|
1880
342
|
track: t,
|
|
1881
343
|
resolution: n,
|
|
1882
344
|
codec: r
|
|
1883
345
|
}, s) => {
|
|
1884
|
-
const
|
|
1885
|
-
return
|
|
346
|
+
const a = t.getSettings(), c = a.width, u = a.height, [i, m] = n.split("x"), d = c / Number(i), l = u / Number(m), f = Math.max(d, l, 1), C = j(Number(i), r);
|
|
347
|
+
return k({
|
|
1886
348
|
sender: e,
|
|
1887
|
-
maxBitrate:
|
|
349
|
+
maxBitrate: C,
|
|
1888
350
|
onSetParameters: s,
|
|
1889
|
-
scaleResolutionDownBy:
|
|
351
|
+
scaleResolutionDownBy: f
|
|
1890
352
|
});
|
|
1891
|
-
},
|
|
353
|
+
}, Ke = async ({
|
|
1892
354
|
mainCam: e,
|
|
1893
355
|
resolutionMainCam: t,
|
|
1894
356
|
sender: n,
|
|
1895
357
|
track: r,
|
|
1896
358
|
codec: s
|
|
1897
|
-
},
|
|
359
|
+
}, a) => {
|
|
1898
360
|
switch (e) {
|
|
1899
|
-
case
|
|
1900
|
-
return
|
|
1901
|
-
case
|
|
1902
|
-
return
|
|
1903
|
-
case
|
|
1904
|
-
return t !== void 0 ?
|
|
361
|
+
case B.PAUSE_MAIN_CAM:
|
|
362
|
+
return Ge({ sender: n, codec: s }, a);
|
|
363
|
+
case B.RESUME_MAIN_CAM:
|
|
364
|
+
return P({ sender: n, track: r, codec: s }, a);
|
|
365
|
+
case B.MAX_MAIN_CAM_RESOLUTION:
|
|
366
|
+
return t !== void 0 ? Xe(
|
|
1905
367
|
{ sender: n, track: r, codec: s, resolution: t },
|
|
1906
|
-
|
|
1907
|
-
) :
|
|
368
|
+
a
|
|
369
|
+
) : P({ sender: n, track: r, codec: s }, a);
|
|
1908
370
|
default:
|
|
1909
|
-
return
|
|
371
|
+
return P({ sender: n, track: r, codec: s }, a);
|
|
1910
372
|
}
|
|
1911
|
-
},
|
|
373
|
+
}, U = {
|
|
1912
374
|
isChanged: !1,
|
|
1913
375
|
parameters: {
|
|
1914
376
|
encodings: [{}],
|
|
@@ -1917,54 +379,54 @@ const Zu = /* @__PURE__ */ ot(Qu), el = (e) => Rc(
|
|
|
1917
379
|
headerExtensions: [],
|
|
1918
380
|
rtcp: {}
|
|
1919
381
|
}
|
|
1920
|
-
},
|
|
382
|
+
}, L = async ({
|
|
1921
383
|
mainCam: e,
|
|
1922
384
|
resolutionMainCam: t,
|
|
1923
385
|
connection: n,
|
|
1924
386
|
onSetParameters: r,
|
|
1925
387
|
ignoreForCodec: s
|
|
1926
388
|
}) => {
|
|
1927
|
-
const
|
|
1928
|
-
if (!(
|
|
1929
|
-
return
|
|
1930
|
-
const
|
|
1931
|
-
return
|
|
1932
|
-
{ mainCam: e, resolutionMainCam: t, sender:
|
|
389
|
+
const a = n.getSenders(), c = Pe(a);
|
|
390
|
+
if (!(c != null && c.track))
|
|
391
|
+
return U;
|
|
392
|
+
const u = await Ie(c);
|
|
393
|
+
return K(u, s) ? U : Ke(
|
|
394
|
+
{ mainCam: e, resolutionMainCam: t, sender: c, codec: u, track: c.track },
|
|
1933
395
|
r
|
|
1934
396
|
);
|
|
1935
|
-
},
|
|
397
|
+
}, Ze = (e, {
|
|
1936
398
|
ignoreForCodec: t,
|
|
1937
399
|
onSetParameters: n
|
|
1938
400
|
} = {}) => {
|
|
1939
401
|
const r = async () => {
|
|
1940
|
-
const { connection:
|
|
1941
|
-
if (!
|
|
402
|
+
const { connection: i } = e;
|
|
403
|
+
if (!i)
|
|
1942
404
|
throw new Error("connection is not exist");
|
|
1943
|
-
return
|
|
1944
|
-
connection:
|
|
405
|
+
return L({
|
|
406
|
+
connection: i,
|
|
1945
407
|
onSetParameters: n,
|
|
1946
408
|
ignoreForCodec: t
|
|
1947
409
|
});
|
|
1948
410
|
};
|
|
1949
411
|
let s = r;
|
|
1950
|
-
const
|
|
1951
|
-
const { mainCam:
|
|
1952
|
-
if (!
|
|
412
|
+
const a = async (i) => (s = async () => {
|
|
413
|
+
const { mainCam: m, resolutionMainCam: d } = i, { connection: l } = e;
|
|
414
|
+
if (!l)
|
|
1953
415
|
throw new Error("connection is not exist");
|
|
1954
|
-
return
|
|
1955
|
-
mainCam:
|
|
416
|
+
return L({
|
|
417
|
+
mainCam: m,
|
|
1956
418
|
resolutionMainCam: d,
|
|
1957
|
-
connection:
|
|
419
|
+
connection: l,
|
|
1958
420
|
onSetParameters: n,
|
|
1959
421
|
ignoreForCodec: t
|
|
1960
422
|
});
|
|
1961
423
|
}, s());
|
|
1962
424
|
return {
|
|
1963
425
|
subscribe: () => {
|
|
1964
|
-
e.onSession("main-cam-control",
|
|
426
|
+
e.onSession("main-cam-control", a);
|
|
1965
427
|
},
|
|
1966
428
|
unsubscribe: () => {
|
|
1967
|
-
e.offSession("main-cam-control",
|
|
429
|
+
e.offSession("main-cam-control", a);
|
|
1968
430
|
},
|
|
1969
431
|
balanceByTrack: r,
|
|
1970
432
|
resetMainCamControl() {
|
|
@@ -1976,19 +438,19 @@ const Zu = /* @__PURE__ */ ot(Qu), el = (e) => Rc(
|
|
|
1976
438
|
};
|
|
1977
439
|
};
|
|
1978
440
|
export {
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
441
|
+
B as EEventsMainCAM,
|
|
442
|
+
tn as EEventsMic,
|
|
443
|
+
rn as EEventsSyncMediaState,
|
|
444
|
+
sn as EUseLicense,
|
|
445
|
+
on as causes,
|
|
446
|
+
an as constants,
|
|
447
|
+
dn as debug,
|
|
448
|
+
He as default,
|
|
449
|
+
cn as disableDebug,
|
|
450
|
+
un as enableDebug,
|
|
451
|
+
ln as eventNames,
|
|
452
|
+
Ie as getCodecFromSender,
|
|
453
|
+
Sn as hasCanceledCallError,
|
|
454
|
+
Ze as resolveVideoSendingBalancer,
|
|
455
|
+
Qe as tools
|
|
1994
456
|
};
|