sip-connector 14.1.2-7 → 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 (152) hide show
  1. package/dist/@SipConnector-BBhQzo-W.cjs +1 -0
  2. package/dist/@SipConnector-G96OmJEP.js +2248 -0
  3. package/dist/ApiManager/@ApiManager.d.ts +59 -0
  4. package/dist/ApiManager/__tests-utils__/helpers.d.ts +9 -0
  5. package/dist/ApiManager/constants.d.ts +72 -0
  6. package/dist/ApiManager/eventNames.d.ts +34 -0
  7. package/dist/ApiManager/index.d.ts +3 -0
  8. package/dist/ApiManager/types.d.ts +99 -0
  9. package/dist/CallManager/@CallManager.d.ts +26 -0
  10. package/dist/CallManager/AbstractCallStrategy.d.ts +47 -0
  11. package/dist/CallManager/MCUCallStrategy.d.ts +30 -0
  12. package/dist/CallManager/RemoteStreamsManager.d.ts +8 -0
  13. package/dist/CallManager/causes.d.ts +13 -0
  14. package/dist/CallManager/eventNames.d.ts +45 -0
  15. package/dist/CallManager/hasCanceledCallError.d.ts +2 -0
  16. package/dist/CallManager/index.d.ts +7 -0
  17. package/dist/CallManager/types.d.ts +59 -0
  18. package/dist/ConnectionManager/@ConnectionManager.d.ts +48 -0
  19. package/dist/ConnectionManager/ConfigurationManager.d.ts +60 -0
  20. package/dist/ConnectionManager/ConnectionFlow.d.ts +84 -0
  21. package/dist/ConnectionManager/ConnectionStateMachine.d.ts +61 -0
  22. package/dist/ConnectionManager/RegistrationManager.d.ts +17 -0
  23. package/dist/ConnectionManager/SipOperations.d.ts +32 -0
  24. package/dist/ConnectionManager/UAFactory.d.ts +50 -0
  25. package/dist/ConnectionManager/eventNames.d.ts +16 -0
  26. package/dist/ConnectionManager/getExtraHeadersRemoteAddress.d.ts +2 -0
  27. package/dist/ConnectionManager/index.d.ts +3 -0
  28. package/dist/IncomingCallManager/@IncomingCallManager.d.ts +37 -0
  29. package/dist/IncomingCallManager/eventNames.d.ts +13 -0
  30. package/dist/IncomingCallManager/index.d.ts +2 -0
  31. package/dist/PresentationManager/@PresentationManager.d.ts +47 -0
  32. package/dist/PresentationManager/constants.d.ts +1 -0
  33. package/dist/PresentationManager/eventNames.d.ts +11 -0
  34. package/dist/PresentationManager/index.d.ts +2 -0
  35. package/dist/PresentationManager/types.d.ts +2 -0
  36. package/dist/SipConnector/@SipConnector.d.ts +96 -0
  37. package/dist/SipConnector/eventNames.d.ts +4 -0
  38. package/dist/SipConnector/index.d.ts +2 -0
  39. package/dist/{src/SipConnectorFacade → SipConnectorFacade}/SipConnectorFacade.d.ts +19 -17
  40. package/dist/{src/__fixtures__ → __fixtures__}/BaseSession.mock.d.ts +9 -9
  41. package/dist/{src/__fixtures__ → __fixtures__}/RTCPeerConnectionMock.d.ts +7 -1
  42. package/dist/{src/__fixtures__ → __fixtures__}/RTCRtpSenderMock.d.ts +1 -0
  43. package/dist/{src/__fixtures__ → __fixtures__}/RTCSessionMock.d.ts +14 -9
  44. package/dist/{src/__fixtures__ → __fixtures__}/UA.mock.d.ts +15 -17
  45. package/dist/{src → __fixtures__}/eventNames.d.ts +1 -1
  46. package/dist/{src/__fixtures__ → __fixtures__}/index.d.ts +4 -4
  47. package/dist/{src/__fixtures__ → __fixtures__}/jssip.mock.d.ts +4 -4
  48. package/dist/doMock.cjs +1 -1
  49. package/dist/{src/doMock.d.ts → doMock.d.ts} +2 -1
  50. package/dist/doMock.js +444 -344
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.d.ts +14 -0
  53. package/dist/index.js +870 -703
  54. package/dist/setParametersToSender/index.d.ts +3 -0
  55. package/dist/{src/setParametersToSender → setParametersToSender}/resolveHasNeedToUpdateItemEncoding.d.ts +1 -1
  56. package/dist/{src/videoSendingBalancer → setParametersToSender}/setEncodingsToSender.d.ts +1 -5
  57. package/dist/setParametersToSender/setMaxBitrateToSender.d.ts +2 -0
  58. package/dist/{src/setParametersToSender → setParametersToSender}/setParametersToSender.d.ts +1 -4
  59. package/dist/setParametersToSender/types.d.ts +5 -0
  60. package/dist/{src/tools → tools}/__fixtures__/connectToServer.d.ts +2 -2
  61. package/dist/{src/tools → tools}/__fixtures__/processRequest.d.ts +1 -1
  62. package/dist/{src/tools → tools}/error/getLinkError.d.ts +1 -1
  63. package/dist/{src/tools → tools}/error/getTypeFromError.d.ts +1 -1
  64. package/dist/{src/tools → tools}/error/getValuesFromError.d.ts +1 -1
  65. package/dist/{src/tools → tools}/error/index.d.ts +1 -1
  66. package/dist/{src/tools → tools}/index.d.ts +2 -2
  67. package/dist/{src/tools → tools}/prepareMediaStream.d.ts +1 -1
  68. package/dist/{src/tools → tools}/setVideoTrackContentHints.d.ts +1 -1
  69. package/dist/{src/tools/syncMediaState/index.d.ts → tools/syncMediaState/createSyncMediaState.d.ts} +1 -1
  70. package/dist/tools/syncMediaState/index.d.ts +1 -0
  71. package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMainCam.d.ts +1 -1
  72. package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMic.d.ts +1 -1
  73. package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMainCam.d.ts +1 -1
  74. package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMic.d.ts +1 -1
  75. package/dist/types.d.ts +23 -0
  76. package/dist/utils/utils.d.ts +4 -0
  77. package/dist/videoSendingBalancer/CodecProvider.d.ts +7 -0
  78. package/dist/videoSendingBalancer/ParametersSetterWithQueue.d.ts +12 -0
  79. package/dist/videoSendingBalancer/SenderBalancer.d.ts +52 -0
  80. package/dist/videoSendingBalancer/SenderFinder.d.ts +7 -0
  81. package/dist/videoSendingBalancer/TaskQueue.d.ts +20 -0
  82. package/dist/videoSendingBalancer/VideoSendingBalancer.d.ts +44 -0
  83. package/dist/videoSendingBalancer/VideoSendingEventHandler.d.ts +25 -0
  84. package/dist/videoSendingBalancer/calcBitrate/calcMaxBitrateByWidth.d.ts +4 -0
  85. package/dist/videoSendingBalancer/calcBitrate/calcMaxBitrateByWidthAndCodec.d.ts +4 -0
  86. package/dist/videoSendingBalancer/calcBitrate/index.d.ts +1 -0
  87. package/dist/videoSendingBalancer/calcResolution/calcScaleResolutionDownBy.d.ts +6 -0
  88. package/dist/videoSendingBalancer/calcResolution/index.d.ts +1 -0
  89. package/dist/videoSendingBalancer/index.d.ts +3 -0
  90. package/dist/videoSendingBalancer/types.d.ts +36 -0
  91. package/package.json +36 -43
  92. package/dist/SipConnector-BHvTGgmw.js +0 -1352
  93. package/dist/SipConnector-ChW25Tx9.cjs +0 -1
  94. package/dist/src/SipConnector.d.ts +0 -235
  95. package/dist/src/causes.d.ts +0 -23
  96. package/dist/src/getExtraHeadersRemoteAddress.d.ts +0 -2
  97. package/dist/src/headers.d.ts +0 -37
  98. package/dist/src/index.d.ts +0 -11
  99. package/dist/src/setParametersToSender/index.d.ts +0 -1
  100. package/dist/src/types.d.ts +0 -69
  101. package/dist/src/videoSendingBalancer/balance.d.ts +0 -10
  102. package/dist/src/videoSendingBalancer/getMaxBitrateByWidth.d.ts +0 -3
  103. package/dist/src/videoSendingBalancer/getMaxBitrateByWidthAndCodec.d.ts +0 -3
  104. package/dist/src/videoSendingBalancer/index.d.ts +0 -13
  105. package/dist/src/videoSendingBalancer/processSender.d.ts +0 -10
  106. package/dist/src/videoSendingBalancer/scaleBitrate.d.ts +0 -2
  107. /package/dist/{src/SipConnectorFacade → SipConnectorFacade}/index.d.ts +0 -0
  108. /package/dist/{src/__fixtures__ → __fixtures__}/Registrator.mock.d.ts +0 -0
  109. /package/dist/{src/__fixtures__ → __fixtures__}/Request.mock.d.ts +0 -0
  110. /package/dist/{src/__fixtures__ → __fixtures__}/WebSocketInterface.mock.d.ts +0 -0
  111. /package/dist/{src/__fixtures__ → __fixtures__}/accountNotify.d.ts +0 -0
  112. /package/dist/{src/__fixtures__ → __fixtures__}/channels.d.ts +0 -0
  113. /package/dist/{src/__fixtures__ → __fixtures__}/channelsNotify.d.ts +0 -0
  114. /package/dist/{src/__fixtures__ → __fixtures__}/conferenceParticipantTokenIssuedNotify.d.ts +0 -0
  115. /package/dist/{src → __fixtures__}/constants.d.ts +0 -0
  116. /package/dist/{src/__fixtures__ → __fixtures__}/delayPromise.d.ts +0 -0
  117. /package/dist/{src/__fixtures__ → __fixtures__}/enterRoom.d.ts +0 -0
  118. /package/dist/{src/__fixtures__ → __fixtures__}/mediaState.d.ts +0 -0
  119. /package/dist/{src/__fixtures__ → __fixtures__}/participantMoveRequests.d.ts +0 -0
  120. /package/dist/{src/__fixtures__ → __fixtures__}/participantNotify.d.ts +0 -0
  121. /package/dist/{src/__fixtures__ → __fixtures__}/remoteCallerData.d.ts +0 -0
  122. /package/dist/{src/__fixtures__ → __fixtures__}/utils.d.ts +0 -0
  123. /package/dist/{src/__fixtures__ → __fixtures__}/webcastNotify.d.ts +0 -0
  124. /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
  125. /package/dist/{src/setParametersToSender → setParametersToSender}/configureDegradationPreference.d.ts +0 -0
  126. /package/dist/{src/setParametersToSender → setParametersToSender}/configureEmptyEncodings.d.ts +0 -0
  127. /package/dist/{src/setParametersToSender → setParametersToSender}/configureEncodings.d.ts +0 -0
  128. /package/dist/{src/setParametersToSender → setParametersToSender}/configureMaxBitrate.d.ts +0 -0
  129. /package/dist/{src/setParametersToSender → setParametersToSender}/configureScaleResolutionDownBy.d.ts +0 -0
  130. /package/dist/{src/setParametersToSender → setParametersToSender}/hasChangedRTCRtpSendParameters.d.ts +0 -0
  131. /package/dist/{src/tools → tools}/__fixtures__/call.d.ts +0 -0
  132. /package/dist/{src/tools → tools}/__fixtures__/hasValidUri.d.ts +0 -0
  133. /package/dist/{src/tools → tools}/__fixtures__/permissions.d.ts +0 -0
  134. /package/dist/{src/tools → tools}/__tests-utils__/parseObject.d.ts +0 -0
  135. /package/dist/{src/tools → tools}/__tests-utils__/resolveParseArray.d.ts +0 -0
  136. /package/dist/{src/tools → tools}/error/stringifyMessage.d.ts +0 -0
  137. /package/dist/{src/tools → tools}/generateSimulcastEncodings.d.ts +0 -0
  138. /package/dist/{src/tools → tools}/getExtraHeaders.d.ts +0 -0
  139. /package/dist/{src/tools → tools}/getUserAgent.d.ts +0 -0
  140. /package/dist/{src/tools → tools}/hasPurgatory.d.ts +0 -0
  141. /package/dist/{src/tools → tools}/resolveUpdateTransceiver.d.ts +0 -0
  142. /package/dist/{src/videoSendingBalancer → tools}/scaleResolutionAndBitrate.d.ts +0 -0
  143. /package/dist/{src/tools/sendDTMFAccumulated.d.ts → tools/sendDtmfFAccumulated.d.ts} +0 -0
  144. /package/dist/{src/utils → utils}/errors.d.ts +0 -0
  145. /package/dist/{src/utils → utils}/findSenderByStream.d.ts +0 -0
  146. /package/dist/{src/utils → utils}/findVideoSender.d.ts +0 -0
  147. /package/dist/{src/utils → utils}/findVideoTrack.d.ts +0 -0
  148. /package/dist/{src/utils → utils}/getCodecFromSender.d.ts +0 -0
  149. /package/dist/{src/videoSendingBalancer → utils}/hasIncludesString.d.ts +0 -0
  150. /package/dist/{src/utils → utils}/replaceForbiddenSymbolsWithUnderscore.d.ts +0 -0
  151. /package/dist/{src/videoSendingBalancer → videoSendingBalancer/calcBitrate}/hasAv1Codec.d.ts +0 -0
  152. /package/dist/{src/videoSendingBalancer → videoSendingBalancer/calcBitrate}/scaleBitrateByCodec.d.ts +0 -0
