sip-connector 19.9.0 → 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.
Files changed (35) hide show
  1. package/README.md +131 -37
  2. package/dist/@SipConnector-CZiURTVf.cjs +1 -0
  3. package/dist/{@SipConnector-BpypVXj0.js → @SipConnector-D4DfiZRM.js} +860 -554
  4. package/dist/ApiManager/eventNames.d.ts +10 -3
  5. package/dist/CallManager/@CallManager.d.ts +18 -4
  6. package/dist/CallManager/MCUSession.d.ts +0 -1
  7. package/dist/CallManager/RecvSession.d.ts +1 -1
  8. package/dist/CallManager/RemoteStreamsManager.d.ts +20 -5
  9. package/dist/CallManager/RoleManager.d.ts +31 -0
  10. package/dist/CallManager/eventNames.d.ts +9 -2
  11. package/dist/CallManager/index.d.ts +1 -1
  12. package/dist/CallManager/types.d.ts +17 -5
  13. package/dist/ConnectionManager/@ConnectionManager.d.ts +2 -2
  14. package/dist/ConnectionManager/ConfigurationManager.d.ts +6 -1
  15. package/dist/ConnectionManager/ConnectionFlow.d.ts +5 -4
  16. package/dist/ConnectionManager/SipOperations.d.ts +2 -2
  17. package/dist/ConnectionManager/UAFactory.d.ts +4 -4
  18. package/dist/SipConnector/@SipConnector.d.ts +4 -2
  19. package/dist/SipConnector/eventNames.d.ts +1 -1
  20. package/dist/SipConnectorFacade/@SipConnectorFacade.d.ts +0 -2
  21. package/dist/VideoSendingBalancer/__fixtures__/createMockTrack.d.ts +1 -1
  22. package/dist/__fixtures__/RTCPeerConnectionMock.d.ts +1 -1
  23. package/dist/__fixtures__/index.d.ts +4 -4
  24. package/dist/doMock.cjs +1 -1
  25. package/dist/doMock.js +23 -21
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.js +156 -171
  28. package/dist/tools/__fixtures__/connectToServer.d.ts +15 -15
  29. package/dist/tools/__fixtures__/permissions.d.ts +2 -2
  30. package/dist/tools/__fixtures__/processRequest.d.ts +2 -2
  31. package/dist/tools/index.d.ts +1 -0
  32. package/dist/tools/sendOffer.d.ts +39 -0
  33. package/dist/utils/utils.d.ts +1 -1
  34. package/package.json +4 -4
  35. package/dist/@SipConnector-CR3DyIpB.cjs +0 -1
