sip-connector 14.1.2-7 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/@SipConnector-CZo7A8_q.cjs +1 -0
  2. package/dist/@SipConnector-DbvV1Leg.js +2247 -0
  3. package/dist/ApiManager/@ApiManager.d.ts +59 -0
  4. package/dist/ApiManager/constants.d.ts +71 -0
  5. package/dist/ApiManager/eventNames.d.ts +33 -0
  6. package/dist/ApiManager/index.d.ts +3 -0
  7. package/dist/ApiManager/types.d.ts +99 -0
  8. package/dist/CallManager/@CallManager.d.ts +26 -0
  9. package/dist/CallManager/AbstractCallStrategy.d.ts +47 -0
  10. package/dist/CallManager/MCUCallStrategy.d.ts +30 -0
  11. package/dist/CallManager/RemoteStreamsManager.d.ts +8 -0
  12. package/dist/CallManager/causes.d.ts +13 -0
  13. package/dist/CallManager/eventNames.d.ts +45 -0
  14. package/dist/CallManager/hasCanceledCallError.d.ts +2 -0
  15. package/dist/CallManager/index.d.ts +7 -0
  16. package/dist/CallManager/types.d.ts +59 -0
  17. package/dist/ConnectionManager/@ConnectionManager.d.ts +48 -0
  18. package/dist/ConnectionManager/ConfigurationManager.d.ts +60 -0
  19. package/dist/ConnectionManager/ConnectionFlow.d.ts +84 -0
  20. package/dist/ConnectionManager/ConnectionStateMachine.d.ts +61 -0
  21. package/dist/ConnectionManager/RegistrationManager.d.ts +17 -0
  22. package/dist/ConnectionManager/SipOperations.d.ts +32 -0
  23. package/dist/ConnectionManager/UAFactory.d.ts +50 -0
  24. package/dist/ConnectionManager/eventNames.d.ts +16 -0
  25. package/dist/ConnectionManager/index.d.ts +3 -0
  26. package/dist/IncomingCallManager/@IncomingCallManager.d.ts +37 -0
  27. package/dist/IncomingCallManager/eventNames.d.ts +13 -0
  28. package/dist/IncomingCallManager/index.d.ts +2 -0
  29. package/dist/PresentationManager/@PresentationManager.d.ts +47 -0
  30. package/dist/PresentationManager/constants.d.ts +1 -0
  31. package/dist/PresentationManager/eventNames.d.ts +11 -0
  32. package/dist/PresentationManager/index.d.ts +2 -0
  33. package/dist/PresentationManager/types.d.ts +2 -0
  34. package/dist/SipConnector/@SipConnector.d.ts +96 -0
  35. package/dist/SipConnector/eventNames.d.ts +4 -0
  36. package/dist/SipConnector/index.d.ts +2 -0
  37. package/dist/{src/SipConnectorFacade → SipConnectorFacade}/SipConnectorFacade.d.ts +7 -16
  38. package/dist/{src/__fixtures__ → __fixtures__}/BaseSession.mock.d.ts +9 -9
  39. package/dist/{src/__fixtures__ → __fixtures__}/RTCPeerConnectionMock.d.ts +6 -0
  40. package/dist/{src/__fixtures__ → __fixtures__}/RTCSessionMock.d.ts +13 -8
  41. package/dist/{src/__fixtures__ → __fixtures__}/UA.mock.d.ts +13 -15
  42. package/dist/{src → __fixtures__}/eventNames.d.ts +1 -1
  43. package/dist/{src/__fixtures__ → __fixtures__}/index.d.ts +4 -4
  44. package/dist/{src/__fixtures__ → __fixtures__}/jssip.mock.d.ts +3 -3
  45. package/dist/doMock.cjs +1 -1
  46. package/dist/{src/doMock.d.ts → doMock.d.ts} +2 -1
  47. package/dist/doMock.js +442 -341
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.ts +14 -0
  50. package/dist/index.js +718 -671
  51. package/dist/{src/setParametersToSender → setParametersToSender}/resolveHasNeedToUpdateItemEncoding.d.ts +1 -1
  52. package/dist/{src/tools → tools}/__fixtures__/connectToServer.d.ts +2 -2
  53. package/dist/{src/tools → tools}/__fixtures__/processRequest.d.ts +1 -1
  54. package/dist/{src/tools → tools}/error/getLinkError.d.ts +1 -1
  55. package/dist/{src/tools → tools}/error/getTypeFromError.d.ts +1 -1
  56. package/dist/{src/tools → tools}/error/getValuesFromError.d.ts +1 -1
  57. package/dist/{src/tools → tools}/index.d.ts +1 -1
  58. package/dist/{src/tools → tools}/prepareMediaStream.d.ts +1 -1
  59. package/dist/{src/tools → tools}/setVideoTrackContentHints.d.ts +1 -1
  60. package/dist/{src/tools → tools}/syncMediaState/index.d.ts +1 -1
  61. package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMainCam.d.ts +1 -1
  62. package/dist/{src/tools → tools}/syncMediaState/resolveOnStartMic.d.ts +1 -1
  63. package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMainCam.d.ts +1 -1
  64. package/dist/{src/tools → tools}/syncMediaState/resolveOnStopMic.d.ts +1 -1
  65. package/dist/types.d.ts +23 -0
  66. package/dist/{src/videoSendingBalancer → videoSendingBalancer}/balance.d.ts +1 -1
  67. package/dist/{src/videoSendingBalancer → videoSendingBalancer}/getMaxBitrateByWidth.d.ts +1 -0
  68. package/dist/{src/videoSendingBalancer → videoSendingBalancer}/getMaxBitrateByWidthAndCodec.d.ts +1 -0
  69. package/dist/{src/videoSendingBalancer → videoSendingBalancer}/index.d.ts +1 -1
  70. package/dist/{src/videoSendingBalancer → videoSendingBalancer}/processSender.d.ts +1 -1
  71. package/package.json +35 -42
  72. package/dist/SipConnector-BHvTGgmw.js +0 -1352
  73. package/dist/SipConnector-ChW25Tx9.cjs +0 -1
  74. package/dist/src/SipConnector.d.ts +0 -235
  75. package/dist/src/causes.d.ts +0 -23
  76. package/dist/src/headers.d.ts +0 -37
  77. package/dist/src/index.d.ts +0 -11
  78. package/dist/src/types.d.ts +0 -69
  79. /package/dist/{src → ConnectionManager}/getExtraHeadersRemoteAddress.d.ts +0 -0
  80. /package/dist/{src/SipConnectorFacade → SipConnectorFacade}/index.d.ts +0 -0
  81. /package/dist/{src/__fixtures__ → __fixtures__}/RTCRtpSenderMock.d.ts +0 -0
  82. /package/dist/{src/__fixtures__ → __fixtures__}/Registrator.mock.d.ts +0 -0
  83. /package/dist/{src/__fixtures__ → __fixtures__}/Request.mock.d.ts +0 -0
  84. /package/dist/{src/__fixtures__ → __fixtures__}/WebSocketInterface.mock.d.ts +0 -0
  85. /package/dist/{src/__fixtures__ → __fixtures__}/accountNotify.d.ts +0 -0
  86. /package/dist/{src/__fixtures__ → __fixtures__}/channels.d.ts +0 -0
  87. /package/dist/{src/__fixtures__ → __fixtures__}/channelsNotify.d.ts +0 -0
  88. /package/dist/{src/__fixtures__ → __fixtures__}/conferenceParticipantTokenIssuedNotify.d.ts +0 -0
  89. /package/dist/{src → __fixtures__}/constants.d.ts +0 -0
  90. /package/dist/{src/__fixtures__ → __fixtures__}/delayPromise.d.ts +0 -0
  91. /package/dist/{src/__fixtures__ → __fixtures__}/enterRoom.d.ts +0 -0
  92. /package/dist/{src/__fixtures__ → __fixtures__}/mediaState.d.ts +0 -0
  93. /package/dist/{src/__fixtures__ → __fixtures__}/participantMoveRequests.d.ts +0 -0
  94. /package/dist/{src/__fixtures__ → __fixtures__}/participantNotify.d.ts +0 -0
  95. /package/dist/{src/__fixtures__ → __fixtures__}/remoteCallerData.d.ts +0 -0
  96. /package/dist/{src/__fixtures__ → __fixtures__}/utils.d.ts +0 -0
  97. /package/dist/{src/__fixtures__ → __fixtures__}/webcastNotify.d.ts +0 -0
  98. /package/dist/{src/logger.d.ts → logger.d.ts} +0 -0
  99. /package/dist/{src/setParametersToSender → setParametersToSender}/configureDegradationPreference.d.ts +0 -0
  100. /package/dist/{src/setParametersToSender → setParametersToSender}/configureEmptyEncodings.d.ts +0 -0
  101. /package/dist/{src/setParametersToSender → setParametersToSender}/configureEncodings.d.ts +0 -0
  102. /package/dist/{src/setParametersToSender → setParametersToSender}/configureMaxBitrate.d.ts +0 -0
  103. /package/dist/{src/setParametersToSender → setParametersToSender}/configureScaleResolutionDownBy.d.ts +0 -0
  104. /package/dist/{src/setParametersToSender → setParametersToSender}/hasChangedRTCRtpSendParameters.d.ts +0 -0
  105. /package/dist/{src/setParametersToSender → setParametersToSender}/index.d.ts +0 -0
  106. /package/dist/{src/setParametersToSender → setParametersToSender}/setParametersToSender.d.ts +0 -0
  107. /package/dist/{src/tools → tools}/__fixtures__/call.d.ts +0 -0
  108. /package/dist/{src/tools → tools}/__fixtures__/hasValidUri.d.ts +0 -0
  109. /package/dist/{src/tools → tools}/__fixtures__/permissions.d.ts +0 -0
  110. /package/dist/{src/tools → tools}/__tests-utils__/parseObject.d.ts +0 -0
  111. /package/dist/{src/tools → tools}/__tests-utils__/resolveParseArray.d.ts +0 -0
  112. /package/dist/{src/tools → tools}/error/index.d.ts +0 -0
  113. /package/dist/{src/tools → tools}/error/stringifyMessage.d.ts +0 -0
  114. /package/dist/{src/tools → tools}/generateSimulcastEncodings.d.ts +0 -0
  115. /package/dist/{src/tools → tools}/getExtraHeaders.d.ts +0 -0
  116. /package/dist/{src/tools → tools}/getUserAgent.d.ts +0 -0
  117. /package/dist/{src/tools → tools}/hasPurgatory.d.ts +0 -0
  118. /package/dist/{src/tools → tools}/resolveUpdateTransceiver.d.ts +0 -0
  119. /package/dist/{src/tools/sendDTMFAccumulated.d.ts → tools/sendDtmfFAccumulated.d.ts} +0 -0
  120. /package/dist/{src/utils → utils}/errors.d.ts +0 -0
  121. /package/dist/{src/utils → utils}/findSenderByStream.d.ts +0 -0
  122. /package/dist/{src/utils → utils}/findVideoSender.d.ts +0 -0
  123. /package/dist/{src/utils → utils}/findVideoTrack.d.ts +0 -0
  124. /package/dist/{src/utils → utils}/getCodecFromSender.d.ts +0 -0
  125. /package/dist/{src/utils → utils}/replaceForbiddenSymbolsWithUnderscore.d.ts +0 -0
  126. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/hasAv1Codec.d.ts +0 -0
  127. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/hasIncludesString.d.ts +0 -0
  128. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleBitrate.d.ts +0 -0
  129. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleBitrateByCodec.d.ts +0 -0
  130. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/scaleResolutionAndBitrate.d.ts +0 -0
  131. /package/dist/{src/videoSendingBalancer → videoSendingBalancer}/setEncodingsToSender.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";
