sip-connector 23.0.0 → 23.1.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-CmHfa0Ce.js → @SipConnector-B599bzsb.js} +223 -204
- package/dist/@SipConnector-Cf-5oSvs.cjs +1 -0
- package/dist/CallManager/@CallManager.d.ts +2 -0
- package/dist/CallManager/RecvSession.d.ts +1 -0
- package/dist/CallManager/StreamsManagerProvider.d.ts +1 -0
- package/dist/__fixtures__/Request.mock.d.ts +1 -1
- package/dist/__fixtures__/UA.mock.d.ts +13 -3
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +162 -134
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/@SipConnector-DwgaqxCG.cjs +0 -1
|
@@ -8,9 +8,9 @@ import { createStackPromises as Ee, isPromiseIsNotActualError as Ze } from "stac
|
|
|
8
8
|
import "ua-parser-js";
|
|
9
9
|
import "sequent-promises";
|
|
10
10
|
import et from "lodash";
|
|
11
|
-
const ee = "sip-connector", d = Z(ee),
|
|
11
|
+
const ee = "sip-connector", d = Z(ee), di = () => {
|
|
12
12
|
Z.enable(ee);
|
|
13
|
-
},
|
|
13
|
+
}, hi = () => {
|
|
14
14
|
Z.enable(`-${ee}`);
|
|
15
15
|
}, tt = "Error decline with 603", nt = 1006, st = (n) => typeof n == "object" && n !== null && "code" in n && n.code === nt, it = (n) => n.message === tt;
|
|
16
16
|
var W = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(W || {}), y = /* @__PURE__ */ ((n) => (n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n))(y || {}), _ = /* @__PURE__ */ ((n) => (n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.STATS = "application/vinteo.webrtc.stats", n))(_ || {}), f = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(f || {}), x = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(x || {}), Se = /* @__PURE__ */ ((n) => (n.H264 = "H264", n.VP8 = "VP8", n.VP9 = "VP9", n.AV1 = "AV1", n))(Se || {}), h = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENTED_STREAM_STATE = "x-webrtc-share-state", n.CONTENTED_STREAM_CODEC = "x-webrtc-share-codec", n.AVAILABLE_INCOMING_BITRATE = "X-WEBRTC-AVAILABLE-INCOMING-BITRATE", n.AUDIO_TRACK_COUNT = "X-WEBRTC-AUDIO-TRACK-COUNT", n.VIDEO_TRACK_COUNT = "X-WEBRTC-VIDEO-TRACK-COUNT", n.TRACKS_DIRECTION = "X-WEBRTC-TRACKS-DIRECTION", n.AUDIO_ID = "X-WEBRTC-AUDIOID", n))(h || {}), $ = /* @__PURE__ */ ((n) => (n.AVAILABLE_CONTENTED_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_CONTENTED_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))($ || {}), U = /* @__PURE__ */ ((n) => (n.AVAILABLE_CONTENTED_STREAM = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_CONTENTED_STREAM = "x-webrtc-share-state: CONTENTEND", n.ACK_PERMISSION_TO_START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.STOPPED_CLIENT_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n))(U || {}), Q = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(Q || {}), Ce = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Ce || {}), g = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "enter-room", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "use-license", n.NEW_DTMF = "new-dtmf", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CONTENTED_STREAM_AVAILABLE = "contented-stream:available", n.CONTENTED_STREAM_NOT_AVAILABLE = "contented-stream:not-available", n.PRESENTATION_MUST_STOP = "presentation:must-stop", n.CHANNELS_ALL = "channels:all", n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS_SYNTHETIC = "participant:move-request-to-spectators-synthetic", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS_WITH_AUDIO_ID = "participant:move-request-to-spectators-with-audio-id", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.ADMIN_START_MAIN_CAM = "admin:start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin:stop-main-cam", n.ADMIN_START_MIC = "admin:start-mic", n.ADMIN_STOP_MIC = "admin:stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin:force-sync-media-state", n))(g || {});
|
|
@@ -935,11 +935,15 @@ class pt {
|
|
|
935
935
|
this.connection.close();
|
|
936
936
|
}
|
|
937
937
|
async call(e) {
|
|
938
|
-
const t = this.waitForTracks()
|
|
938
|
+
const t = this.waitForTracks();
|
|
939
|
+
await this.renegotiate(e), await t;
|
|
940
|
+
}
|
|
941
|
+
async renegotiate(e) {
|
|
942
|
+
const t = await this.createOffer(), s = await this.tools.sendOffer(
|
|
939
943
|
{ conferenceNumber: e, quality: this.config.quality, audioChannel: this.config.audioChannel },
|
|
940
|
-
|
|
944
|
+
t
|
|
941
945
|
);
|
|
942
|
-
await this.setRemoteDescription(
|
|
946
|
+
return await this.setRemoteDescription(s), !0;
|
|
943
947
|
}
|
|
944
948
|
async createOffer() {
|
|
945
949
|
const e = await this.connection.createOffer();
|
|
@@ -1160,8 +1164,8 @@ class vt {
|
|
|
1160
1164
|
this.lastEmittedStreams = void 0;
|
|
1161
1165
|
}
|
|
1162
1166
|
}
|
|
1163
|
-
const ft = "default", Mt = "dual", ie = (n) => [...n.getTracks()].some((e) => e.label.includes(Mt));
|
|
1164
|
-
class
|
|
1167
|
+
const ft = "default", Mt = "dual", _t = "content_", bt = (n) => `${_t}${n.toLowerCase()}`, ie = (n) => [...n.getTracks()].some((e) => e.label.includes(Mt));
|
|
1168
|
+
class Ot {
|
|
1165
1169
|
mainRemoteStreamsManager;
|
|
1166
1170
|
recvRemoteStreamsManager;
|
|
1167
1171
|
constructor(e, t) {
|
|
@@ -1187,13 +1191,21 @@ class _t {
|
|
|
1187
1191
|
}) {
|
|
1188
1192
|
const t = this.recvRemoteStreamsManager;
|
|
1189
1193
|
return { manager: t, getRemoteStreams: () => {
|
|
1190
|
-
const
|
|
1191
|
-
return { mainStream:
|
|
1194
|
+
const r = t.getStreams(ft)[0], a = this.getRecvRemoteContentedStream({ stateInfo: e });
|
|
1195
|
+
return { mainStream: r, contentedStream: a };
|
|
1192
1196
|
} };
|
|
1193
1197
|
}
|
|
1198
|
+
getRecvRemoteContentedStream({
|
|
1199
|
+
stateInfo: e
|
|
1200
|
+
}) {
|
|
1201
|
+
if (!e.isAvailable || e.codec === void 0)
|
|
1202
|
+
return;
|
|
1203
|
+
const t = bt(e.codec);
|
|
1204
|
+
return this.recvRemoteStreamsManager.getStreams(t)[0];
|
|
1205
|
+
}
|
|
1194
1206
|
}
|
|
1195
1207
|
const re = (n) => n.streams[0]?.id;
|
|
1196
|
-
class
|
|
1208
|
+
class Dt {
|
|
1197
1209
|
events;
|
|
1198
1210
|
callStateMachine;
|
|
1199
1211
|
isPendingCall = !1;
|
|
@@ -1212,7 +1224,7 @@ class bt {
|
|
|
1212
1224
|
disposeRecvSessionTrackListener;
|
|
1213
1225
|
streamsChangeTracker = new vt();
|
|
1214
1226
|
constructor(e, t) {
|
|
1215
|
-
this.conferenceStateManager = e, this.contentedStreamManager = t, this.events = Et(), this.mcuSession = new Ct(this.events, { onReset: this.reset }), this.callStateMachine = new gt(this.events), this.streamsManagerProvider = new
|
|
1227
|
+
this.conferenceStateManager = e, this.contentedStreamManager = t, this.events = Et(), this.mcuSession = new Ct(this.events, { onReset: this.reset }), this.callStateMachine = new gt(this.events), this.streamsManagerProvider = new Ot(
|
|
1216
1228
|
this.mainRemoteStreamsManager,
|
|
1217
1229
|
this.recvRemoteStreamsManager
|
|
1218
1230
|
), this.subscribeCallStatusChange(), this.subscribeMcuRemoteTrackEvents(), this.subscribeContentedStreamEvents();
|
|
@@ -1262,7 +1274,7 @@ class bt {
|
|
|
1262
1274
|
return this.mcuSession.endCall();
|
|
1263
1275
|
}
|
|
1264
1276
|
async renegotiate() {
|
|
1265
|
-
return this.
|
|
1277
|
+
return this.roleManager.hasSpectator() ? this.renegotiateRecvSession() : this.renegotiateMcuSession();
|
|
1266
1278
|
}
|
|
1267
1279
|
answerToIncomingCall = async (e, t) => {
|
|
1268
1280
|
this.isPendingAnswer = !0;
|
|
@@ -1405,40 +1417,47 @@ class bt {
|
|
|
1405
1417
|
this.emitEventChangedRemoteStreams(this.getRemoteStreams());
|
|
1406
1418
|
});
|
|
1407
1419
|
}
|
|
1420
|
+
async renegotiateRecvSession() {
|
|
1421
|
+
const e = this.conferenceStateManager.getNumber();
|
|
1422
|
+
return e === void 0 || this.recvSession === void 0 ? !1 : this.recvSession.renegotiate(e);
|
|
1423
|
+
}
|
|
1424
|
+
async renegotiateMcuSession() {
|
|
1425
|
+
return this.mcuSession.renegotiate();
|
|
1426
|
+
}
|
|
1408
1427
|
}
|
|
1409
|
-
const
|
|
1428
|
+
const Pt = (n, e) => (n.degradationPreference = e.degradationPreference, n), yt = (n, e) => {
|
|
1410
1429
|
n.encodings ??= [];
|
|
1411
1430
|
for (let t = n.encodings.length; t < e; t += 1)
|
|
1412
1431
|
n.encodings.push({});
|
|
1413
1432
|
return n;
|
|
1414
|
-
}, Ie = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n,
|
|
1415
|
-
if (
|
|
1433
|
+
}, Ie = (n) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== n, Lt = Ie(), wt = (n, e) => {
|
|
1434
|
+
if (Lt(n, e))
|
|
1416
1435
|
return n;
|
|
1417
|
-
},
|
|
1418
|
-
const t = n.maxBitrate, s =
|
|
1436
|
+
}, Ut = (n, e) => {
|
|
1437
|
+
const t = n.maxBitrate, s = wt(e, t);
|
|
1419
1438
|
return s !== void 0 && (n.maxBitrate = s), n;
|
|
1420
|
-
}, ve = 1,
|
|
1439
|
+
}, ve = 1, Ft = Ie(
|
|
1421
1440
|
ve
|
|
1422
|
-
),
|
|
1441
|
+
), Bt = (n, e) => {
|
|
1423
1442
|
const t = n === void 0 ? void 0 : Math.max(n, ve);
|
|
1424
|
-
if (t !== void 0 &&
|
|
1443
|
+
if (t !== void 0 && Ft(
|
|
1425
1444
|
t,
|
|
1426
1445
|
e
|
|
1427
1446
|
))
|
|
1428
1447
|
return t;
|
|
1429
|
-
},
|
|
1430
|
-
const t = n.scaleResolutionDownBy, s =
|
|
1448
|
+
}, kt = (n, e) => {
|
|
1449
|
+
const t = n.scaleResolutionDownBy, s = Bt(
|
|
1431
1450
|
e,
|
|
1432
1451
|
t
|
|
1433
1452
|
);
|
|
1434
1453
|
return s !== void 0 && (n.scaleResolutionDownBy = s), n;
|
|
1435
|
-
},
|
|
1454
|
+
}, $t = (n, e) => {
|
|
1436
1455
|
const t = e.encodings?.length ?? 0;
|
|
1437
|
-
return
|
|
1456
|
+
return yt(n, t), n.encodings.forEach((s, i) => {
|
|
1438
1457
|
const r = (e?.encodings ?? [])[i], a = r?.maxBitrate, o = r?.scaleResolutionDownBy;
|
|
1439
|
-
|
|
1458
|
+
Ut(s, a), kt(s, o);
|
|
1440
1459
|
}), n;
|
|
1441
|
-
},
|
|
1460
|
+
}, Gt = (n, e) => {
|
|
1442
1461
|
if (n.codecs?.length !== e.codecs?.length)
|
|
1443
1462
|
return !0;
|
|
1444
1463
|
for (let t = 0; t < (n.codecs?.length ?? 0); t++)
|
|
@@ -1455,15 +1474,15 @@ const Ot = (n, e) => (n.degradationPreference = e.degradationPreference, n), Dt
|
|
|
1455
1474
|
if (JSON.stringify(n.encodings[t]) !== JSON.stringify(e.encodings[t]))
|
|
1456
1475
|
return !0;
|
|
1457
1476
|
return n.rtcp?.cname !== e.rtcp?.cname || n.rtcp?.reducedSize !== e.rtcp?.reducedSize || n.degradationPreference !== e.degradationPreference;
|
|
1458
|
-
},
|
|
1477
|
+
}, Vt = async (n, e) => {
|
|
1459
1478
|
const t = n.getParameters(), s = JSON.parse(
|
|
1460
1479
|
JSON.stringify(t)
|
|
1461
1480
|
);
|
|
1462
|
-
|
|
1463
|
-
const i =
|
|
1481
|
+
$t(t, e), Pt(t, e);
|
|
1482
|
+
const i = Gt(s, t);
|
|
1464
1483
|
return i && await n.setParameters(t), { parameters: t, isChanged: i };
|
|
1465
1484
|
}, fe = async (n, e, t) => {
|
|
1466
|
-
const { isChanged: s, parameters: i } = await
|
|
1485
|
+
const { isChanged: s, parameters: i } = await Vt(n, {
|
|
1467
1486
|
encodings: [
|
|
1468
1487
|
{
|
|
1469
1488
|
scaleResolutionDownBy: e.scaleResolutionDownBy,
|
|
@@ -1472,8 +1491,8 @@ const Ot = (n, e) => (n.degradationPreference = e.degradationPreference, n), Dt
|
|
|
1472
1491
|
]
|
|
1473
1492
|
});
|
|
1474
1493
|
return s && t && t(i), { isChanged: s, parameters: i };
|
|
1475
|
-
},
|
|
1476
|
-
const s =
|
|
1494
|
+
}, qt = (n, e) => n.find((t) => t.track !== null && e.getTracks().includes(t.track)), Ht = async (n, e, t) => {
|
|
1495
|
+
const s = qt(n, e);
|
|
1477
1496
|
if (s)
|
|
1478
1497
|
return fe(s, { maxBitrate: t });
|
|
1479
1498
|
};
|
|
@@ -1484,9 +1503,9 @@ const Me = [
|
|
|
1484
1503
|
"presentation:end",
|
|
1485
1504
|
"presentation:ended",
|
|
1486
1505
|
"presentation:failed"
|
|
1487
|
-
],
|
|
1488
|
-
var
|
|
1489
|
-
const
|
|
1506
|
+
], Wt = () => new R(Me);
|
|
1507
|
+
var xt = /* @__PURE__ */ ((n) => (n.IDLE = "presentation:idle", n.STARTING = "presentation:starting", n.ACTIVE = "presentation:active", n.STOPPING = "presentation:stopping", n.FAILED = "presentation:failed", n))(xt || {});
|
|
1508
|
+
const Qt = G({
|
|
1490
1509
|
types: {
|
|
1491
1510
|
context: {},
|
|
1492
1511
|
events: {}
|
|
@@ -1811,9 +1830,9 @@ const Wt = G({
|
|
|
1811
1830
|
}
|
|
1812
1831
|
}
|
|
1813
1832
|
});
|
|
1814
|
-
class
|
|
1833
|
+
class Yt extends V {
|
|
1815
1834
|
constructor(e) {
|
|
1816
|
-
super(
|
|
1835
|
+
super(Qt), this.subscribeCallEvents(e);
|
|
1817
1836
|
}
|
|
1818
1837
|
get isIdle() {
|
|
1819
1838
|
return this.state === "presentation:idle";
|
|
@@ -1883,8 +1902,8 @@ class xt extends V {
|
|
|
1883
1902
|
);
|
|
1884
1903
|
}
|
|
1885
1904
|
}
|
|
1886
|
-
const
|
|
1887
|
-
class
|
|
1905
|
+
const Xt = 1, li = (n) => je(n);
|
|
1906
|
+
class Jt {
|
|
1888
1907
|
events;
|
|
1889
1908
|
presentationStateMachine;
|
|
1890
1909
|
promisePendingStartPresentation;
|
|
@@ -1897,7 +1916,7 @@ class Yt {
|
|
|
1897
1916
|
callManager: e,
|
|
1898
1917
|
maxBitrate: t
|
|
1899
1918
|
}) {
|
|
1900
|
-
this.callManager = e, this.maxBitrate = t, this.events =
|
|
1919
|
+
this.callManager = e, this.maxBitrate = t, this.events = Wt(), this.presentationStateMachine = new Yt(this.callManager.events), this.subscribe();
|
|
1901
1920
|
}
|
|
1902
1921
|
get presentationActor() {
|
|
1903
1922
|
return this.presentationStateMachine.actorRef;
|
|
@@ -1995,7 +2014,7 @@ class Yt {
|
|
|
1995
2014
|
stream: s,
|
|
1996
2015
|
presentationOptions: i,
|
|
1997
2016
|
options: r = {
|
|
1998
|
-
callLimit:
|
|
2017
|
+
callLimit: Xt
|
|
1999
2018
|
}
|
|
2000
2019
|
}) {
|
|
2001
2020
|
const a = async () => this.sendPresentation(
|
|
@@ -2041,7 +2060,7 @@ class Yt {
|
|
|
2041
2060
|
if (!e || !t || s === void 0)
|
|
2042
2061
|
return;
|
|
2043
2062
|
const i = e.getSenders();
|
|
2044
|
-
await
|
|
2063
|
+
await Ht(i, t, s);
|
|
2045
2064
|
};
|
|
2046
2065
|
getRtcSessionProtected = () => {
|
|
2047
2066
|
const e = this.callManager.getEstablishedRTCSession();
|
|
@@ -2062,7 +2081,7 @@ class Yt {
|
|
|
2062
2081
|
delete this.streamPresentationCurrent;
|
|
2063
2082
|
}
|
|
2064
2083
|
}
|
|
2065
|
-
class
|
|
2084
|
+
class zt {
|
|
2066
2085
|
data;
|
|
2067
2086
|
getUa;
|
|
2068
2087
|
constructor(e) {
|
|
@@ -2159,7 +2178,7 @@ const _e = [
|
|
|
2159
2178
|
"registrationFailed",
|
|
2160
2179
|
"newMessage",
|
|
2161
2180
|
"sipEvent"
|
|
2162
|
-
],
|
|
2181
|
+
], jt = [
|
|
2163
2182
|
"disconnecting",
|
|
2164
2183
|
"connect-started",
|
|
2165
2184
|
"connect-succeeded",
|
|
@@ -2167,12 +2186,12 @@ const _e = [
|
|
|
2167
2186
|
"connect-parameters-resolve-success",
|
|
2168
2187
|
"connect-parameters-resolve-failed",
|
|
2169
2188
|
"connected-with-configuration"
|
|
2170
|
-
], be = [..._e, ...
|
|
2171
|
-
function
|
|
2189
|
+
], be = [..._e, ...jt], Kt = () => new R(be);
|
|
2190
|
+
function Zt(n) {
|
|
2172
2191
|
return (e) => `sip:${e}@${n}`;
|
|
2173
2192
|
}
|
|
2174
|
-
const
|
|
2175
|
-
class
|
|
2193
|
+
const en = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, Oe = (n) => n.trim().replaceAll(" ", "_"), tn = en(1e5, 99999999), nn = 3;
|
|
2194
|
+
class sn {
|
|
2176
2195
|
cancelableConnectWithRepeatedCalls;
|
|
2177
2196
|
JsSIP;
|
|
2178
2197
|
events;
|
|
@@ -2216,7 +2235,7 @@ class tn {
|
|
|
2216
2235
|
cancelRequests() {
|
|
2217
2236
|
this.cancelConnectWithRepeatedCalls();
|
|
2218
2237
|
}
|
|
2219
|
-
connectWithDuplicatedCalls = async (e, { callLimit: t =
|
|
2238
|
+
connectWithDuplicatedCalls = async (e, { callLimit: t = nn } = {}) => {
|
|
2220
2239
|
const s = async () => this.connectInner(e), i = (r) => {
|
|
2221
2240
|
const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), l = r != null && !st(r);
|
|
2222
2241
|
return c || l;
|
|
@@ -2326,8 +2345,8 @@ class tn {
|
|
|
2326
2345
|
});
|
|
2327
2346
|
}
|
|
2328
2347
|
}
|
|
2329
|
-
var
|
|
2330
|
-
const
|
|
2348
|
+
var rn = /* @__PURE__ */ ((n) => (n.IDLE = "connection:idle", n.PREPARING = "connection:preparing", n.CONNECTING = "connection:connecting", n.CONNECTED = "connection:connected", n.REGISTERED = "connection:registered", n.ESTABLISHED = "connection:established", n.DISCONNECTED = "connection:disconnected", n.FAILED = "connection:failed", n))(rn || {}), De = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(De || {});
|
|
2349
|
+
const an = Object.values(De), on = G({
|
|
2331
2350
|
types: {
|
|
2332
2351
|
context: {},
|
|
2333
2352
|
events: {}
|
|
@@ -2707,11 +2726,11 @@ const sn = Object.values(De), rn = G({
|
|
|
2707
2726
|
}
|
|
2708
2727
|
}
|
|
2709
2728
|
});
|
|
2710
|
-
class
|
|
2729
|
+
class cn extends V {
|
|
2711
2730
|
events;
|
|
2712
2731
|
unsubscribeFromEvents;
|
|
2713
2732
|
constructor(e) {
|
|
2714
|
-
super(
|
|
2733
|
+
super(on), this.events = e, this.subscribeToEvents();
|
|
2715
2734
|
}
|
|
2716
2735
|
get isIdle() {
|
|
2717
2736
|
return this.hasState(
|
|
@@ -2793,7 +2812,7 @@ class an extends V {
|
|
|
2793
2812
|
return this.getSnapshot().can({ type: e });
|
|
2794
2813
|
}
|
|
2795
2814
|
getValidEvents() {
|
|
2796
|
-
return
|
|
2815
|
+
return an.filter((e) => this.canTransition(e));
|
|
2797
2816
|
}
|
|
2798
2817
|
hasState(e) {
|
|
2799
2818
|
return this.getSnapshot().matches(e);
|
|
@@ -2865,7 +2884,7 @@ class an extends V {
|
|
|
2865
2884
|
this.toFailed(e instanceof Error ? e : void 0);
|
|
2866
2885
|
};
|
|
2867
2886
|
}
|
|
2868
|
-
class
|
|
2887
|
+
class dn {
|
|
2869
2888
|
events;
|
|
2870
2889
|
getUaProtected;
|
|
2871
2890
|
constructor(e) {
|
|
@@ -2902,7 +2921,7 @@ class on {
|
|
|
2902
2921
|
};
|
|
2903
2922
|
}
|
|
2904
2923
|
}
|
|
2905
|
-
class
|
|
2924
|
+
class hn {
|
|
2906
2925
|
uaFactory;
|
|
2907
2926
|
getUaProtected;
|
|
2908
2927
|
constructor(e) {
|
|
@@ -2967,7 +2986,7 @@ class cn {
|
|
|
2967
2986
|
});
|
|
2968
2987
|
}
|
|
2969
2988
|
}
|
|
2970
|
-
const
|
|
2989
|
+
const ln = (n) => {
|
|
2971
2990
|
const e = [];
|
|
2972
2991
|
return n !== void 0 && n !== "" && e.push(`X-Vinteo-Remote: ${n}`), e;
|
|
2973
2992
|
};
|
|
@@ -2996,10 +3015,10 @@ class F {
|
|
|
2996
3015
|
throw new Error("user is required for authorized connection");
|
|
2997
3016
|
}
|
|
2998
3017
|
static resolveAuthorizationUser(e, t) {
|
|
2999
|
-
return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${
|
|
3018
|
+
return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${tn()}`;
|
|
3000
3019
|
}
|
|
3001
3020
|
static buildExtraHeaders(e, t) {
|
|
3002
|
-
const s = e !== void 0 && e !== "" ?
|
|
3021
|
+
const s = e !== void 0 && e !== "" ? ln(e) : [];
|
|
3003
3022
|
return t === void 0 ? s : [...s, ...t];
|
|
3004
3023
|
}
|
|
3005
3024
|
createConfiguration({
|
|
@@ -3023,7 +3042,7 @@ class F {
|
|
|
3023
3042
|
sipServerIp: r,
|
|
3024
3043
|
sipServerUrl: s
|
|
3025
3044
|
});
|
|
3026
|
-
const E = F.resolveAuthorizationUser(a, e), m =
|
|
3045
|
+
const E = F.resolveAuthorizationUser(a, e), m = Zt(r), D = m(E), A = new this.JsSIP.WebSocketInterface(`wss://${s}/webrtc/wss/`);
|
|
3027
3046
|
return {
|
|
3028
3047
|
configuration: {
|
|
3029
3048
|
password: t,
|
|
@@ -3063,8 +3082,8 @@ class F {
|
|
|
3063
3082
|
}), { ua: r, helpers: i };
|
|
3064
3083
|
}
|
|
3065
3084
|
}
|
|
3066
|
-
const Pe = "Not ready for connection",
|
|
3067
|
-
class
|
|
3085
|
+
const Pe = "Not ready for connection", gn = (n) => n instanceof Error && n.message === Pe, un = () => new Error(Pe), Tn = async (n) => typeof n == "function" ? n() : n;
|
|
3086
|
+
class En {
|
|
3068
3087
|
events;
|
|
3069
3088
|
ua;
|
|
3070
3089
|
socket;
|
|
@@ -3076,15 +3095,15 @@ class un {
|
|
|
3076
3095
|
configurationManager;
|
|
3077
3096
|
JsSIP;
|
|
3078
3097
|
constructor({ JsSIP: e }) {
|
|
3079
|
-
this.JsSIP = e, this.events =
|
|
3098
|
+
this.JsSIP = e, this.events = Kt(), this.uaFactory = new F(e), this.registrationManager = new dn({
|
|
3080
3099
|
events: this.events,
|
|
3081
3100
|
getUaProtected: this.getUaProtected
|
|
3082
|
-
}), this.stateMachine = new
|
|
3101
|
+
}), this.stateMachine = new cn(this.events), this.configurationManager = new zt({
|
|
3083
3102
|
getUa: this.getUa
|
|
3084
|
-
}), this.sipOperations = new
|
|
3103
|
+
}), this.sipOperations = new hn({
|
|
3085
3104
|
uaFactory: this.uaFactory,
|
|
3086
3105
|
getUaProtected: this.getUaProtected
|
|
3087
|
-
}), this.connectionFlow = new
|
|
3106
|
+
}), this.connectionFlow = new sn({
|
|
3088
3107
|
JsSIP: this.JsSIP,
|
|
3089
3108
|
events: this.events,
|
|
3090
3109
|
uaFactory: this.uaFactory,
|
|
@@ -3189,7 +3208,7 @@ class un {
|
|
|
3189
3208
|
getUa = () => this.ua;
|
|
3190
3209
|
connectWithProcessError = async (e, t) => {
|
|
3191
3210
|
if (!(t?.hasReadyForConnection?.() ?? !0))
|
|
3192
|
-
throw
|
|
3211
|
+
throw un();
|
|
3193
3212
|
return this.processConnect(e, t).catch(async (i) => {
|
|
3194
3213
|
const r = i;
|
|
3195
3214
|
return this.disconnect().then(() => {
|
|
@@ -3199,7 +3218,7 @@ class un {
|
|
|
3199
3218
|
});
|
|
3200
3219
|
});
|
|
3201
3220
|
};
|
|
3202
|
-
processConnect = async (e, t) => (this.events.trigger(C.CONNECT_STARTED, {}),
|
|
3221
|
+
processConnect = async (e, t) => (this.events.trigger(C.CONNECT_STARTED, {}), Tn(e).then((s) => (this.events.trigger(C.CONNECT_PARAMETERS_RESOLVE_SUCCESS, s), s)).catch((s) => {
|
|
3203
3222
|
throw this.events.trigger(C.CONNECT_PARAMETERS_RESOLVE_FAILED, s), s;
|
|
3204
3223
|
}).then(async (s) => this.connectionFlow.connect(s, t)).then((s) => (this.events.trigger(C.CONNECT_SUCCEEDED, {
|
|
3205
3224
|
...s
|
|
@@ -3208,7 +3227,7 @@ class un {
|
|
|
3208
3227
|
throw this.events.trigger(C.CONNECT_FAILED, i), i;
|
|
3209
3228
|
}));
|
|
3210
3229
|
}
|
|
3211
|
-
class
|
|
3230
|
+
class Sn {
|
|
3212
3231
|
connectionManager;
|
|
3213
3232
|
stackPromises = Ee({
|
|
3214
3233
|
noRunIsNotActual: !0
|
|
@@ -3222,11 +3241,11 @@ class Tn {
|
|
|
3222
3241
|
this.stackPromises.stop();
|
|
3223
3242
|
}
|
|
3224
3243
|
}
|
|
3225
|
-
const ae = 0,
|
|
3226
|
-
class
|
|
3244
|
+
const ae = 0, Cn = 30;
|
|
3245
|
+
class pn {
|
|
3227
3246
|
countInner = ae;
|
|
3228
3247
|
initialCount = ae;
|
|
3229
|
-
limitInner =
|
|
3248
|
+
limitInner = Cn;
|
|
3230
3249
|
isInProgress = !1;
|
|
3231
3250
|
onStatusChange;
|
|
3232
3251
|
constructor({
|
|
@@ -3259,7 +3278,7 @@ class Sn {
|
|
|
3259
3278
|
this.countInner = this.initialCount, this.finishAttempt();
|
|
3260
3279
|
}
|
|
3261
3280
|
}
|
|
3262
|
-
class
|
|
3281
|
+
class mn {
|
|
3263
3282
|
connectionManager;
|
|
3264
3283
|
interval;
|
|
3265
3284
|
checkTelephonyByTimeout = void 0;
|
|
@@ -3304,7 +3323,7 @@ const ye = [
|
|
|
3304
3323
|
"changed-attempt-status",
|
|
3305
3324
|
"stop-attempts-by-error",
|
|
3306
3325
|
"limit-reached-attempts"
|
|
3307
|
-
],
|
|
3326
|
+
], Nn = () => new R(ye);
|
|
3308
3327
|
class te {
|
|
3309
3328
|
callManager;
|
|
3310
3329
|
disposers = [];
|
|
@@ -3330,15 +3349,15 @@ class te {
|
|
|
3330
3349
|
this.callManager.isCallActive ? e?.() : t();
|
|
3331
3350
|
}
|
|
3332
3351
|
}
|
|
3333
|
-
const
|
|
3334
|
-
class
|
|
3352
|
+
const An = 15e3, Rn = 2;
|
|
3353
|
+
class In {
|
|
3335
3354
|
connectionManager;
|
|
3336
3355
|
pingServerByTimeoutWithFailCalls;
|
|
3337
3356
|
constructor({ connectionManager: e }) {
|
|
3338
|
-
this.connectionManager = e, this.pingServerByTimeoutWithFailCalls = Xe(
|
|
3357
|
+
this.connectionManager = e, this.pingServerByTimeoutWithFailCalls = Xe(Rn, {
|
|
3339
3358
|
whenPossibleRequest: async () => {
|
|
3340
3359
|
},
|
|
3341
|
-
requestInterval:
|
|
3360
|
+
requestInterval: An,
|
|
3342
3361
|
request: async () => (d("ping"), this.connectionManager.ping().then(() => {
|
|
3343
3362
|
d("ping success");
|
|
3344
3363
|
}))
|
|
@@ -3351,14 +3370,14 @@ class An {
|
|
|
3351
3370
|
this.pingServerByTimeoutWithFailCalls.stop();
|
|
3352
3371
|
}
|
|
3353
3372
|
}
|
|
3354
|
-
class
|
|
3373
|
+
class vn {
|
|
3355
3374
|
pingServerRequester;
|
|
3356
3375
|
notActiveCallSubscriber;
|
|
3357
3376
|
constructor({
|
|
3358
3377
|
connectionManager: e,
|
|
3359
3378
|
callManager: t
|
|
3360
3379
|
}) {
|
|
3361
|
-
this.pingServerRequester = new
|
|
3380
|
+
this.pingServerRequester = new In({
|
|
3362
3381
|
connectionManager: e
|
|
3363
3382
|
}), this.notActiveCallSubscriber = new te({ callManager: t });
|
|
3364
3383
|
}
|
|
@@ -3379,7 +3398,7 @@ class Rn {
|
|
|
3379
3398
|
this.notActiveCallSubscriber.unsubscribe();
|
|
3380
3399
|
}
|
|
3381
3400
|
}
|
|
3382
|
-
class
|
|
3401
|
+
class fn {
|
|
3383
3402
|
connectionManager;
|
|
3384
3403
|
isRegistrationFailed = !1;
|
|
3385
3404
|
disposers = [];
|
|
@@ -3415,12 +3434,12 @@ class In {
|
|
|
3415
3434
|
this.isRegistrationFailed = !1;
|
|
3416
3435
|
}
|
|
3417
3436
|
}
|
|
3418
|
-
const
|
|
3437
|
+
const Mn = 3e3, _n = 15e3, oe = {
|
|
3419
3438
|
LIMIT_REACHED: "Limit reached",
|
|
3420
3439
|
FAILED_TO_RECONNECT: "Failed to reconnect"
|
|
3421
|
-
},
|
|
3422
|
-
},
|
|
3423
|
-
class
|
|
3440
|
+
}, bn = async () => {
|
|
3441
|
+
}, On = (n) => !0;
|
|
3442
|
+
class Dn {
|
|
3424
3443
|
events;
|
|
3425
3444
|
connectionManager;
|
|
3426
3445
|
connectionQueueManager;
|
|
@@ -3440,20 +3459,20 @@ class bn {
|
|
|
3440
3459
|
connectionManager: t,
|
|
3441
3460
|
callManager: s
|
|
3442
3461
|
}, i) {
|
|
3443
|
-
const r = i?.onBeforeRetry ??
|
|
3444
|
-
this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.canRetryOnError = a, this.networkInterfacesSubscriber = i?.networkInterfacesSubscriber, this.resumeFromSleepModeSubscriber = i?.resumeFromSleepModeSubscriber, this.events =
|
|
3462
|
+
const r = i?.onBeforeRetry ?? bn, a = i?.canRetryOnError ?? On;
|
|
3463
|
+
this.connectionQueueManager = e, this.connectionManager = t, this.onBeforeRetry = r, this.canRetryOnError = a, this.networkInterfacesSubscriber = i?.networkInterfacesSubscriber, this.resumeFromSleepModeSubscriber = i?.resumeFromSleepModeSubscriber, this.events = Nn(), this.checkTelephonyRequester = new mn({
|
|
3445
3464
|
connectionManager: t,
|
|
3446
|
-
interval: i?.checkTelephonyRequestInterval ??
|
|
3447
|
-
}), this.pingServerIfNotActiveCallRequester = new
|
|
3465
|
+
interval: i?.checkTelephonyRequestInterval ?? _n
|
|
3466
|
+
}), this.pingServerIfNotActiveCallRequester = new vn({
|
|
3448
3467
|
connectionManager: t,
|
|
3449
3468
|
callManager: s
|
|
3450
|
-
}), this.registrationFailedOutOfCallSubscriber = new
|
|
3469
|
+
}), this.registrationFailedOutOfCallSubscriber = new fn({
|
|
3451
3470
|
connectionManager: t,
|
|
3452
3471
|
callManager: s
|
|
3453
|
-
}), this.attemptsState = new
|
|
3472
|
+
}), this.attemptsState = new pn({
|
|
3454
3473
|
onStatusChange: this.emitStatusChange
|
|
3455
3474
|
}), this.cancelableRequestBeforeRetry = new Y(r), this.delayBetweenAttempts = new Je(
|
|
3456
|
-
i?.timeoutBetweenAttempts ??
|
|
3475
|
+
i?.timeoutBetweenAttempts ?? Mn
|
|
3457
3476
|
), this.notActiveCallSubscriber = new te({ callManager: s });
|
|
3458
3477
|
}
|
|
3459
3478
|
start(e) {
|
|
@@ -3519,7 +3538,7 @@ class bn {
|
|
|
3519
3538
|
}
|
|
3520
3539
|
}
|
|
3521
3540
|
handleConnectionError(e, t) {
|
|
3522
|
-
if (
|
|
3541
|
+
if (gn(e)) {
|
|
3523
3542
|
this.attemptsState.finishAttempt(), this.events.trigger(v.STOP_ATTEMPTS_BY_ERROR, e);
|
|
3524
3543
|
return;
|
|
3525
3544
|
}
|
|
@@ -3608,12 +3627,12 @@ class bn {
|
|
|
3608
3627
|
};
|
|
3609
3628
|
}
|
|
3610
3629
|
var j = /* @__PURE__ */ ((n) => (n.STATE_CHANGED = "state-changed", n.STATE_RESET = "state-reset", n))(j || {});
|
|
3611
|
-
const Le = ["state-changed", "state-reset"],
|
|
3612
|
-
class
|
|
3630
|
+
const Le = ["state-changed", "state-reset"], Pn = () => new R(Le);
|
|
3631
|
+
class yn {
|
|
3613
3632
|
events;
|
|
3614
3633
|
state = {};
|
|
3615
3634
|
constructor() {
|
|
3616
|
-
this.events =
|
|
3635
|
+
this.events = Pn();
|
|
3617
3636
|
}
|
|
3618
3637
|
getState() {
|
|
3619
3638
|
return { ...this.state };
|
|
@@ -3663,7 +3682,7 @@ class Dn {
|
|
|
3663
3682
|
this.events.off(e, t);
|
|
3664
3683
|
}
|
|
3665
3684
|
}
|
|
3666
|
-
const
|
|
3685
|
+
const Ln = G({
|
|
3667
3686
|
types: {
|
|
3668
3687
|
context: {},
|
|
3669
3688
|
events: {}
|
|
@@ -3704,9 +3723,9 @@ const Pn = G({
|
|
|
3704
3723
|
}
|
|
3705
3724
|
}
|
|
3706
3725
|
});
|
|
3707
|
-
class
|
|
3726
|
+
class wn extends V {
|
|
3708
3727
|
constructor() {
|
|
3709
|
-
super(
|
|
3728
|
+
super(Ln);
|
|
3710
3729
|
}
|
|
3711
3730
|
get isAvailable() {
|
|
3712
3731
|
return this.state === "contented-stream:available";
|
|
@@ -3748,16 +3767,16 @@ class yn extends V {
|
|
|
3748
3767
|
}
|
|
3749
3768
|
}
|
|
3750
3769
|
var K = /* @__PURE__ */ ((n) => (n.AVAILABLE = "available", n.NOT_AVAILABLE = "not-available", n))(K || {});
|
|
3751
|
-
const
|
|
3770
|
+
const Un = [
|
|
3752
3771
|
"available",
|
|
3753
3772
|
"not-available"
|
|
3754
3773
|
/* NOT_AVAILABLE */
|
|
3755
|
-
],
|
|
3756
|
-
class
|
|
3774
|
+
], Fn = () => new R(Un);
|
|
3775
|
+
class Bn {
|
|
3757
3776
|
events;
|
|
3758
3777
|
stateMachine;
|
|
3759
3778
|
constructor() {
|
|
3760
|
-
this.events =
|
|
3779
|
+
this.events = Fn(), this.stateMachine = new wn(), this.proxyEvents();
|
|
3761
3780
|
}
|
|
3762
3781
|
get isAvailable() {
|
|
3763
3782
|
return this.stateMachine.isAvailable;
|
|
@@ -3796,9 +3815,9 @@ const we = [
|
|
|
3796
3815
|
"declinedIncomingCall",
|
|
3797
3816
|
"terminatedIncomingCall",
|
|
3798
3817
|
"failedIncomingCall"
|
|
3799
|
-
],
|
|
3800
|
-
var
|
|
3801
|
-
const
|
|
3818
|
+
], kn = () => new R(we);
|
|
3819
|
+
var $n = /* @__PURE__ */ ((n) => (n.IDLE = "incoming:idle", n.RINGING = "incoming:ringing", n.CONSUMED = "incoming:consumed", n.DECLINED = "incoming:declined", n.TERMINATED = "incoming:terminated", n.FAILED = "incoming:failed", n))($n || {});
|
|
3820
|
+
const Gn = G({
|
|
3802
3821
|
types: {
|
|
3803
3822
|
context: {},
|
|
3804
3823
|
events: {}
|
|
@@ -4130,9 +4149,9 @@ const kn = G({
|
|
|
4130
4149
|
}
|
|
4131
4150
|
}
|
|
4132
4151
|
});
|
|
4133
|
-
class
|
|
4152
|
+
class Vn extends V {
|
|
4134
4153
|
constructor({ incomingEvents: e, connectionEvents: t }) {
|
|
4135
|
-
super(
|
|
4154
|
+
super(Gn), this.subscribeIncomingEvents(e), this.subscribeConnectionEvents(t);
|
|
4136
4155
|
}
|
|
4137
4156
|
get isIdle() {
|
|
4138
4157
|
return this.state === "incoming:idle";
|
|
@@ -4217,14 +4236,14 @@ class $n extends V {
|
|
|
4217
4236
|
this.send({ type: "INCOMING.CLEAR" });
|
|
4218
4237
|
}
|
|
4219
4238
|
}
|
|
4220
|
-
const
|
|
4221
|
-
class
|
|
4239
|
+
const qn = 486, Hn = 487;
|
|
4240
|
+
class Wn {
|
|
4222
4241
|
events;
|
|
4223
4242
|
incomingStateMachine;
|
|
4224
4243
|
incomingRTCSession;
|
|
4225
4244
|
connectionManager;
|
|
4226
4245
|
constructor(e) {
|
|
4227
|
-
this.connectionManager = e, this.events =
|
|
4246
|
+
this.connectionManager = e, this.events = kn(), this.incomingStateMachine = new Vn({
|
|
4228
4247
|
incomingEvents: this.events,
|
|
4229
4248
|
connectionEvents: this.connectionManager.events
|
|
4230
4249
|
}), this.start();
|
|
@@ -4260,7 +4279,7 @@ class qn {
|
|
|
4260
4279
|
return this.incomingStateMachine.toConsumed(), this.removeIncomingSession(), e;
|
|
4261
4280
|
};
|
|
4262
4281
|
async declineToIncomingCall({
|
|
4263
|
-
statusCode: e =
|
|
4282
|
+
statusCode: e = Hn
|
|
4264
4283
|
} = {}) {
|
|
4265
4284
|
return new Promise((t, s) => {
|
|
4266
4285
|
try {
|
|
@@ -4272,7 +4291,7 @@ class qn {
|
|
|
4272
4291
|
});
|
|
4273
4292
|
}
|
|
4274
4293
|
async busyIncomingCall() {
|
|
4275
|
-
return this.declineToIncomingCall({ statusCode:
|
|
4294
|
+
return this.declineToIncomingCall({ statusCode: qn });
|
|
4276
4295
|
}
|
|
4277
4296
|
on(e, t) {
|
|
4278
4297
|
return this.events.on(e, t);
|
|
@@ -4313,20 +4332,20 @@ class qn {
|
|
|
4313
4332
|
}
|
|
4314
4333
|
}
|
|
4315
4334
|
var Ue = /* @__PURE__ */ ((n) => (n.SNAPSHOT_CHANGED = "snapshot-changed", n))(Ue || {});
|
|
4316
|
-
const Fe = ["snapshot-changed"],
|
|
4335
|
+
const Fe = ["snapshot-changed"], xn = () => new R(Fe), Qn = (n, e) => Object.is(n, e), ce = (n) => ({
|
|
4317
4336
|
connection: n.connection.getSnapshot(),
|
|
4318
4337
|
call: n.call.getSnapshot(),
|
|
4319
4338
|
incoming: n.incoming.getSnapshot(),
|
|
4320
4339
|
presentation: n.presentation.getSnapshot()
|
|
4321
4340
|
});
|
|
4322
|
-
class
|
|
4341
|
+
class Yn {
|
|
4323
4342
|
events;
|
|
4324
4343
|
actors;
|
|
4325
4344
|
currentSnapshot;
|
|
4326
4345
|
subscribers = /* @__PURE__ */ new Set();
|
|
4327
4346
|
actorSubscriptions = [];
|
|
4328
4347
|
constructor(e) {
|
|
4329
|
-
this.events =
|
|
4348
|
+
this.events = xn(), this.actors = {
|
|
4330
4349
|
connection: e.connectionManager.connectionActor,
|
|
4331
4350
|
call: e.callManager.callActor,
|
|
4332
4351
|
incoming: e.incomingCallManager.incomingActor,
|
|
@@ -4342,7 +4361,7 @@ class xn {
|
|
|
4342
4361
|
return this.currentSnapshot;
|
|
4343
4362
|
}
|
|
4344
4363
|
subscribe(e, t, s) {
|
|
4345
|
-
const i = typeof t == "function", r = i ? e : (T) => T, a = i ? t : e, o = (i ? s : void 0) ??
|
|
4364
|
+
const i = typeof t == "function", r = i ? e : (T) => T, a = i ? t : e, o = (i ? s : void 0) ?? Qn, c = r(this.currentSnapshot), l = {
|
|
4346
4365
|
selector: r,
|
|
4347
4366
|
listener: a,
|
|
4348
4367
|
equals: o,
|
|
@@ -4378,7 +4397,7 @@ class xn {
|
|
|
4378
4397
|
}
|
|
4379
4398
|
const B = 1e3;
|
|
4380
4399
|
var p = /* @__PURE__ */ ((n) => (n.INBOUND_RTP = "inbound-rtp", n.REMOTE_OUTBOUND_RTP = "remote-outbound-rtp", n.MEDIA_SOURCE = "media-source", n.OUTBOUND_RTP = "outbound-rtp", n.REMOTE_INBOUND_RTP = "remote-inbound-rtp", n.CODEC = "codec", n.CANDIDATE_PAIR = "candidate-pair", n.CERTIFICATE = "certificate", n.TRANSPORT = "transport", n.LOCAL_CANDIDATE = "local-candidate", n.REMOTE_CANDIDATE = "remote-candidate", n))(p || {});
|
|
4381
|
-
const Be = ["collected"],
|
|
4400
|
+
const Be = ["collected"], Xn = () => new R(Be), Jn = "api/v2/rtp2webrtc/offer", zn = async ({
|
|
4382
4401
|
serverUrl: n,
|
|
4383
4402
|
conferenceNumber: e,
|
|
4384
4403
|
quality: t,
|
|
@@ -4387,7 +4406,7 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4387
4406
|
token: r
|
|
4388
4407
|
}) => {
|
|
4389
4408
|
const a = new URL(
|
|
4390
|
-
`https://${n.replace(/\/$/, "")}/${
|
|
4409
|
+
`https://${n.replace(/\/$/, "")}/${Jn}/${encodeURIComponent(e)}`
|
|
4391
4410
|
);
|
|
4392
4411
|
a.searchParams.set("quality", t), a.searchParams.set("audio", String(s));
|
|
4393
4412
|
const o = {
|
|
@@ -4413,7 +4432,7 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4413
4432
|
}, de = () => "performance" in window ? performance.now() : Date.now(), q = (n) => [...n.keys()].reduce((e, t) => {
|
|
4414
4433
|
const s = n.get(t);
|
|
4415
4434
|
return s === void 0 ? e : { ...e, [s.type]: s };
|
|
4416
|
-
}, {}),
|
|
4435
|
+
}, {}), jn = (n) => {
|
|
4417
4436
|
if (!n)
|
|
4418
4437
|
return {
|
|
4419
4438
|
outboundRtp: void 0,
|
|
@@ -4459,7 +4478,7 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4459
4478
|
codec: t[p.CODEC],
|
|
4460
4479
|
synchronizationSources: e
|
|
4461
4480
|
};
|
|
4462
|
-
},
|
|
4481
|
+
}, Kn = ({
|
|
4463
4482
|
audioReceiverStats: n,
|
|
4464
4483
|
synchronizationSourcesAudio: e
|
|
4465
4484
|
}) => {
|
|
@@ -4494,18 +4513,18 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4494
4513
|
remoteCandidate: e[p.REMOTE_CANDIDATE],
|
|
4495
4514
|
transport: e[p.TRANSPORT]
|
|
4496
4515
|
};
|
|
4497
|
-
},
|
|
4516
|
+
}, Zn = ({
|
|
4498
4517
|
audioSenderStats: n,
|
|
4499
4518
|
videoSenderFirstStats: e,
|
|
4500
4519
|
videoSenderSecondStats: t
|
|
4501
4520
|
}) => ({
|
|
4502
4521
|
video: he(e),
|
|
4503
4522
|
secondVideo: he(t),
|
|
4504
|
-
audio:
|
|
4523
|
+
audio: jn(n),
|
|
4505
4524
|
additional: ke(
|
|
4506
4525
|
n ?? e ?? t
|
|
4507
4526
|
)
|
|
4508
|
-
}),
|
|
4527
|
+
}), es = ({
|
|
4509
4528
|
audioReceiverStats: n,
|
|
4510
4529
|
videoReceiverFirstStats: e,
|
|
4511
4530
|
videoReceiverSecondStats: t,
|
|
@@ -4519,14 +4538,14 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4519
4538
|
videoReceiversStats: t,
|
|
4520
4539
|
synchronizationSourcesVideo: s.video
|
|
4521
4540
|
}),
|
|
4522
|
-
audio:
|
|
4541
|
+
audio: Kn({
|
|
4523
4542
|
audioReceiverStats: n,
|
|
4524
4543
|
synchronizationSourcesAudio: s.audio
|
|
4525
4544
|
}),
|
|
4526
4545
|
additional: ke(
|
|
4527
4546
|
n ?? e ?? t
|
|
4528
4547
|
)
|
|
4529
|
-
}),
|
|
4548
|
+
}), ts = ({
|
|
4530
4549
|
audioSenderStats: n,
|
|
4531
4550
|
videoSenderFirstStats: e,
|
|
4532
4551
|
videoSenderSecondStats: t,
|
|
@@ -4535,11 +4554,11 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4535
4554
|
videoReceiverSecondStats: r,
|
|
4536
4555
|
synchronizationSources: a
|
|
4537
4556
|
}) => {
|
|
4538
|
-
const o =
|
|
4557
|
+
const o = Zn({
|
|
4539
4558
|
audioSenderStats: n,
|
|
4540
4559
|
videoSenderFirstStats: e,
|
|
4541
4560
|
videoSenderSecondStats: t
|
|
4542
|
-
}), c =
|
|
4561
|
+
}), c = es({
|
|
4543
4562
|
audioReceiverStats: s,
|
|
4544
4563
|
videoReceiverFirstStats: i,
|
|
4545
4564
|
videoReceiverSecondStats: r,
|
|
@@ -4549,7 +4568,7 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4549
4568
|
outbound: o,
|
|
4550
4569
|
inbound: c
|
|
4551
4570
|
};
|
|
4552
|
-
},
|
|
4571
|
+
}, ns = async (n) => {
|
|
4553
4572
|
const e = "audio", t = "video", s = n.getSenders(), i = s.find((E) => E.track?.kind === e), r = s.filter((E) => E.track?.kind === t), a = n.getReceivers(), o = a.find((E) => E.track.kind === e), c = a.filter((E) => E.track.kind === t), l = {
|
|
4554
4573
|
trackIdentifier: o?.track.id,
|
|
4555
4574
|
item: o?.getSynchronizationSources()[0]
|
|
@@ -4586,22 +4605,22 @@ const Be = ["collected"], Qn = () => new R(Be), Yn = "api/v2/rtp2webrtc/offer",
|
|
|
4586
4605
|
videoReceiverSecondStats: xe
|
|
4587
4606
|
};
|
|
4588
4607
|
});
|
|
4589
|
-
},
|
|
4608
|
+
}, ss = (n) => {
|
|
4590
4609
|
d(String(n));
|
|
4591
4610
|
};
|
|
4592
|
-
class
|
|
4611
|
+
class is {
|
|
4593
4612
|
events;
|
|
4594
4613
|
setTimeoutRequest;
|
|
4595
|
-
requesterAllStatistics = new Y(
|
|
4614
|
+
requesterAllStatistics = new Y(ns);
|
|
4596
4615
|
constructor() {
|
|
4597
|
-
this.events =
|
|
4616
|
+
this.events = Xn(), this.setTimeoutRequest = new ue();
|
|
4598
4617
|
}
|
|
4599
4618
|
get requested() {
|
|
4600
4619
|
return this.setTimeoutRequest.requested;
|
|
4601
4620
|
}
|
|
4602
4621
|
start(e, {
|
|
4603
4622
|
interval: t = B,
|
|
4604
|
-
onError: s =
|
|
4623
|
+
onError: s = ss
|
|
4605
4624
|
} = {}) {
|
|
4606
4625
|
this.stop(), this.setTimeoutRequest.request(() => {
|
|
4607
4626
|
this.collectStatistics(e, {
|
|
@@ -4632,7 +4651,7 @@ class ns {
|
|
|
4632
4651
|
}) => {
|
|
4633
4652
|
const s = de();
|
|
4634
4653
|
this.requestAllStatistics(e).then((i) => {
|
|
4635
|
-
this.events.trigger("collected",
|
|
4654
|
+
this.events.trigger("collected", ts(i));
|
|
4636
4655
|
const a = de() - s;
|
|
4637
4656
|
let o = B;
|
|
4638
4657
|
a > 48 ? o = B * 4 : a > 32 ? o = B * 3 : a > 16 && (o = B * 2), this.start(e, {
|
|
@@ -4650,8 +4669,8 @@ class ns {
|
|
|
4650
4669
|
return this.requesterAllStatistics.request(t);
|
|
4651
4670
|
};
|
|
4652
4671
|
}
|
|
4653
|
-
const
|
|
4654
|
-
class
|
|
4672
|
+
const rs = 500;
|
|
4673
|
+
class as {
|
|
4655
4674
|
statsPeerConnection;
|
|
4656
4675
|
availableStats;
|
|
4657
4676
|
previousAvailableStats;
|
|
@@ -4661,7 +4680,7 @@ class is {
|
|
|
4661
4680
|
callManager: e,
|
|
4662
4681
|
apiManager: t
|
|
4663
4682
|
}) {
|
|
4664
|
-
this.callManager = e, this.apiManager = t, this.statsPeerConnection = new
|
|
4683
|
+
this.callManager = e, this.apiManager = t, this.statsPeerConnection = new is(), this.subscribe();
|
|
4665
4684
|
}
|
|
4666
4685
|
get events() {
|
|
4667
4686
|
return this.statsPeerConnection.events;
|
|
@@ -4711,7 +4730,7 @@ class is {
|
|
|
4711
4730
|
return this.previousInboundRtp?.packetsReceived;
|
|
4712
4731
|
}
|
|
4713
4732
|
get isReceivingPackets() {
|
|
4714
|
-
const e = this.packetsReceived !== void 0 && this.packetsReceived >=
|
|
4733
|
+
const e = this.packetsReceived !== void 0 && this.packetsReceived >= rs, t = this.packetsReceived !== this.previousPacketsReceived;
|
|
4715
4734
|
return e && t;
|
|
4716
4735
|
}
|
|
4717
4736
|
on(e, t) {
|
|
@@ -4751,32 +4770,32 @@ class is {
|
|
|
4751
4770
|
});
|
|
4752
4771
|
}
|
|
4753
4772
|
}
|
|
4754
|
-
const
|
|
4773
|
+
const os = (n, e) => n.filter((s) => e.some((i) => i.clockRate === s.clockRate && i.mimeType === s.mimeType && i.channels === s.channels && i.sdpFmtpLine === s.sdpFmtpLine)), cs = (n) => {
|
|
4755
4774
|
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, i = t === null ? [] : t.codecs;
|
|
4756
|
-
return
|
|
4757
|
-
},
|
|
4775
|
+
return os(s, i);
|
|
4776
|
+
}, ds = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
|
|
4758
4777
|
const i = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), a = i === -1 ? Number.MAX_VALUE : i, o = r === -1 ? Number.MAX_VALUE : r;
|
|
4759
4778
|
return a - o;
|
|
4760
|
-
}),
|
|
4779
|
+
}), hs = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), ls = (n, {
|
|
4761
4780
|
preferredMimeTypesVideoCodecs: e,
|
|
4762
4781
|
excludeMimeTypesVideoCodecs: t
|
|
4763
4782
|
}) => {
|
|
4764
4783
|
try {
|
|
4765
4784
|
if (typeof n.setCodecPreferences == "function" && n.sender.track?.kind === "video" && (e !== void 0 && e.length > 0 || t !== void 0 && t.length > 0)) {
|
|
4766
|
-
const s =
|
|
4785
|
+
const s = cs("video"), i = hs(s, t), r = ds(i, e);
|
|
4767
4786
|
n.setCodecPreferences(r);
|
|
4768
4787
|
}
|
|
4769
4788
|
} catch (s) {
|
|
4770
4789
|
d("setCodecPreferences error", s);
|
|
4771
4790
|
}
|
|
4772
|
-
},
|
|
4773
|
-
class
|
|
4791
|
+
}, gs = (n) => [...n.keys()].map((e) => n.get(e)), us = (n, e) => gs(n).find((t) => t?.type === e), Ts = async (n) => n.getStats().then((e) => us(e, "codec")?.mimeType);
|
|
4792
|
+
class Es {
|
|
4774
4793
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
4775
4794
|
async getCodecFromSender(e) {
|
|
4776
|
-
return await
|
|
4795
|
+
return await Ts(e) ?? "";
|
|
4777
4796
|
}
|
|
4778
4797
|
}
|
|
4779
|
-
class
|
|
4798
|
+
class Ss {
|
|
4780
4799
|
stackPromises = Ee({
|
|
4781
4800
|
noRunIsNotActual: !0
|
|
4782
4801
|
});
|
|
@@ -4801,11 +4820,11 @@ class Ts {
|
|
|
4801
4820
|
});
|
|
4802
4821
|
}
|
|
4803
4822
|
}
|
|
4804
|
-
class
|
|
4823
|
+
class Cs {
|
|
4805
4824
|
taskQueue;
|
|
4806
4825
|
onSetParameters;
|
|
4807
4826
|
constructor(e) {
|
|
4808
|
-
this.onSetParameters = e, this.taskQueue = new
|
|
4827
|
+
this.onSetParameters = e, this.taskQueue = new Ss();
|
|
4809
4828
|
}
|
|
4810
4829
|
async setEncodingsToSender(e, t) {
|
|
4811
4830
|
return this.taskQueue.add(async () => fe(e, t, this.onSetParameters));
|
|
@@ -4814,17 +4833,17 @@ class Es {
|
|
|
4814
4833
|
this.taskQueue.stop();
|
|
4815
4834
|
}
|
|
4816
4835
|
}
|
|
4817
|
-
const $e = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()),
|
|
4818
|
-
const t =
|
|
4836
|
+
const $e = (n, e) => n !== void 0 && e !== void 0 && n.toLowerCase().includes(e.toLowerCase()), ps = 1e6, b = (n) => n * ps, Ge = b(0.06), Ve = b(4), ms = (n) => n <= 64 ? Ge : n <= 128 ? b(0.12) : n <= 256 ? b(0.25) : n <= 384 ? b(0.32) : n <= 426 ? b(0.38) : n <= 640 ? b(0.5) : n <= 848 ? b(0.7) : n <= 1280 ? b(1) : n <= 1920 ? b(2) : Ve, Ns = "av1", As = (n) => $e(n, Ns), Rs = 0.6, ne = (n, e) => As(e) ? n * Rs : n, Is = (n) => ne(Ge, n), vs = (n) => ne(Ve, n), ge = (n, e) => {
|
|
4837
|
+
const t = ms(n);
|
|
4819
4838
|
return ne(t, e);
|
|
4820
|
-
}, z = 1,
|
|
4839
|
+
}, z = 1, fs = ({
|
|
4821
4840
|
videoTrack: n,
|
|
4822
4841
|
targetSize: e
|
|
4823
4842
|
}) => {
|
|
4824
4843
|
const t = n.getSettings(), s = t.width, i = t.height, r = s === void 0 ? z : s / e.width, a = i === void 0 ? z : i / e.height;
|
|
4825
4844
|
return Math.max(r, a, z);
|
|
4826
4845
|
};
|
|
4827
|
-
class
|
|
4846
|
+
class Ms {
|
|
4828
4847
|
ignoreForCodec;
|
|
4829
4848
|
senderFinder;
|
|
4830
4849
|
codecProvider;
|
|
@@ -4899,7 +4918,7 @@ class vs {
|
|
|
4899
4918
|
async downgradeResolutionSender(e) {
|
|
4900
4919
|
const { sender: t, codec: s } = e, i = {
|
|
4901
4920
|
scaleResolutionDownBy: 200,
|
|
4902
|
-
maxBitrate:
|
|
4921
|
+
maxBitrate: Is(s)
|
|
4903
4922
|
};
|
|
4904
4923
|
return this.parametersSetter.setEncodingsToSender(t, i);
|
|
4905
4924
|
}
|
|
@@ -4909,7 +4928,7 @@ class vs {
|
|
|
4909
4928
|
* @returns Promise с результатом
|
|
4910
4929
|
*/
|
|
4911
4930
|
async setBitrateByTrackResolution(e) {
|
|
4912
|
-
const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ?
|
|
4931
|
+
const { sender: t, videoTrack: s, codec: i } = e, a = s.getSettings().width, o = a === void 0 ? vs(i) : ge(a, i);
|
|
4913
4932
|
return this.parametersSetter.setEncodingsToSender(t, {
|
|
4914
4933
|
scaleResolutionDownBy: 1,
|
|
4915
4934
|
maxBitrate: o
|
|
@@ -4925,7 +4944,7 @@ class vs {
|
|
|
4925
4944
|
const [s, i] = e.split("x"), { sender: r, videoTrack: a, codec: o } = t, c = {
|
|
4926
4945
|
width: Number(s),
|
|
4927
4946
|
height: Number(i)
|
|
4928
|
-
}, l =
|
|
4947
|
+
}, l = fs({
|
|
4929
4948
|
videoTrack: a,
|
|
4930
4949
|
targetSize: c
|
|
4931
4950
|
}), T = ge(c.width, o), u = {
|
|
@@ -4935,14 +4954,14 @@ class vs {
|
|
|
4935
4954
|
return this.parametersSetter.setEncodingsToSender(r, u);
|
|
4936
4955
|
}
|
|
4937
4956
|
}
|
|
4938
|
-
const
|
|
4939
|
-
class
|
|
4957
|
+
const _s = (n) => n.find((e) => e.track?.kind === "video");
|
|
4958
|
+
class bs {
|
|
4940
4959
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
4941
4960
|
findVideoSender(e) {
|
|
4942
|
-
return
|
|
4961
|
+
return _s(e);
|
|
4943
4962
|
}
|
|
4944
4963
|
}
|
|
4945
|
-
class
|
|
4964
|
+
class Os {
|
|
4946
4965
|
currentSender;
|
|
4947
4966
|
originalReplaceTrack;
|
|
4948
4967
|
lastWidth;
|
|
@@ -5006,7 +5025,7 @@ class _s {
|
|
|
5006
5025
|
this.setTimeoutRequest.cancelRequest(), this.lastWidth = void 0, this.lastHeight = void 0;
|
|
5007
5026
|
}
|
|
5008
5027
|
}
|
|
5009
|
-
class
|
|
5028
|
+
class Ds {
|
|
5010
5029
|
apiManager;
|
|
5011
5030
|
currentHandler;
|
|
5012
5031
|
constructor(e) {
|
|
@@ -5026,7 +5045,7 @@ class bs {
|
|
|
5026
5045
|
this.currentHandler && (this.apiManager.off("main-cam-control", this.currentHandler), this.currentHandler = void 0);
|
|
5027
5046
|
}
|
|
5028
5047
|
}
|
|
5029
|
-
class
|
|
5048
|
+
class Ps {
|
|
5030
5049
|
eventHandler;
|
|
5031
5050
|
senderBalancer;
|
|
5032
5051
|
parametersSetterWithQueue;
|
|
@@ -5038,16 +5057,16 @@ class Os {
|
|
|
5038
5057
|
onSetParameters: i,
|
|
5039
5058
|
pollIntervalMs: r
|
|
5040
5059
|
} = {}) {
|
|
5041
|
-
this.getConnection = t, this.eventHandler = new
|
|
5060
|
+
this.getConnection = t, this.eventHandler = new Ds(e), this.parametersSetterWithQueue = new Cs(i), this.senderBalancer = new Ms(
|
|
5042
5061
|
{
|
|
5043
|
-
senderFinder: new
|
|
5044
|
-
codecProvider: new
|
|
5062
|
+
senderFinder: new bs(),
|
|
5063
|
+
codecProvider: new Es(),
|
|
5045
5064
|
parametersSetter: this.parametersSetterWithQueue
|
|
5046
5065
|
},
|
|
5047
5066
|
{
|
|
5048
5067
|
ignoreForCodec: s
|
|
5049
5068
|
}
|
|
5050
|
-
), this.trackMonitor = new
|
|
5069
|
+
), this.trackMonitor = new Os({ pollIntervalMs: r });
|
|
5051
5070
|
}
|
|
5052
5071
|
/**
|
|
5053
5072
|
* Подписывается на события управления главной камерой
|
|
@@ -5097,8 +5116,8 @@ const qe = [
|
|
|
5097
5116
|
"balancing-started",
|
|
5098
5117
|
"balancing-stopped",
|
|
5099
5118
|
"parameters-updated"
|
|
5100
|
-
],
|
|
5101
|
-
class
|
|
5119
|
+
], ys = () => new R(qe);
|
|
5120
|
+
class Ls {
|
|
5102
5121
|
isBalancingActive = !1;
|
|
5103
5122
|
events;
|
|
5104
5123
|
callManager;
|
|
@@ -5106,7 +5125,7 @@ class Ps {
|
|
|
5106
5125
|
videoSendingBalancer;
|
|
5107
5126
|
startBalancingTimer;
|
|
5108
5127
|
constructor(e, t, s = {}) {
|
|
5109
|
-
this.events =
|
|
5128
|
+
this.events = ys(), this.callManager = e, this.balancingStartDelay = s.balancingStartDelay ?? 1e4, this.videoSendingBalancer = new Ps(
|
|
5110
5129
|
t,
|
|
5111
5130
|
() => e.connection,
|
|
5112
5131
|
{
|
|
@@ -5176,13 +5195,13 @@ class Ps {
|
|
|
5176
5195
|
this.startBalancingTimer && (clearTimeout(this.startBalancingTimer), this.startBalancingTimer = void 0);
|
|
5177
5196
|
}
|
|
5178
5197
|
}
|
|
5179
|
-
const He = "no-inbound-frames", We = [He],
|
|
5180
|
-
class
|
|
5198
|
+
const He = "no-inbound-frames", We = [He], ws = () => new R(We);
|
|
5199
|
+
class Us {
|
|
5181
5200
|
events;
|
|
5182
5201
|
statsManager;
|
|
5183
5202
|
callManager;
|
|
5184
5203
|
constructor(e, t) {
|
|
5185
|
-
this.statsManager = e, this.callManager = t, this.events =
|
|
5204
|
+
this.statsManager = e, this.callManager = t, this.events = ws(), this.subscribe();
|
|
5186
5205
|
}
|
|
5187
5206
|
get mainVideoTrack() {
|
|
5188
5207
|
return this.callManager.getMainRemoteStream()?.getVideoTracks()[0];
|
|
@@ -5202,12 +5221,12 @@ class Ls {
|
|
|
5202
5221
|
this.statsManager.on("collected", this.handleStatsCollected);
|
|
5203
5222
|
}
|
|
5204
5223
|
}
|
|
5205
|
-
const
|
|
5206
|
-
class
|
|
5224
|
+
const Fs = 3e3;
|
|
5225
|
+
class Bs {
|
|
5207
5226
|
renegotiateRequester;
|
|
5208
5227
|
renegotiateThrottled;
|
|
5209
5228
|
callManager;
|
|
5210
|
-
constructor(e, t =
|
|
5229
|
+
constructor(e, t = Fs) {
|
|
5211
5230
|
this.callManager = e, this.renegotiateRequester = new Y(e.renegotiate.bind(e)), this.renegotiateThrottled = et.throttle(
|
|
5212
5231
|
this.requestRenegotiate.bind(this),
|
|
5213
5232
|
t
|
|
@@ -5236,13 +5255,11 @@ class Us {
|
|
|
5236
5255
|
d("cancel recover main stream"), this.renegotiateThrottled.cancel(), this.renegotiateRequester.cancelRequest();
|
|
5237
5256
|
}
|
|
5238
5257
|
}
|
|
5239
|
-
const
|
|
5258
|
+
const ks = 1e6, $s = ye.map((n) => `auto-connect:${n}`), Gs = be.map((n) => `connection:${n}`), Vs = Ne.map((n) => `call:${n}`), qs = Le.map((n) => `conference-state:${n}`), Hs = pe.map((n) => `api:${n}`), Ws = we.map((n) => `incoming-call:${n}`), xs = Me.map((n) => `presentation:${n}`), Qs = Be.map((n) => `stats:${n}`), Ys = qe.map((n) => `video-balancer:${n}`), Xs = We.map((n) => `main-stream-health:${n}`), Js = Fe.map((n) => `session:${n}`), zs = [
|
|
5240
5259
|
"disconnected-from-out-of-call",
|
|
5241
5260
|
"connected-with-configuration-from-out-of-call",
|
|
5242
5261
|
"stopped-presentation-by-server-command"
|
|
5243
|
-
],
|
|
5244
|
-
...Bs,
|
|
5245
|
-
...ks,
|
|
5262
|
+
], js = [
|
|
5246
5263
|
...$s,
|
|
5247
5264
|
...Gs,
|
|
5248
5265
|
...Vs,
|
|
@@ -5252,9 +5269,11 @@ const Fs = 1e6, Bs = ye.map((n) => `auto-connect:${n}`), ks = be.map((n) => `con
|
|
|
5252
5269
|
...xs,
|
|
5253
5270
|
...Qs,
|
|
5254
5271
|
...Ys,
|
|
5255
|
-
...Xs
|
|
5256
|
-
|
|
5257
|
-
|
|
5272
|
+
...Xs,
|
|
5273
|
+
...Js,
|
|
5274
|
+
...zs
|
|
5275
|
+
], Ks = () => new R(js);
|
|
5276
|
+
class gi {
|
|
5258
5277
|
events;
|
|
5259
5278
|
connectionManager;
|
|
5260
5279
|
connectionQueueManager;
|
|
@@ -5278,26 +5297,26 @@ class hi {
|
|
|
5278
5297
|
videoBalancerOptions: i,
|
|
5279
5298
|
autoConnectorOptions: r
|
|
5280
5299
|
} = {}) {
|
|
5281
|
-
this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events =
|
|
5300
|
+
this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.events = Ks(), this.apiManager = new dt(), this.connectionManager = new En({ JsSIP: e }), this.connectionQueueManager = new Sn({
|
|
5282
5301
|
connectionManager: this.connectionManager
|
|
5283
|
-
}), this.conferenceStateManager = new
|
|
5302
|
+
}), this.conferenceStateManager = new yn(), this.contentedStreamManager = new Bn(), this.callManager = new Dt(this.conferenceStateManager, this.contentedStreamManager), this.incomingCallManager = new Wn(this.connectionManager), this.presentationManager = new Jt({
|
|
5284
5303
|
callManager: this.callManager,
|
|
5285
|
-
maxBitrate:
|
|
5286
|
-
}), this.statsManager = new
|
|
5304
|
+
maxBitrate: ks
|
|
5305
|
+
}), this.statsManager = new as({
|
|
5287
5306
|
callManager: this.callManager,
|
|
5288
5307
|
apiManager: this.apiManager
|
|
5289
|
-
}), this.autoConnectorManager = new
|
|
5308
|
+
}), this.autoConnectorManager = new Dn(
|
|
5290
5309
|
{
|
|
5291
5310
|
connectionQueueManager: this.connectionQueueManager,
|
|
5292
5311
|
connectionManager: this.connectionManager,
|
|
5293
5312
|
callManager: this.callManager
|
|
5294
5313
|
},
|
|
5295
5314
|
r
|
|
5296
|
-
), this.videoSendingBalancerManager = new
|
|
5315
|
+
), this.videoSendingBalancerManager = new Ls(
|
|
5297
5316
|
this.callManager,
|
|
5298
5317
|
this.apiManager,
|
|
5299
5318
|
i
|
|
5300
|
-
), this.mainStreamHealthMonitor = new
|
|
5319
|
+
), this.mainStreamHealthMonitor = new Us(this.statsManager, this.callManager), this.mainStreamRecovery = new Bs(this.callManager), this.sessionManager = new Yn({
|
|
5301
5320
|
connectionManager: this.connectionManager,
|
|
5302
5321
|
callManager: this.callManager,
|
|
5303
5322
|
incomingCallManager: this.incomingCallManager,
|
|
@@ -5504,7 +5523,7 @@ class hi {
|
|
|
5504
5523
|
if (i === void 0)
|
|
5505
5524
|
throw new Error("No sipServerUrl for sendOffer");
|
|
5506
5525
|
const r = this.conferenceStateManager.getToken();
|
|
5507
|
-
return
|
|
5526
|
+
return zn({
|
|
5508
5527
|
serverUrl: i,
|
|
5509
5528
|
offer: t,
|
|
5510
5529
|
token: r,
|
|
@@ -5514,7 +5533,7 @@ class hi {
|
|
|
5514
5533
|
});
|
|
5515
5534
|
};
|
|
5516
5535
|
setCodecPreferences(e) {
|
|
5517
|
-
|
|
5536
|
+
ls(e, {
|
|
5518
5537
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
5519
5538
|
excludeMimeTypesVideoCodecs: this.excludeMimeTypesVideoCodecs
|
|
5520
5539
|
});
|
|
@@ -5541,22 +5560,22 @@ class hi {
|
|
|
5541
5560
|
export {
|
|
5542
5561
|
Ae as E,
|
|
5543
5562
|
ut as O,
|
|
5544
|
-
|
|
5545
|
-
|
|
5563
|
+
gi as S,
|
|
5564
|
+
rn as a,
|
|
5546
5565
|
ht as b,
|
|
5547
|
-
|
|
5566
|
+
$n as c,
|
|
5548
5567
|
fe as d,
|
|
5549
|
-
|
|
5568
|
+
Vt as e,
|
|
5550
5569
|
Ce as f,
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5570
|
+
hi as g,
|
|
5571
|
+
gn as h,
|
|
5572
|
+
di as i,
|
|
5573
|
+
li as j,
|
|
5555
5574
|
p as k,
|
|
5556
5575
|
d as l,
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5576
|
+
is as m,
|
|
5577
|
+
Ts as n,
|
|
5578
|
+
xt as o,
|
|
5560
5579
|
H as p,
|
|
5561
|
-
|
|
5580
|
+
zn as s
|
|
5562
5581
|
};
|