sip-connector 15.0.0 → 15.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/@SipConnector-BBhQzo-W.cjs +1 -0
  2. package/dist/{@SipConnector-DbvV1Leg.js → @SipConnector-G96OmJEP.js} +97 -96
  3. package/dist/ApiManager/__tests-utils__/helpers.d.ts +9 -0
  4. package/dist/ApiManager/constants.d.ts +2 -1
  5. package/dist/ApiManager/eventNames.d.ts +2 -1
  6. package/dist/CallManager/MCUCallStrategy.d.ts +1 -1
  7. package/dist/ConnectionManager/@ConnectionManager.d.ts +3 -3
  8. package/dist/ConnectionManager/getExtraHeadersRemoteAddress.d.ts +2 -2
  9. package/dist/IncomingCallManager/@IncomingCallManager.d.ts +2 -2
  10. package/dist/SipConnector/@SipConnector.d.ts +2 -2
  11. package/dist/SipConnector/eventNames.d.ts +1 -1
  12. package/dist/SipConnectorFacade/SipConnectorFacade.d.ts +12 -1
  13. package/dist/__fixtures__/BaseSession.mock.d.ts +1 -1
  14. package/dist/__fixtures__/RTCPeerConnectionMock.d.ts +2 -2
  15. package/dist/__fixtures__/RTCRtpSenderMock.d.ts +1 -0
  16. package/dist/__fixtures__/RTCSessionMock.d.ts +2 -2
  17. package/dist/__fixtures__/UA.mock.d.ts +2 -2
  18. package/dist/__fixtures__/eventNames.d.ts +1 -1
  19. package/dist/__fixtures__/jssip.mock.d.ts +1 -1
  20. package/dist/doMock.cjs +1 -1
  21. package/dist/doMock.js +18 -19
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +645 -525
  25. package/dist/setParametersToSender/index.d.ts +3 -1
  26. package/dist/{videoSendingBalancer → setParametersToSender}/setEncodingsToSender.d.ts +1 -5
  27. package/dist/setParametersToSender/setMaxBitrateToSender.d.ts +2 -0
  28. package/dist/setParametersToSender/setParametersToSender.d.ts +1 -4
  29. package/dist/setParametersToSender/types.d.ts +5 -0
  30. package/dist/tools/error/index.d.ts +1 -1
  31. package/dist/tools/index.d.ts +1 -1
  32. package/dist/tools/syncMediaState/createSyncMediaState.d.ts +18 -0
  33. package/dist/tools/syncMediaState/index.d.ts +1 -18
  34. package/dist/utils/utils.d.ts +4 -0
  35. package/dist/videoSendingBalancer/CodecProvider.d.ts +7 -0
  36. package/dist/videoSendingBalancer/ParametersSetterWithQueue.d.ts +12 -0
  37. package/dist/videoSendingBalancer/SenderBalancer.d.ts +52 -0
  38. package/dist/videoSendingBalancer/SenderFinder.d.ts +7 -0
  39. package/dist/videoSendingBalancer/TaskQueue.d.ts +20 -0
  40. package/dist/videoSendingBalancer/VideoSendingBalancer.d.ts +44 -0
  41. package/dist/videoSendingBalancer/VideoSendingEventHandler.d.ts +25 -0
  42. package/dist/videoSendingBalancer/calcBitrate/calcMaxBitrateByWidth.d.ts +4 -0
  43. package/dist/videoSendingBalancer/calcBitrate/calcMaxBitrateByWidthAndCodec.d.ts +4 -0
  44. package/dist/videoSendingBalancer/calcBitrate/index.d.ts +1 -0
  45. package/dist/videoSendingBalancer/calcResolution/calcScaleResolutionDownBy.d.ts +6 -0
  46. package/dist/videoSendingBalancer/calcResolution/index.d.ts +1 -0
  47. package/dist/videoSendingBalancer/index.d.ts +3 -13
  48. package/dist/videoSendingBalancer/types.d.ts +36 -0
  49. package/package.json +11 -11
  50. package/dist/@SipConnector-CZo7A8_q.cjs +0 -1
  51. package/dist/videoSendingBalancer/balance.d.ts +0 -10
  52. package/dist/videoSendingBalancer/getMaxBitrateByWidth.d.ts +0 -4
  53. package/dist/videoSendingBalancer/getMaxBitrateByWidthAndCodec.d.ts +0 -4
  54. package/dist/videoSendingBalancer/processSender.d.ts +0 -10
  55. package/dist/videoSendingBalancer/scaleBitrate.d.ts +0 -2
  56. /package/dist/{videoSendingBalancer → tools}/scaleResolutionAndBitrate.d.ts +0 -0
  57. /package/dist/{videoSendingBalancer → utils}/hasIncludesString.d.ts +0 -0
  58. /package/dist/videoSendingBalancer/{hasAv1Codec.d.ts → calcBitrate/hasAv1Codec.d.ts} +0 -0
  59. /package/dist/videoSendingBalancer/{scaleBitrateByCodec.d.ts → calcBitrate/scaleBitrateByCodec.d.ts} +0 -0
@@ -3,7 +3,7 @@ import "@krivega/cancelable-promise";
3
3
  import k from "debug";
4
4
  import { hasCanceledError as K, repeatedCallsAsync as V } from "repeated-calls";
5
5
  import { setup as j, createActor as Z } from "xstate";