1
+ import { O as D, S as L } from "./@SipConnector-DbvV1Leg.js";
2
+ import y from "@krivega/jssip/lib/NameAddrHeader";
6
3
  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) ?? "";
4
+ import { EventEmitter as b } from "node:events";
5
+ import { IncomingRequest as V } from "@krivega/jssip/lib/SIPMessage";
6
+ import { NameAddrHeader as k, URI as E, C as N } from "@krivega/jssip";
7
+ import { createAudioMediaStreamTrackMock as W, createVideoMediaStreamTrackMock as U } from "webrtc-mock";
8
+ import { Events as _ } from "events-constructor";
9
+ class T extends V {
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,32 +259,29 @@ 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
+ dtmf = null;
273
+ track = null;
274
+ transport = null;
275
+ transform = null;
276
+ parameters = {
277
+ encodings: [{}],
278
+ transactionId: "0",
279
+ codecs: [],
280
+ headerExtensions: [],
281
+ rtcp: {}
282
+ };
283
+ parametersGets;
194
284
  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
285
  this.track = e ?? null;
208
286
  }
209
287
  // eslint-disable-next-line class-methods-use-this
@@ -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,176 @@ 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
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
447
+ replaceMediaStream = jest.fn(async (e) => {
448
+ });
449
+ isEndedInner = !1;
339
450
  constructor({
340
- url: t = "",
341
- mediaStream: n,
342
- eventHandlers: i,
343
- originator: d
451
+ eventHandlers: e,
452
+ originator: t,
453
+ remoteIdentity: r = new k(
454
+ new E("sip", "caller1", "test1.com", 5060),
455
+ "Test Caller 1"
456
+ )
344
457
  }) {
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;
458
+ super({ originator: t, eventHandlers: e, remoteIdentity: r });
459
+ }
460
+ static setPresentationError(e) {
461
+ this.presentationError = e;
462
+ }
463
+ static resetPresentationError() {
464
+ this.presentationError = void 0;
465
+ }
466
+ static setStartPresentationError(e, { count: t = Number.POSITIVE_INFINITY } = {}) {
467
+ this.startPresentationError = e, this.countStartPresentationError = t;
373
468
  }
