sip-connector 20.5.0 → 20.6.1

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