6
- var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n))(N || {}), U = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(U || {});
6
+ var N = /* @__PURE__ */ ((n) => (n.PEER_CONNECTION = "peerconnection", n.CONNECTING = "connecting", n.SENDING = "sending", n.PROGRESS = "progress", n.ACCEPTED = "accepted", n.CONFIRMED = "confirmed", n.ENDED = "ended", n.FAILED = "failed", n.NEW_DTMF = "newDTMF", n.NEW_INFO = "newInfo", n.HOLD = "hold", n.UNHOLD = "unhold", n.MUTED = "muted", n.UNMUTED = "unmuted", n.REINVITE = "reinvite", n.UPDATE = "update", n.REFER = "refer", n.REPLACES = "replaces", n.SDP = "sdp", n.ICE_CANDIDATE = "icecandidate", n.GET_USER_MEDIA_FAILED = "getusermediafailed", n.PEER_CONNECTION_CREATE_OFFER_FAILED = "peerconnection:createofferfailed", n.PEER_CONNECTION_CREATE_ANSWER_FAILED = "peerconnection:createanswerfailed", n.PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED = "peerconnection:setlocaldescriptionfailed", n.PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED = "peerconnection:setremotedescriptionfailed", n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n.PEER_CONNECTION_CONFIRMED = "peerconnection:confirmed", n.PEER_CONNECTION_ONTRACK = "peerconnection:ontrack", n.ENDED_FROM_SERVER = "ended:fromserver", n))(N || {}), b = /* @__PURE__ */ ((n) => (n.LOCAL = "local", n.REMOTE = "remote", n.SYSTEM = "system", n))(b || {});
7
7
  const H = [
8
8
  "peerconnection",
9
9
  "connecting",
@@ -38,14 +38,7 @@ const H = [
38
38
  ], G = [
39
39
  ...H,
40
40
  ...ee
41
- ];
42
- function te(n) {
43
- return (e) => `sip:${e}@${n}`;
44
- }
45
- const ne = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, B = (n) => n.trim().replaceAll(" ", "_"), se = ne(1e5, 99999999), ie = (n) => n.some((t) => {
46
- const { kind: s } = t;
47
- return s === "video";
48
- }), re = (n, e) => {
41
+ ], te = (n, e) => {
49
42
  n.getVideoTracks().forEach((s) => {
50
43
  "contentHint" in s && s.contentHint !== e && (s.contentHint = e);
51
44
  });
@@ -57,8 +50,15 @@ const ne = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, B = (n) => n
57
50
  if (!n || e === "recvonly" && t === "recvonly")
58
51
  return;
59
52
  const i = t === "recvonly" ? [] : n.getAudioTracks(), r = e === "recvonly" ? [] : n.getVideoTracks(), a = [...i, ...r], o = new MediaStream(a);
60
- return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && re(o, s), o;
53
+ return o.getTracks = () => [...o.getAudioTracks(), ...o.getVideoTracks()], s && s !== "none" && te(o, s), o;
61
54
  };
55
+ function ne(n) {
56
+ return (e) => `sip:${e}@${n}`;
57
+ }
58
+ const se = (n, e) => () => Math.floor(Math.random() * (e - n)) + n, B = (n) => n.trim().replaceAll(" ", "_"), ie = se(1e5, 99999999), re = (n) => n.some((t) => {
59
+ const { kind: s } = t;
60
+ return s === "video";
61
+ });
62
62
  class ae {
63
63
  isPendingCall = !1;
64
64
  isPendingAnswer = !1;
@@ -125,20 +125,20 @@ class ce extends ae {
125
125
  ontrack: a,
126
126
  iceServers: o,
127
127
  directionVideo: c,
128
- directionAudio: g,
128
+ directionAudio: T,
129
129
  contentHint: d,
130
130
  offerToReceiveAudio: l = !0,
131
131
  offerToReceiveVideo: E = !0,
132
132
  sendEncodings: S,
133
- onAddedTransceiver: I
133
+ onAddedTransceiver: R
134
134
  }) => (this.isPendingCall = !0, new Promise((C, p) => {
135
- this.callConfiguration.number = s, this.callConfiguration.answer = !1, this.handleCall({ ontrack: a }).then(C).catch((b) => {
136
- p(b);
135
+ this.callConfiguration.number = s, this.callConfiguration.answer = !1, this.handleCall({ ontrack: a }).then(C).catch((w) => {
136
+ p(w);
137
137
  }), this.rtcSession = e.call(t(s), {
138
138
  extraHeaders: r,
139
139
  mediaStream: v(i, {
140
140
  directionVideo: c,
141
- directionAudio: g,
141
+ directionAudio: T,
142
142
  contentHint: d
143
143
  }),
144
144
  // необходимо передавать в методе call, чтобы подписаться на события peerconnection,
@@ -146,7 +146,7 @@ class ce extends ae {
146
146
  // и после создания нет возможности подписаться на события peerconnection через subscribeToSessionEvents
147
147
  eventHandlers: this.events.triggers,
148
148
  directionVideo: c,
149
- directionAudio: g,
149
+ directionAudio: T,
150
150
  pcConfig: {
151
151
  iceServers: o
152
152
  },
@@ -155,7 +155,7 @@ class ce extends ae {
155
155
  offerToReceiveVideo: E
156
156
  },
157
157
  sendEncodings: S,
158
- onAddedTransceiver: I
158
+ onAddedTransceiver: R
159
159
  });
160
160
  }).finally(() => {
161
161
  this.isPendingCall = !1;
@@ -178,15 +178,15 @@ class ce extends ae {
178
178
  directionVideo: a,
179
179
  directionAudio: o,
180
180
  offerToReceiveAudio: c,
181
- offerToReceiveVideo: g,
181
+ offerToReceiveVideo: T,
182
182
  contentHint: d,
183
183
  sendEncodings: l,
184
184
  onAddedTransceiver: E
185
- }) => (this.isPendingAnswer = !0, new Promise((S, I) => {
185
+ }) => (this.isPendingAnswer = !0, new Promise((S, R) => {
186
186
  try {
187
187
  const C = e();
188
- this.rtcSession = C, this.subscribeToSessionEvents(C), this.callConfiguration.answer = !0, this.callConfiguration.number = C.remote_identity.uri.user, this.handleCall({ ontrack: s }).then(S).catch((b) => {
189
- I(b);
188
+ this.rtcSession = C, this.subscribeToSessionEvents(C), this.callConfiguration.answer = !0, this.callConfiguration.number = C.remote_identity.uri.user, this.handleCall({ ontrack: s }).then(S).catch((w) => {
189
+ R(w);
190
190
  });
191
191
  const p = v(t, {
192
192
  directionVideo: a,
@@ -203,13 +203,13 @@ class ce extends ae {
203
203
  },
204
204
  rtcOfferConstraints: {
205
205
  offerToReceiveAudio: c,
206
- offerToReceiveVideo: g
206
+ offerToReceiveVideo: T
207
207
  },
208
208
  sendEncodings: l,
209
209
  onAddedTransceiver: E
210
210
  });
211
211
  } catch (C) {
212
- I(C);
212
+ R(C);
213
213
  }
214
214
  }).finally(() => {
215
215
  this.isPendingAnswer = !1;
@@ -224,7 +224,7 @@ class ce extends ae {
224
224
  if (!this.connection)
225
225
  return;
226
226
  const t = this.connection.getReceivers().map(({ track: s }) => s);
227
- return ie(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
227
+ return re(t) ? this.remoteStreamsManager.generateStreams(t) : this.remoteStreamsManager.generateAudioStreams(t);
228
228
  }
229
229
  async replaceMediaStream(e, t) {
230
230
  if (!this.rtcSession)
@@ -248,17 +248,17 @@ class ce extends ae {
248
248
  }, c = (E) => {
249
249
  r(), o(), s(E);
250
250
  };
251
- let g;
251
+ let T;
252
252
  const d = ({ peerconnection: E }) => {
253
- g = E;
254
- const S = (I) => {
255
- this.events.trigger(N.PEER_CONNECTION_ONTRACK, E), e && e(I);
253
+ T = E;
254
+ const S = (R) => {
255
+ this.events.trigger(N.PEER_CONNECTION_ONTRACK, E), e && e(R);
256
256
  };
257
257
  E.addEventListener("track", S), this.disposers.add(() => {
258
258
  E.removeEventListener("track", S);
259
259
  });
260
260
  }, l = () => {
261
- g !== void 0 && this.events.trigger(N.PEER_CONNECTION_CONFIRMED, g), r(), o(), t(g);
261
+ T !== void 0 && this.events.trigger(N.PEER_CONNECTION_CONFIRMED, T), r(), o(), t(T);
262
262
  };
263
263
  i(), a();
264
264
  });
@@ -277,7 +277,7 @@ class ce extends ae {
277
277
  }
278
278
  handleEnded = (e) => {
279
279
  const { originator: t } = e;
280
- t === U.REMOTE && this.events.trigger(N.ENDED_FROM_SERVER, e), this.reset();
280
+ t === b.REMOTE && this.events.trigger(N.ENDED_FROM_SERVER, e), this.reset();
281
281
  };
282
282
  reset = () => {
283
283
  delete this.rtcSession, this.remoteStreamsManager.reset(), this.unsubscribeFromSessionEvents(), this.callConfiguration.number = void 0, this.callConfiguration.answer = !1;
@@ -336,7 +336,7 @@ const W = "sip-connector", m = k(W), He = () => {
336
336
  }, Ge = () => {
337
337
  k.enable(`-${W}`);
338
338
  }, Te = "Error decline with 603", he = 1006, de = (n) => typeof n == "object" && n !== null && "code" in n && n.code === he, Ee = (n) => n.message === Te;
339
- var h = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n))(h || {}), y = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(y || {}), w = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n))(w || {}), M = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(M || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(_ || {}), f = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(f || {}), L = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(L || {}), F = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(F || {}), Se = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Se || {}), T = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n))(T || {});
339
+ var h = /* @__PURE__ */ ((n) => (n.CONTENT_TYPE = "content-type", n.CONTENT_ENTER_ROOM = "x-webrtc-enter-room", n.CONTENT_USE_LICENSE = "X-WEBRTC-USE-LICENSE", n.PARTICIPANT_NAME = "X-WEBRTC-PARTICIPANT-NAME", n.INPUT_CHANNELS = "X-WEBRTC-INPUT-CHANNELS", n.OUTPUT_CHANNELS = "X-WEBRTC-OUTPUT-CHANNELS", n.MAIN_CAM = "X-WEBRTC-MAINCAM", n.MIC = "X-WEBRTC-MIC", n.MEDIA_SYNC = "X-WEBRTC-SYNC", n.MAIN_CAM_RESOLUTION = "X-WEBRTC-MAINCAM-RESOLUTION", n.MEDIA_STATE = "X-WEBRTC-MEDIA-STATE", n.MEDIA_TYPE = "X-Vinteo-Media-Type", n.MAIN_CAM_STATE = "X-Vinteo-MainCam-State", n.MIC_STATE = "X-Vinteo-Mic-State", n.CONTENT_PARTICIPANT_STATE = "X-WEBRTC-PARTSTATE", n.NOTIFY = "X-VINTEO-NOTIFY", n.CONTENT_ENABLE_MEDIA_DEVICE = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", n.CONTENT_SHARE_STATE = "x-webrtc-share-state", n.MUST_STOP_PRESENTATION_P2P = "x-webrtc-share-state: YOUMUSTSTOPSENDCONTENT", n.START_PRESENTATION_P2P = "x-webrtc-share-state: YOUCANRECEIVECONTENT", n.STOP_PRESENTATION_P2P = "x-webrtc-share-state: CONTENTEND", n.STOP_PRESENTATION = "x-webrtc-share-state: STOPPRESENTATION", n.START_PRESENTATION = "x-webrtc-share-state: LETMESTARTPRESENTATION", n.ENABLE_MAIN_CAM = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE: LETMESTARTMAINCAM", n))(h || {}), y = /* @__PURE__ */ ((n) => (n.AVAILABLE_SECOND_REMOTE_STREAM = "YOUCANRECEIVECONTENT", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "CONTENTEND", n.MUST_STOP_PRESENTATION = "YOUMUSTSTOPSENDCONTENT", n))(y || {}), U = /* @__PURE__ */ ((n) => (n.SPECTATOR = "SPECTATOR", n.PARTICIPANT = "PARTICIPANT", n.SPECTATOR_OVER_SFU = "SPECTATOROVERSFU", n))(U || {}), M = /* @__PURE__ */ ((n) => (n.ENTER_ROOM = "application/vinteo.webrtc.roomname", n.MIC = "application/vinteo.webrtc.mic", n.USE_LICENSE = "application/vinteo.webrtc.uselic", n.PARTICIPANT_STATE = "application/vinteo.webrtc.partstate", n.NOTIFY = "application/vinteo.webrtc.notify", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(M || {}), _ = /* @__PURE__ */ ((n) => (n.CHANNELS = "application/vinteo.webrtc.channels", n.MEDIA_STATE = "application/vinteo.webrtc.mediastate", n.REFUSAL = "application/vinteo.webrtc.refusal", n.SHARE_STATE = "application/vinteo.webrtc.sharedesktop", n.MAIN_CAM = "application/vinteo.webrtc.maincam", n))(_ || {}), f = /* @__PURE__ */ ((n) => (n.PAUSE_MAIN_CAM = "PAUSEMAINCAM", n.RESUME_MAIN_CAM = "RESUMEMAINCAM", n.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", n.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", n.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", n))(f || {}), L = /* @__PURE__ */ ((n) => (n.ADMIN_STOP_MIC = "ADMINSTOPMIC", n.ADMIN_START_MIC = "ADMINSTARTMIC", n))(L || {}), F = /* @__PURE__ */ ((n) => (n.ADMIN_SYNC_FORCED = "1", n.ADMIN_SYNC_NOT_FORCED = "0", n))(F || {}), Se = /* @__PURE__ */ ((n) => (n.AUDIO = "AUDIO", n.VIDEO = "VIDEO", n.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", n))(Se || {}), g = /* @__PURE__ */ ((n) => (n.CHANNELS_NOTIFY = "channels:notify", n.PARTICIPANT_ADDED_TO_LIST_MODERATORS = "participant:added-to-list-moderators", n.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS = "participant:removed-from-list-moderators", n.PARTICIPANT_MOVE_REQUEST_TO_STREAM = "participant:move-request-to-stream", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS = "participant:move-request-to-spectators", n.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS = "participant:move-request-to-participants", n.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS_OVER_SFU = "participant:move-request-to-spectators-over-sfu", n.PARTICIPATION_ACCEPTING_WORD_REQUEST = "participation:accepting-word-request", n.PARTICIPATION_CANCELLING_WORD_REQUEST = "participation:cancelling-word-request", n.WEBCAST_STARTED = "webcast:started", n.WEBCAST_STOPPED = "webcast:stopped", n.ACCOUNT_CHANGED = "account:changed", n.ACCOUNT_DELETED = "account:deleted", n.CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "conference:participant-token-issued", n.CHANNELS = "channels", n.ENTER_ROOM = "enterRoom", n.SHARE_STATE = "shareState", n.MAIN_CAM_CONTROL = "main-cam-control", n.USE_LICENSE = "useLicense", n.ADMIN_START_MAIN_CAM = "admin-start-main-cam", n.ADMIN_STOP_MAIN_CAM = "admin-stop-main-cam", n.ADMIN_START_MIC = "admin-start-mic", n.ADMIN_STOP_MIC = "admin-stop-mic", n.ADMIN_FORCE_SYNC_MEDIA_STATE = "admin-force-sync-media-state", n.AVAILABLE_SECOND_REMOTE_STREAM = "availableSecondRemoteStream", n.NOT_AVAILABLE_SECOND_REMOTE_STREAM = "notAvailableSecondRemoteStream", n.MUST_STOP_PRESENTATION = "mustStopPresentation", n.NEW_DTMF = "newDTMF", n))(g || {});
340
340
  const q = [
341
341
  "participation:accepting-word-request",
342
342
  "participation:cancelling-word-request",
@@ -351,6 +351,7 @@ const q = [
351
351
  "participant:removed-from-list-moderators",
352
352
  "participant:move-request-to-spectators",
353
353
  "participant:move-request-to-participants",
354
+ "participant:move-request-to-spectators-over-sfu",
354
355
  "channels",
355
356
  "enterRoom",
356
357
  "shareState",
@@ -378,10 +379,10 @@ class le {
378
379
  this.connectionManager = e, this.callManager = t, this.events = new O(q), this.subscribe();
379
380
  }
380
381
  async waitChannels() {
381
- return this.wait(T.CHANNELS);
382
+ return this.wait(g.CHANNELS);
382
383
  }
383
384
  async waitSyncMediaState() {
384
- return this.wait(T.ADMIN_FORCE_SYNC_MEDIA_STATE);
385
+ return this.wait(g.ADMIN_FORCE_SYNC_MEDIA_STATE);
385
386
  }
386
387
  async sendDTMF(e) {
387
388
  return new Promise((t, s) => {
@@ -392,7 +393,7 @@ class le {
392
393
  s(r);
393
394
  }
394
395
  i && (this.callManager.once("newDTMF", ({ originator: r }) => {
395
- r === U.LOCAL && t();
396
+ r === b.LOCAL && t();
396
397
  }), i.sendDTMF(e, {
397
398
  duration: 120,
398
399
  interToneGap: 600
@@ -573,7 +574,7 @@ class le {
573
574
  };
574
575
  handleNewInfo = (e) => {
575
576
  const { originator: t } = e;
576
- if (t !== U.REMOTE)
577
+ if (t !== b.REMOTE)
577
578
  return;
578
579
  const { request: s } = e, i = s.getHeader(h.CONTENT_TYPE);
579
580
  if (i !== void 0)
@@ -613,7 +614,7 @@ class le {
613
614
  inputChannels: t,
614
615
  outputChannels: s
615
616
  };
616
- this.events.trigger(T.CHANNELS_NOTIFY, i);
617
+ this.events.trigger(g.CHANNELS_NOTIFY, i);
617
618
  };
618
619
  triggerWebcastStartedNotify = ({
619
620
  body: { conference: e, type: t }
@@ -622,7 +623,7 @@ class le {
622
623
  conference: e,
623
624
  type: t
624
625
  };
625
- this.events.trigger(T.WEBCAST_STARTED, s);
626
+ this.events.trigger(g.WEBCAST_STARTED, s);
626
627
  };
627
628
  triggerWebcastStoppedNotify = ({
628
629
  body: { conference: e, type: t }
@@ -631,7 +632,7 @@ class le {
631
632
  conference: e,
632
633
  type: t
633
634
  };
634
- this.events.trigger(T.WEBCAST_STOPPED, s);
635
+ this.events.trigger(g.WEBCAST_STOPPED, s);
635
636
  };
636
637
  triggerAddedToListModeratorsNotify = ({
637
638
  conference: e
@@ -640,7 +641,7 @@ class le {
640
641
  conference: e
641
642
  };
642
643
  this.events.trigger(
643
- T.PARTICIPANT_ADDED_TO_LIST_MODERATORS,
644
+ g.PARTICIPANT_ADDED_TO_LIST_MODERATORS,
644
645
  t
645
646
  );
646
647
  };
@@ -651,7 +652,7 @@ class le {
651
652
  conference: e
652
653
  };
653
654
  this.events.trigger(
654
- T.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS,
655
+ g.PARTICIPANT_REMOVED_FROM_LIST_MODERATORS,
655
656
  t
656
657
  );
657
658
  };
@@ -661,7 +662,7 @@ class le {
661
662
  const t = {
662
663
  conference: e
663
664
  };
664
- this.events.trigger(T.PARTICIPATION_ACCEPTING_WORD_REQUEST, t);
665
+ this.events.trigger(g.PARTICIPATION_ACCEPTING_WORD_REQUEST, t);
665
666
  };
666
667
  triggerParticipationCancellingWordRequest = ({
667
668
  body: { conference: e }
@@ -669,7 +670,7 @@ class le {
669
670
  const t = {
670
671
  conference: e
671
672
  };
672
- this.events.trigger(T.PARTICIPATION_CANCELLING_WORD_REQUEST, t);
673
+ this.events.trigger(g.PARTICIPATION_CANCELLING_WORD_REQUEST, t);
673
674
  };
674
675
  triggerParticipantMoveRequestToStream = ({
675
676
  body: { conference: e }
@@ -677,13 +678,13 @@ class le {
677
678
  const t = {
678
679
  conference: e
679
680
  };
680
- this.events.trigger(T.PARTICIPANT_MOVE_REQUEST_TO_STREAM, t);
681
+ this.events.trigger(g.PARTICIPANT_MOVE_REQUEST_TO_STREAM, t);
681
682
  };
682
683
  triggerAccountChangedNotify = () => {
683
- this.events.trigger(T.ACCOUNT_CHANGED, void 0);
684
+ this.events.trigger(g.ACCOUNT_CHANGED, void 0);
684
685
  };
685
686
  triggerAccountDeletedNotify = () => {
686
- this.events.trigger(T.ACCOUNT_DELETED, void 0);
687
+ this.events.trigger(g.ACCOUNT_DELETED, void 0);
687
688
  };
688
689
  triggerConferenceParticipantTokenIssued = ({
689
690
  body: { conference: e, participant: t, jwt: s }
@@ -694,7 +695,7 @@ class le {
694
695
  jwt: s
695
696
  };
696
697
  this.events.trigger(
697
- T.CONFERENCE_PARTICIPANT_TOKEN_ISSUED,
698
+ g.CONFERENCE_PARTICIPANT_TOKEN_ISSUED,
698
699
  i
699
700
  );
700
701
  };
@@ -705,62 +706,62 @@ class le {
705
706
  inputChannels: t,
706
707
  outputChannels: s
707
708
  };
708
- this.events.trigger(T.CHANNELS, i);
709
+ this.events.trigger(g.CHANNELS, i);
709
710
  }
710
711
  };
711
712
  triggerEnterRoom = (e) => {
712
713
  const t = e.getHeader(h.CONTENT_ENTER_ROOM), s = e.getHeader(h.PARTICIPANT_NAME);
713
- this.events.trigger(T.ENTER_ROOM, { room: t, participantName: s });
714
+ this.events.trigger(g.ENTER_ROOM, { room: t, participantName: s });
714
715
  };
715
716
  triggerShareState = (e) => {
716
717
  const t = e.getHeader(h.CONTENT_SHARE_STATE);
717
718
  if (t !== void 0)
718
719
  switch (t) {
719
720
  case y.AVAILABLE_SECOND_REMOTE_STREAM: {
720
- this.events.trigger(T.AVAILABLE_SECOND_REMOTE_STREAM, void 0);
721
+ this.events.trigger(g.AVAILABLE_SECOND_REMOTE_STREAM, void 0);
721
722
  break;
722
723
  }
723
724
  case y.NOT_AVAILABLE_SECOND_REMOTE_STREAM: {
724
- this.events.trigger(T.NOT_AVAILABLE_SECOND_REMOTE_STREAM, void 0);
725
+ this.events.trigger(g.NOT_AVAILABLE_SECOND_REMOTE_STREAM, void 0);
725
726
  break;
726
727
  }
727
728
  case y.MUST_STOP_PRESENTATION: {
728
- this.events.trigger(T.MUST_STOP_PRESENTATION, void 0);
729
+ this.events.trigger(g.MUST_STOP_PRESENTATION, void 0);
729
730
  break;
730
731
  }
731
732
  }
732
733
  };
733
734
  maybeTriggerParticipantMoveRequest = (e) => {
734
735
  const t = e.getHeader(h.CONTENT_PARTICIPANT_STATE);
735
- t === w.SPECTATOR && this.events.trigger(T.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS, void 0), t === w.PARTICIPANT && this.events.trigger(T.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS, void 0);
736
+ t === U.SPECTATOR && this.events.trigger(g.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS, void 0), t === U.PARTICIPANT && this.events.trigger(g.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS, void 0), t === U.SPECTATOR_OVER_SFU && this.events.trigger(g.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS_OVER_SFU, void 0);
736
737
  };
737
738
  triggerMainCamControl = (e) => {
738
739
  const t = e.getHeader(h.MAIN_CAM), s = e.getHeader(h.MEDIA_SYNC), i = s === F.ADMIN_SYNC_FORCED;
739
740
  if (t === f.ADMIN_START_MAIN_CAM) {
740
- this.events.trigger(T.ADMIN_START_MAIN_CAM, { isSyncForced: i });
741
+ this.events.trigger(g.ADMIN_START_MAIN_CAM, { isSyncForced: i });
741
742
  return;
742
743
  }
743
744
  if (t === f.ADMIN_STOP_MAIN_CAM) {
744
- this.events.trigger(T.ADMIN_STOP_MAIN_CAM, { isSyncForced: i });
745
+ this.events.trigger(g.ADMIN_STOP_MAIN_CAM, { isSyncForced: i });
745
746
  return;
746
747
  }
747
- (t === f.RESUME_MAIN_CAM || t === f.PAUSE_MAIN_CAM) && s !== void 0 && this.events.trigger(T.ADMIN_FORCE_SYNC_MEDIA_STATE, { isSyncForced: i });
748
+ (t === f.RESUME_MAIN_CAM || t === f.PAUSE_MAIN_CAM) && s !== void 0 && this.events.trigger(g.ADMIN_FORCE_SYNC_MEDIA_STATE, { isSyncForced: i });
748
749
  const r = e.getHeader(h.MAIN_CAM_RESOLUTION);
749
- this.events.trigger(T.MAIN_CAM_CONTROL, {
750
+ this.events.trigger(g.MAIN_CAM_CONTROL, {
750
751
  mainCam: t,
751
752
  resolutionMainCam: r
752
753
  });
753
754
  };
754
755
  triggerMicControl = (e) => {
755
756
  const t = e.getHeader(h.MIC), i = e.getHeader(h.MEDIA_SYNC) === F.ADMIN_SYNC_FORCED;
756
- t === L.ADMIN_START_MIC ? this.events.trigger(T.ADMIN_START_MIC, { isSyncForced: i }) : t === L.ADMIN_STOP_MIC && this.events.trigger(T.ADMIN_STOP_MIC, { isSyncForced: i });
757
+ t === L.ADMIN_START_MIC ? this.events.trigger(g.ADMIN_START_MIC, { isSyncForced: i }) : t === L.ADMIN_STOP_MIC && this.events.trigger(g.ADMIN_STOP_MIC, { isSyncForced: i });
757
758
  };
758
759
  triggerUseLicense = (e) => {
759
760
  const t = e.getHeader(h.CONTENT_USE_LICENSE);
760
- this.events.trigger(T.USE_LICENSE, t);
761
+ this.events.trigger(g.USE_LICENSE, t);
761
762
  };
762
763
  }
763
- var R = /* @__PURE__ */ ((n) => (n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n))(R || {});
764
+ var I = /* @__PURE__ */ ((n) => (n.START_PRESENTATION = "presentation:start", n.STARTED_PRESENTATION = "presentation:started", n.END_PRESENTATION = "presentation:end", n.ENDED_PRESENTATION = "presentation:ended", n.FAILED_PRESENTATION = "presentation:failed", n))(I || {});
764
765
  const Y = [
765
766
  "presentation:start",
766
767
  "presentation:started",
@@ -789,11 +790,11 @@ class Ne {
789
790
  sendEncodings: a,
790
791
  onAddedTransceiver: o
791
792
  } = {}, c) {
792
- const g = this.getRtcSessionProtected();
793
+ const T = this.getRtcSessionProtected();
793
794
  if (this.streamPresentationCurrent)
794
795
  throw new Error("Presentation is already started");
795
796
  return this.sendPresentationWithDuplicatedCalls(e, {
796
- rtcSession: g,
797
+ rtcSession: T,
797
798
  stream: t,
798
799
  presentationOptions: {
799
800
  isNeedReinvite: s,
@@ -811,8 +812,8 @@ class Ne {
811
812
  let s = this.promisePendingStartPresentation ?? Promise.resolve(void 0);
812
813
  const i = this.callManager.getEstablishedRTCSession();
813
814
  return i && t ? s = e().then(async () => i.stopPresentation(t)).catch((r) => {
814
- throw this.events.trigger(R.FAILED_PRESENTATION, r), r;
815
- }) : t && this.events.trigger(R.ENDED_PRESENTATION, t), this.promisePendingStopPresentation = s, s.finally(() => {
815
+ throw this.events.trigger(I.FAILED_PRESENTATION, r), r;
816
+ }) : t && this.events.trigger(I.ENDED_PRESENTATION, t), this.promisePendingStopPresentation = s, s.finally(() => {
816
817
  this.resetPresentation();
817
818
  });
818
819
  }
@@ -857,15 +858,15 @@ class Ne {
857
858
  }
858
859
  subscribe() {
859
860
  this.callManager.on("presentation:start", (e) => {
860
- this.events.trigger(R.START_PRESENTATION, e);
861
+ this.events.trigger(I.START_PRESENTATION, e);
861
862
  }), this.callManager.on("presentation:started", (e) => {
862
- this.events.trigger(R.STARTED_PRESENTATION, e);
863
+ this.events.trigger(I.STARTED_PRESENTATION, e);
863
864
  }), this.callManager.on("presentation:end", (e) => {
864
- this.events.trigger(R.END_PRESENTATION, e);
865
+ this.events.trigger(I.END_PRESENTATION, e);
865
866
  }), this.callManager.on("presentation:ended", (e) => {
866
- this.events.trigger(R.ENDED_PRESENTATION, e);
867
+ this.events.trigger(I.ENDED_PRESENTATION, e);
867
868
  }), this.callManager.on("presentation:failed", (e) => {
868
- this.events.trigger(R.FAILED_PRESENTATION, e);
869
+ this.events.trigger(I.FAILED_PRESENTATION, e);
869
870
  }), this.callManager.on("failed", this.handleEnded), this.callManager.on("ended", this.handleEnded);
870
871
  }
871
872
  async sendPresentationWithDuplicatedCalls(e, {
@@ -901,13 +902,13 @@ class Ne {
901
902
  if (c === void 0)
902
903
  throw new Error("No streamPresentationTarget");
903
904
  this.streamPresentationCurrent = c;
904
- const g = e().then(async () => t.startPresentation(c, i, {
905
+ const T = e().then(async () => t.startPresentation(c, i, {
905
906
  sendEncodings: a,
906
907
  onAddedTransceiver: o
907
908
  })).then(() => s).catch((d) => {
908
- throw this.removeStreamPresentationCurrent(), this.events.trigger(R.FAILED_PRESENTATION, d), d;
909
+ throw this.removeStreamPresentationCurrent(), this.events.trigger(I.FAILED_PRESENTATION, d), d;
909
910
  });
910
- return this.promisePendingStartPresentation = g, g.finally(() => {
911
+ return this.promisePendingStartPresentation = T, T.finally(() => {
911
912
  this.promisePendingStartPresentation = void 0;
912
913
  });
913
914
  }
@@ -1004,7 +1005,7 @@ class ue {
1004
1005
  }
1005
1006
  }
1006
1007
  var u = /* @__PURE__ */ ((n) => (n.CONNECTING = "connecting", n.CONNECTED = "connected", n.DISCONNECTED = "disconnected", n.NEW_RTC_SESSION = "newRTCSession", n.REGISTERED = "registered", n.UNREGISTERED = "unregistered", n.REGISTRATION_FAILED = "registrationFailed", n.NEW_MESSAGE = "newMessage", n.SIP_EVENT = "sipEvent", n))(u || {});
1007
- const z = [
1008
+ const Q = [
1008
1009
  "connecting",
1009
1010
  "connected",
1010
1011
  "disconnected",
@@ -1014,7 +1015,7 @@ const z = [
1014
1015
  "registrationFailed",
1015
1016
  "newMessage",
1016
1017
  "sipEvent"
1017
- ], Q = [...z], Ae = 3;
1018
+ ], z = [...Q], Ae = 3;
1018
1019
  class _e {
1019
1020
  cancelableConnectWithRepeatedCalls;
1020
1021
  JsSIP;
@@ -1060,8 +1061,8 @@ class _e {
1060
1061
  }
1061
1062
  connectWithDuplicatedCalls = async (e, { callLimit: t = Ae } = {}) => {
1062
1063
  const s = async () => this.connectInner(e), i = (r) => {
1063
- const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), g = r != null && !de(r);
1064
- return c || g;
1064
+ const c = this.getUa()?.isConnected() === !0 && this.hasEqualConnectionConfiguration(e), T = r != null && !de(r);
1065
+ return c || T;
1065
1066
  };
1066
1067
  return this.stateMachine.startConnect(), this.cancelableConnectWithRepeatedCalls = V({
1067
1068
  targetFunction: s,
@@ -1089,7 +1090,7 @@ class _e {
1089
1090
  sessionTimers: a,
1090
1091
  registerExpires: o,
1091
1092
  connectionRecoveryMinInterval: c,
1092
- connectionRecoveryMaxInterval: g,
1093
+ connectionRecoveryMaxInterval: T,
1093
1094
  userAgent: d,
1094
1095
  displayName: l = "",
1095
1096
  register: E = !1,
@@ -1113,7 +1114,7 @@ class _e {
1113
1114
  sessionTimers: a,
1114
1115
  registerExpires: o,
1115
1116
  connectionRecoveryMinInterval: c,
1116
- connectionRecoveryMaxInterval: g,
1117
+ connectionRecoveryMaxInterval: T,
1117
1118
  userAgent: d,
1118
1119
  remoteAddress: r,
1119
1120
  extraHeaders: S
@@ -1129,15 +1130,15 @@ class _e {
1129
1130
  return;
1130
1131
  }
1131
1132
  let i;
1132
- i = ((c, g) => {
1133
+ i = ((c, T) => {
1133
1134
  if (this.getConnectionConfiguration().register === !0)
1134
- return this.registrationManager.subscribeToStartEvents(c, g);
1135
+ return this.registrationManager.subscribeToStartEvents(c, T);
1135
1136
  const l = u.CONNECTED, E = [u.DISCONNECTED];
1136
1137
  return this.events.on(l, c), E.forEach((S) => {
1137
- this.events.on(S, g);
1138
+ this.events.on(S, T);
1138
1139
  }), () => {
1139
1140
  this.events.off(l, c), E.forEach((S) => {
1140
- this.events.off(S, g);
1141
+ this.events.off(S, T);
1141
1142
  });
1142
1143
  };
1143
1144
  })(() => {
@@ -1151,7 +1152,7 @@ class _e {
1151
1152
  }
1152
1153
  }
1153
1154
  var X = /* @__PURE__ */ ((n) => (n.START_CONNECT = "START_CONNECT", n.START_INIT_UA = "START_INIT_UA", n.UA_CONNECTED = "UA_CONNECTED", n.UA_REGISTERED = "UA_REGISTERED", n.UA_UNREGISTERED = "UA_UNREGISTERED", n.UA_DISCONNECTED = "UA_DISCONNECTED", n.CONNECTION_FAILED = "CONNECTION_FAILED", n.RESET = "RESET", n))(X || {});
1154
- const Ie = j({
1155
+ const Re = j({
1155
1156
  types: {
1156
1157
  context: {},
1157
1158
  events: {}
@@ -1465,14 +1466,14 @@ const Ie = j({
1465
1466
  }
1466
1467
  }
1467
1468
  });
1468
- class Re {
1469
+ class Ie {
1469
1470
  actor;
1470
1471
  stateChangeListeners = /* @__PURE__ */ new Set();
1471
1472
  events;
1472
1473
  unsubscribeFromEvents;
1473
1474
  actorSubscription;
1474
1475
  constructor(e) {
1475
- this.events = e, this.actor = Z(Ie), this.actorSubscription = this.actor.subscribe((t) => {
1476
+ this.events = e, this.actor = Z(Re), this.actorSubscription = this.actor.subscribe((t) => {
1476
1477
  const s = t.value;
1477
1478
  this.stateChangeListeners.forEach((i) => {
1478
1479
  i(s);
@@ -1710,12 +1711,12 @@ class pe {
1710
1711
  extraHeaders: a
1711
1712
  }) {
1712
1713
  return new Promise((o, c) => {
1713
- const { configuration: g } = this.uaFactory.createConfiguration({
1714
+ const { configuration: T } = this.uaFactory.createConfiguration({
1714
1715
  sipWebSocketServerURL: i,
1715
1716
  displayName: t,
1716
1717
  userAgent: e,
1717
1718
  sipServerUrl: s
1718
- }), d = this.uaFactory.createUA({ ...g, remoteAddress: r, extraHeaders: a }), l = () => {
1719
+ }), d = this.uaFactory.createUA({ ...T, remoteAddress: r, extraHeaders: a }), l = () => {
1719
1720
  const S = new Error("Telephony is not available");
1720
1721
  c(S);
1721
1722
  };
@@ -1758,7 +1759,7 @@ class P {
1758
1759
  throw new Error("user is required for authorized connection");
1759
1760
  }
1760
1761
  static resolveAuthorizationUser(e, t) {
1761
- return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${se()}`;
1762
+ return e && t !== void 0 && t.trim() !== "" ? t.trim() : `${ie()}`;
1762
1763
  }
1763
1764
  static buildExtraHeaders(e, t) {
1764
1765
  const s = e !== void 0 && e !== "" ? Pe(e) : [];
@@ -1774,7 +1775,7 @@ class P {
1774
1775
  sessionTimers: o = !1,
1775
1776
  registerExpires: c = 300,
1776
1777
  // 5 minutes in sec
1777
- connectionRecoveryMinInterval: g = 2,
1778
+ connectionRecoveryMinInterval: T = 2,
1778
1779
  connectionRecoveryMaxInterval: d = 6,
1779
1780
  userAgent: l
1780
1781
  }) {
@@ -1785,19 +1786,19 @@ class P {
1785
1786
  sipServerUrl: r,
1786
1787
  sipWebSocketServerURL: s
1787
1788
  });
1788
- const E = P.resolveAuthorizationUser(a, e), S = te(r), I = S(E), C = new this.JsSIP.WebSocketInterface(s);
1789
+ const E = P.resolveAuthorizationUser(a, e), S = ne(r), R = S(E), C = new this.JsSIP.WebSocketInterface(s);
1789
1790
  return {
1790
1791
  configuration: {
1791
1792
  password: t,
1792
1793
  register: a,
1793
- uri: I,
1794
+ uri: R,
1794
1795
  display_name: B(i),
1795
1796
  user_agent: l,
1796
1797
  sdpSemantics: "unified-plan",
1797
1798
  sockets: [C],
1798
1799
  session_timers: o,
1799
1800
  register_expires: c,
1800
- connection_recovery_min_interval: g,
1801
+ connection_recovery_min_interval: T,
1801
1802
  connection_recovery_max_interval: d
1802
1803
  },
1803
1804
  helpers: {
@@ -1820,7 +1821,7 @@ class P {
1820
1821
  extraHeaders: e.extraHeaders
1821
1822
  });
1822
1823
  return t.eachTriggers((a, o) => {
1823
- const c = z.find((g) => g === o);
1824
+ const c = Q.find((T) => T === o);
1824
1825
  c && r.on(c, a);
1825
1826
  }), { ua: r, helpers: i };
1826
1827
  }
@@ -1837,10 +1838,10 @@ class me {
1837
1838
  configurationManager;
1838
1839
  JsSIP;
1839
1840
  constructor({ JsSIP: e }) {
1840
- this.JsSIP = e, this.events = new O(Q), this.uaFactory = new P(e), this.registrationManager = new Me({
1841
+ this.JsSIP = e, this.events = new O(z), this.uaFactory = new P(e), this.registrationManager = new Me({
1841
1842
  events: this.events,
1842
1843
  getUaProtected: this.getUaProtected
1843
- }), this.stateMachine = new Re(this.events), this.configurationManager = new ue({
1844
+ }), this.stateMachine = new Ie(this.events), this.configurationManager = new ue({
1844
1845
  getUa: this.getUa
1845
1846
  }), this.sipOperations = new pe({
1846
1847
  uaFactory: this.uaFactory,
@@ -2034,7 +2035,7 @@ class De {
2034
2035
  delete this.incomingRTCSession;
2035
2036
  }
2036
2037
  }
2037
- const ve = Q.map((n) => `connection:${n}`), ye = G.map((n) => `call:${n}`), Ue = q.map((n) => `api:${n}`), be = J.map((n) => `incoming-call:${n}`), we = Y.map((n) => `presentation:${n}`), Le = [
2038
+ const ve = z.map((n) => `connection:${n}`), ye = G.map((n) => `call:${n}`), Ue = q.map((n) => `api:${n}`), be = J.map((n) => `incoming-call:${n}`), we = Y.map((n) => `presentation:${n}`), Le = [
2038
2039
  ...ve,
2039
2040
  ...ye,
2040
2041
  ...Ue,
@@ -2236,7 +2237,7 @@ class xe {
2236
2237
  }
2237
2238
  export {
2238
2239
  x as E,
2239
- U as O,
2240
+ b as O,
2240
2241
  xe as S,
2241
2242
  f as a,
2242
2243
  Se as b,
@@ -0,0 +1,9 @@
1
+ export declare class MockRequest {
2
+ private headers;
3
+ static createInfoEvent(originator: string, request: MockRequest): {
4
+ readonly originator: string;
5
+ readonly request: MockRequest;
6
+ };
7
+ setHeader(name: string, value: string): void;
8
+ getHeader(name: string): string | undefined;
9
+ }
@@ -31,7 +31,8 @@ export declare enum EShareState {
31
31
  }
32
32
  export declare enum EParticipantType {
33
33
  SPECTATOR = "SPECTATOR",
34
- PARTICIPANT = "PARTICIPANT"
34
+ PARTICIPANT = "PARTICIPANT",
35
+ SPECTATOR_OVER_SFU = "SPECTATOROVERSFU"
35
36
  }
36
37
  export declare enum EContentTypeReceived {
37
38
  ENTER_ROOM = "application/vinteo.webrtc.roomname",