374
469
  static resetStartPresentationError() {
375
470
  this.startPresentationError = void 0, this.countStartPresentationError = Number.POSITIVE_INFINITY, this.countStartsPresentation = 0;
376
471
  }
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);
472
+ startPresentation = async (e) => {
473
+ if (i.countStartsPresentation += 1, i.presentationError)
474
+ throw this.trigger("presentation:start", e), this.trigger("presentation:failed", e), i.presentationError;
475
+ if (i.startPresentationError && i.countStartsPresentation < i.countStartPresentationError)
476
+ throw this.trigger("presentation:start", e), this.trigger("presentation:failed", e), i.startPresentationError;
477
+ return super.startPresentation(e);
478
+ };
479
+ stopPresentation = async (e) => {
480
+ if (i.presentationError)
481
+ throw this.trigger("presentation:end", e), this.trigger("presentation:failed", e), i.presentationError;
482
+ return super.stopPresentation(e);
483
+ };
484
+ initPeerconnection(e) {
485
+ return e ? (this.createPeerconnection(e), !0) : !1;
486
+ }
487
+ createPeerconnection(e) {
488
+ const t = W();
489
+ t.id = "mainaudio1";
490
+ const r = [t];
491
+ if (Et(e)) {
492
+ const a = U();
493
+ a.id = "mainvideo1", r.push(a);
392
494
  }
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", {
495
+ this.connection = new at(void 0, r), this.addStream(e), this.trigger("peerconnection", { peerconnection: this.connection });
496
+ }
497
+ connect(e, { mediaStream: t } = {}) {
498
+ const r = ct(e);
499
+ return this.initPeerconnection(t), setTimeout(() => {
500
+ e.includes(dt) ? this.trigger("failed", {
401
501
  originator: "remote",
402
502
  message: "IncomingResponse",
403
- cause: D
503
+ cause: "Rejected"
404
504
  }) : (this.trigger("connecting"), setTimeout(() => {
405
- this.trigger("enterRoom", { room: n });
505
+ this.newInfo({
506
+ originator: D.REMOTE,
507
+ // @ts-expect-error
508
+ request: {
509
+ getHeader: (s) => s === "content-type" ? "application/vinteo.webrtc.roomname" : s === "x-webrtc-enter-room" ? r : s === "x-webrtc-participant-name" ? "Test Caller 1" : ""
510
+ }
511
+ });
406
512
  }, 100), setTimeout(() => {
407
513
  this.trigger("accepted");
408
514
  }, 200), setTimeout(() => {
409
515
  this.trigger("confirmed");
410
516
  }, 300));
411
- }, g);
517
+ }, f), this.connection;
412
518
  }
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;
519
+ terminate({ status_code: e, cause: t } = {}) {
520
+ return this.status_code = e, this.trigger("ended", { status_code: e, cause: t, originator: "local" }), this.isEndedInner = !1, this;
415
521
  }