package/dist/doMock.js CHANGED
@@ -1,35 +1,114 @@
1
- var k = Object.defineProperty;
2
- var A = (o, e, t) => e in o ? k(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var r = (o, e, t) => A(o, typeof e != "symbol" ? e + "" : e, t);
4
- import { o as b, R as D, U as L, S as W } from "./SipConnector-BHvTGgmw.js";
5
- import V from "@krivega/jssip/lib/NameAddrHeader";
6
- import F from "@krivega/jssip/lib/URI";
7
- import { EventEmitter as x } from "node:events";
8
- import { IncomingRequest as U } from "@krivega/jssip/lib/SIPMessage";
9
- import { createAudioMediaStreamTrackMock as H, createVideoMediaStreamTrackMock as z } from "webrtc-mock";
10
- import N from "events-constructor";
11
- import { URI as _, C as T } from "@krivega/jssip";
12
- class S extends U {
13
- constructor(t) {
14
- super();
15
- r(this, "headers");
16
- this.headers = new Headers(t);
17
- }
18
- getHeader(t) {
19
- return this.headers.get(t) ?? "";
1
+ import { EventEmitter as D } from "node:events";
2
+ import L from "@krivega/jssip/lib/NameAddrHeader";
3
+ import y from "@krivega/jssip/lib/URI";
4
+ import { IncomingRequest as F } from "@krivega/jssip/lib/SIPMessage";
5
+ import { NameAddrHeader as b, URI as E, C as N } from "@krivega/jssip";
6
+ import { createAudioMediaStreamTrackMock as V, createVideoMediaStreamTrackMock as k } from "webrtc-mock";
7
+ import { Events as _ } from "events-constructor";
8
+ import { O as W, S as U } from "./@SipConnector-G96OmJEP.js";
9
+ class T extends F {
10
+ headers;
11
+ constructor(e) {
12
+ super(), this.headers = new Headers(e);
13
+ }
14
+ getHeader(e) {
15
+ return this.headers.get(e) ?? "";
20
16
  }
21
17
  }
22
- class Y {
18
+ const G = "incomingCall", H = "declinedIncomingCall", x = "failedIncomingCall", q = "terminatedIncomingCall", A = "connecting", Y = "connected", j = "disconnected", z = "newRTCSession", B = "registered", $ = "unregistered", J = "registrationFailed", K = "newMessage", Q = "sipEvent", X = "availableSecondRemoteStream", Z = "notAvailableSecondRemoteStream", ee = "mustStopPresentation", te = "shareState", re = "enterRoom", ne = "useLicense", oe = "peerconnection:confirmed", se = "peerconnection:ontrack", ie = "channels", ae = "channels:notify", ce = "ended:fromserver", de = "main-cam-control", Ee = "admin-stop-main-cam", he = "admin-start-main-cam", me = "admin-stop-mic", le = "admin-start-mic", ue = "admin-force-sync-media-state", pe = "participant:added-to-list-moderators", ge = "participant:removed-from-list-moderators", _e = "participant:move-request-to-stream", Te = "participant:move-request-to-spectators", Ie = "participant:move-request-to-participants", we = "participation:accepting-word-request", Se = "participation:cancelling-word-request", Ne = "webcast:started", fe = "webcast:stopped", Ce = "account:changed", Re = "account:deleted", Me = "conference:participant-token-issued", Ae = "ended", Oe = "sending", Pe = "reinvite", ve = "replaces", De = "refer", Le = "progress", ye = "accepted", Fe = "confirmed", be = "peerconnection", Ve = "failed", ke = "muted", We = "unmuted", Ue = "newDTMF", Ge = "newInfo", He = "hold", xe = "unhold", qe = "update", Ye = "sdp", je = "icecandidate", ze = "getusermediafailed", Be = "peerconnection:createofferfailed", $e = "peerconnection:createanswerfailed", Je = "peerconnection:setlocaldescriptionfailed", Ke = "peerconnection:setremotedescriptionfailed", Qe = "presentation:start", Xe = "presentation:started", Ze = "presentation:end", et = "presentation:ended", tt = "presentation:failed", rt = [
19
+ G,
20
+ H,
21
+ q,
22
+ x,
23
+ we,
24
+ Se,
25
+ _e,
26
+ ae,
27
+ Me,
28
+ Ce,
29
+ Re,
30
+ Ne,
31
+ fe,
32
+ pe,
33
+ ge
34
+ ], O = [
35
+ A,
36
+ Y,
37
+ j,
38
+ z,
39
+ B,
40
+ $,
41
+ J,
42
+ K,
43
+ Q
44
+ ], nt = [
45
+ X,
46
+ Z,
47
+ ee,
48
+ te,
49
+ re,
50
+ ne,
51
+ oe,
52
+ se,
53
+ ie,
54
+ ce,
55
+ de,
56
+ he,
57
+ Ee,
58
+ me,
59
+ le,
60
+ ue,
61
+ Te,
62
+ Ie
63
+ ], p = [
64
+ Ae,
65
+ A,
66
+ Oe,
67
+ Pe,
68
+ ve,
69
+ De,
70
+ Le,
71
+ ye,
72
+ Fe,
73
+ be,
74
+ Ve,
75
+ ke,
76
+ We,
77
+ Ue,
78
+ Ge,
79
+ He,
80
+ xe,
81
+ qe,
82
+ Ye,
83
+ je,
84
+ ze,
85
+ Be,
86
+ $e,
87
+ Je,
88
+ Ke,
89
+ Qe,
90
+ Xe,
91
+ Ze,
92
+ et,
93
+ tt
94
+ ];
95
+ [...O, ...rt];
96
+ [
97
+ ...p,
98
+ ...nt
99
+ ];
100
+ class ot {
101
+ originator;
102
+ connection;
103
+ events;
104
+ remote_identity;
105
+ mutedOptions = { audio: !1, video: !1 };
23
106
  constructor({
24
107
  originator: e = "local",
25
- eventHandlers: t
108
+ eventHandlers: t,
109
+ remoteIdentity: r
26
110
  }) {
27
- r(this, "originator");
28
- r(this, "connection");
29
- r(this, "events");
30
- r(this, "remote_identity");
31
- r(this, "mutedOptions", { audio: !1, video: !1 });
32
- this.originator = e, this.events = new N(b), this.initEvents(t);
111
+ this.originator = e, this.events = new _(p), this.initEvents(t), this.remote_identity = r;
33
112
  }
34
113
  get contact() {
35
114
  throw new Error("Method not implemented.");
@@ -81,7 +160,7 @@ class Y {
81
160
  terminate(e) {
82
161
  throw new Error("Method not implemented.");
83
162
  }
84
- async sendInfo(e, t, n) {
163
+ async sendInfo(e, t, r) {
85
164
  throw new Error("Method not implemented.");
86
165
  }
87
166
  hold(e, t) {
@@ -124,10 +203,10 @@ class Y {
124
203
  throw new Error("Method not implemented.");
125
204
  }
126
205
  off(e, t) {
127
- throw new Error("Method not implemented.");
206
+ return this.events.off(e, t), this;
128
207
  }
129
208
  removeAllListeners(e) {
130
- throw new Error("Method not implemented.");
209
+ return console.warn("Method not implemented. Event:", e), this;
131
210
  }
132
211
  setMaxListeners(e) {
133
212
  throw new Error("Method not implemented.");
@@ -157,12 +236,14 @@ class Y {
157
236
  throw new Error("Method not implemented.");
158
237
  }
159
238
  initEvents(e) {
160
- Object.entries(e).forEach(([t, n]) => this.on(t, n));
239
+ e && Object.entries(e).forEach(([t, r]) => {
240
+ this.on(t, r);
241
+ });
161
242
  }
162
243
  // @ts-expect-error
163
244
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
164
245
  on(e, t) {
165
- return this.events.on(e, t), this;
246
+ return p.includes(e) && this.events.on(e, t), this;
166
247
  }
167
248
  trigger(e, t) {
168
249
  this.events.trigger(e, t);
@@ -178,37 +259,34 @@ class Y {
178
259
  this.trigger("newDTMF", { originator: this.originator });
179
260
  }
180
261
  async startPresentation(e) {
181
- return e;
182
- }
183
- async updatePresentation(e) {
184
- return e;
262
+ return this.trigger("presentation:start", e), this.trigger("presentation:started", e), e;
185
263
  }
186
264
  async stopPresentation(e) {
187
- return e;
265
+ return this.trigger("presentation:end", e), this.trigger("presentation:ended", e), e;
188
266
  }
189
267
  isEstablished() {
190
268
  return !0;
191
269
  }
192
270
  }
193
- class q {
271
+ class st {
272
+ stats = (/* @__PURE__ */ new Map()).set("codec", { mimeType: "video/h264" });
273
+ dtmf = null;
274
+ track = null;
275
+ transport = null;
276
+ transform = null;
277
+ parameters = {
278
+ encodings: [{}],
279
+ transactionId: "0",
280
+ codecs: [],
281
+ headerExtensions: [],
282
+ rtcp: {}
283
+ };
284
+ parametersGets;
194
285
  constructor({ track: e } = {}) {
195
- r(this, "dtmf", null);
196
- r(this, "track", null);
197
- r(this, "transport", null);
198
- r(this, "transform", null);
199
- r(this, "parameters", {
200
- encodings: [{}],
201
- transactionId: "0",
202
- codecs: [],
203
- headerExtensions: [],
204
- rtcp: {}
205
- });
206
- r(this, "parametersGets");
207
286
  this.track = e ?? null;
208
287
  }
209
- // eslint-disable-next-line class-methods-use-this
210
288
  async getStats() {
211
- throw new Error("Method not implemented.");
289
+ return this.stats;
212
290
  }
213
291
  async replaceTrack(e) {
214
292
  this.track = e ?? null;
@@ -233,43 +311,39 @@ class q {
233
311
  throw new Error("Method not implemented.");
234
312
  }
235
313
  }
236
- class G {
314
+ const it = ["track"];
315
+ class at {
316
+ senders = [];
317
+ receivers = [];
318
+ canTrickleIceCandidates;
319
+ connectionState;
320
+ currentLocalDescription;
321
+ currentRemoteDescription;
322
+ iceConnectionState;
323
+ iceGatheringState;
324
+ idpErrorInfo;
325
+ idpLoginUrl;
326
+ localDescription;
327
+ onconnectionstatechange;
328
+ ondatachannel;
329
+ onicecandidate;
330
+ // eslint-disable-next-line unicorn/no-null
331
+ onicecandidateerror = null;
332
+ oniceconnectionstatechange;
333
+ onicegatheringstatechange;
334
+ onnegotiationneeded;
335
+ onsignalingstatechange;
336
+ ontrack;
337
+ peerIdentity = void 0;
338
+ pendingLocalDescription;
339
+ pendingRemoteDescription;
340
+ remoteDescription;
341
+ // eslint-disable-next-line unicorn/no-null
342
+ sctp = null;
343
+ signalingState;
344
+ events;
237
345
  constructor(e, t) {
238
- r(this, "senders", []);
239
- r(this, "receivers", []);
240
- r(this, "canTrickleIceCandidates");
241
- r(this, "connectionState");
242
- r(this, "currentLocalDescription");
243
- r(this, "currentRemoteDescription");
244
- r(this, "iceConnectionState");
245
- r(this, "iceGatheringState");
246
- r(this, "idpErrorInfo");
247
- r(this, "idpLoginUrl");
248
- r(this, "localDescription");
249
- r(this, "onconnectionstatechange");
250
- r(this, "ondatachannel");
251
- r(this, "onicecandidate");
252
- // eslint-disable-next-line unicorn/no-null
253
- r(this, "onicecandidateerror", null);
254
- r(this, "oniceconnectionstatechange");
255
- r(this, "onicegatheringstatechange");
256
- r(this, "onnegotiationneeded");
257
- r(this, "onsignalingstatechange");
258
- r(this, "ontrack");
259
- r(this, "peerIdentity");
260
- r(this, "pendingLocalDescription");
261
- r(this, "pendingRemoteDescription");
262
- r(this, "remoteDescription");
263
- // eslint-disable-next-line unicorn/no-null
264
- r(this, "sctp", null);
265
- r(this, "signalingState");
266
- r(this, "getReceivers", () => this.receivers);
267
- r(this, "getSenders", () => this.senders);
268
- r(this, "addTrack", (e) => {
269
- const t = new q({ track: e });
270
- return this.senders.push(t), t;
271
- });
272
- this.receivers = t.map((n) => ({ track: n }));
346
+ this.events = new _(it), this.receivers = t.map((r) => ({ track: r }));
273
347
  }
274
348
  getRemoteStreams() {
275
349
  throw new Error("Method not implemented.");
@@ -292,7 +366,7 @@ class G {
292
366
  createDataChannel(e, t) {
293
367
  throw new Error("Method not implemented.");
294
368
  }
295
- async createOffer(e, t, n) {
369
+ async createOffer(e, t, r) {
296
370
  throw new Error("Method not implemented.");
297
371
  }
298
372
  getConfiguration() {
@@ -319,147 +393,175 @@ class G {
319
393
  async setRemoteDescription(e) {
320
394
  throw new Error("Method not implemented.");
321
395
  }
322
- addEventListener(e, t, n) {
323
- throw new Error("Method not implemented.");
396
+ addEventListener(e, t, r) {
397
+ this.events.on(e, t);
324
398
  }
325
- removeEventListener(e, t, n) {
326
- throw new Error("Method not implemented.");
399
+ removeEventListener(e, t, r) {
400
+ this.events.off(e, t);
327
401
  }
328
402
  dispatchEvent(e) {
329
403
  throw new Error("Method not implemented.");
330
404
  }
405
+ getReceivers = () => this.receivers;
406
+ getSenders = () => this.senders;
407
+ addTrack = (e) => {
408
+ const t = new st({ track: e });
409
+ return this.senders.push(t), this.events.trigger("track", { track: e }), t;
410
+ };
331
411
  }
332
- function J(o) {
333
- const e = o.match(/(purgatory)|[\d.]+/g);
412
+ function ct(n) {
413
+ const e = n.match(/(purgatory)|[\d.]+/g);
334
414
  if (!e)
335
415
  throw new Error("wrong sip url");
336
416
  return e[0];
337
417
  }
338
- const g = 400, $ = "777", j = (o) => o.getVideoTracks().length > 0, a = class a extends Y {
418
+ const f = 400, dt = "777", Et = (n) => n.getVideoTracks().length > 0;
419
+ class i extends ot {
420
+ static presentationError;
421
+ static startPresentationError;
422
+ static countStartPresentationError = Number.POSITIVE_INFINITY;
423
+ static countStartsPresentation = 0;
424
+ url;
425
+ status_code;
426
+ /**
427
+ * answer
428
+ *
429
+ * @param {Object} arg1 - The argument 1
430
+ * @param {Object} arg1.mediaStream - The media stream
431
+ * @param {Array} arg1.eventHandlers - The event handlers
432
+
433
+ * @returns {undefined}
434
+ */
435
+ answer = jest.fn(({ mediaStream: e }) => {
436
+ if (this.originator !== "remote")
437
+ throw new Error("answer available only for remote sessions");
438
+ this.initPeerconnection(e), setTimeout(() => {
439
+ this.trigger("connecting"), setTimeout(() => {
440
+ this.trigger("accepted");
441
+ }, 100), setTimeout(() => {
442
+ this.trigger("confirmed");
443
+ }, 200);
444
+ }, f);
445
+ });
446
+ replaceMediaStream = jest.fn(async (e) => {
447
+ });
448
+ isEndedInner = !1;
339
449
  constructor({
340
- url: t = "",
341
- mediaStream: n,
342
- eventHandlers: i,
343
- originator: d
450
+ eventHandlers: e,
451
+ originator: t,
452
+ remoteIdentity: r = new b(
453
+ new E("sip", "caller1", "test1.com", 5060),
454
+ "Test Caller 1"
455
+ )
344
456
  }) {
345
- super({ originator: d, eventHandlers: i });
346
- r(this, "url");
347
- r(this, "status_code");
348
- /**
349
- * answer
350
- *
351
- * @param {Object} arg1 - The argument 1
352
- * @param {Object} arg1.mediaStream - The media stream
353
- * @param {Array} arg1.eventHandlers - The event handlers
354
-
355
- * @returns {undefined}
356
- */
357
- r(this, "answer", jest.fn(({ mediaStream: t }) => {
358
- if (this.originator !== "remote")
359
- throw new Error("answer available only for remote sessions");
360
- this.initPeerconnection(t), setTimeout(() => {
361
- this.trigger("connecting"), setTimeout(() => {
362
- this.trigger("accepted");
363
- }, 100), setTimeout(() => {
364
- this.trigger("confirmed");
365
- }, 200);
366
- }, g);
367
- }));
368
- r(this, "isEndedInner", !1);
369
- this.url = t, this.initPeerconnection(n);
370
- }
371
- static setStartPresentationError(t, { count: n = Number.POSITIVE_INFINITY } = {}) {
372
- this.startPresentationError = t, this.countStartPresentationError = n;
457
+ super({ originator: t, eventHandlers: e, remoteIdentity: r });
458
+ }
459
+ static setPresentationError(e) {
460
+ this.presentationError = e;
461
+ }
462
+ static resetPresentationError() {
463
+ this.presentationError = void 0;
464
+ }
465
+ static setStartPresentationError(e, { count: t = Number.POSITIVE_INFINITY } = {}) {
466
+ this.startPresentationError = e, this.countStartPresentationError = t;
373
467
  }
374
468
  static resetStartPresentationError() {
375
469
  this.startPresentationError = void 0, this.countStartPresentationError = Number.POSITIVE_INFINITY, this.countStartsPresentation = 0;
376
470
  }
377
- async startPresentation(t) {
378
- if (a.countStartsPresentation += 1, a.startPresentationError && a.countStartsPresentation < a.countStartPresentationError)
379
- throw a.startPresentationError;
380
- return super.startPresentation(t);
381
- }
382
- initPeerconnection(t) {
383
- return t ? (this.createPeerconnection(t), !0) : !1;
384
- }
385
- createPeerconnection(t) {
386
- const n = H();
387
- n.id = "mainaudio1";
388
- const i = [n];
389
- if (j(t)) {
390
- const c = z();
391
- c.id = "mainvideo1", i.push(c);
471
+ startPresentation = async (e) => {
472
+ if (i.countStartsPresentation += 1, i.presentationError)
473
+ throw this.trigger("presentation:start", e), this.trigger("presentation:failed", e), i.presentationError;
474
+ if (i.startPresentationError && i.countStartsPresentation < i.countStartPresentationError)
475
+ throw this.trigger("presentation:start", e), this.trigger("presentation:failed", e), i.startPresentationError;
476
+ return super.startPresentation(e);
477
+ };
478
+ stopPresentation = async (e) => {
479
+ if (i.presentationError)
480
+ throw this.trigger("presentation:end", e), this.trigger("presentation:failed", e), i.presentationError;
481
+ return super.stopPresentation(e);
482
+ };
483
+ initPeerconnection(e) {
484
+ return e ? (this.createPeerconnection(e), !0) : !1;
485
+ }
486
+ createPeerconnection(e) {
487
+ const t = V();
488
+ t.id = "mainaudio1";
489
+ const r = [t];
490
+ if (Et(e)) {
491
+ const a = k();
492
+ a.id = "mainvideo1", r.push(a);
392
493
  }
393
- this.connection = new G(void 0, i), this.addStream(t), setTimeout(() => {
394
- this.trigger("peerconnection", { peerconnection: this.connection });
395
- }, g);
396
- }
397
- connect(t) {
398
- const n = J(t);
399
- setTimeout(() => {
400
- this.url.includes($) ? this.trigger("failed", {
494
+ this.connection = new at(void 0, r), this.addStream(e), this.trigger("peerconnection", { peerconnection: this.connection });
495
+ }
496
+ connect(e, { mediaStream: t } = {}) {
497
+ const r = ct(e);
498
+ return this.initPeerconnection(t), setTimeout(() => {
499
+ e.includes(dt) ? this.trigger("failed", {
401
500
  originator: "remote",
402
501
  message: "IncomingResponse",
403
- cause: D
502
+ cause: "Rejected"
404
503
  }) : (this.trigger("connecting"), setTimeout(() => {
405
- this.trigger("enterRoom", { room: n });
504
+ this.newInfo({
505
+ originator: W.REMOTE,
506
+ // @ts-expect-error
507
+ request: {
508
+ getHeader: (s) => s === "content-type" ? "application/vinteo.webrtc.roomname" : s === "x-webrtc-enter-room" ? r : s === "x-webrtc-participant-name" ? "Test Caller 1" : ""
509
+ }
510
+ });
406
511
  }, 100), setTimeout(() => {
407
512
  this.trigger("accepted");
408
513
  }, 200), setTimeout(() => {
409
514
  this.trigger("confirmed");
410
515
  }, 300));
411
- }, g);
516
+ }, f), this.connection;
412
517
  }
413
- terminate({ status_code: t, cause: n } = {}) {
414
- return this.status_code = t, this.trigger("ended", { status_code: t, cause: n, originator: "local" }), this.isEndedInner = !1, this;
518
+ terminate({ status_code: e, cause: t } = {}) {
519
+ return this.status_code = e, this.trigger("ended", { status_code: e, cause: t, originator: "local" }), this.isEndedInner = !1, this;
415
520
  }
416
521
  async terminateAsync({
417
- status_code: t,
418
- cause: n
522
+ status_code: e,
523
+ cause: t
419
524
  } = {}) {
420
- this.terminate({ status_code: t, cause: n });
525
+ this.terminate({ status_code: e, cause: t });
421
526
  }
422
- terminateRemote({ status_code: t } = {}) {
423
- return this.status_code = t, this.trigger("ended", { status_code: t, originator: "remote" }), this;
527
+ terminateRemote({ status_code: e } = {}) {
528
+ return this.status_code = e, this.trigger("ended", { status_code: e, originator: "remote" }), this;
424
529
  }
425
- addStream(t, n = "getTracks") {
426
- t[n]().forEach((i) => this.connection.addTrack(i));
530
+ addStream(e, t = "getTracks") {
531
+ e[t]().forEach((r) => this.connection.addTrack(r));
427
532
  }
428
- forEachSenders(t) {
429
- const n = this.connection.getSenders();
430
- for (const i of n)
431
- t(i);
432
- return n;
533
+ forEachSenders(e) {
534
+ const t = this.connection.getSenders();
535
+ for (const r of t)
536
+ e(r);
537
+ return t;
433
538
  }
434
539
  /* eslint-disable no-param-reassign */
435
- toggleMuteAudio(t) {
436
- this.forEachSenders(({ track: n }) => {
437
- n && n.kind === "audio" && (n.enabled = !t);
540
+ toggleMuteAudio(e) {
541
+ this.forEachSenders(({ track: t }) => {
542
+ t && t.kind === "audio" && (t.enabled = !e);
438
543
  });
439
544
  }
440
545
  /* eslint-enable no-param-reassign */
441
546
  /* eslint-disable no-param-reassign */
442
- toggleMuteVideo(t) {
443
- this.forEachSenders(({ track: n }) => {
444
- n && n.kind === "video" && (n.enabled = !t);
547
+ toggleMuteVideo(e) {
548
+ this.forEachSenders(({ track: t }) => {
549
+ t && t.kind === "video" && (t.enabled = !e);
445
550
  });
446
551
  }
447
- mute(t) {
448
- t.audio && (this.mutedOptions.audio = !0, this.toggleMuteAudio(this.mutedOptions.audio)), t.video && (this.mutedOptions.video = !0, this.toggleMuteVideo(this.mutedOptions.video)), this.onmute(t);
552
+ mute(e) {
553
+ e.audio && (this.mutedOptions.audio = !0, this.toggleMuteAudio(this.mutedOptions.audio)), e.video && (this.mutedOptions.video = !0, this.toggleMuteVideo(this.mutedOptions.video)), this.onmute(e);
449
554
  }
450
- unmute(t) {
451
- t.audio && (this.mutedOptions.audio = !1), t.video && (this.mutedOptions.video = !1), this.trigger("unmuted", t);
555
+ unmute(e) {
556
+ e.audio && (this.mutedOptions.audio = !1), e.video && (this.mutedOptions.video = !1), this.trigger("unmuted", e);
452
557
  }
453
558
  isMuted() {
454
559
  return this.mutedOptions;
455
560
  }
456
- // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function, class-methods-use-this
457
- async replaceMediaStream(t) {
458
- }
459
- onmute({ audio: t, video: n }) {
561
+ onmute({ audio: e, video: t }) {
460
562
  this.trigger("muted", {
461
- audio: t,
462
- video: n
563
+ audio: e,
564
+ video: t
463
565
  });
464
566
  }
465
567
  // eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
@@ -468,17 +570,13 @@ const g = 400, $ = "777", j = (o) => o.getVideoTracks().length > 0, a = class a
468
570
  isEnded() {
469
571
  return this.isEndedInner;
470
572
  }
471
- newInfo(t) {
472
- this.trigger("newInfo", t);
573
+ newInfo(e) {
574
+ this.trigger("newInfo", e);
473
575
  }
474
576
  /* eslint-enable no-param-reassign */
475
- };
476
- r(a, "startPresentationError"), r(a, "countStartPresentationError", Number.POSITIVE_INFINITY), r(a, "countStartsPresentation", 0);
477
- let u = a;
478
- class B {
479
- constructor() {
480
- r(this, "extraHeaders", []);
481
- }
577
+ }
578
+ class ht {
579
+ extraHeaders = [];
482
580
  setExtraHeaders(e) {
483
581
  this.extraHeaders = e;
484
582
  }
@@ -486,86 +584,91 @@ class B {
486
584
  setExtraContactParams() {
487
585
  }
488
586
  }
489
- const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m = 400, w = {
587
+ const c = "PASSWORD_CORRECT", C = "PASSWORD_CORRECT_2", mt = "NAME_INCORRECT", d = 400, u = {
490
588
  url: "wss://sipServerUrl/webrtc/wss/",
491
589
  sip_uri: "sip:sipServerUrl;transport=ws",
492
590
  via_transport: "WSS"
493
- }, C = {
591
+ }, R = {
494
592
  status_code: 200,
495
593
  reason_phrase: "OK"
496
- }, y = {
594
+ }, M = {
497
595
  status_code: 401,
498
596
  reason_phrase: "Unauthorized"
499
- }, s = class s {
597
+ };
598
+ class o {
599
+ static isAvailableTelephony = !0;
600
+ static startError;
601
+ static countStartError = Number.POSITIVE_INFINITY;
602
+ static countStarts = 0;
603
+ events;
604
+ registratorInner;
605
+ // @ts-expect-error – Jest создаёт функцию-замок.
606
+ call = jest.fn(
607
+ (e, t) => {
608
+ const { mediaStream: r, eventHandlers: s } = t;
609
+ return this.session = new i({ eventHandlers: s, originator: "local" }), this.session.connect(e, { mediaStream: r }), this.session;
610
+ }
611
+ );
612
+ sendOptions = jest.fn(
613
+ (e, t, r) => {
614
+ console.log("sendOptions", e, t, r);
615
+ }
616
+ );
617
+ /**
618
+ * start – имитирует запуск UA.
619
+ */
620
+ start = jest.fn(() => {
621
+ if (o.countStarts += 1, o.startError && o.countStarts < o.countStartError) {
622
+ this.trigger("disconnected", o.startError);
623
+ return;
624
+ }
625
+ this.register();
626
+ });
627
+ /**
628
+ * stop – имитирует остановку UA.
629
+ */
630
+ stop = jest.fn(() => {
631
+ this.startedTimeout && clearTimeout(this.startedTimeout), this.stopedTimeout && clearTimeout(this.stopedTimeout), this.unregister(), this.isStarted() ? this.stopedTimeout = setTimeout(() => {
632
+ this.trigger("disconnected", { error: !0, socket: u });
633
+ }, d) : this.trigger("disconnected", { error: !0, socket: u });
634
+ });
635
+ removeAllListeners = jest.fn(() => (this.events.removeEventHandlers(), this));
636
+ once = jest.fn((e, t) => (this.events.once(e, t), this));
637
+ startedTimeout;
638
+ stopedTimeout;
639
+ session;
640
+ isRegisteredInner;
641
+ isConnectedInner;
642
+ configuration;
500
643
  constructor(e) {
501
- r(this, "events");
502
- r(this, "registratorInner");
503
- // @ts-expect-error
504
- r(this, "call", jest.fn(
505
- (e, t) => {
506
- const { mediaStream: n, eventHandlers: i } = t;
507
- return this.session = new u({ url: e, mediaStream: n, eventHandlers: i, originator: "local" }), this.session.connect(e), this.session;
508
- }
509
- ));
510
- r(this, "startedTimeout");
511
- r(this, "stopedTimeout");
512
- r(this, "session");
513
- r(this, "isRegisteredInner");
514
- r(this, "isConnectedInner");
515
- r(this, "configuration");
516
- this.events = new N(L);
517
- const [t, n] = e.uri.split(":"), [i, d] = n.split("@"), c = {
644
+ this.events = new _(O);
645
+ const [t, r] = e.uri.split(":"), [s, a] = r.split("@"), l = {
518
646
  ...e,
519
- uri: new _(t, i, d)
647
+ uri: new E(t, s, a)
520
648
  };
521
- this.configuration = c, this.registratorInner = new B();
649
+ this.configuration = l, this.registratorInner = new ht();
522
650
  }
523
651
  static setStartError(e, { count: t = Number.POSITIVE_INFINITY } = {}) {
524
- this.startError = e, this.countStartError = t;
652
+ o.startError = e, o.countStartError = t;
525
653
  }
526
654
  static resetStartError() {
527
- this.startError = void 0, this.countStartError = Number.POSITIVE_INFINITY, this.countStarts = 0;
655
+ o.startError = void 0, o.countStartError = Number.POSITIVE_INFINITY, o.countStarts = 0;
528
656
  }
529
657
  static setAvailableTelephony() {
530
- this.isAvailableTelephony = !0;
658
+ o.isAvailableTelephony = !0;
531
659
  }
532
660
  static setNotAvailableTelephony() {
533
- this.isAvailableTelephony = !1;
534
- }
535
- /**
536
- * start
537
- *
538
- * @returns {undefined}
539
- */
540
- start() {
541
- if (s.countStarts += 1, s.startError && s.countStarts < s.countStartError) {
542
- this.trigger("disconnected", s.startError);
543
- return;
544
- }
545
- this.register();
661
+ o.isAvailableTelephony = !1;
546
662
  }
547
- /**
548
- * stop
549
- *
550
- * @returns {undefined}
551
- */
552
- stop() {
553
- this.startedTimeout && clearTimeout(this.startedTimeout), this.stopedTimeout && clearTimeout(this.stopedTimeout), this.unregister(), this.isStarted() ? this.stopedTimeout = setTimeout(() => {
554
- this.trigger("disconnected", { error: !0, socket: w });
555
- }, m) : this.trigger("disconnected", { error: !0, socket: w });
663
+ static reset() {
664
+ o.resetStartError(), o.setAvailableTelephony();
556
665
  }
557
666
  on(e, t) {
558
667
  return this.events.on(e, t), this;
559
668
  }
560
- once(e, t) {
561
- return this.events.once(e, t), this;
562
- }
563
669
  off(e, t) {
564
670
  return this.events.off(e, t), this;
565
671
  }
566
- removeAllListeners() {
567
- return this.events.removeEventHandlers(), this;
568
- }
569
672
  trigger(e, t) {
570
673
  this.events.trigger(e, t);
571
674
  }
@@ -575,8 +678,7 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
575
678
  * @returns {undefined}
576
679
  */
577
680
  terminateSessions() {
578
- var e;
579
- (e = this.session) == null || e.terminate();
681
+ this.session?.terminate();
580
682
  }
581
683
  set(e, t) {
582
684
  return this.configuration[e] = t, !0;
@@ -588,14 +690,14 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
588
690
  */
589
691
  register() {
590
692
  this.startedTimeout && clearTimeout(this.startedTimeout);
591
- const { password: e, register: t, uri: n } = this.configuration;
592
- t === !0 && n.user.includes(K) ? (this.isRegisteredInner = !1, this.isConnectedInner = !1, this.startedTimeout = setTimeout(() => {
593
- this.trigger("registrationFailed", { response: y, cause: T.causes.REJECTED });
594
- }, m)) : !this.isRegistered() && t === !0 && (e === h || e === R) ? (this.isRegisteredInner = !0, this.startedTimeout = setTimeout(() => {
595
- this.trigger("registered", { response: C });
596
- }, m)) : t === !0 && e !== h && e !== R && (this.isRegisteredInner = !1, this.isConnectedInner = !1, this.startedTimeout = setTimeout(() => {
597
- this.trigger("registrationFailed", { response: y, cause: T.causes.REJECTED });
598
- }, m)), s.isAvailableTelephony ? (this.trigger("connected", { socket: w }), this.isConnectedInner = !0) : this.stop();
693
+ const { password: e, register: t, uri: r } = this.configuration;
694
+ t === !0 && r.user.includes(mt) ? (this.isRegisteredInner = !1, this.isConnectedInner = !1, this.startedTimeout = setTimeout(() => {
695
+ this.trigger("registrationFailed", { response: M, cause: N.causes.REJECTED });
696
+ }, d)) : !this.isRegistered() && t === !0 && (e === c || e === C) ? (this.isRegisteredInner = !0, this.startedTimeout = setTimeout(() => {
697
+ this.trigger("registered", { response: R });
698
+ }, d)) : t === !0 && e !== c && e !== C && (this.isRegisteredInner = !1, this.isConnectedInner = !1, this.startedTimeout = setTimeout(() => {
699
+ this.trigger("registrationFailed", { response: M, cause: N.causes.REJECTED });
700
+ }, d)), o.isAvailableTelephony ? (this.trigger("connected", { socket: u }), this.isConnectedInner = !0) : this.stop();
599
701
  }
600
702
  /**
601
703
  * unregister
@@ -603,7 +705,7 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
603
705
  * @returns {undefined}
604
706
  */
605
707
  unregister() {
606
- this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response: C });
708
+ this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response: R });
607
709
  }
608
710
  isRegistered() {
609
711
  return this.isRegisteredInner === !0;
@@ -625,125 +727,123 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
625
727
  registrator() {
626
728
  return this.registratorInner;
627
729
  }
628
- };
629
- r(s, "isAvailableTelephony", !0), r(s, "startError"), r(s, "countStartError", Number.POSITIVE_INFINITY), r(s, "countStarts", 0);
630
- let E = s;
631
- class X {
730
+ }
731
+ class lt {
732
+ url;
632
733
  constructor(e) {
633
- r(this, "url");
634
734
  this.url = e;
635
735
  }
636
736
  }
637
- class Q extends x {
638
- constructor(t, n) {
639
- super();
640
- r(this, "contentType");
641
- r(this, "body");
642
- this.contentType = t, this.body = n;
737
+ class ut extends D {
738
+ contentType;
739
+ body;
740
+ constructor(e, t) {
741
+ super(), this.contentType = e, this.body = t;
643
742
  }
644
743
  }
645
- const f = "remote", Z = (o, e) => {
646
- const t = new S(e), n = {
647
- originator: f,
744
+ const g = "remote", pt = (n, e) => {
745
+ const t = new T(e), r = {
746
+ originator: g,
648
747
  request: t,
649
- info: new Q("", "")
748
+ info: new ut("", "")
650
749
  };
651
- o.newInfo(n);
652
- }, ee = (o, e) => {
653
- const n = { event: "sipEvent", request: new S(e) };
654
- o.newSipEvent(n);
655
- }, te = (o, {
750
+ n.newInfo(r);
751
+ }, gt = (n, e) => {
752
+ const r = { event: "sipEvent", request: new T(e) };
753
+ n.newSipEvent(r);
754
+ }, _t = (n, {
656
755
  incomingNumber: e = "1234",
657
756
  displayName: t,
658
- host: n
757
+ host: r
659
758
  }) => {
660
- const i = new u({ originator: f, eventHandlers: {} }), d = new F("sip", e, n);
661
- i.remote_identity = new V(d, t);
662
- const c = new S([]);
663
- o.trigger("newRTCSession", {
664
- originator: f,
665
- session: i,
666
- request: c
759
+ const s = new i({ originator: g, eventHandlers: {} }), a = new y("sip", e, r);
760
+ s.remote_identity = new L(a, t);
761
+ const l = new T([]);
762
+ n.trigger("newRTCSession", {
763
+ originator: g,
764
+ session: s,
765
+ request: l
667
766
  });
668
- }, re = (o, e) => {
669
- e ? o.trigger("failed", e) : o.trigger("failed", o);
767
+ }, Tt = (n, e) => {
768
+ e ? n.trigger("failed", e) : n.trigger("failed", n);
670
769
  }, P = {
671
- triggerNewInfo: Z,
672
- triggerNewSipEvent: ee,
673
- triggerIncomingSession: te,
674
- triggerFailIncomingSession: re,
675
- WebSocketInterface: X,
676
- UA: E,
770
+ triggerNewInfo: pt,
771
+ triggerNewSipEvent: gt,
772
+ triggerIncomingSession: _t,
773
+ triggerFailIncomingSession: Tt,
774
+ WebSocketInterface: lt,
775
+ UA: o,
677
776
  C: {
678
777
  INVITE: "INVITE"
679
778
  }
680
- }, I = "user", l = "displayName", M = "SIP_SERVER_URL", O = "SIP_WEB_SOCKET_SERVER_URL", ne = new P.WebSocketInterface(O), v = {
779
+ }, I = "user", h = "displayName", w = "SIP_SERVER_URL", v = "SIP_WEB_SOCKET_SERVER_URL", It = new P.WebSocketInterface(v), S = {
681
780
  userAgent: "Chrome",
682
- sipServerUrl: M,
683
- sipWebSocketServerURL: O
684
- }, ge = {
685
- ...v
686
- }, oe = {
687
- ...v,
781
+ sipServerUrl: w,
782
+ sipWebSocketServerURL: v
783
+ }, vt = {
784
+ ...S
785
+ }, wt = {
786
+ ...S,
688
787
  user: I,
689
- password: h,
788
+ password: c,
690
789
  register: !0
691
- }, we = {
692
- ...oe,
693
- displayName: l
694
- }, Ee = {
695
- ...v,
696
- displayName: l,
790
+ }, Dt = {
791
+ ...wt,
792
+ displayName: h
793
+ }, Lt = {
794
+ ...S,
795
+ displayName: h,
697
796
  register: !1
698
- }, p = {
797
+ }, m = {
699
798
  session_timers: !1,
700
- sockets: [ne],
799
+ sockets: [It],
701
800
  user_agent: "Chrome",
702
- sdp_semantics: "unified-plan",
801
+ sdpSemantics: "unified-plan",
703
802
  register_expires: 300,
704
803
  connection_recovery_max_interval: 6,
705
804
  connection_recovery_min_interval: 2
706
- }, fe = {
707
- ...p,
708
- password: h,
709
- uri: new _("sip", I, M),
805
+ }, yt = {
806
+ ...m,
807
+ password: c,
808
+ uri: new E("sip", I, w),
710
809
  display_name: "",
711
810
  register: !0
712
- }, _e = {
713
- ...p,
714
- password: h,
715
- uri: new _("sip", I, M),
716
- display_name: l,
811
+ }, Ft = {
812
+ ...m,
813
+ password: c,
814
+ uri: new E("sip", I, w),
815
+ display_name: h,
717
816
  register: !0
718
- }, Se = {
719
- ...p,
720
- display_name: l,
817
+ }, bt = {
818
+ ...m,
819
+ display_name: h,
721
820
  register: !1
722
- }, Ie = {
723
- ...p,
821
+ }, Vt = {
822
+ ...m,
724
823
  display_name: "",
725
824
  register: !1
726
- }, ie = "10.10.10.10", Me = [`X-Vinteo-Remote: ${ie}`], ve = () => new W({
825
+ }, St = "10.10.10.10", kt = [`X-Vinteo-Remote: ${St}`], Wt = () => new U({
727
826
  JsSIP: P
728
827
  });
729
828
  export {
730
- $ as FAILED_CONFERENCE_NUMBER,
731
- K as NAME_INCORRECT,
732
- h as PASSWORD_CORRECT,
733
- R as PASSWORD_CORRECT_2,
734
- M as SIP_SERVER_URL,
735
- O as SIP_WEB_SOCKET_SERVER_URL,
736
- oe as dataForConnectionWithAuthorization,
737
- we as dataForConnectionWithAuthorizationWithDisplayName,
738
- Ee as dataForConnectionWithoutAuthorization,
739
- ge as dataForConnectionWithoutAuthorizationWithoutDisplayName,
740
- l as displayName,
741
- ve as doMockSipConnector,
742
- Me as extraHeadersRemoteAddress,
743
- ie as remoteAddress,
744
- fe as uaConfigurationWithAuthorization,
745
- _e as uaConfigurationWithAuthorizationWithDisplayName,
746
- Se as uaConfigurationWithoutAuthorization,
747
- Ie as uaConfigurationWithoutAuthorizationWithoutDisplayName,
829
+ dt as FAILED_CONFERENCE_NUMBER,
830
+ P as JsSIP,
831
+ mt as NAME_INCORRECT,
832
+ c as PASSWORD_CORRECT,
833
+ C as PASSWORD_CORRECT_2,
834
+ w as SIP_SERVER_URL,
835
+ v as SIP_WEB_SOCKET_SERVER_URL,
836
+ wt as dataForConnectionWithAuthorization,
837
+ Dt as dataForConnectionWithAuthorizationWithDisplayName,
838
+ Lt as dataForConnectionWithoutAuthorization,
839
+ vt as dataForConnectionWithoutAuthorizationWithoutDisplayName,
840
+ h as displayName,
841
+ Wt as doMockSipConnector,
842
+ kt as extraHeadersRemoteAddress,
843
+ St as remoteAddress,
844
+ yt as uaConfigurationWithAuthorization,
845
+ Ft as uaConfigurationWithAuthorizationWithDisplayName,
846
+ bt as uaConfigurationWithoutAuthorization,
847
+ Vt as uaConfigurationWithoutAuthorizationWithoutDisplayName,
748
848
  I as user
749
849
  };