sip-connector 19.8.3 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -138
- package/dist/@SipConnector-CZiURTVf.cjs +1 -0
- package/dist/{@SipConnector-BmkeKEDD.js → @SipConnector-D4DfiZRM.js} +1117 -977
- package/dist/ApiManager/@ApiManager.d.ts +0 -1
- package/dist/ApiManager/constants.d.ts +3 -8
- package/dist/ApiManager/eventNames.d.ts +15 -6
- package/dist/ApiManager/index.d.ts +0 -1
- package/dist/ApiManager/types.d.ts +0 -6
- package/dist/CallManager/@CallManager.d.ts +44 -15
- package/dist/CallManager/MCUSession.d.ts +0 -2
- package/dist/CallManager/RecvSession.d.ts +29 -0
- package/dist/CallManager/RemoteStreamsManager.d.ts +20 -5
- package/dist/CallManager/RoleManager.d.ts +31 -0
- package/dist/CallManager/eventNames.d.ts +9 -2
- package/dist/CallManager/index.d.ts +1 -2
- package/dist/CallManager/types.d.ts +29 -35
- package/dist/ConnectionManager/@ConnectionManager.d.ts +2 -2
- package/dist/ConnectionManager/ConfigurationManager.d.ts +6 -1
- package/dist/ConnectionManager/ConnectionFlow.d.ts +5 -4
- package/dist/ConnectionManager/SipOperations.d.ts +2 -2
- package/dist/ConnectionManager/UAFactory.d.ts +4 -4
- package/dist/SipConnector/@SipConnector.d.ts +4 -4
- package/dist/SipConnector/eventNames.d.ts +1 -1
- package/dist/SipConnectorFacade/@SipConnectorFacade.d.ts +0 -2
- package/dist/VideoSendingBalancer/__fixtures__/createMockTrack.d.ts +1 -1
- package/dist/__fixtures__/RTCPeerConnectionMock.d.ts +14 -18
- package/dist/__fixtures__/index.d.ts +4 -4
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +134 -131
- package/dist/index.cjs +1 -1
- package/dist/index.js +156 -171
- package/dist/tools/__fixtures__/connectToServer.d.ts +15 -15
- package/dist/tools/__fixtures__/permissions.d.ts +2 -2
- package/dist/tools/__fixtures__/processRequest.d.ts +2 -2
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/sendOffer.d.ts +39 -0
- package/dist/utils/utils.d.ts +1 -1
- package/package.json +13 -5
- package/dist/@SipConnector-BHakZWEK.cjs +0 -1
- package/dist/CallManager/AbstractCallStrategy.d.ts +0 -54
- package/dist/CallManager/MCUCallStrategy.d.ts +0 -31
- package/dist/TransceiverManager/@TransceiverManager.d.ts +0 -70
- package/dist/TransceiverManager/index.d.ts +0 -1
- package/dist/TransceiverManager/types.d.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import "events-constructor";
|
|
2
|
-
import { E as
|
|
3
|
-
import {
|
|
4
|
-
import { isCanceledError as
|
|
5
|
-
import { hasCanceledError as
|
|
6
|
-
import { debounce as
|
|
7
|
-
import { UAParser as
|
|
8
|
-
import { sequentPromises as
|
|
9
|
-
import { isPromiseIsNotActualError as
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
2
|
+
import { E as p, l as r, p as $, s as W, a as H, b as j, h as K } from "./@SipConnector-D4DfiZRM.js";
|
|
3
|
+
import { g as Ie, c as Ue, S as ke, i as xe, d as Le, e as Ve, j as Be, f as $e } from "./@SipConnector-D4DfiZRM.js";
|
|
4
|
+
import { isCanceledError as x } from "@krivega/cancelable-promise";
|
|
5
|
+
import { hasCanceledError as X } from "repeated-calls";
|
|
6
|
+
import { debounce as Y } from "ts-debounce";
|
|
7
|
+
import { UAParser as G } from "ua-parser-js";
|
|
8
|
+
import { sequentPromises as q } from "sequent-promises";
|
|
9
|
+
import { isPromiseIsNotActualError as He } from "stack-promises";
|
|
10
|
+
const z = (n) => n instanceof Object && ("originator" in n || "cause" in n), Ne = (n) => {
|
|
11
|
+
if (x(n))
|
|
12
12
|
return !0;
|
|
13
|
-
if (!
|
|
13
|
+
if (!z(n))
|
|
14
14
|
return !1;
|
|
15
15
|
const { originator: e, cause: t } = n;
|
|
16
|
-
return typeof t == "string" ? t ===
|
|
17
|
-
},
|
|
18
|
-
const n = new
|
|
16
|
+
return typeof t == "string" ? t === p.REQUEST_TIMEOUT || t === p.REJECTED || e === "local" && (t === p.CANCELED || t === p.BYE) : !1;
|
|
17
|
+
}, J = () => globalThis.process?.versions?.electron !== void 0, L = () => {
|
|
18
|
+
const n = new G(), { name: e } = n.getBrowser(), t = J();
|
|
19
19
|
return {
|
|
20
20
|
isChrome: e === "Chrome" || t
|
|
21
21
|
};
|
|
22
|
-
},
|
|
22
|
+
}, N = (n) => {
|
|
23
23
|
const { url: e, cause: t } = n;
|
|
24
24
|
let o = e;
|
|
25
|
-
return (t ===
|
|
25
|
+
return (t === p.BAD_MEDIA_DESCRIPTION || t === p.NOT_FOUND) && (o = `${n.message.to.uri.user}@${n.message.to.uri.host}`), o;
|
|
26
26
|
};
|
|
27
|
-
var
|
|
28
|
-
const
|
|
27
|
+
var V = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(V || {});
|
|
28
|
+
const Q = new Error("Unknown error"), Z = (n = Q) => {
|
|
29
29
|
const { cause: e, socket: t } = n;
|
|
30
30
|
let o = "CONNECT_SERVER_FAILED";
|
|
31
31
|
switch (e) {
|
|
@@ -33,19 +33,19 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
33
33
|
o = "WRONG_USER_OR_PASSWORD";
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
|
-
case
|
|
36
|
+
case p.BAD_MEDIA_DESCRIPTION: {
|
|
37
37
|
o = "BAD_MEDIA_ERROR";
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
case
|
|
40
|
+
case p.NOT_FOUND: {
|
|
41
41
|
o = "NOT_FOUND_ERROR";
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
default:
|
|
45
|
-
t !== void 0 && t._ws?.readyState === 3 ? o = "WS_CONNECTION_FAILED" :
|
|
45
|
+
t !== void 0 && t._ws?.readyState === 3 ? o = "WS_CONNECTION_FAILED" : N(n) !== void 0 && N(n) !== "" && (o = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
46
46
|
}
|
|
47
47
|
return o;
|
|
48
|
-
},
|
|
48
|
+
}, ee = (n) => {
|
|
49
49
|
let e = "";
|
|
50
50
|
try {
|
|
51
51
|
e = JSON.stringify(n);
|
|
@@ -53,16 +53,16 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
53
53
|
r("failed to stringify message", t);
|
|
54
54
|
}
|
|
55
55
|
return e;
|
|
56
|
-
},
|
|
57
|
-
const { code: e, cause: t, message: o } = n, a =
|
|
58
|
-
return typeof o == "object" && o !== null ? s.message =
|
|
59
|
-
},
|
|
56
|
+
}, ne = new Error("Unknown error"), te = (n = ne) => {
|
|
57
|
+
const { code: e, cause: t, message: o } = n, a = N(n), s = { code: "", cause: "", message: "" };
|
|
58
|
+
return typeof o == "object" && o !== null ? s.message = ee(o) : o && (s.message = String(o)), a !== void 0 && a !== "" && (s.link = a), e !== void 0 && e !== "" && (s.code = e), t !== void 0 && t !== "" && (s.cause = t), s;
|
|
59
|
+
}, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
60
60
|
__proto__: null,
|
|
61
|
-
EErrorTypes:
|
|
62
|
-
getLinkError:
|
|
63
|
-
getTypeFromError:
|
|
64
|
-
getValuesFromError:
|
|
65
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
61
|
+
EErrorTypes: V,
|
|
62
|
+
getLinkError: N,
|
|
63
|
+
getTypeFromError: Z,
|
|
64
|
+
getValuesFromError: te
|
|
65
|
+
}, Symbol.toStringTag, { value: "Module" })), re = ({
|
|
66
66
|
sessionId: n,
|
|
67
67
|
remoteAddress: e,
|
|
68
68
|
isMutedAudio: t,
|
|
@@ -72,65 +72,65 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
72
72
|
}) => {
|
|
73
73
|
const c = [], u = t ? "0" : "1", d = o ? "0" : "1";
|
|
74
74
|
return c.push(`X-Vinteo-Mic-State: ${u}`, `X-Vinteo-MainCam-State: ${d}`), (a === !1 || a === void 0) && c.push("X-Vinteo-Purgatory-Call: yes"), n !== void 0 && n !== "" && c.push(`X-Vinteo-Session: ${n}`), s === !0 && c.push("X-Vinteo-Presentation-Call: yes"), e !== void 0 && e !== "" && c.push(`X-Vinteo-Remote: ${e}`), c;
|
|
75
|
-
},
|
|
75
|
+
}, se = "[@*!|]", ae = "_", ce = (n) => {
|
|
76
76
|
let e = n;
|
|
77
|
-
return e = e.replaceAll(new RegExp(
|
|
78
|
-
},
|
|
77
|
+
return e = e.replaceAll(new RegExp(se, "g"), ae), e;
|
|
78
|
+
}, ie = ({
|
|
79
79
|
appName: n,
|
|
80
80
|
appVersion: e,
|
|
81
81
|
browserName: t,
|
|
82
82
|
browserVersion: o
|
|
83
83
|
}) => {
|
|
84
|
-
const s = `${
|
|
84
|
+
const s = `${ce(n)} ${e}`;
|
|
85
85
|
return `ChromeNew - ${t === void 0 ? s : `${t} ${o}, ${s}`}`;
|
|
86
|
-
},
|
|
86
|
+
}, ue = ({
|
|
87
87
|
isUnifiedSdpSemantic: n,
|
|
88
88
|
appVersion: e,
|
|
89
89
|
browserName: t,
|
|
90
90
|
browserVersion: o,
|
|
91
91
|
appName: a
|
|
92
|
-
}) => n ?
|
|
92
|
+
}) => n ? ie({ appVersion: e, browserName: t, browserVersion: o, appName: a }) : "Chrome", B = "purgatory", y = (n) => n === B, le = (n) => (e) => [...e].map((o) => async () => n(o)), de = async ({
|
|
93
93
|
accumulatedKeys: n,
|
|
94
94
|
sendKey: e,
|
|
95
95
|
canRunTask: t
|
|
96
96
|
}) => {
|
|
97
|
-
const a =
|
|
98
|
-
return
|
|
99
|
-
}, fe = (n) => (t) => (r("onStartMainCam"), n.on("api:admin-start-main-cam", t)), Ce = (n) => (t) => (r("onStartMic"), n.on("api:admin-start-mic", t)),
|
|
100
|
-
const e = (l,
|
|
101
|
-
if (
|
|
97
|
+
const a = le(e)(n);
|
|
98
|
+
return q(a, t);
|
|
99
|
+
}, fe = (n) => (t) => (r("onStartMainCam"), n.on("api:admin-start-main-cam", t)), Ce = (n) => (t) => (r("onStartMic"), n.on("api:admin-start-mic", t)), Se = (n) => (t) => (r("onStopMainCam"), n.on("api:admin-stop-main-cam", t)), me = (n) => (t) => (r("onStopMic"), n.on("api:admin-stop-mic", t)), pe = ({ sipConnector: n }) => {
|
|
100
|
+
const e = (l, f) => ({ isSyncForced: C }) => {
|
|
101
|
+
if (C === !0) {
|
|
102
102
|
l();
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
}, t = fe(n), o =
|
|
107
|
-
let c, u, d,
|
|
105
|
+
f();
|
|
106
|
+
}, t = fe(n), o = Se(n), a = Ce(n), s = me(n);
|
|
107
|
+
let c, u, d, E;
|
|
108
108
|
const T = ({
|
|
109
109
|
onStartMainCamForced: l,
|
|
110
|
-
onStartMainCamNotForced:
|
|
111
|
-
onStopMainCamForced:
|
|
112
|
-
onStopMainCamNotForced:
|
|
113
|
-
onStartMicForced:
|
|
114
|
-
onStartMicNotForced:
|
|
115
|
-
onStopMicForced:
|
|
116
|
-
onStopMicNotForced:
|
|
110
|
+
onStartMainCamNotForced: f,
|
|
111
|
+
onStopMainCamForced: C,
|
|
112
|
+
onStopMainCamNotForced: R,
|
|
113
|
+
onStartMicForced: b,
|
|
114
|
+
onStartMicNotForced: v,
|
|
115
|
+
onStopMicForced: P,
|
|
116
|
+
onStopMicNotForced: M
|
|
117
117
|
}) => {
|
|
118
|
-
const
|
|
118
|
+
const S = e(
|
|
119
119
|
l,
|
|
120
|
-
|
|
120
|
+
f
|
|
121
121
|
);
|
|
122
|
-
c = t(
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
c = t(S);
|
|
123
|
+
const m = e(
|
|
124
|
+
C,
|
|
125
|
+
R
|
|
126
126
|
);
|
|
127
|
-
u = o(
|
|
128
|
-
const
|
|
129
|
-
d = a(
|
|
130
|
-
const
|
|
131
|
-
|
|
127
|
+
u = o(m);
|
|
128
|
+
const A = e(b, v);
|
|
129
|
+
d = a(A);
|
|
130
|
+
const h = e(P, M);
|
|
131
|
+
E = s(h);
|
|
132
132
|
}, _ = () => {
|
|
133
|
-
c?.(), u?.(), d?.(),
|
|
133
|
+
c?.(), u?.(), d?.(), E?.();
|
|
134
134
|
};
|
|
135
135
|
return {
|
|
136
136
|
start: (l) => {
|
|
@@ -140,30 +140,31 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
140
140
|
_();
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
},
|
|
143
|
+
}, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
144
144
|
__proto__: null,
|
|
145
|
-
PURGATORY_CONFERENCE_NUMBER:
|
|
146
|
-
createSyncMediaState:
|
|
147
|
-
createUaParser:
|
|
148
|
-
error:
|
|
149
|
-
getExtraHeaders:
|
|
150
|
-
getUserAgent:
|
|
151
|
-
hasPurgatory:
|
|
152
|
-
prepareMediaStream:
|
|
153
|
-
sendDtmfAccumulated:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
145
|
+
PURGATORY_CONFERENCE_NUMBER: B,
|
|
146
|
+
createSyncMediaState: pe,
|
|
147
|
+
createUaParser: L,
|
|
148
|
+
error: oe,
|
|
149
|
+
getExtraHeaders: re,
|
|
150
|
+
getUserAgent: ue,
|
|
151
|
+
hasPurgatory: y,
|
|
152
|
+
prepareMediaStream: $,
|
|
153
|
+
sendDtmfAccumulated: de,
|
|
154
|
+
sendOffer: W,
|
|
155
|
+
setEncodingsToSender: H,
|
|
156
|
+
setParametersToSender: j
|
|
157
|
+
}, Symbol.toStringTag, { value: "Module" })), Ae = () => L().isChrome, he = (n) => {
|
|
158
|
+
if (!x(n) && !X(n) && !K(n))
|
|
158
159
|
throw n;
|
|
159
160
|
return { configuration: void 0, isSuccessful: !1 };
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
},
|
|
161
|
+
}, Ee = ({ kind: n, readyState: e }) => n === "video" && e === "live", I = (n, e, { onEnterPurgatory: t, onEnterConference: o }) => {
|
|
162
|
+
y(n) ? t && t() : o && o({ isSuccessProgressCall: e });
|
|
163
|
+
}, U = (n, e) => {
|
|
163
164
|
n(), e && e();
|
|
164
|
-
},
|
|
165
|
+
}, k = (n, e, t) => {
|
|
165
166
|
throw n && n(), e(), t;
|
|
166
|
-
},
|
|
167
|
+
}, ge = /* @__PURE__ */ new Set([
|
|
167
168
|
"on",
|
|
168
169
|
"once",
|
|
169
170
|
"onceRace",
|
|
@@ -182,7 +183,7 @@ const ee = new Error("Unknown error"), ne = (n = ee) => {
|
|
|
182
183
|
"isConfigured",
|
|
183
184
|
"isRegistered"
|
|
184
185
|
]);
|
|
185
|
-
class
|
|
186
|
+
class Fe {
|
|
186
187
|
// @ts-expect-error: proxy method
|
|
187
188
|
on;
|
|
188
189
|
// @ts-expect-error: proxy method
|
|
@@ -221,7 +222,7 @@ class we {
|
|
|
221
222
|
constructor(e) {
|
|
222
223
|
return this.sipConnector = e, new Proxy(this, {
|
|
223
224
|
get: (t, o, a) => {
|
|
224
|
-
if (typeof o == "string" &&
|
|
225
|
+
if (typeof o == "string" && ge.has(o) && o in this.sipConnector) {
|
|
225
226
|
const c = Reflect.get(this.sipConnector, o, this.sipConnector);
|
|
226
227
|
return typeof c == "function" ? c.bind(this.sipConnector) : c;
|
|
227
228
|
}
|
|
@@ -230,7 +231,7 @@ class we {
|
|
|
230
231
|
}
|
|
231
232
|
});
|
|
232
233
|
}
|
|
233
|
-
connectToServer = async (e, t) => this.sipConnector.connect(e, t).then((o) => (r("connectToServer then"), { configuration: o, isSuccessful: !0 })).catch(async (o) => (r("connectToServer catch: error", o),
|
|
234
|
+
connectToServer = async (e, t) => this.sipConnector.connect(e, t).then((o) => (r("connectToServer then"), { configuration: o, isSuccessful: !0 })).catch(async (o) => (r("connectToServer catch: error", o), he(o)));
|
|
234
235
|
callToServer = async (e) => {
|
|
235
236
|
const {
|
|
236
237
|
conference: t,
|
|
@@ -240,54 +241,46 @@ class we {
|
|
|
240
241
|
contentHint: c,
|
|
241
242
|
degradationPreference: u,
|
|
242
243
|
sendEncodings: d,
|
|
243
|
-
offerToReceiveAudio:
|
|
244
|
+
offerToReceiveAudio: E,
|
|
244
245
|
offerToReceiveVideo: T,
|
|
245
246
|
directionVideo: _,
|
|
246
|
-
directionAudio:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
} = e, v = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
257
|
-
onReadyRemoteStreams: y
|
|
258
|
-
}), P = this.resolveHandleReadyRemoteStreams({
|
|
259
|
-
onReadyRemoteStreams: () => {
|
|
260
|
-
v().catch(r);
|
|
261
|
-
}
|
|
262
|
-
});
|
|
247
|
+
directionAudio: O,
|
|
248
|
+
onBeforeProgressCall: g,
|
|
249
|
+
onSuccessProgressCall: l,
|
|
250
|
+
onEnterPurgatory: f,
|
|
251
|
+
onEnterConference: C,
|
|
252
|
+
onFailProgressCall: R,
|
|
253
|
+
onFinishProgressCall: b,
|
|
254
|
+
onEndedCall: v,
|
|
255
|
+
onAddedTransceiver: P
|
|
256
|
+
} = e;
|
|
263
257
|
r("callToServer", e);
|
|
264
258
|
const M = async () => (r("startCall"), this.sipConnector.call({
|
|
265
259
|
mediaStream: o,
|
|
266
260
|
extraHeaders: a,
|
|
267
261
|
iceServers: s,
|
|
268
262
|
contentHint: c,
|
|
269
|
-
offerToReceiveAudio:
|
|
263
|
+
offerToReceiveAudio: E,
|
|
270
264
|
offerToReceiveVideo: T,
|
|
271
265
|
directionVideo: _,
|
|
272
|
-
directionAudio:
|
|
266
|
+
directionAudio: O,
|
|
273
267
|
degradationPreference: u,
|
|
274
|
-
onAddedTransceiver:
|
|
268
|
+
onAddedTransceiver: P,
|
|
275
269
|
sendEncodings: d,
|
|
276
|
-
number: t
|
|
277
|
-
ontrack: P
|
|
270
|
+
number: t
|
|
278
271
|
}));
|
|
279
|
-
let
|
|
280
|
-
const
|
|
281
|
-
r("enterRoom", { _room: i, isSuccessProgressCall:
|
|
282
|
-
onEnterPurgatory:
|
|
283
|
-
onEnterConference:
|
|
272
|
+
let S = !1, m;
|
|
273
|
+
const h = (r("subscribeEnterConference: onEnterConference", C), this.sipConnector.on("api:enterRoom", ({ room: i }) => {
|
|
274
|
+
r("enterRoom", { _room: i, isSuccessProgressCall: S }), m = i, (f ?? C) && I(m, S, {
|
|
275
|
+
onEnterPurgatory: f,
|
|
276
|
+
onEnterConference: C
|
|
284
277
|
});
|
|
285
|
-
})),
|
|
286
|
-
|
|
287
|
-
}), i),
|
|
288
|
-
r("onFinish"),
|
|
278
|
+
})), F = (i) => (r("onSuccess"), S = !0, l && l({ isPurgatory: y(m) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
|
|
279
|
+
U(h, v);
|
|
280
|
+
}), i), D = (i) => (r("onFail"), k(R, h, i)), w = () => {
|
|
281
|
+
r("onFinish"), b && b();
|
|
289
282
|
};
|
|
290
|
-
return r("onBeforeProgressCall"),
|
|
283
|
+
return r("onBeforeProgressCall"), g && g(t), M().then(F).catch((i) => D(i)).finally(w);
|
|
291
284
|
};
|
|
292
285
|
disconnectFromServer = async () => this.sipConnector.disconnect().then(() => (r("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (r("disconnectFromServer: catch", e), { isSuccessful: !1 }));
|
|
293
286
|
answerToIncomingCall = async (e) => {
|
|
@@ -299,25 +292,18 @@ class we {
|
|
|
299
292
|
degradationPreference: c,
|
|
300
293
|
sendEncodings: u,
|
|
301
294
|
offerToReceiveAudio: d,
|
|
302
|
-
offerToReceiveVideo:
|
|
295
|
+
offerToReceiveVideo: E,
|
|
303
296
|
directionVideo: T,
|
|
304
297
|
directionAudio: _,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
} = e, b = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
315
|
-
onReadyRemoteStreams: A
|
|
316
|
-
}), v = this.resolveHandleReadyRemoteStreams({
|
|
317
|
-
onReadyRemoteStreams: () => {
|
|
318
|
-
b().catch(r);
|
|
319
|
-
}
|
|
320
|
-
});
|
|
298
|
+
onBeforeProgressCall: O,
|
|
299
|
+
onSuccessProgressCall: g,
|
|
300
|
+
onEnterPurgatory: l,
|
|
301
|
+
onEnterConference: f,
|
|
302
|
+
onFailProgressCall: C,
|
|
303
|
+
onFinishProgressCall: R,
|
|
304
|
+
onEndedCall: b,
|
|
305
|
+
onAddedTransceiver: v
|
|
306
|
+
} = e;
|
|
321
307
|
r("answerToIncomingCall", e);
|
|
322
308
|
const P = async () => this.sipConnector.answerToIncomingCall({
|
|
323
309
|
mediaStream: t,
|
|
@@ -325,33 +311,32 @@ class we {
|
|
|
325
311
|
iceServers: a,
|
|
326
312
|
contentHint: s,
|
|
327
313
|
offerToReceiveAudio: d,
|
|
328
|
-
offerToReceiveVideo:
|
|
314
|
+
offerToReceiveVideo: E,
|
|
329
315
|
directionVideo: T,
|
|
330
316
|
directionAudio: _,
|
|
331
317
|
degradationPreference: c,
|
|
332
|
-
onAddedTransceiver:
|
|
333
|
-
sendEncodings: u
|
|
334
|
-
ontrack: v
|
|
318
|
+
onAddedTransceiver: v,
|
|
319
|
+
sendEncodings: u
|
|
335
320
|
}), M = () => {
|
|
336
321
|
const { remoteCallerData: i } = this.sipConnector;
|
|
337
322
|
return i.incomingNumber;
|
|
338
323
|
};
|
|
339
|
-
let
|
|
340
|
-
const
|
|
341
|
-
r("enterRoom", { room: i.room, isSuccessProgressCall:
|
|
342
|
-
onEnterPurgatory:
|
|
343
|
-
onEnterConference:
|
|
324
|
+
let S = !1, m;
|
|
325
|
+
const h = (r("subscribeEnterConference: onEnterConference", f), this.sipConnector.on("api:enterRoom", (i) => {
|
|
326
|
+
r("enterRoom", { room: i.room, isSuccessProgressCall: S }), m = i.room, (l ?? f) && I(m, S, {
|
|
327
|
+
onEnterPurgatory: l,
|
|
328
|
+
onEnterConference: f
|
|
344
329
|
});
|
|
345
|
-
})),
|
|
346
|
-
|
|
347
|
-
}), i),
|
|
348
|
-
r("onFinish"),
|
|
330
|
+
})), F = (i) => (r("onSuccess"), S = !0, g && g({ isPurgatory: y(m) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
|
|
331
|
+
U(h, b);
|
|
332
|
+
}), i), D = (i) => (r("onFail"), k(C, h, i)), w = () => {
|
|
333
|
+
r("onFinish"), R && R();
|
|
349
334
|
};
|
|
350
|
-
if (r("onBeforeProgressCall"),
|
|
335
|
+
if (r("onBeforeProgressCall"), O) {
|
|
351
336
|
const i = M();
|
|
352
|
-
|
|
337
|
+
O(i);
|
|
353
338
|
}
|
|
354
|
-
return P().then(
|
|
339
|
+
return P().then(F).catch((i) => D(i)).finally(w);
|
|
355
340
|
};
|
|
356
341
|
updatePresentation = async ({
|
|
357
342
|
mediaStream: e,
|
|
@@ -426,15 +411,15 @@ class we {
|
|
|
426
411
|
};
|
|
427
412
|
resolveHandleReadyRemoteStreamsDebounced = ({
|
|
428
413
|
onReadyRemoteStreams: e
|
|
429
|
-
}) =>
|
|
414
|
+
}) => Y(() => {
|
|
430
415
|
const t = this.sipConnector.getRemoteStreams();
|
|
431
|
-
r("remoteStreams", t),
|
|
416
|
+
r("remoteStreams", t), e(t);
|
|
432
417
|
}, 200);
|
|
433
418
|
// eslint-disable-next-line @typescript-eslint/class-methods-use-this
|
|
434
419
|
resolveHandleReadyRemoteStreams = ({
|
|
435
420
|
onReadyRemoteStreams: e
|
|
436
421
|
}) => ({ track: t }) => {
|
|
437
|
-
|
|
422
|
+
Ee(t) && e();
|
|
438
423
|
};
|
|
439
424
|
getRemoteStreams = () => (r("getRemoteStreams"), this.sipConnector.getRemoteStreams());
|
|
440
425
|
onUseLicense = (e) => (r("onUseLicense"), this.sipConnector.on("api:useLicense", e));
|
|
@@ -446,21 +431,21 @@ class we {
|
|
|
446
431
|
r("offStats"), this.sipConnector.off("stats:collected", e);
|
|
447
432
|
};
|
|
448
433
|
}
|
|
449
|
-
var
|
|
434
|
+
var Re = /* @__PURE__ */ ((n) => (n.VP8 = "video/VP8", n.VP9 = "video/VP9", n.H264 = "video/H264", n.AV1 = "video/AV1", n.rtx = "video/rtx", n.red = "video/red", n.flexfec03 = "video/flexfec-03", n))(Re || {});
|
|
450
435
|
export {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
436
|
+
p as ECallCause,
|
|
437
|
+
Re as EMimeTypesVideoCodecs,
|
|
438
|
+
Ie as EStatsTypes,
|
|
439
|
+
Ue as EUseLicense,
|
|
440
|
+
ke as SipConnector,
|
|
441
|
+
Fe as SipConnectorFacade,
|
|
442
|
+
xe as StatsPeerConnection,
|
|
443
|
+
Le as disableDebug,
|
|
444
|
+
Ve as enableDebug,
|
|
445
|
+
Be as getCodecFromSender,
|
|
446
|
+
Ae as hasAvailableStats,
|
|
447
|
+
Ne as hasCanceledCallError,
|
|
448
|
+
$e as hasCanceledStartPresentationError,
|
|
449
|
+
He as hasConnectionPromiseIsNotActualError,
|
|
450
|
+
ye as tools
|
|
466
451
|
};
|
|
@@ -5,49 +5,49 @@ export declare const dataForConnectionWithAuthorization: {
|
|
|
5
5
|
user: string;
|
|
6
6
|
register: boolean;
|
|
7
7
|
remoteAddress: string;
|
|
8
|
+
sipServerIp: string;
|
|
8
9
|
sipServerUrl: string;
|
|
9
|
-
sipWebSocketServerURL: string;
|
|
10
10
|
userAgent: string;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const dataForConnectionWithAuthorizationWithDisplayName: {
|
|
14
14
|
displayName: string;
|
|
15
15
|
remoteAddress: string;
|
|
16
|
+
sipServerIp: string;
|
|
16
17
|
sipServerUrl: string;
|
|
17
|
-
sipWebSocketServerURL: string;
|
|
18
18
|
userAgent: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const dataForConnectionWithoutAuthorization: {
|
|
21
21
|
displayName: string;
|
|
22
22
|
register: boolean;
|
|
23
23
|
remoteAddress: string;
|
|
24
|
+
sipServerIp: string;
|
|
24
25
|
sipServerUrl: string;
|
|
25
|
-
sipWebSocketServerURL: string;
|
|
26
26
|
userAgent: string;
|
|
27
27
|
};
|
|
28
28
|
export declare const dataForConnectionWithoutAuthorizationWithoutDisplayName: {
|
|
29
29
|
displayName: string;
|
|
30
30
|
register: boolean;
|
|
31
31
|
remoteAddress: string;
|
|
32
|
+
sipServerIp: string;
|
|
32
33
|
sipServerUrl: string;
|
|
33
|
-
sipWebSocketServerURL: string;
|
|
34
34
|
userAgent: string;
|
|
35
35
|
};
|
|
36
|
-
export declare const
|
|
37
|
-
|
|
36
|
+
export declare const dataForConnectionWithoutAuthorizationWithSipServerIpChanged: {
|
|
37
|
+
sipServerIp: string;
|
|
38
38
|
displayName: string;
|
|
39
39
|
register: boolean;
|
|
40
40
|
remoteAddress: string;
|
|
41
|
-
|
|
41
|
+
sipServerUrl: string;
|
|
42
42
|
userAgent: string;
|
|
43
43
|
};
|
|
44
|
-
export declare const
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
export declare const dataForConnectionWithoutAuthorizationWithSipServerUrlChanged: {
|
|
45
|
+
sipServerUrl: string;
|
|
46
|
+
sipServerUrlChanged: boolean;
|
|
47
47
|
displayName: string;
|
|
48
48
|
register: boolean;
|
|
49
49
|
remoteAddress: string;
|
|
50
|
-
|
|
50
|
+
sipServerIp: string;
|
|
51
51
|
userAgent: string;
|
|
52
52
|
};
|
|
53
53
|
export declare const dataForConnectionWithAuthorizationIncorrectUser: {
|
|
@@ -55,8 +55,8 @@ export declare const dataForConnectionWithAuthorizationIncorrectUser: {
|
|
|
55
55
|
password: string;
|
|
56
56
|
register: boolean;
|
|
57
57
|
remoteAddress: string;
|
|
58
|
+
sipServerIp: string;
|
|
58
59
|
sipServerUrl: string;
|
|
59
|
-
sipWebSocketServerURL: string;
|
|
60
60
|
userAgent: string;
|
|
61
61
|
displayName: string;
|
|
62
62
|
};
|
|
@@ -65,8 +65,8 @@ export declare const dataForConnectionWithAuthorizationIncorrectPassword: {
|
|
|
65
65
|
user: string;
|
|
66
66
|
register: boolean;
|
|
67
67
|
remoteAddress: string;
|
|
68
|
+
sipServerIp: string;
|
|
68
69
|
sipServerUrl: string;
|
|
69
|
-
sipWebSocketServerURL: string;
|
|
70
70
|
userAgent: string;
|
|
71
71
|
displayName: string;
|
|
72
72
|
};
|
|
@@ -76,8 +76,8 @@ export declare const withNameChanged: {
|
|
|
76
76
|
user: string;
|
|
77
77
|
register: boolean;
|
|
78
78
|
remoteAddress: string;
|
|
79
|
+
sipServerIp: string;
|
|
79
80
|
sipServerUrl: string;
|
|
80
|
-
sipWebSocketServerURL: string;
|
|
81
81
|
userAgent: string;
|
|
82
82
|
displayName: string;
|
|
83
83
|
};
|
|
@@ -87,8 +87,8 @@ export declare const dataForConnectionWithAuthorizationPasswordChanged: {
|
|
|
87
87
|
user: string;
|
|
88
88
|
register: boolean;
|
|
89
89
|
remoteAddress: string;
|
|
90
|
+
sipServerIp: string;
|
|
90
91
|
sipServerUrl: string;
|
|
91
|
-
sipWebSocketServerURL: string;
|
|
92
92
|
userAgent: string;
|
|
93
93
|
displayName: string;
|
|
94
94
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const canConnectToServer: ({ remoteAddress,
|
|
1
|
+
export declare const canConnectToServer: ({ remoteAddress, sipServerIp, sipServerUrl, user, password, register, }: {
|
|
2
2
|
remoteAddress: string | undefined;
|
|
3
|
+
sipServerIp: string | undefined;
|
|
3
4
|
sipServerUrl: string | undefined;
|
|
4
|
-
sipWebSocketServerURL: string | undefined;
|
|
5
5
|
user: string;
|
|
6
6
|
password: string;
|
|
7
7
|
register: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SipConnector } from '../../SipConnector';
|
|
2
2
|
declare const resolveInitUaPromised: (sipConnector: SipConnector) => (state: {
|
|
3
3
|
remoteAddress: string | undefined;
|
|
4
|
-
|
|
4
|
+
sipServerIp: string;
|
|
5
5
|
displayName: string;
|
|
6
|
-
|
|
6
|
+
sipServerUrl: string;
|
|
7
7
|
user: string;
|
|
8
8
|
password: string;
|
|
9
9
|
register: boolean;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as getUserAgent } from './getUserAgent';
|
|
|
5
5
|
export { default as hasPurgatory, PURGATORY_CONFERENCE_NUMBER } from './hasPurgatory';
|
|
6
6
|
export { default as prepareMediaStream } from './prepareMediaStream';
|
|
7
7
|
export { default as sendDtmfAccumulated } from './sendDtmfFAccumulated';
|
|
8
|
+
export { default as sendOffer } from './sendOffer';
|
|
8
9
|
export { setEncodingsToSender, setParametersToSender } from './setParametersToSender';
|
|
9
10
|
export type { TOnSetParameters, TResultSetParametersToSender } from './setParametersToSender';
|
|
10
11
|
export { createSyncMediaState } from './syncMediaState';
|