416
522
  async terminateAsync({
417
- status_code: t,
418
- cause: n
523
+ status_code: e,
524
+ cause: t
419
525
  } = {}) {
420
- this.terminate({ status_code: t, cause: n });
526
+ this.terminate({ status_code: e, cause: t });
421
527
  }
422
- terminateRemote({ status_code: t } = {}) {
423
- return this.status_code = t, this.trigger("ended", { status_code: t, originator: "remote" }), this;
528
+ terminateRemote({ status_code: e } = {}) {
529
+ return this.status_code = e, this.trigger("ended", { status_code: e, originator: "remote" }), this;
424
530
  }
425
- addStream(t, n = "getTracks") {
426
- t[n]().forEach((i) => this.connection.addTrack(i));
531
+ addStream(e, t = "getTracks") {
532
+ e[t]().forEach((r) => this.connection.addTrack(r));
427
533
  }
428
- forEachSenders(t) {
429
- const n = this.connection.getSenders();
430
- for (const i of n)
431
- t(i);
432
- return n;
534
+ forEachSenders(e) {
535
+ const t = this.connection.getSenders();
536
+ for (const r of t)
537
+ e(r);
538
+ return t;
433
539
  }
434
540
  /* eslint-disable no-param-reassign */
435
- toggleMuteAudio(t) {
436
- this.forEachSenders(({ track: n }) => {
437
- n && n.kind === "audio" && (n.enabled = !t);
541
+ toggleMuteAudio(e) {
542
+ this.forEachSenders(({ track: t }) => {
543
+ t && t.kind === "audio" && (t.enabled = !e);
438
544
  });
439
545
  }
440
546
  /* eslint-enable no-param-reassign */
441
547
  /* eslint-disable no-param-reassign */
442
- toggleMuteVideo(t) {
443
- this.forEachSenders(({ track: n }) => {
444
- n && n.kind === "video" && (n.enabled = !t);
548
+ toggleMuteVideo(e) {
549
+ this.forEachSenders(({ track: t }) => {
550
+ t && t.kind === "video" && (t.enabled = !e);
445
551
  });
446
552
  }
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);
553
+ mute(e) {
554
+ 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
555
  }
450
- unmute(t) {
451
- t.audio && (this.mutedOptions.audio = !1), t.video && (this.mutedOptions.video = !1), this.trigger("unmuted", t);
556
+ unmute(e) {
557
+ e.audio && (this.mutedOptions.audio = !1), e.video && (this.mutedOptions.video = !1), this.trigger("unmuted", e);
452
558
  }
453
559
  isMuted() {
454
560
  return this.mutedOptions;
455
561
  }
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 }) {
562
+ onmute({ audio: e, video: t }) {
460
563
  this.trigger("muted", {
461
- audio: t,
462
- video: n
564
+ audio: e,
565
+ video: t
463
566
  });
464
567
  }
465
568
  // eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
@@ -468,17 +571,13 @@ const g = 400, $ = "777", j = (o) => o.getVideoTracks().length > 0, a = class a
468
571
  isEnded() {
469
572
  return this.isEndedInner;
470
573
  }
471
- newInfo(t) {
472
- this.trigger("newInfo", t);
574
+ newInfo(e) {
575
+ this.trigger("newInfo", e);
473
576
  }
474
577
  /* 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
- }
578
+ }
579
+ class ht {
580
+ extraHeaders = [];
482
581
  setExtraHeaders(e) {
483
582
  this.extraHeaders = e;
484
583
  }
@@ -486,86 +585,91 @@ class B {
486
585
  setExtraContactParams() {
487
586
  }
488
587
  }
489
- const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m = 400, w = {
588
+ const c = "PASSWORD_CORRECT", C = "PASSWORD_CORRECT_2", mt = "NAME_INCORRECT", d = 400, u = {
490
589
  url: "wss://sipServerUrl/webrtc/wss/",
491
590
  sip_uri: "sip:sipServerUrl;transport=ws",
492
591
  via_transport: "WSS"
493
- }, C = {
592
+ }, R = {
494
593
  status_code: 200,
495
594
  reason_phrase: "OK"
496
- }, y = {
595
+ }, M = {
497
596
  status_code: 401,
498
597
  reason_phrase: "Unauthorized"
499
- }, s = class s {
598
+ };
599
+ class o {
600
+ static isAvailableTelephony = !0;
601
+ static startError;
602
+ static countStartError = Number.POSITIVE_INFINITY;
603
+ static countStarts = 0;
604
+ events;
605
+ registratorInner;
606
+ // @ts-expect-error – Jest создаёт функцию-замок.
607
+ call = jest.fn(
608
+ (e, t) => {
609
+ const { mediaStream: r, eventHandlers: s } = t;
610
+ return this.session = new i({ eventHandlers: s, originator: "local" }), this.session.connect(e, { mediaStream: r }), this.session;
611
+ }
612
+ );
613
+ sendOptions = jest.fn(
614
+ (e, t, r) => {
615
+ console.log("sendOptions", e, t, r);
616
+ }
617
+ );
618
+ /**
619
+ * start – имитирует запуск UA.
620
+ */
621
+ start = jest.fn(() => {
622
+ if (o.countStarts += 1, o.startError && o.countStarts < o.countStartError) {
623
+ this.trigger("disconnected", o.startError);
624
+ return;
625
+ }
626
+ this.register();
627
+ });
628
+ /**
629
+ * stop – имитирует остановку UA.
630
+ */
631
+ stop = jest.fn(() => {
632
+ this.startedTimeout && clearTimeout(this.startedTimeout), this.stopedTimeout && clearTimeout(this.stopedTimeout), this.unregister(), this.isStarted() ? this.stopedTimeout = setTimeout(() => {
633
+ this.trigger("disconnected", { error: !0, socket: u });
634
+ }, d) : this.trigger("disconnected", { error: !0, socket: u });
635
+ });
636
+ removeAllListeners = jest.fn(() => (this.events.removeEventHandlers(), this));
637
+ once = jest.fn((e, t) => (this.events.once(e, t), this));
638
+ startedTimeout;
639
+ stopedTimeout;
640
+ session;
641
+ isRegisteredInner;
642
+ isConnectedInner;
643
+ configuration;
500
644
  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 = {
645
+ this.events = new _(O);
646
+ const [t, r] = e.uri.split(":"), [s, a] = r.split("@"), l = {
518
647
  ...e,
519
- uri: new _(t, i, d)
648
+ uri: new E(t, s, a)
520
649
  };
521
- this.configuration = c, this.registratorInner = new B();
650
+ this.configuration = l, this.registratorInner = new ht();
522
651
  }
523
652
  static setStartError(e, { count: t = Number.POSITIVE_INFINITY } = {}) {
524
- this.startError = e, this.countStartError = t;
653
+ o.startError = e, o.countStartError = t;
525
654
  }
526
655
  static resetStartError() {
527
- this.startError = void 0, this.countStartError = Number.POSITIVE_INFINITY, this.countStarts = 0;
656
+ o.startError = void 0, o.countStartError = Number.POSITIVE_INFINITY, o.countStarts = 0;
528
657
  }
529
658
  static setAvailableTelephony() {
530
- this.isAvailableTelephony = !0;
659
+ o.isAvailableTelephony = !0;
531
660
  }
532
661
  static setNotAvailableTelephony() {
533
- this.isAvailableTelephony = !1;
662
+ o.isAvailableTelephony = !1;
534
663
  }
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();
546
- }
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 });
664
+ static reset() {
665
+ o.resetStartError(), o.setAvailableTelephony();
556
666
  }
557
667
  on(e, t) {
558
668
  return this.events.on(e, t), this;
559
669
  }
560
- once(e, t) {
561
- return this.events.once(e, t), this;
562
- }
563
670
  off(e, t) {
564
671
  return this.events.off(e, t), this;
565
672
  }
566
- removeAllListeners() {
567
- return this.events.removeEventHandlers(), this;
568
- }
569
673
  trigger(e, t) {
570
674
  this.events.trigger(e, t);
571
675
  }
@@ -575,8 +679,7 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
575
679
  * @returns {undefined}
576
680
  */
577
681
  terminateSessions() {
578
- var e;
579
- (e = this.session) == null || e.terminate();
682
+ this.session?.terminate();
580
683
  }
581
684
  set(e, t) {
582
685
  return this.configuration[e] = t, !0;
@@ -588,14 +691,14 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
588
691
  */
589
692
  register() {
590
693
  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();
694
+ const { password: e, register: t, uri: r } = this.configuration;
695
+ t === !0 && r.user.includes(mt) ? (this.isRegisteredInner = !1, this.isConnectedInner = !1, this.startedTimeout = setTimeout(() => {
696
+ this.trigger("registrationFailed", { response: M, cause: N.causes.REJECTED });
697
+ }, d)) : !this.isRegistered() && t === !0 && (e === c || e === C) ? (this.isRegisteredInner = !0, this.startedTimeout = setTimeout(() => {
698
+ this.trigger("registered", { response: R });
699
+ }, d)) : t === !0 && e !== c && e !== C && (this.isRegisteredInner = !1, this.isConnectedInner = !1, this.startedTimeout = setTimeout(() => {
700
+ this.trigger("registrationFailed", { response: M, cause: N.causes.REJECTED });
701
+ }, d)), o.isAvailableTelephony ? (this.trigger("connected", { socket: u }), this.isConnectedInner = !0) : this.stop();
599
702
  }
600
703
  /**
601
704
  * unregister
@@ -603,7 +706,7 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
603
706
  * @returns {undefined}
604
707
  */
605
708
  unregister() {
606
- this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response: C });
709
+ this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response: R });
607
710
  }
608
711
  isRegistered() {
609
712
  return this.isRegisteredInner === !0;
@@ -625,125 +728,123 @@ const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m
625
728
  registrator() {
626
729
  return this.registratorInner;
627
730
  }
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 {
731
+ }
732
+ class lt {
733
+ url;
632
734
  constructor(e) {
633
- r(this, "url");
634
735
  this.url = e;
635
736
  }
636
737
  }
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;
738
+ class ut extends b {
739
+ contentType;
740
+ body;
741
+ constructor(e, t) {
742
+ super(), this.contentType = e, this.body = t;
643
743
  }
644
744
  }
645
- const f = "remote", Z = (o, e) => {
646
- const t = new S(e), n = {
647
- originator: f,
745
+ const g = "remote", pt = (n, e) => {
746
+ const t = new T(e), r = {
747
+ originator: g,
648
748
  request: t,
649
- info: new Q("", "")
749
+ info: new ut("", "")
650
750
  };
651
- o.newInfo(n);
652
- }, ee = (o, e) => {
653
- const n = { event: "sipEvent", request: new S(e) };
654
- o.newSipEvent(n);
655
- }, te = (o, {
751
+ n.newInfo(r);
752
+ }, gt = (n, e) => {
753
+ const r = { event: "sipEvent", request: new T(e) };
754
+ n.newSipEvent(r);
755
+ }, _t = (n, {
656
756
  incomingNumber: e = "1234",
657
757
  displayName: t,
658
- host: n
758
+ host: r
659
759
  }) => {
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
760
+ const s = new i({ originator: g, eventHandlers: {} }), a = new F("sip", e, r);
761
+ s.remote_identity = new y(a, t);
762
+ const l = new T([]);
763
+ n.trigger("newRTCSession", {
764
+ originator: g,
765
+ session: s,
766
+ request: l
667
767
  });
668
- }, re = (o, e) => {
669
- e ? o.trigger("failed", e) : o.trigger("failed", o);
768
+ }, Tt = (n, e) => {
769
+ e ? n.trigger("failed", e) : n.trigger("failed", n);
670
770
  }, P = {
671
- triggerNewInfo: Z,
672
- triggerNewSipEvent: ee,
673
- triggerIncomingSession: te,
674
- triggerFailIncomingSession: re,
675
- WebSocketInterface: X,
676
- UA: E,
771
+ triggerNewInfo: pt,
772
+ triggerNewSipEvent: gt,
773
+ triggerIncomingSession: _t,
774
+ triggerFailIncomingSession: Tt,
775
+ WebSocketInterface: lt,
776
+ UA: o,
677
777
  C: {
678
778
  INVITE: "INVITE"
679
779
  }
680
- }, I = "user", l = "displayName", M = "SIP_SERVER_URL", O = "SIP_WEB_SOCKET_SERVER_URL", ne = new P.WebSocketInterface(O), v = {
780
+ }, I = "user", h = "displayName", w = "SIP_SERVER_URL", v = "SIP_WEB_SOCKET_SERVER_URL", It = new P.WebSocketInterface(v), S = {
681
781
  userAgent: "Chrome",
682
- sipServerUrl: M,
683
- sipWebSocketServerURL: O
684
- }, ge = {
685
- ...v
686
- }, oe = {
687
- ...v,
782
+ sipServerUrl: w,
783
+ sipWebSocketServerURL: v
784
+ }, vt = {
785
+ ...S
786
+ }, wt = {
787
+ ...S,
688
788
  user: I,
689
- password: h,
789
+ password: c,
690
790
  register: !0
691
- }, we = {
692
- ...oe,
693
- displayName: l
694
- }, Ee = {
695
- ...v,
696
- displayName: l,
791
+ }, Dt = {
792
+ ...wt,
793
+ displayName: h
794
+ }, Lt = {
795
+ ...S,
796
+ displayName: h,
697
797
  register: !1
698
- }, p = {
798
+ }, m = {
699
799
  session_timers: !1,
700
- sockets: [ne],
800
+ sockets: [It],
701
801
  user_agent: "Chrome",
702
- sdp_semantics: "unified-plan",
802
+ sdpSemantics: "unified-plan",
703
803
  register_expires: 300,
704
804
  connection_recovery_max_interval: 6,
705
805
  connection_recovery_min_interval: 2
706
- }, fe = {
707
- ...p,
708
- password: h,
709
- uri: new _("sip", I, M),
806
+ }, yt = {
807
+ ...m,
808
+ password: c,
809
+ uri: new E("sip", I, w),
710
810
  display_name: "",
711
811
  register: !0
712
- }, _e = {
713
- ...p,
714
- password: h,
715
- uri: new _("sip", I, M),
716
- display_name: l,
812
+ }, Ft = {
813
+ ...m,
814
+ password: c,
815
+ uri: new E("sip", I, w),
816
+ display_name: h,
717
817
  register: !0
718
- }, Se = {
719
- ...p,
720
- display_name: l,
818
+ }, bt = {
819
+ ...m,
820
+ display_name: h,
721
821
  register: !1
722
- }, Ie = {
723
- ...p,
822
+ }, Vt = {
823
+ ...m,
724
824
  display_name: "",
725
825
  register: !1
726
- }, ie = "10.10.10.10", Me = [`X-Vinteo-Remote: ${ie}`], ve = () => new W({
826
+ }, St = "10.10.10.10", kt = [`X-Vinteo-Remote: ${St}`], Wt = () => new L({
727
827
  JsSIP: P
728
828
  });
729
829
  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,
830
+ dt as FAILED_CONFERENCE_NUMBER,
831
+ P as JsSIP,
832
+ mt as NAME_INCORRECT,
833
+ c as PASSWORD_CORRECT,
834
+ C as PASSWORD_CORRECT_2,
835
+ w as SIP_SERVER_URL,
836
+ v as SIP_WEB_SOCKET_SERVER_URL,
837
+ wt as dataForConnectionWithAuthorization,
838
+ Dt as dataForConnectionWithAuthorizationWithDisplayName,
839
+ Lt as dataForConnectionWithoutAuthorization,
840
+ vt as dataForConnectionWithoutAuthorizationWithoutDisplayName,
841
+ h as displayName,
842
+ Wt as doMockSipConnector,
843
+ kt as extraHeadersRemoteAddress,
844
+ St as remoteAddress,
845
+ yt as uaConfigurationWithAuthorization,
846
+ Ft as uaConfigurationWithAuthorizationWithDisplayName,
847
+ bt as uaConfigurationWithoutAuthorization,
848
+ Vt as uaConfigurationWithoutAuthorizationWithoutDisplayName,
748
849
  I as user
749
850
  };