sip-connector 10.0.0 → 10.0.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.
@@ -1,11 +1,11 @@
1
1
  var At = Object.defineProperty;
2
2
  var Rt = (s, e, t) => e in s ? At(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var r = (s, e, t) => Rt(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { CancelableRequest as C, isCanceledError as It } from "@krivega/cancelable-promise";
5
- import pe from "events-constructor";
6
- import { repeatedCallsAsync as De } from "repeated-calls";
3
+ var o = (s, e, t) => Rt(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CancelableRequest as g, isCanceledError as It } from "@krivega/cancelable-promise";
5
+ import De from "events-constructor";
6
+ import { repeatedCallsAsync as pe } from "repeated-calls";
7
7
  import x from "debug";
8
- const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code", Pt = "Internal Error", Ot = "Busy", He = "Rejected", pt = "Redirected", Dt = "Unavailable", Mt = "Not Found", vt = "Address Incomplete", yt = "Incompatible SDP", wt = "Missing SDP", bt = "Authentication Error", We = "Terminated", Ut = "WebRTC Error", ke = "Canceled", Lt = "No Answer", Ht = "Expires", Wt = "No ACK", kt = "Dialog Error", Bt = "User Denied Media Access", qt = "Bad Media Description", Ft = "RTP Timeout", cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8
+ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code", Pt = "Internal Error", Ot = "Busy", He = "Rejected", Dt = "Redirected", pt = "Unavailable", Mt = "Not Found", vt = "Address Incomplete", yt = "Incompatible SDP", wt = "Missing SDP", bt = "Authentication Error", We = "Terminated", Ut = "WebRTC Error", ke = "Canceled", Lt = "No Answer", Ht = "Expires", Wt = "No ACK", kt = "Dialog Error", Bt = "User Denied Media Access", qt = "Bad Media Description", Ft = "RTP Timeout", cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9
9
  __proto__: null,
10
10
  ADDRESS_INCOMPLETE: vt,
11
11
  AUTHENTICATION_ERROR: bt,
@@ -22,28 +22,28 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
22
22
  NOT_FOUND: Mt,
23
23
  NO_ACK: Wt,
24
24
  NO_ANSWER: Lt,
25
- REDIRECTED: pt,
25
+ REDIRECTED: Dt,
26
26
  REJECTED: He,
27
27
  REQUEST_TIMEOUT: Le,
28
28
  RTP_TIMEOUT: Ft,
29
29
  SIP_FAILURE_CODE: mt,
30
- UNAVAILABLE: Dt,
30
+ UNAVAILABLE: pt,
31
31
  USER_DENIED_MEDIA_ACCESS: Bt,
32
32
  WEBRTC_ERROR: Ut
33
- }, Symbol.toStringTag, { value: "Module" })), V = "incomingCall", Y = "declinedIncomingCall", G = "failedIncomingCall", $ = "terminatedIncomingCall", H = "connecting", f = "connected", S = "disconnected", M = "newRTCSession", m = "registered", X = "unregistered", P = "registrationFailed", Be = "newMessage", J = "sipEvent", z = "availableSecondRemoteStream", Q = "notAvailableSecondRemoteStream", j = "mustStopPresentation", v = "shareState", K = "enterRoom", Z = "useLicense", ee = "peerconnection:confirmed", te = "peerconnection:ontrack", y = "channels", ne = "channels:notify", se = "ended:fromserver", ie = "main-cam-control", re = "admin-stop-main-cam", oe = "admin-start-main-cam", ae = "admin-stop-mic", ce = "admin-start-mic", w = "admin-force-sync-media-state", _e = "participant:added-to-list-moderators", Ee = "participant:removed-from-list-moderators", de = "participant:move-request-to-stream", he = "participant:move-request-to-spectators", le = "participation:accepting-word-request", ue = "participation:cancelling-word-request", Te = "webcast:started", Se = "webcast:stopped", Ne = "account:changed", Ce = "account:deleted", ge = "conference:participant-token-issued", O = "ended", qe = "sending", Fe = "reinvite", xe = "replaces", Ve = "refer", Ye = "progress", Ge = "accepted", b = "confirmed", U = "peerconnection", A = "failed", $e = "muted", Xe = "unmuted", Ae = "newDTMF", Re = "newInfo", Je = "hold", ze = "unhold", Qe = "update", je = "sdp", Ke = "icecandidate", Ze = "getusermediafailed", et = "peerconnection:createofferfailed", tt = "peerconnection:createanswerfailed", nt = "peerconnection:setlocaldescriptionfailed", st = "peerconnection:setremotedescriptionfailed", it = "presentation:start", rt = "presentation:started", ot = "presentation:end", Ie = "presentation:ended", L = "presentation:failed", at = "SPECTATOR", ct = 1e6, _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
33
+ }, Symbol.toStringTag, { value: "Module" })), V = "incomingCall", Y = "declinedIncomingCall", G = "failedIncomingCall", $ = "terminatedIncomingCall", H = "connecting", f = "connected", S = "disconnected", M = "newRTCSession", m = "registered", J = "unregistered", P = "registrationFailed", Be = "newMessage", X = "sipEvent", z = "availableSecondRemoteStream", Q = "notAvailableSecondRemoteStream", j = "mustStopPresentation", v = "shareState", K = "enterRoom", Z = "useLicense", ee = "peerconnection:confirmed", te = "peerconnection:ontrack", y = "channels", ne = "channels:notify", se = "ended:fromserver", ie = "main-cam-control", oe = "admin-stop-main-cam", re = "admin-start-main-cam", ae = "admin-stop-mic", ce = "admin-start-mic", w = "admin-force-sync-media-state", _e = "participant:added-to-list-moderators", Ee = "participant:removed-from-list-moderators", de = "participant:move-request-to-stream", he = "participant:move-request-to-spectators", le = "participation:accepting-word-request", Te = "participation:cancelling-word-request", ue = "webcast:started", Se = "webcast:stopped", Ne = "account:changed", ge = "account:deleted", Ce = "conference:participant-token-issued", O = "ended", qe = "sending", Fe = "reinvite", xe = "replaces", Ve = "refer", Ye = "progress", Ge = "accepted", b = "confirmed", U = "peerconnection", A = "failed", $e = "muted", Je = "unmuted", Ae = "newDTMF", Re = "newInfo", Xe = "hold", ze = "unhold", Qe = "update", je = "sdp", Ke = "icecandidate", Ze = "getusermediafailed", et = "peerconnection:createofferfailed", tt = "peerconnection:createanswerfailed", nt = "peerconnection:setlocaldescriptionfailed", st = "peerconnection:setremotedescriptionfailed", it = "presentation:start", ot = "presentation:started", rt = "presentation:end", Ie = "presentation:ended", L = "presentation:failed", at = "SPECTATOR", ct = 1e6, _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34
34
  __proto__: null,
35
35
  ACCEPTED: Ge,
36
36
  ACCOUNT_CHANGED: Ne,
37
- ACCOUNT_DELETED: Ce,
37
+ ACCOUNT_DELETED: ge,
38
38
  ADMIN_FORCE_SYNC_MEDIA_STATE: w,
39
- ADMIN_START_MAIN_CAM: oe,
39
+ ADMIN_START_MAIN_CAM: re,
40
40
  ADMIN_START_MIC: ce,
41
- ADMIN_STOP_MAIN_CAM: re,
41
+ ADMIN_STOP_MAIN_CAM: oe,
42
42
  ADMIN_STOP_MIC: ae,
43
43
  AVAILABLE_SECOND_REMOTE_STREAM_EVENT: z,
44
44
  CHANNELS: y,
45
45
  CHANNELS_NOTIFY: ne,
46
- CONFERENCE_PARTICIPANT_TOKEN_ISSUED: ge,
46
+ CONFERENCE_PARTICIPANT_TOKEN_ISSUED: Ce,
47
47
  CONFIRMED: b,
48
48
  CONNECTED: f,
49
49
  CONNECTING: H,
@@ -55,7 +55,7 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
55
55
  FAILED: A,
56
56
  FAILED_INCOMING_CALL: G,
57
57
  GET_USER_MEDIA_FAILED: Ze,
58
- HOLD: Je,
58
+ HOLD: Xe,
59
59
  ICE_CANDIDATE: Ke,
60
60
  INCOMING_CALL: V,
61
61
  MAIN_CAM_CONTROL: ie,
@@ -72,7 +72,7 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
72
72
  PARTICIPANT_MOVE_REQUEST_TO_STREAM: de,
73
73
  PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: Ee,
74
74
  PARTICIPATION_ACCEPTING_WORD_REQUEST: le,
75
- PARTICIPATION_CANCELLING_WORD_REQUEST: ue,
75
+ PARTICIPATION_CANCELLING_WORD_REQUEST: Te,
76
76
  PEER_CONNECTION: U,
77
77
  PEER_CONNECTION_CONFIRMED: ee,
78
78
  PEER_CONNECTION_CREATE_ANSWER_FAILED: tt,
@@ -80,11 +80,11 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
80
80
  PEER_CONNECTION_ONTRACK: te,
81
81
  PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: nt,
82
82
  PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: st,
83
- PRESENTATION_END: ot,
83
+ PRESENTATION_END: rt,
84
84
  PRESENTATION_ENDED: Ie,