package/dist/index.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import "events-constructor";
2
- import { E as C, l as r, p as j, s as K, a as X, h as Y } from "./@SipConnector-BpypVXj0.js";
3
- import { f as ke, b as xe, S as Le, g as Ve, d as Be, e as $e, i as He, c as We } from "./@SipConnector-BpypVXj0.js";
4
- import { isCanceledError as V } from "@krivega/cancelable-promise";
5
- import { hasCanceledError as G } from "repeated-calls";
6
- import { debounce as q } from "ts-debounce";
7
- import { UAParser as z } from "ua-parser-js";
8
- import { sequentPromises as J } from "sequent-promises";
9
- import { isPromiseIsNotActualError as Ke } from "stack-promises";
10
- const Q = (n) => n instanceof Object && ("originator" in n || "cause" in n), Ae = (n) => {
11
- if (V(n))
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 (!Q(n))
13
+ if (!z(n))
14
14
  return !1;
15
15
  const { originator: e, cause: t } = n;
16
- return typeof t == "string" ? t === C.REQUEST_TIMEOUT || t === C.REJECTED || e === "local" && (t === C.CANCELED || t === C.BYE) : !1;
17
- }, Z = () => globalThis.process?.versions?.electron !== void 0, B = () => {
18
- const n = new z(), { name: e } = n.getBrowser(), t = Z();
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
- }, D = (n) => {
22
+ }, N = (n) => {
23
23
  const { url: e, cause: t } = n;
24
24
  let o = e;
25
- return (t === C.BAD_MEDIA_DESCRIPTION || t === C.NOT_FOUND) && (o = `${n.message.to.uri.user}@${n.message.to.uri.host}`), o;
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 $ = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))($ || {});
28
- const ee = new Error("Unknown error"), ne = (n = ee) => {
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 C.BAD_MEDIA_DESCRIPTION: {
36
+ case p.BAD_MEDIA_DESCRIPTION: {
37
37
  o = "BAD_MEDIA_ERROR";
38
38
  break;
39
39
  }
40
- case C.NOT_FOUND: {
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" : D(n) !== void 0 && D(n) !== "" && (o = "CONNECT_SERVER_FAILED_BY_LINK");
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
- }, te = (n) => {
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
- }, oe = new Error("Unknown error"), re = (n = oe) => {
57
- const { code: e, cause: t, message: o } = n, a = D(n), s = { code: "", cause: "", message: "" };
58
- return typeof o == "object" && o !== null ? s.message = te(o) : o && (s.message = String(o)), a !== void 0 && a !== "" && (s.link = a), e !== void 0 && e !== "" && (s.code = e), t !== void 0 && t !== "" && (s.cause = t), s;
59
- }, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
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: D,
63
- getTypeFromError: ne,
64
- getValuesFromError: re
65
- }, Symbol.toStringTag, { value: "Module" })), ae = ({
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
- }, ce = "[@*!|]", ie = "_", ue = (n) => {
75
+ }, se = "[@*!|]", ae = "_", ce = (n) => {
76
76
  let e = n;
77
- return e = e.replaceAll(new RegExp(ce, "g"), ie), e;
78
- }, le = ({
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 = `${ue(n)} ${e}`;
84
+ const s = `${ce(n)} ${e}`;
85
85
  return `ChromeNew - ${t === void 0 ? s : `${t} ${o}, ${s}`}`;
86
- }, de = ({
86
+ }, ue = ({
87
87
  isUnifiedSdpSemantic: n,
88
88
  appVersion: e,
89
89
  browserName: t,
90
90
  browserVersion: o,
91
91
  appName: a
92
- }) => n ? le({ appVersion: e, browserName: t, browserVersion: o, appName: a }) : "Chrome", H = "purgatory", F = (n) => n === H, me = (n) => (e) => [...e].map((o) => async () => n(o)), Se = async ({
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 = me(e)(n);
98
- return J(a, t);
99
- }, fe = (n) => (t) => (r("onStartMainCam"), n.on("api:admin-start-main-cam", t)), Ce = (n) => (t) => (r("onStartMic"), n.on("api:admin-start-mic", t)), pe = (n) => (t) => (r("onStopMainCam"), n.on("api:admin-stop-main-cam", t)), he = (n) => (t) => (r("onStopMic"), n.on("api:admin-stop-mic", t)), Re = ({ sipConnector: n }) => {
100
- const e = (l, S) => ({ isSyncForced: m }) => {
101
- if (m === !0) {
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
- S();
106
- }, t = fe(n), o = pe(n), a = Ce(n), s = he(n);
107
- let c, u, d, R;
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: S,
111
- onStopMainCamForced: m,
112
- onStopMainCamNotForced: p,
113
- onStartMicForced: E,
114
- onStartMicNotForced: g,
115
- onStopMicForced: O,
116
- onStopMicNotForced: b
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 v = e(
118
+ const S = e(
119
119
  l,
120
- S
120
+ f
121
121
  );
122
- c = t(v);
123
- const P = e(
124
- m,
125
- p
122
+ c = t(S);
123
+ const m = e(
124
+ C,
125
+ R
126
126
  );
127
- u = o(P);
128
- const M = e(E, g);
129
- d = a(M);
130
- const f = e(O, b);
131
- R = s(f);
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?.(), R?.();
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
- }, De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
143
+ }, ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
144
144
  __proto__: null,
145
- PURGATORY_CONFERENCE_NUMBER: H,
146
- createSyncMediaState: Re,
147
- createUaParser: B,
148
- error: se,
149
- getExtraHeaders: ae,
150
- getUserAgent: de,
151
- hasPurgatory: F,
152
- prepareMediaStream: j,
153
- sendDtmfAccumulated: Se,
154
- setEncodingsToSender: K,
155
- setParametersToSender: X
156
- }, Symbol.toStringTag, { value: "Module" })), Fe = () => B().isChrome, Ee = (n) => {
157
- if (!V(n) && !G(n) && !Y(n))
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
- }, ge = ({ kind: n, readyState: e }) => n === "video" && e === "live", k = (n, e, { onEnterPurgatory: t, onEnterConference: o }) => {
161
- F(n) ? t && t() : o && o({ isSuccessProgressCall: e });
162
- }, x = (n, e) => {
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
- }, L = (n, e, t) => {
165
+ }, k = (n, e, t) => {
165
166
  throw n && n(), e(), t;
166
- }, be = /* @__PURE__ */ new Set([
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 we {
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" && be.has(o) && o in this.sipConnector) {
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), Ee(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: R,
244
+ offerToReceiveAudio: E,
244
245
  offerToReceiveVideo: T,
245
246
  directionVideo: _,
246
- directionAudio: A,
247
- setRemoteStreams: y,
248
- onBeforeProgressCall: l,
249
- onSuccessProgressCall: S,
250
- onEnterPurgatory: m,
251
- onEnterConference: p,
252
- onFailProgressCall: E,
253
- onFinishProgressCall: g,
254
- onEndedCall: O,
255
- onAddedTransceiver: b
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: R,
263
+ offerToReceiveAudio: E,
270
264
  offerToReceiveVideo: T,
271
265
  directionVideo: _,
272
- directionAudio: A,
266
+ directionAudio: O,
273
267
  degradationPreference: u,
274
- onAddedTransceiver: b,
268
+ onAddedTransceiver: P,
275
269
  sendEncodings: d,
276
- number: t,
277
- ontrack: P
270
+ number: t
278
271
  }));
279
- let f = !1, h;
280
- const N = (r("subscribeEnterConference: onEnterConference", p), this.sipConnector.on("api:enterRoom", ({ room: i }) => {
281
- r("enterRoom", { _room: i, isSuccessProgressCall: f }), h = i, (m ?? p) && k(h, f, {
282
- onEnterPurgatory: m,
283
- onEnterConference: p
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
- })), w = (i) => (r("onSuccess"), f = !0, v().catch(r), S && S({ isPurgatory: F(h) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
286
- x(N, O);
287
- }), i), I = (i) => (r("onFail"), L(E, N, i)), U = () => {
288
- r("onFinish"), g && g();
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"), l && l(t), M().then(w).catch((i) => I(i)).finally(U);
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: R,
295
+ offerToReceiveVideo: E,
303
296
  directionVideo: T,
304
297
  directionAudio: _,
305
- setRemoteStreams: A,
306
- onBeforeProgressCall: y,
307
- onSuccessProgressCall: l,
308
- onEnterPurgatory: S,
309
- onEnterConference: m,
310
- onFailProgressCall: p,
311
- onFinishProgressCall: E,
312
- onEndedCall: g,
313
- onAddedTransceiver: O
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: R,
314
+ offerToReceiveVideo: E,
329
315
  directionVideo: T,
330
316
  directionAudio: _,
331
317
  degradationPreference: c,
332
- onAddedTransceiver: O,
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 f = !1, h;
340
- const N = (r("subscribeEnterConference: onEnterConference", m), this.sipConnector.on("api:enterRoom", (i) => {
341
- r("enterRoom", { room: i.room, isSuccessProgressCall: f }), h = i.room, (S ?? m) && k(h, f, {
342
- onEnterPurgatory: S,
343
- onEnterConference: m
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
- })), w = (i) => (r("onSuccess"), f = !0, b().catch(r), l && l({ isPurgatory: F(h) }), this.sipConnector.onceRace(["call:ended", "call:failed"], () => {
346
- x(N, g);
347
- }), i), I = (i) => (r("onFail"), L(p, N, i)), U = () => {
348
- r("onFinish"), E && E();
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"), y) {
335
+ if (r("onBeforeProgressCall"), O) {
351
336
  const i = M();
352
- y(i);
337
+ O(i);
353
338
  }
354
- return P().then(w).catch((i) => I(i)).finally(U);
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
- }) => q(() => {
414
+ }) => Y(() => {
430
415
  const t = this.sipConnector.getRemoteStreams();
431
- r("remoteStreams", t), t && e(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
- ge(t) && e();
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 ve = /* @__PURE__ */ ((n) => (n.VP8 = "video/VP8", n.VP9 = "video/VP9", n.H264 = "video/H264", n.AV1 = "video/AV1", n.rtx = "video/rtx", n.red = "video/red", n.flexfec03 = "video/flexfec-03", n))(ve || {});
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
- C as ECallCause,
452
- ve as EMimeTypesVideoCodecs,
453
- ke as EStatsTypes,
454
- xe as EUseLicense,
455
- Le as SipConnector,
456
- we as SipConnectorFacade,
457
- Ve as StatsPeerConnection,
458
- Be as disableDebug,
459
- $e as enableDebug,
460
- He as getCodecFromSender,
461
- Fe as hasAvailableStats,
462
- Ae as hasCanceledCallError,
463
- We as hasCanceledStartPresentationError,
464
- Ke as hasConnectionPromiseIsNotActualError,
465
- De as tools
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 dataForConnectionWithoutAuthorizationWithSipServerUrlChanged: {
37
- sipServerUrl: string;
36
+ export declare const dataForConnectionWithoutAuthorizationWithSipServerIpChanged: {
37
+ sipServerIp: string;
38
38
  displayName: string;
39
39
  register: boolean;
40
40
  remoteAddress: string;
41
- sipWebSocketServerURL: string;
41
+ sipServerUrl: string;
42
42
  userAgent: string;
43
43
  };
44
- export declare const dataForConnectionWithoutAuthorizationWithSipWebSocketServerUrlChanged: {
45
- sipWebSocketServerURL: string;
46
- sipWebSocketServerURLChanged: boolean;
44
+ export declare const dataForConnectionWithoutAuthorizationWithSipServerUrlChanged: {
45
+ sipServerUrl: string;
46
+ sipServerUrlChanged: boolean;
47
47
  displayName: string;
48
48
  register: boolean;
49
49
  remoteAddress: string;
50
- sipServerUrl: string;
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, sipServerUrl, sipWebSocketServerURL, user, password, register, }: {
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
- sipServerUrl: string;
4
+ sipServerIp: string;
5
5
  displayName: string;
6
- sipWebSocketServerURL: string;
6
+ sipServerUrl: string;
7
7
  user: string;
8
8
  password: string;
9
9
  register: boolean;
@@ -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';