85
85
  PRESENTATION_FAILED: L,
86
86
  PRESENTATION_START: it,
87
- PRESENTATION_STARTED: rt,
87
+ PRESENTATION_STARTED: ot,
88
88
  PROGRESS: Ye,
89
89
  REFER: Ve,
90
90
  REGISTERED: m,
@@ -94,15 +94,15 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
94
94
  SDP: je,
95
95
  SENDING: qe,
96
96
  SHARE_STATE: v,
97
- SIP_EVENT: J,
97
+ SIP_EVENT: X,
98
98
  SPECTATOR: at,
99
99
  TERMINATED_INCOMING_CALL: $,
100
100
  UNHOLD: ze,
101
- UNMUTED: Xe,
102
- UNREGISTERED: X,
101
+ UNMUTED: Je,
102
+ UNREGISTERED: J,
103
103
  UPDATE: Qe,
104
104
  USE_LICENSE: Z,
105
- WEBCAST_STARTED: Te,
105
+ WEBCAST_STARTED: ue,
106
106
  WEBCAST_STOPPED: Se
107
107
  }, Symbol.toStringTag, { value: "Module" })), _t = [
108
108
  V,
@@ -110,13 +110,13 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
110
110
  $,
111
111
  G,
112
112
  le,
113
- ue,
113
+ Te,
114
114
  de,
115
115
  ne,
116
- ge,
117
- Ne,
118
116
  Ce,
119
- Te,
117
+ Ne,
118
+ ge,
119
+ ue,
120
120
  Se,
121
121
  _e,
122
122
  Ee
@@ -126,10 +126,10 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
126
126
  S,
127
127
  M,
128
128
  m,
129
- X,
129
+ J,
130
130
  P,
131
131
  Be,
132
- J
132
+ X
133
133
  ], Et = [
134
134
  z,
135
135
  Q,
@@ -142,8 +142,8 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
142
142
  y,
143
143
  se,
144
144
  ie,
145
- oe,
146
145
  re,
146
+ oe,
147
147
  ae,
148
148
  ce,
149
149
  w,
@@ -161,10 +161,10 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
161
161
  U,
162
162
  A,
163
163
  $e,
164
- Xe,
164
+ Je,
165
165
  Ae,
166
166
  Re,
167
- Je,
167
+ Xe,
168
168
  ze,
169
169
  Qe,
170
170
  je,
@@ -175,8 +175,8 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
175
175
  nt,
176
176
  st,
177
177
  it,
178
- rt,
179
178
  ot,
179
+ rt,
180
180
  Ie,
181
181
  L
182
182
  ], dt = [...fe, ..._t], ht = [
@@ -193,43 +193,42 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
193
193
  }, Symbol.toStringTag, { value: "Module" })), xt = (s) => {
194
194
  const e = [];
195
195
  return s && e.push(`X-Vinteo-Remote: ${s}`), e;
196
- }, Vt = "content-type", Yt = "x-webrtc-enter-room", p = "application/vinteo.webrtc.sharedesktop", Gt = "application/vinteo.webrtc.roomname", $t = "application/vinteo.webrtc.channels", Xt = "application/vinteo.webrtc.mediastate", Jt = "application/vinteo.webrtc.refusal", Me = "application/vinteo.webrtc.maincam", zt = "application/vinteo.webrtc.mic", Qt = "application/vinteo.webrtc.uselic", jt = "X-WEBRTC-USE-LICENSE", Kt = "X-WEBRTC-PARTICIPANT-NAME", ve = "X-WEBRTC-INPUT-CHANNELS", ye = "X-WEBRTC-OUTPUT-CHANNELS", Zt = "X-WEBRTC-MAINCAM", en = "X-WEBRTC-MIC", we = "X-WEBRTC-SYNC", tn = "X-WEBRTC-MAINCAM-RESOLUTION", nn = "X-WEBRTC-MEDIA-STATE", sn = "X-Vinteo-Media-Type", rn = "X-Vinteo-MainCam-State", on = "X-Vinteo-Mic-State", an = "application/vinteo.webrtc.partstate", cn = "X-WEBRTC-PARTSTATE", _n = "application/vinteo.webrtc.notify", En = "X-VINTEO-NOTIFY", R = "x-webrtc-share-state", dn = `${R}: LETMESTARTPRESENTATION`, hn = `${R}: STOPPRESENTATION`, lt = "YOUCANRECEIVECONTENT", ut = "CONTENTEND", Tt = "YOUMUSTSTOPSENDCONTENT", ln = `${R}: ${Tt}`, un = `${R}: ${lt}`, Tn = `${R}: ${ut}`, Sn = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", Nn = `${Sn}: LETMESTARTMAINCAM`, Pe = "sip-connector", k = x(Pe), ds = () => {
196
+ }, Vt = "content-type", Yt = "x-webrtc-enter-room", D = "application/vinteo.webrtc.sharedesktop", Gt = "application/vinteo.webrtc.roomname", $t = "application/vinteo.webrtc.channels", Jt = "application/vinteo.webrtc.mediastate", Xt = "application/vinteo.webrtc.refusal", Me = "application/vinteo.webrtc.maincam", zt = "application/vinteo.webrtc.mic", Qt = "application/vinteo.webrtc.uselic", jt = "X-WEBRTC-USE-LICENSE", Kt = "X-WEBRTC-PARTICIPANT-NAME", ve = "X-WEBRTC-INPUT-CHANNELS", ye = "X-WEBRTC-OUTPUT-CHANNELS", Zt = "X-WEBRTC-MAINCAM", en = "X-WEBRTC-MIC", we = "X-WEBRTC-SYNC", tn = "X-WEBRTC-MAINCAM-RESOLUTION", nn = "X-WEBRTC-MEDIA-STATE", sn = "X-Vinteo-Media-Type", on = "X-Vinteo-MainCam-State", rn = "X-Vinteo-Mic-State", an = "application/vinteo.webrtc.partstate", cn = "X-WEBRTC-PARTSTATE", _n = "application/vinteo.webrtc.notify", En = "X-VINTEO-NOTIFY", R = "x-webrtc-share-state", dn = `${R}: LETMESTARTPRESENTATION`, hn = `${R}: STOPPRESENTATION`, lt = "YOUCANRECEIVECONTENT", Tt = "CONTENTEND", ut = "YOUMUSTSTOPSENDCONTENT", ln = `${R}: ${ut}`, Tn = `${R}: ${lt}`, un = `${R}: ${Tt}`, Sn = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", Nn = `${Sn}: LETMESTARTMAINCAM`, Pe = "sip-connector", k = x(Pe), ds = () => {
197
197
  x.enable(Pe);
198
198
  }, hs = () => {
199
199
  x.enable(`-${Pe}`);
200
- }, Cn = (s, e) => {
200
+ }, gn = (s, e) => {
201
201
  s.getVideoTracks().forEach((n) => {
202
202
  "contentHint" in n && n.contentHint !== e && (n.contentHint = e);
203
203
  });
204
- }, D = (s, {
204
+ }, p = (s, {
205
205
  videoMode: e,
206
206
  audioMode: t,
207
207
  contentHint: n
208
208
  } = {}) => {
209
209
  if (!s || e === "recvonly" && t === "recvonly")
210
210
  return;
211
- const i = t === "recvonly" ? [] : s.getAudioTracks(), o = e === "recvonly" ? [] : s.getVideoTracks(), a = [...i, ...o], c = new MediaStream(a);
212
- return c.getTracks = () => [...c.getAudioTracks(), ...c.getVideoTracks()], n && n !== "none" && Cn(c, n), c;
211
+ const i = t === "recvonly" ? [] : s.getAudioTracks(), r = e === "recvonly" ? [] : s.getVideoTracks(), a = [...i, ...r], c = new MediaStream(a);
212
+ return c.getTracks = () => [...c.getAudioTracks(), ...c.getVideoTracks()], n && n !== "none" && gn(c, n), c;
213
213
  };
214
- var I = /* @__PURE__ */ ((s) => (s.PAUSE_MAIN_CAM = "PAUSEMAINCAM", s.RESUME_MAIN_CAM = "RESUMEMAINCAM", s.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", s.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", s.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", s))(I || {}), B = /* @__PURE__ */ ((s) => (s.ADMIN_STOP_MIC = "ADMINSTOPMIC", s.ADMIN_START_MIC = "ADMINSTARTMIC", s))(B || {}), q = /* @__PURE__ */ ((s) => (s.ADMIN_SYNC_FORCED = "1", s.ADMIN_SYNC_NOT_FORCED = "0", s))(q || {}), gn = /* @__PURE__ */ ((s) => (s.AUDIO = "AUDIO", s.VIDEO = "VIDEO", s.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", s))(gn || {});
214
+ var I = /* @__PURE__ */ ((s) => (s.PAUSE_MAIN_CAM = "PAUSEMAINCAM", s.RESUME_MAIN_CAM = "RESUMEMAINCAM", s.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", s.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", s.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", s))(I || {}), B = /* @__PURE__ */ ((s) => (s.ADMIN_STOP_MIC = "ADMINSTOPMIC", s.ADMIN_START_MIC = "ADMINSTARTMIC", s))(B || {}), q = /* @__PURE__ */ ((s) => (s.ADMIN_SYNC_FORCED = "1", s.ADMIN_SYNC_NOT_FORCED = "0", s))(q || {}), Cn = /* @__PURE__ */ ((s) => (s.AUDIO = "AUDIO", s.VIDEO = "VIDEO", s.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", s))(Cn || {});
215
215
  function An(s) {
216
216
  return (e) => `sip:${e}@${s}`;
217
217
  }
218
218
  const Rn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, be = (s) => s.trim().replaceAll(" ", "_"), In = Rn(1e5, 99999999), fn = (s) => s.some((t) => {
219
219
  const { kind: n } = t;
220
220
  return n === "video";
221
- }), mn = "Error decline with 603", Pn = 1006, On = (s) => typeof s == "object" && s !== null && "code" in s && s.code === Pn, pn = (s) => s.message === mn, Dn = (s, e) => s.find((t) => t.track && e.getTracks().includes(t.track)), Mn = (s, e) => ({ ...s, degradationPreference: e.degradationPreference }), vn = (s, e) => {
222
- let { encodings: t } = s;
223
- t === void 0 && (t = []);
224
- for (let n = t.length; n < e; n += 1)
225
- t.push({});
226
- return { ...s, encodings: t };
221
+ }), mn = "Error decline with 603", Pn = 1006, On = (s) => typeof s == "object" && s !== null && "code" in s && s.code === Pn, Dn = (s) => s.message === mn, pn = (s, e) => s.find((t) => t.track && e.getTracks().includes(t.track)), Mn = (s, e) => (s.degradationPreference = e.degradationPreference, s), vn = (s, e) => {
222
+ s.encodings === void 0 && (s.encodings = []);
223
+ for (let t = s.encodings.length; t < e; t += 1)
224
+ s.encodings.push({});
225
+ return s;
227
226
  }, St = (s) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== s, yn = St(), wn = (s, e) => {
228
227
  if (yn(s, e))
229
228
  return s;
230
229
  }, bn = (s, e) => {
231
230
  const t = s.maxBitrate, n = wn(e, t);
232
- return n !== void 0 ? { ...s, maxBitrate: n } : s;
231
+ return n !== void 0 && (s.maxBitrate = n), s;
233
232
  }, Nt = 1, Un = St(
234
233
  Nt
235
234
  ), Ln = (s, e) => {
@@ -244,39 +243,37 @@ const Rn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, be = (s) =>
244
243
  e,
245
244
  t
246
245
  );
247
- return n !== void 0 ? { ...s, scaleResolutionDownBy: n } : s;
246
+ return n !== void 0 && (s.scaleResolutionDownBy = n), s;
248
247
  }, Wn = (s, e) => {
249
- var o;
250
- const t = ((o = e.encodings) == null ? void 0 : o.length) ?? 0, n = vn(s, t), i = n.encodings.map((a, c) => {
251
- const _ = ((e == null ? void 0 : e.encodings) ?? [])[c], d = _ == null ? void 0 : _.maxBitrate, E = _ == null ? void 0 : _.scaleResolutionDownBy;
252
- let h = bn(a, d);
253
- return h = Hn(h, E), h;
254
- });
255
- return { ...n, encodings: i };
248
+ var n;
249
+ const t = ((n = e.encodings) == null ? void 0 : n.length) ?? 0;
250
+ return vn(s, t), s.encodings.forEach((i, r) => {
251
+ const a = ((e == null ? void 0 : e.encodings) ?? [])[r], c = a == null ? void 0 : a.maxBitrate, E = a == null ? void 0 : a.scaleResolutionDownBy;
252
+ bn(i, c), Hn(i, E);
253
+ }), s;
256
254
  }, kn = (s, e) => {
257
- var t, n, i, o, a, c, _, d;
255
+ var t, n, i, r, a, c, E, d;
258
256
  if (((t = s.codecs) == null ? void 0 : t.length) !== ((n = e.codecs) == null ? void 0 : n.length))
259
257
  return !0;
260
- for (let E = 0; E < (((i = s.codecs) == null ? void 0 : i.length) ?? 0); E++)
261
- if (JSON.stringify(s.codecs[E]) !== JSON.stringify(e.codecs[E]))
258
+ for (let _ = 0; _ < (((i = s.codecs) == null ? void 0 : i.length) ?? 0); _++)
259
+ if (JSON.stringify(s.codecs[_]) !== JSON.stringify(e.codecs[_]))
262
260
  return !0;
263
- if (((o = s.headerExtensions) == null ? void 0 : o.length) !== ((a = e.headerExtensions) == null ? void 0 : a.length))
261
+ if (((r = s.headerExtensions) == null ? void 0 : r.length) !== ((a = e.headerExtensions) == null ? void 0 : a.length))
264
262
  return !0;
265
- for (let E = 0; E < (((c = s.headerExtensions) == null ? void 0 : c.length) ?? 0); E++)
266
- if (JSON.stringify(s.headerExtensions[E]) !== JSON.stringify(e.headerExtensions[E]))
263
+ for (let _ = 0; _ < (((c = s.headerExtensions) == null ? void 0 : c.length) ?? 0); _++)
264
+ if (JSON.stringify(s.headerExtensions[_]) !== JSON.stringify(e.headerExtensions[_]))
267
265
  return !0;
268
- if (((_ = s.encodings) == null ? void 0 : _.length) !== ((d = e.encodings) == null ? void 0 : d.length))
266
+ if (((E = s.encodings) == null ? void 0 : E.length) !== ((d = e.encodings) == null ? void 0 : d.length))
269
267
  return !0;
270
- for (let E = 0; E < (s.encodings.length ?? 0); E++)
271
- if (JSON.stringify(s.encodings[E]) !== JSON.stringify(e.encodings[E]))
268
+ for (let _ = 0; _ < (s.encodings.length ?? 0); _++)
269
+ if (JSON.stringify(s.encodings[_]) !== JSON.stringify(e.encodings[_]))
272
270
  return !0;
273
271
  return s.rtcp.cname !== e.rtcp.cname || s.rtcp.reducedSize !== e.rtcp.reducedSize || s.degradationPreference !== e.degradationPreference;
274
272
  }, Bn = async (s, e) => {
275
- const t = s.getParameters();
276
- let n = Wn(t, e);
277
- n = Mn(n, e);
278
- const i = kn(t, n);
279
- return i && await s.setParameters(n), { parameters: n, isChanged: i };
273
+ const t = s.getParameters(), n = JSON.parse(JSON.stringify(t));
274
+ Wn(t, e), Mn(t, e);
275
+ const i = kn(n, t);
276
+ return i && await s.setParameters(t), { parameters: t, isChanged: i };
280
277
  }, qn = async (s, e, t) => {
281
278
  const { isChanged: n, parameters: i } = await Bn(s, {
282
279
  encodings: [
@@ -288,47 +285,47 @@ const Rn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, be = (s) =>
288
285
  });
289
286
  return n && t && t(i), { isChanged: n, parameters: i };
290
287
  }, Fn = async (s, e, t) => {
291
- const n = Dn(s, e);
288
+ const n = pn(s, e);
292
289
  if (n)
293
290
  return qn(n, { maxBitrate: t });
294
291
  }, xn = 486, Vn = 487, F = "local", Ue = "remote", Yn = 3, Gn = 1, ls = (s = new Error()) => {
295
292
  const { originator: e, cause: t } = s;
296
293
  return It(s) ? !0 : typeof t == "string" ? t === Le || t === He || e === F && (t === ke || t === We) : !1;
297
- }, g = "SipConnector", $n = "channels", Xn = "WebcastStarted", Jn = "WebcastStopped", zn = "accountChanged", Qn = "accountDeleted", jn = "addedToListModerators", Kn = "removedFromListModerators", Zn = "ParticipationRequestAccepted", es = "ParticipationRequestRejected", ts = "ParticipantMovedToWebcast", ns = "ConferenceParticipantTokenIssued";
298
- class us {
294
+ }, C = "SipConnector", $n = "channels", Jn = "WebcastStarted", Xn = "WebcastStopped", zn = "accountChanged", Qn = "accountDeleted", jn = "addedToListModerators", Kn = "removedFromListModerators", Zn = "ParticipationRequestAccepted", es = "ParticipationRequestRejected", ts = "ParticipantMovedToWebcast", ns = "ConferenceParticipantTokenIssued";
295
+ class Ts {
299
296
  constructor({ JsSIP: e }) {
300
- r(this, "_isRegisterConfig", !1);
301
- r(this, "_connectionConfiguration", {});
302
- r(this, "_remoteStreams", {});
303
- r(this, "JsSIP");
304
- r(this, "_sessionEvents");
305
- r(this, "_uaEvents");
306
- r(this, "_cancelableConnect");
307
- r(this, "_cancelableConnectWithRepeatedCalls");
308
- r(this, "_cancelableSendPresentationWithRepeatedCalls");
309
- r(this, "_cancelableInitUa");
310
- r(this, "_cancelableDisconnect");
311
- r(this, "_cancelableSet");
312
- r(this, "_cancelableCall");
313
- r(this, "_cancelableAnswer");
314
- r(this, "_cancelableSendDTMF");
315
- r(this, "getSipServerUrl", (e) => e);
316
- r(this, "promisePendingStartPresentation");
317
- r(this, "promisePendingStopPresentation");
318
- r(this, "ua");
319
- r(this, "session");
320
- r(this, "incomingSession");
321
- r(this, "_streamPresentationCurrent");
322
- r(this, "socket");
323
- r(this, "connect", async (e, t) => (this._cancelRequests(), this._connectWithDuplicatedCalls(e, t)));
324
- r(this, "initUa", async (e) => this._cancelableInitUa.request(e));
325
- r(this, "set", async (e) => this._cancelableSet.request(e));
326
- r(this, "call", async (e) => this._cancelableCall.request(e));
327
- r(this, "disconnect", async () => (this._cancelRequests(), this._disconnectWithoutCancelRequests()));
328
- r(this, "answerToIncomingCall", async (e) => this._cancelableAnswer.request(e));
329
- r(this, "sendDTMF", async (e) => this._cancelableSendDTMF.request(e));
330
- r(this, "hangUp", async () => (this._cancelRequests(), this._hangUpWithoutCancelRequests()));
331
- r(this, "tryRegister", async () => {
297
+ o(this, "_isRegisterConfig", !1);
298
+ o(this, "_connectionConfiguration", {});
299
+ o(this, "_remoteStreams", {});
300
+ o(this, "JsSIP");
301
+ o(this, "_sessionEvents");
302
+ o(this, "_uaEvents");
303
+ o(this, "_cancelableConnect");
304
+ o(this, "_cancelableConnectWithRepeatedCalls");
305
+ o(this, "_cancelableSendPresentationWithRepeatedCalls");
306
+ o(this, "_cancelableInitUa");
307
+ o(this, "_cancelableDisconnect");
308
+ o(this, "_cancelableSet");
309
+ o(this, "_cancelableCall");
310
+ o(this, "_cancelableAnswer");
311
+ o(this, "_cancelableSendDTMF");
312
+ o(this, "getSipServerUrl", (e) => e);
313
+ o(this, "promisePendingStartPresentation");
314
+ o(this, "promisePendingStopPresentation");
315
+ o(this, "ua");
316
+ o(this, "session");
317
+ o(this, "incomingSession");
318
+ o(this, "_streamPresentationCurrent");
319
+ o(this, "socket");
320
+ o(this, "connect", async (e, t) => (this._cancelRequests(), this._connectWithDuplicatedCalls(e, t)));
321
+ o(this, "initUa", async (e) => this._cancelableInitUa.request(e));
322
+ o(this, "set", async (e) => this._cancelableSet.request(e));
323
+ o(this, "call", async (e) => this._cancelableCall.request(e));
324
+ o(this, "disconnect", async () => (this._cancelRequests(), this._disconnectWithoutCancelRequests()));
325
+ o(this, "answerToIncomingCall", async (e) => this._cancelableAnswer.request(e));
326
+ o(this, "sendDTMF", async (e) => this._cancelableSendDTMF.request(e));
327
+ o(this, "hangUp", async () => (this._cancelRequests(), this._hangUpWithoutCancelRequests()));
328
+ o(this, "tryRegister", async () => {
332
329
  if (!this.isRegisterConfig)
333
330
  throw new Error("Config is not registered");
334
331
  this._uaEvents.trigger(H, void 0);
@@ -339,25 +336,25 @@ class us {
339
336
  }
340
337
  return this.register();
341
338
  });
342
- r(this, "declineToIncomingCall", async ({ statusCode: e = Vn } = {}) => new Promise((t, n) => {
339
+ o(this, "declineToIncomingCall", async ({ statusCode: e = Vn } = {}) => new Promise((t, n) => {
343
340
  if (!this.isAvailableIncomingCall) {
344
341
  n(new Error("no incomingSession"));
345
342
  return;
346
343
  }
347
- const i = this.incomingSession, o = this.remoteCallerData;
348
- this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(Y, o), t(i.terminate({ status_code: e }));
344
+ const i = this.incomingSession, r = this.remoteCallerData;
345
+ this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(Y, r), t(i.terminate({ status_code: e }));
349
346
  }));
350
- r(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: xn }));
351
- r(this, "removeIncomingSession", () => {
347
+ o(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: xn }));
348
+ o(this, "removeIncomingSession", () => {
352
349
  delete this.incomingSession;
353
350
  });
354
- r(this, "_connectWithDuplicatedCalls", async (e, { callLimit: t = Yn } = {}) => {
355
- const n = async () => this._cancelableConnect.request(e), i = (o) => {
351
+ o(this, "_connectWithDuplicatedCalls", async (e, { callLimit: t = Yn } = {}) => {
352
+ const n = async () => this._cancelableConnect.request(e), i = (r) => {
356
353
  var d;
357
- const c = !!((d = this.ua) != null && d.isConnected()) && this.hasEqualConnectionConfiguration(e), _ = !!o && !On(o);
358
- return c || _;
354
+ const c = !!((d = this.ua) != null && d.isConnected()) && this.hasEqualConnectionConfiguration(e), E = !!r && !On(r);
355
+ return c || E;
359
356
  };
360
- return this._cancelableConnectWithRepeatedCalls = De({
357
+ return this._cancelableConnectWithRepeatedCalls = pe({
361
358
  targetFunction: n,
362
359
  isComplete: i,
363
360
  callLimit: t,
@@ -366,13 +363,13 @@ class us {
366
363
  onAfterCancel: () => {
367
364
  this._cancelableConnect.cancelRequest();
368
365
  }
369
- }), this._cancelableConnectWithRepeatedCalls.then((o) => {
370
- if (o instanceof this.JsSIP.UA)
371
- return o;
372
- throw o;
366
+ }), this._cancelableConnectWithRepeatedCalls.then((r) => {
367
+ if (r instanceof this.JsSIP.UA)
368
+ return r;
369
+ throw r;
373
370
  });
374
371
  });
375
- r(this, "handleNewRTCSession", ({ originator: e, session: t }) => {
372
+ o(this, "handleNewRTCSession", ({ originator: e, session: t }) => {
376
373
  if (e === Ue) {
377
374
  this.incomingSession = t;
378
375
  const n = this.remoteCallerData;
@@ -381,21 +378,21 @@ class us {
381
378
  }), this._uaEvents.trigger(V, n);
382
379
  }
383
380
  });
384
- r(this, "_connect", async (e) => this.initUa(e).then(async () => this._start()));
385
- r(this, "_initUa", async ({
381
+ o(this, "_connect", async (e) => this.initUa(e).then(async () => this._start()));
382
+ o(this, "_initUa", async ({
386
383
  user: e,
387
384
  password: t,
388
385
  sipServerUrl: n,
389
386
  sipWebSocketServerURL: i,
390
- remoteAddress: o,
387
+ remoteAddress: r,
391
388
  sessionTimers: a,
392
389
  registerExpires: c,
393
- connectionRecoveryMinInterval: _,
390
+ connectionRecoveryMinInterval: E,
394
391
  connectionRecoveryMaxInterval: d,
395
- userAgent: E,
392
+ userAgent: _,
396
393
  displayName: h = "",
397
394
  register: l = !1,
398
- extraHeaders: u = []
395
+ extraHeaders: T = []
399
396
  }) => {
400
397
  if (!n)
401
398
  throw new Error("sipServerUrl is required");
@@ -412,7 +409,7 @@ class us {
412
409
  user: e,
413
410
  password: t
414
411
  };
415
- const { configuration: N, helpers: T } = this.createUaConfiguration({
412
+ const { configuration: N, helpers: u } = this.createUaConfiguration({
416
413
  user: e,
417
414
  sipServerUrl: n,
418
415
  sipWebSocketServerURL: i,
@@ -421,16 +418,16 @@ class us {
421
418
  register: l,
422
419
  sessionTimers: a,
423
420
  registerExpires: c,
424
- connectionRecoveryMinInterval: _,
421
+ connectionRecoveryMinInterval: E,
425
422
  connectionRecoveryMaxInterval: d,
426
- userAgent: E
423
+ userAgent: _
427
424
  });
428
- return this.getSipServerUrl = T.getSipServerUrl, this.socket = T.socket, this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!l, this.ua = this._createUa({ ...N, remoteAddress: o, extraHeaders: u }), this._uaEvents.eachTriggers((W, Ct) => {
429
- const Oe = fe.find((gt) => gt === Ct);
425
+ return this.getSipServerUrl = u.getSipServerUrl, this.socket = u.socket, this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!l, this.ua = this._createUa({ ...N, remoteAddress: r, extraHeaders: T }), this._uaEvents.eachTriggers((W, gt) => {
426
+ const Oe = fe.find((Ct) => Ct === gt);
430
427
  Oe && this.ua && this.ua.on(Oe, W);
431
428
  }), this.ua;
432
429
  });
433
- r(this, "_createUa", ({
430
+ o(this, "_createUa", ({
434
431
  remoteAddress: e,
435
432
  extraHeaders: t = [],
436
433
  ...n
@@ -438,7 +435,7 @@ class us {
438
435
  const i = new this.JsSIP.UA(n), a = [...e ? xt(e) : [], ...t];
439
436
  return a.length > 0 && i.registrator().setExtraHeaders(a), i;
440
437
  });
441
- r(this, "_start", async () => new Promise((e, t) => {
438
+ o(this, "_start", async () => new Promise((e, t) => {
442
439
  const { ua: n } = this;
443
440
  if (!n) {
444
441
  t(new Error("this.ua is not initialized"));
@@ -446,32 +443,32 @@ class us {
446
443
  }
447
444
  const i = () => {
448
445
  c(), e(n);
449
- }, o = (_) => {
450
- c(), t(_);
446
+ }, r = (E) => {
447
+ c(), t(E);
451
448
  }, a = () => {
452
- this.isRegisterConfig ? (this.on(m, i), this.on(P, o)) : this.on(f, i), this.on(S, o);
449
+ this.isRegisterConfig ? (this.on(m, i), this.on(P, r)) : this.on(f, i), this.on(S, r);
453
450
  }, c = () => {
454
- this.off(m, i), this.off(P, o), this.off(f, i), this.off(S, o);
451
+ this.off(m, i), this.off(P, r), this.off(f, i), this.off(S, r);
455
452
  };
456
453
  a(), this.on(M, this.handleNewRTCSession), n.start();
457
454
  }));
458
- r(this, "_set", async ({ displayName: e, password: t }) => new Promise((n, i) => {
459
- const { ua: o } = this;
460
- if (!o) {
455
+ o(this, "_set", async ({ displayName: e, password: t }) => new Promise((n, i) => {
456
+ const { ua: r } = this;
457
+ if (!r) {
461
458
  i(new Error("this.ua is not initialized"));
462
459
  return;
463
460
  }
464
461
  let a = !1, c = !1;
465
- e !== void 0 && e !== this._connectionConfiguration.displayName && (a = o.set("display_name", be(e)), this._connectionConfiguration.displayName = e), t !== void 0 && t !== this._connectionConfiguration.password && (c = o.set("password", t), this._connectionConfiguration.password = t);
466
- const _ = a || c;
462
+ e !== void 0 && e !== this._connectionConfiguration.displayName && (a = r.set("display_name", be(e)), this._connectionConfiguration.displayName = e), t !== void 0 && t !== this._connectionConfiguration.password && (c = r.set("password", t), this._connectionConfiguration.password = t);
463
+ const E = a || c;
467
464
  c && this.isRegisterConfig ? this.register().then(() => {
468
- n(_);
465
+ n(E);
469
466
  }).catch((d) => {
470
467
  i(d);
471
- }) : _ ? n(_) : i(new Error("nothing changed"));
468
+ }) : E ? n(E) : i(new Error("nothing changed"));
472
469
  }));
473
- r(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
474
- r(this, "_disconnect", async () => {
470
+ o(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
471
+ o(this, "_disconnect", async () => {
475
472
  this.off(M, this.handleNewRTCSession);
476
473
  const e = new Promise((t) => {
477
474
  this.once(S, () => {
@@ -480,29 +477,29 @@ class us {
480
477
  });
481
478
  return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(S, void 0)) : this._uaEvents.trigger(S, void 0), e;
482
479
  });
483
- r(this, "_call", async ({
480
+ o(this, "_call", async ({
484
481
  number: e,
485
482
  mediaStream: t,
486
483
  extraHeaders: n = [],
487
484
  ontrack: i,
488
- iceServers: o,
485
+ iceServers: r,
489
486
  videoMode: a,
490
487
  audioMode: c,
491
- onAddedSender: _,
488
+ onAddedSender: E,
492
489
  contentHint: d,
493
- offerToReceiveAudio: E = !0,
490
+ offerToReceiveAudio: _ = !0,
494
491
  offerToReceiveVideo: h = !0
495
- }) => new Promise((l, u) => {
492
+ }) => new Promise((l, T) => {
496
493
  const { ua: N } = this;
497
494
  if (!N) {
498
- u(new Error("this.ua is not initialized"));
495
+ T(new Error("this.ua is not initialized"));
499
496
  return;
500
497
  }
501
- this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: i }).then(l).catch((T) => {
502
- u(T);
498
+ this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: i }).then(l).catch((u) => {
499
+ T(u);
503
500
  }), this.session = N.call(this.getSipServerUrl(e), {
504
501
  extraHeaders: n,
505
- mediaStream: D(t, {
502
+ mediaStream: p(t, {
506
503
  videoMode: a,
507
504
  audioMode: c,
508
505
  contentHint: d
@@ -510,50 +507,50 @@ class us {
510
507
  eventHandlers: this._sessionEvents.triggers,
511
508
  videoMode: a,
512
509
  audioMode: c,
513
- onAddedSender: _,
510
+ onAddedSender: E,
514
511
  pcConfig: {
515
- iceServers: o
512
+ iceServers: r
516
513
  },
517
514
  rtcOfferConstraints: {
518
- offerToReceiveAudio: E,
515
+ offerToReceiveAudio: _,
519
516
  offerToReceiveVideo: h
520
517
  }
521
518
  });
522
519
  }));
523
- r(this, "_answer", async ({
520
+ o(this, "_answer", async ({
524
521
  mediaStream: e,
525
522
  ontrack: t,
526
523
  extraHeaders: n = [],
527
524
  iceServers: i,
528
- videoMode: o,
525
+ videoMode: r,
529
526
  audioMode: a,
530
527
  onAddedSender: c,
531
- contentHint: _
532
- }) => new Promise((d, E) => {
528
+ contentHint: E
529
+ }) => new Promise((d, _) => {
533
530
  if (!this.isAvailableIncomingCall) {
534
- E(new Error("no incomingSession"));
531
+ _(new Error("no incomingSession"));
535
532
  return;
536
533
  }
537
534
  this.session = this.incomingSession, this.removeIncomingSession();
538
535
  const { session: h } = this;
539
536
  if (!h) {
540
- E(new Error("No session established"));
537
+ _(new Error("No session established"));
541
538
  return;
542
539
  }
543
- this._sessionEvents.eachTriggers((u, N) => {
544
- const T = me.find((W) => W === N);
545
- T && h.on(T, u);
546
- }), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = h.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(d).catch((u) => {
547
- E(u);
540
+ this._sessionEvents.eachTriggers((T, N) => {
541
+ const u = me.find((W) => W === N);
542
+ u && h.on(u, T);
543
+ }), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = h.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(d).catch((T) => {
544
+ _(T);
548
545
  });
549
- const l = D(e, {
550
- videoMode: o,
546
+ const l = p(e, {
547
+ videoMode: r,
551
548
  audioMode: a,
552
- contentHint: _
549
+ contentHint: E
553
550
  });
554
551
  h.answer({
555
552
  extraHeaders: n,
556
- videoMode: o,
553
+ videoMode: r,
557
554
  audioMode: a,
558
555
  onAddedSender: c,
559
556
  mediaStream: l,
@@ -562,45 +559,45 @@ class us {
562
559
  }
563
560
  });
564
561
  }));
565
- r(this, "_handleCall", async ({ ontrack: e }) => new Promise((t, n) => {
562
+ o(this, "_handleCall", async ({ ontrack: e }) => new Promise((t, n) => {
566
563
  const i = () => {
567
- this.onSession(U, E), this.onSession(b, h);
568
- }, o = () => {
569
- this.offSession(U, E), this.offSession(b, h);
564
+ this.onSession(U, _), this.onSession(b, h);
565
+ }, r = () => {
566
+ this.offSession(U, _), this.offSession(b, h);
570
567
  }, a = () => {
571
- this.onSession(A, _), this.onSession(O, _);
568
+ this.onSession(A, E), this.onSession(O, E);
572
569
  }, c = () => {
573
- this.offSession(A, _), this.offSession(O, _);
574
- }, _ = (l) => {
575
- o(), c(), n(l);
570
+ this.offSession(A, E), this.offSession(O, E);
571
+ }, E = (l) => {
572
+ r(), c(), n(l);
576
573
  };
577
574
  let d;
578
- const E = ({ peerconnection: l }) => {
579
- d = l, d.ontrack = (u) => {
580
- this._sessionEvents.trigger(te, d), e && e(u);
575
+ const _ = ({ peerconnection: l }) => {
576
+ d = l, d.ontrack = (T) => {
577
+ this._sessionEvents.trigger(te, d), e && e(T);
581
578
  };
582
579
  }, h = () => {
583
- d && this._sessionEvents.trigger(ee, d), o(), c(), t(d);
580
+ d && this._sessionEvents.trigger(ee, d), r(), c(), t(d);
584
581
  };
585
582
  i(), a();
586
583
  }));
587
- r(this, "_restoreSession", () => {
584
+ o(this, "_restoreSession", () => {
588
585
  this._cancelRequestsAndResetPresentation(), delete this._connectionConfiguration.number, delete this.session, this._remoteStreams = {};
589
586
  });
590
- r(this, "_sendDTMF", async (e) => new Promise((t, n) => {
587
+ o(this, "_sendDTMF", async (e) => new Promise((t, n) => {
591
588
  const { session: i } = this;
592
589
  if (!i) {
593
590
  n(new Error("No session established"));
594
591
  return;
595
592
  }
596
- this.onceSession(Ae, ({ originator: o }) => {
597
- o === F && t();
593
+ this.onceSession(Ae, ({ originator: r }) => {
594
+ r === F && t();
598
595
  }), i.sendDTMF(e, {
599
596
  duration: 120,
600
597
  interToneGap: 600
601
598
  });
602
599
  }));
603
- r(this, "_hangUpWithoutCancelRequests", async () => {
600
+ o(this, "_hangUpWithoutCancelRequests", async () => {
604
601
  if (this.ua && this.session) {
605
602
  const { session: e } = this;
606
603
  if (this._streamPresentationCurrent)
@@ -613,23 +610,23 @@ class us {
613
610
  return e.terminateAsync();
614
611
  }
615
612
  });
616
- r(this, "_handleShareState", (e) => {
613
+ o(this, "_handleShareState", (e) => {
617
614
  switch (e) {
618
615
  case lt: {
619
616
  this._sessionEvents.trigger(z, void 0);
620
617
  break;
621
618
  }
622
- case ut: {
619
+ case Tt: {
623
620
  this._sessionEvents.trigger(Q, void 0);
624
621
  break;
625
622
  }
626
- case Tt: {
623
+ case ut: {
627
624
  this._sessionEvents.trigger(j, void 0);
628
625
  break;
629
626
  }
630
627
  }
631
628
  });
632
- r(this, "_maybeTriggerChannels", (e) => {
629
+ o(this, "_maybeTriggerChannels", (e) => {
633
630
  const t = e.getHeader(ve), n = e.getHeader(ye);
634
631
  if (t && n) {
635
632
  const i = {
@@ -639,19 +636,19 @@ class us {
639
636
  this._sessionEvents.trigger(y, i);
640
637
  }
641
638
  });
642
- r(this, "_handleNotify", (e) => {
639
+ o(this, "_handleNotify", (e) => {
643
640
  switch (e.cmd) {
644
641
  case $n: {
645
642
  const t = e;
646
643
  this._triggerChannelsNotify(t);
647
644
  break;
648
645
  }
649
- case Xn: {
646
+ case Jn: {
650
647
  const t = e;
651
648
  this._triggerWebcastStartedNotify(t);
652
649
  break;
653
650
  }
654
- case Jn: {
651
+ case Xn: {
655
652
  const t = e;
656
653
  this._triggerWebcastStoppedNotify(t);
657
654
  break;
@@ -698,7 +695,7 @@ class us {
698
695
  k("unknown cmd", e.cmd);
699
696
  }
700
697
  });
701
- r(this, "_triggerRemovedFromListModeratorsNotify", ({
698
+ o(this, "_triggerRemovedFromListModeratorsNotify", ({
702
699
  conference: e
703
700
  }) => {
704
701
  const t = {
@@ -709,33 +706,33 @@ class us {
709
706
  t
710
707
  );
711
708
  });
712
- r(this, "_triggerAddedToListModeratorsNotify", ({ conference: e }) => {
709
+ o(this, "_triggerAddedToListModeratorsNotify", ({ conference: e }) => {
713
710
  const t = {
714
711
  conference: e
715
712
  };
716
713
  this._uaEvents.trigger(_e, t);
717
714
  });
718
- r(this, "_triggerWebcastStartedNotify", ({ body: { conference: e, type: t } }) => {
715
+ o(this, "_triggerWebcastStartedNotify", ({ body: { conference: e, type: t } }) => {
719
716
  const n = {
720
717
  conference: e,
721
718
  type: t
722
719
  };
723
- this._uaEvents.trigger(Te, n);
720
+ this._uaEvents.trigger(ue, n);
724
721
  });
725
- r(this, "_triggerWebcastStoppedNotify", ({ body: { conference: e, type: t } }) => {
722
+ o(this, "_triggerWebcastStoppedNotify", ({ body: { conference: e, type: t } }) => {
726
723
  const n = {
727
724
  conference: e,
728
725
  type: t
729
726
  };
730
727
  this._uaEvents.trigger(Se, n);
731
728
  });
732
- r(this, "_triggerAccountChangedNotify", () => {
729
+ o(this, "_triggerAccountChangedNotify", () => {
733
730
  this._uaEvents.trigger(Ne, void 0);
734
731
  });
735
- r(this, "_triggerAccountDeletedNotify", () => {
736
- this._uaEvents.trigger(Ce, void 0);
732
+ o(this, "_triggerAccountDeletedNotify", () => {
733
+ this._uaEvents.trigger(ge, void 0);
737
734
  });
738
- r(this, "_triggerConferenceParticipantTokenIssued", ({
735
+ o(this, "_triggerConferenceParticipantTokenIssued", ({
739
736
  body: { conference: e, participant: t, jwt: n }
740
737
  }) => {
741
738
  const i = {
@@ -744,18 +741,18 @@ class us {
744
741
  jwt: n
745
742
  };
746
743
  this._uaEvents.trigger(
747
- ge,
744
+ Ce,
748
745
  i
749
746
  );
750
747
  });
751
- r(this, "_triggerChannelsNotify", (e) => {
748
+ o(this, "_triggerChannelsNotify", (e) => {
752
749
  const t = e.input, n = e.output, i = {
753
750
  inputChannels: t,
754
751
  outputChannels: n
755
752
  };
756
753
  this._uaEvents.trigger(ne, i);
757
754
  });
758
- r(this, "_triggerParticipationAcceptingWordRequest", ({
755
+ o(this, "_triggerParticipationAcceptingWordRequest", ({
759
756
  body: { conference: e }
760
757
  }) => {
761
758
  const t = {
@@ -763,15 +760,15 @@ class us {
763
760
  };
764
761
  this._uaEvents.trigger(le, t);
765
762
  });
766
- r(this, "_triggerParticipationCancellingWordRequest", ({
763
+ o(this, "_triggerParticipationCancellingWordRequest", ({
767
764
  body: { conference: e }
768
765
  }) => {
769
766
  const t = {
770
767
  conference: e
771
768
  };
772
- this._uaEvents.trigger(ue, t);
769
+ this._uaEvents.trigger(Te, t);
773
770
  });
774
- r(this, "_triggerParticipantMoveRequestToStream", ({
771
+ o(this, "_triggerParticipantMoveRequestToStream", ({
775
772
  body: { conference: e }
776
773
  }) => {
777
774
  const t = {
@@ -779,43 +776,43 @@ class us {
779
776
  };
780
777
  this._uaEvents.trigger(de, t);
781
778
  });
782
- r(this, "_triggerEnterRoom", (e) => {
779
+ o(this, "_triggerEnterRoom", (e) => {
783
780
  const t = e.getHeader(Yt), n = e.getHeader(Kt);
784
781
  this._sessionEvents.trigger(K, { room: t, participantName: n });
785
782
  });
786
- r(this, "_triggerShareState", (e) => {
783
+ o(this, "_triggerShareState", (e) => {
787
784
  const t = e.getHeader(R);
788
785
  this._sessionEvents.trigger(v, t);
789
786
  });
790
- r(this, "_maybeTriggerParticipantMoveRequestToSpectators", (e) => {
787
+ o(this, "_maybeTriggerParticipantMoveRequestToSpectators", (e) => {
791
788
  e.getHeader(cn) === at && this._sessionEvents.trigger(he, void 0);
792
789
  });
793
- r(this, "_triggerMainCamControl", (e) => {
790
+ o(this, "_triggerMainCamControl", (e) => {
794
791
  const t = e.getHeader(Zt), n = e.getHeader(we), i = n === q.ADMIN_SYNC_FORCED;
795
792
  if (t === I.ADMIN_START_MAIN_CAM) {
796
- this._sessionEvents.trigger(oe, { isSyncForced: i });
793
+ this._sessionEvents.trigger(re, { isSyncForced: i });
797
794
  return;
798
795
  }
799
796
  if (t === I.ADMIN_STOP_MAIN_CAM) {
800
- this._sessionEvents.trigger(re, { isSyncForced: i });
797
+ this._sessionEvents.trigger(oe, { isSyncForced: i });
801
798
  return;
802
799
  }
803
800
  (t === I.RESUME_MAIN_CAM || t === I.PAUSE_MAIN_CAM) && n && this._sessionEvents.trigger(w, { isSyncForced: i });
804
- const o = e.getHeader(tn);
801
+ const r = e.getHeader(tn);
805
802
  this._sessionEvents.trigger(ie, {
806
803
  mainCam: t,
807
- resolutionMainCam: o
804
+ resolutionMainCam: r
808
805
  });
809
806
  });
810
- r(this, "_triggerMicControl", (e) => {
807
+ o(this, "_triggerMicControl", (e) => {
811
808
  const t = e.getHeader(en), i = e.getHeader(we) === q.ADMIN_SYNC_FORCED;
812
809
  t === B.ADMIN_START_MIC ? this._sessionEvents.trigger(ce, { isSyncForced: i }) : t === B.ADMIN_STOP_MIC && this._sessionEvents.trigger(ae, { isSyncForced: i });
813
810
  });
814
- r(this, "_triggerUseLicense", (e) => {
811
+ o(this, "_triggerUseLicense", (e) => {
815
812
  const t = e.getHeader(jt);
816
813
  this._sessionEvents.trigger(Z, t);
817
814
  });
818
- r(this, "_handleNewInfo", (e) => {
815
+ o(this, "_handleNewInfo", (e) => {
819
816
  const { originator: t } = e;
820
817
  if (t !== "remote")
821
818
  return;
@@ -830,7 +827,7 @@ class us {
830
827
  this._maybeHandleNotify(n);
831
828
  break;
832
829
  }
833
- case p: {
830
+ case D: {
834
831
  this._triggerShareState(n);
835
832
  break;
836
833
  }
@@ -852,40 +849,40 @@ class us {
852
849
  }
853
850
  }
854
851
  });
855
- r(this, "_handleSipEvent", ({ request: e }) => {
852
+ o(this, "_handleSipEvent", ({ request: e }) => {
856
853
  this._maybeHandleNotify(e);
857
854
  });
858
- r(this, "_maybeHandleNotify", (e) => {
855
+ o(this, "_maybeHandleNotify", (e) => {
859
856
  const t = e.getHeader(En);
860
857
  if (t) {
861
858
  const n = JSON.parse(t);
862
859
  this._handleNotify(n);
863
860
  }
864
861
  });
865
- r(this, "_handleEnded", (e) => {
862
+ o(this, "_handleEnded", (e) => {
866
863
  const { originator: t } = e;
867
864
  t === Ue && this._sessionEvents.trigger(se, e), this._restoreSession();
868
865
  });
869
- this.JsSIP = e, this._sessionEvents = new pe(ht), this._uaEvents = new pe(dt), this._cancelableConnect = new C(
866
+ this.JsSIP = e, this._sessionEvents = new De(ht), this._uaEvents = new De(dt), this._cancelableConnect = new g(
870
867
  this._connect,
871
868
  {
872
- moduleName: g,
869
+ moduleName: C,
873
870
  afterCancelRequest: () => {
874
871
  this._cancelableInitUa.cancelRequest(), this._cancelableDisconnect.cancelRequest();
875
872
  }
876
873
  }
877
- ), this._cancelableInitUa = new C(
874
+ ), this._cancelableInitUa = new g(
878
875
  this._initUa,
879
- { moduleName: g }
880
- ), this._cancelableDisconnect = new C(
876
+ { moduleName: C }
877
+ ), this._cancelableDisconnect = new g(
881
878
  this._disconnect,
882
- { moduleName: g }
883
- ), this._cancelableSet = new C(this._set, {
884
- moduleName: g
885
- }), this._cancelableCall = new C(
879
+ { moduleName: C }
880
+ ), this._cancelableSet = new g(this._set, {
881
+ moduleName: C
882
+ }), this._cancelableCall = new g(
886
883
  this._call,
887
- { moduleName: g }
888
- ), this._cancelableAnswer = new C(this._answer, { moduleName: g }), this._cancelableSendDTMF = new C(this._sendDTMF, { moduleName: g }), this.onSession(v, this._handleShareState), this.onSession(Re, this._handleNewInfo), this.on(J, this._handleSipEvent), this.onSession(A, this._handleEnded), this.onSession(O, this._handleEnded);
884
+ { moduleName: C }
885
+ ), this._cancelableAnswer = new g(this._answer, { moduleName: C }), this._cancelableSendDTMF = new g(this._sendDTMF, { moduleName: C }), this.onSession(v, this._handleShareState), this.onSession(Re, this._handleNewInfo), this.on(X, this._handleSipEvent), this.onSession(A, this._handleEnded), this.onSession(O, this._handleEnded);
889
886
  }
890
887
  async register() {
891
888
  return new Promise((e, t) => {
@@ -894,13 +891,13 @@ class us {
894
891
  }
895
892
  async unregister() {
896
893
  return new Promise((e, t) => {
897
- this.isRegistered && this.ua ? (this.ua.on(X, e), this.ua.unregister()) : t(new Error("ua is not registered"));
894
+ this.isRegistered && this.ua ? (this.ua.on(J, e), this.ua.unregister()) : t(new Error("ua is not registered"));
898
895
  });
899
896
  }
900
897
  async sendOptions(e, t, n) {
901
898
  if (!this.ua)
902
899
  throw new Error("is not connected");
903
- return new Promise((i, o) => {
900
+ return new Promise((i, r) => {
904
901
  try {
905
902
  this.ua.sendOptions(e, t, {
906
903
  extraHeaders: n,
@@ -908,11 +905,11 @@ class us {
908
905
  succeeded: () => {
909
906
  i();
910
907
  },
911
- failed: o
908
+ failed: r
912
909
  }
913
910
  });
914
911
  } catch (a) {
915
- o(a);
912
+ r(a);
916
913
  }
917
914
  });
918
915
  }
@@ -928,30 +925,30 @@ class us {
928
925
  displayName: t,
929
926
  sipServerUrl: n,
930
927
  sipWebSocketServerURL: i,
931
- remoteAddress: o,
928
+ remoteAddress: r,
932
929
  extraHeaders: a
933
930
  }) {
934
- return new Promise((c, _) => {
931
+ return new Promise((c, E) => {
935
932
  const { configuration: d } = this.createUaConfiguration({
936
933
  sipWebSocketServerURL: i,
937
934
  displayName: t,
938
935
  userAgent: e,
939
936
  sipServerUrl: n
940
- }), E = this._createUa({ ...d, remoteAddress: o, extraHeaders: a }), h = () => {
941
- const u = new Error("Telephony is not available");
942
- _(u);
937
+ }), _ = this._createUa({ ...d, remoteAddress: r, extraHeaders: a }), h = () => {
938
+ const T = new Error("Telephony is not available");
939
+ E(T);
943
940
  };
944
- E.once(S, h);
941
+ _.once(S, h);
945
942
  const l = () => {
946
- E.removeAllListeners(), E.once(S, c), E.stop();
943
+ _.removeAllListeners(), _.once(S, c), _.stop();
947
944
  };
948
- E.once(f, l), E.start();
945
+ _.once(f, l), _.start();
949
946
  });
950
947
  }
951
948
  async replaceMediaStream(e, t) {
952
949
  if (!this.session)
953
950
  throw new Error("No session established");
954
- const { contentHint: n } = t || {}, i = D(e, { contentHint: n });
951
+ const { contentHint: n } = t || {}, i = p(e, { contentHint: n });
955
952
  return this.session.replaceMediaStream(i, t);
956
953
  }
957
954
  async askPermissionToEnableCam(e = {}) {
@@ -963,7 +960,7 @@ class us {
963
960
  ...e,
964
961
  extraHeaders: t
965
962
  }).catch((n) => {
966
- if (pn(n))
963
+ if (Dn(n))
967
964
  throw n;
968
965
  });
969
966
  }
@@ -978,9 +975,9 @@ class us {
978
975
  callLimit: Gn
979
976
  }
980
977
  }) {
981
- const o = async () => this._sendPresentation(e, t, n), a = () => !!this._streamPresentationCurrent;
982
- return this._cancelableSendPresentationWithRepeatedCalls = De({
983
- targetFunction: o,
978
+ const r = async () => this._sendPresentation(e, t, n), a = () => !!this._streamPresentationCurrent;
979
+ return this._cancelableSendPresentationWithRepeatedCalls = pe({
980
+ targetFunction: r,
984
981
  isComplete: a,
985
982
  isRejectAsValid: !0,
986
983
  ...i
@@ -996,18 +993,18 @@ class us {
996
993
  password: t,
997
994
  sipWebSocketServerURL: n,
998
995
  displayName: i = "",
999
- sipServerUrl: o,
996
+ sipServerUrl: r,
1000
997
  register: a = !1,
1001
998
  sessionTimers: c = !1,
1002
- registerExpires: _ = 60 * 5,
999
+ registerExpires: E = 60 * 5,
1003
1000
  // 5 minutes in sec
1004
1001
  connectionRecoveryMinInterval: d = 2,
1005
- connectionRecoveryMaxInterval: E = 6,
1002
+ connectionRecoveryMaxInterval: _ = 6,
1006
1003
  userAgent: h
1007
1004
  }) {
1008
1005
  if (a && !t)
1009
1006
  throw new Error("password is required for authorized connection");
1010
- const l = a && e ? e.trim() : `${In()}`, u = An(o), N = u(l), T = new this.JsSIP.WebSocketInterface(n);
1007
+ const l = a && e ? e.trim() : `${In()}`, T = An(r), N = T(l), u = new this.JsSIP.WebSocketInterface(n);
1011
1008
  return {
1012
1009
  configuration: {
1013
1010
  password: t,
@@ -1016,30 +1013,30 @@ class us {
1016
1013
  display_name: be(i),
1017
1014
  user_agent: h,
1018
1015
  sdp_semantics: "unified-plan",
1019
- sockets: [T],
1016
+ sockets: [u],
1020
1017
  session_timers: c,
1021
- register_expires: _,
1018
+ register_expires: E,
1022
1019
  connection_recovery_min_interval: d,
1023
- connection_recovery_max_interval: E
1020
+ connection_recovery_max_interval: _
1024
1021
  },
1025
1022
  helpers: {
1026
- socket: T,
1027
- getSipServerUrl: u
1023
+ socket: u,
1024
+ getSipServerUrl: T
1028
1025
  }
1029
1026
  };
1030
1027
  }
1031
1028
  async _sendPresentation(e, t, {
1032
1029
  maxBitrate: n = ct,
1033
1030
  onAddedSender: i,
1034
- isNeedReinvite: o = !0,
1031
+ isNeedReinvite: r = !0,
1035
1032
  isP2P: a = !1,
1036
1033
  contentHint: c = "detail"
1037
1034
  }) {
1038
- const _ = D(t, { contentHint: c });
1039
- this._streamPresentationCurrent = _;
1040
- const d = a ? [un] : [dn], E = e.sendInfo(p, void 0, {
1035
+ const E = p(t, { contentHint: c });
1036
+ this._streamPresentationCurrent = E;
1037
+ const d = a ? [Tn] : [dn], _ = e.sendInfo(D, void 0, {
1041
1038
  extraHeaders: d
1042
- }).then(async () => e.startPresentation(_, o, i)).then(async () => {
1039
+ }).then(async () => e.startPresentation(E, r, i)).then(async () => {
1043
1040
  const { connection: h } = this;
1044
1041
  if (!h || n === void 0)
1045
1042
  return;
@@ -1048,7 +1045,7 @@ class us {
1048
1045
  }).then(() => t).catch((h) => {
1049
1046
  throw this._removeStreamPresentationCurrent(), this._sessionEvents.trigger(L, h), h;
1050
1047
  });
1051
- return this.promisePendingStartPresentation = E, E.finally(() => {
1048
+ return this.promisePendingStartPresentation = _, _.finally(() => {
1052
1049
  this.promisePendingStartPresentation = void 0;
1053
1050
  });
1054
1051
  }
@@ -1056,29 +1053,29 @@ class us {
1056
1053
  isNeedReinvite: t,
1057
1054
  isP2P: n,
1058
1055
  maxBitrate: i,
1059
- onAddedSender: o,
1056
+ onAddedSender: r,
1060
1057
  contentHint: a
1061
1058
  } = {}, c) {
1062
- const _ = this.establishedSession;
1063
- if (!_)
1059
+ const E = this.establishedSession;
1060
+ if (!E)
1064
1061
  throw new Error("No session established");
1065
1062
  if (this._streamPresentationCurrent)
1066
1063
  throw new Error("Presentation is already started");
1067
- return n && await this.sendMustStopPresentation(_), this._sendPresentationWithDuplicatedCalls({
1068
- session: _,
1064
+ return n && await this.sendMustStopPresentation(E), this._sendPresentationWithDuplicatedCalls({
1065
+ session: E,
1069
1066
  stream: e,
1070
1067
  presentationOptions: {
1071
1068
  isNeedReinvite: t,
1072
1069
  isP2P: n,
1073
1070
  maxBitrate: i,
1074
- onAddedSender: o,
1071
+ onAddedSender: r,
1075
1072
  contentHint: a
1076
1073
  },
1077
1074
  options: c
1078
1075
  });
1079
1076
  }
1080
1077
  async sendMustStopPresentation(e) {
1081
- await e.sendInfo(p, void 0, {
1078
+ await e.sendInfo(D, void 0, {
1082
1079
  extraHeaders: [ln]
1083
1080
  });
1084
1081
  }
@@ -1088,12 +1085,12 @@ class us {
1088
1085
  this._cancelSendPresentationWithRepeatedCalls();
1089
1086
  const t = this._streamPresentationCurrent;
1090
1087
  let n = this.promisePendingStartPresentation ?? Promise.resolve();
1091
- const i = e ? [Tn] : [hn], o = this.establishedSession;
1092
- return o && t && (n = n.then(async () => o.sendInfo(p, void 0, {
1088
+ const i = e ? [un] : [hn], r = this.establishedSession;
1089
+ return r && t && (n = n.then(async () => r.sendInfo(D, void 0, {
1093
1090
  extraHeaders: i
1094
- })).then(async () => o.stopPresentation(t)).catch((a) => {
1091
+ })).then(async () => r.stopPresentation(t)).catch((a) => {
1095
1092
  throw this._sessionEvents.trigger(L, a), a;
1096
- })), !o && t && this._sessionEvents.trigger(Ie, t), this.promisePendingStopPresentation = n, n.finally(() => {
1093
+ })), !r && t && this._sessionEvents.trigger(Ie, t), this.promisePendingStopPresentation = n, n.finally(() => {
1097
1094
  this._resetPresentation();
1098
1095
  });
1099
1096
  }
@@ -1101,7 +1098,7 @@ class us {
1101
1098
  isP2P: t,
1102
1099
  maxBitrate: n,
1103
1100
  onAddedSender: i,
1104
- contentHint: o
1101
+ contentHint: r
1105
1102
  } = {}) {
1106
1103
  const a = this.establishedSession;
1107
1104
  if (!a)
@@ -1112,7 +1109,7 @@ class us {
1112
1109
  isP2P: t,
1113
1110
  maxBitrate: n,
1114
1111
  onAddedSender: i,
1115
- contentHint: o,
1112
+ contentHint: r,
1116
1113
  isNeedReinvite: !1
1117
1114
  });
1118
1115
  }
@@ -1172,11 +1169,11 @@ class us {
1172
1169
  return (t = this.session) == null ? void 0 : t.connection;
1173
1170
  }
1174
1171
  get remoteCallerData() {
1175
- var e, t, n, i, o, a;
1172
+ var e, t, n, i, r, a;
1176
1173
  return {
1177
1174
  displayName: (t = (e = this.incomingSession) == null ? void 0 : e.remote_identity) == null ? void 0 : t.display_name,
1178
1175
  host: (i = (n = this.incomingSession) == null ? void 0 : n.remote_identity) == null ? void 0 : i.uri.host,
1179
- incomingNumber: (a = (o = this.incomingSession) == null ? void 0 : o.remote_identity) == null ? void 0 : a.uri.user,
1176
+ incomingNumber: (a = (r = this.incomingSession) == null ? void 0 : r.remote_identity) == null ? void 0 : a.uri.user,
1180
1177
  session: this.incomingSession
1181
1178
  };
1182
1179
  }
@@ -1212,11 +1209,11 @@ class us {
1212
1209
  return e.forEach((n, i) => {
1213
1210
  if (n.kind === "audio")
1214
1211
  return;
1215
- const o = n, a = e[i - 1];
1212
+ const r = n, a = e[i - 1];
1216
1213
  let c;
1217
1214
  a && a.kind === "audio" && (c = a);
1218
- const _ = this._generateStream(o, c);
1219
- t.push(_);
1215
+ const E = this._generateStream(r, c);
1216
+ t.push(E);
1220
1217
  }), t;
1221
1218
  }
1222
1219
  _generateAudioStreams(e) {
@@ -1248,21 +1245,21 @@ class us {
1248
1245
  async sendChannels({ inputChannels: e, outputChannels: t }) {
1249
1246
  if (!this.session)
1250
1247
  throw new Error("No session established");
1251
- const n = `${ve}: ${e}`, i = `${ye}: ${t}`, o = [
1248
+ const n = `${ve}: ${e}`, i = `${ye}: ${t}`, r = [
1252
1249
  n,
1253
1250
  i
1254
1251
  ];
1255
- return this.session.sendInfo($t, void 0, { extraHeaders: o });
1252
+ return this.session.sendInfo($t, void 0, { extraHeaders: r });
1256
1253
  }
1257
1254
  async sendMediaState({ cam: e, mic: t }, n = {}) {
1258
1255
  if (!this.session)
1259
1256
  throw new Error("No session established");
1260
- const i = `${nn}: currentstate`, o = `${rn}: ${Number(e)}`, a = `${on}: ${Number(t)}`, c = [
1257
+ const i = `${nn}: currentstate`, r = `${on}: ${Number(e)}`, a = `${rn}: ${Number(t)}`, c = [
1261
1258
  i,
1262
- o,
1259
+ r,
1263
1260
  a
1264
1261
  ];
1265
- return this.session.sendInfo(Xt, void 0, {
1262
+ return this.session.sendInfo(Jt, void 0, {
1266
1263
  noTerminateWhenError: !0,
1267
1264
  ...n,
1268
1265
  extraHeaders: c
@@ -1272,7 +1269,7 @@ class us {
1272
1269
  if (!this.session)
1273
1270
  throw new Error("No session established");
1274
1271
  const c = [`${sn}: ${e === "mic" ? 0 : 1}`];
1275
- return this.session.sendInfo(Jt, void 0, {
1272
+ return this.session.sendInfo(Xt, void 0, {
1276
1273
  noTerminateWhenError: !0,
1277
1274
  ...t,
1278
1275
  extraHeaders: c
@@ -1294,7 +1291,7 @@ export {
1294
1291
  I as E,
1295
1292
  Mt as N,
1296
1293
  He as R,
1297
- us as S,
1294
+ Ts as S,
1298
1295
  dt as U,
1299
1296
  qn as a,
1300
1297
  _s as b,
@@ -1305,7 +1302,7 @@ export {
1305
1302
  B as g,
1306
1303
  ls as h,
1307
1304
  q as i,
1308
- gn as j,
1305
+ Cn as j,
1309
1306
  ht as k,
1310
1307
  k as l,
1311
1308
  Bn as s