sip-connector 14.1.0-alpha.1 → 14.1.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SipConnector-CK3GgjXE.js → @SipConnector-C-ThpS1P.js} +459 -680
- package/dist/@SipConnector-Xh6_JpUI.cjs +1 -0
- package/dist/ApiManager/@ApiManager.d.ts +2 -2
- package/dist/ApiManager/constants.d.ts +1 -1
- package/dist/ApiManager/eventNames.d.ts +1 -1
- package/dist/ApiManager/index.d.ts +1 -0
- package/dist/CallManager/causes.d.ts +2 -1
- package/dist/CallManager/eventNames.d.ts +1 -1
- package/dist/CallManager/index.d.ts +2 -0
- package/dist/CallManager/types.d.ts +1 -1
- package/dist/ConnectionManager/@ConnectionManager.d.ts +3 -2
- package/dist/ConnectionManager/ConnectionFlow.d.ts +3 -2
- package/dist/ConnectionManager/ConnectionStateMachine.d.ts +1 -1
- package/dist/ConnectionManager/RegistrationManager.d.ts +1 -1
- package/dist/ConnectionManager/eventNames.d.ts +1 -1
- package/dist/IncomingCallManager/@IncomingCallManager.d.ts +3 -2
- package/dist/PresentationManager/@PresentationManager.d.ts +2 -2
- package/dist/PresentationManager/eventNames.d.ts +1 -1
- package/dist/PresentationManager/index.d.ts +1 -0
- package/dist/{SipConnector.d.ts → SipConnector/@SipConnector.d.ts} +19 -30
- package/dist/SipConnector/eventNames.d.ts +4 -0
- package/dist/SipConnector/index.d.ts +2 -0
- package/dist/SipConnectorFacade/SipConnectorFacade.d.ts +10 -28
- package/dist/__fixtures__/BaseSession.mock.d.ts +5 -5
- package/dist/__fixtures__/RTCPeerConnectionMock.d.ts +6 -0
- package/dist/__fixtures__/RTCSessionMock.d.ts +5 -5
- package/dist/__fixtures__/UA.mock.d.ts +1 -1
- package/dist/{eventNames.d.ts → __fixtures__/eventNames.d.ts} +1 -1
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.d.ts +1 -1
- package/dist/doMock.js +219 -137
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +512 -546
- package/dist/tools/__fixtures__/processRequest.d.ts +1 -1
- package/dist/tools/error/getLinkError.d.ts +1 -1
- package/dist/tools/error/getTypeFromError.d.ts +1 -1
- package/dist/tools/error/getValuesFromError.d.ts +1 -1
- package/dist/tools/prepareMediaStream.d.ts +1 -1
- package/dist/tools/setVideoTrackContentHints.d.ts +1 -1
- package/dist/tools/syncMediaState/index.d.ts +1 -1
- package/dist/tools/syncMediaState/resolveOnStartMainCam.d.ts +1 -1
- package/dist/tools/syncMediaState/resolveOnStartMic.d.ts +1 -1
- package/dist/tools/syncMediaState/resolveOnStopMainCam.d.ts +1 -1
- package/dist/tools/syncMediaState/resolveOnStopMic.d.ts +1 -1
- package/dist/types.d.ts +0 -46
- package/dist/videoSendingBalancer/balance.d.ts +1 -1
- package/dist/videoSendingBalancer/index.d.ts +1 -1
- package/dist/videoSendingBalancer/processSender.d.ts +1 -1
- package/package.json +3 -3
- package/dist/SipConnector-CwI8aFEA.cjs +0 -1
- package/dist/causes.d.ts +0 -23
- package/dist/headers.d.ts +0 -37
- /package/dist/{getExtraHeadersRemoteAddress.d.ts → ConnectionManager/getExtraHeadersRemoteAddress.d.ts} +0 -0
- /package/dist/{constants.d.ts → __fixtures__/constants.d.ts} +0 -0
package/dist/doMock.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { EventEmitter as
|
|
5
|
-
import { IncomingRequest as
|
|
6
|
-
import { NameAddrHeader as
|
|
7
|
-
import { createAudioMediaStreamTrackMock as
|
|
8
|
-
import
|
|
9
|
-
class
|
|
1
|
+
import { O as D, S as L } from "./@SipConnector-C-ThpS1P.js";
|
|
2
|
+
import y from "@krivega/jssip/lib/NameAddrHeader";
|
|
3
|
+
import F from "@krivega/jssip/lib/URI";
|
|
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
10
|
headers;
|
|
11
11
|
constructor(e) {
|
|
12
12
|
super(), this.headers = new Headers(e);
|
|
@@ -15,7 +15,89 @@ class w extends W {
|
|
|
15
15
|
return this.headers.get(e) ?? "";
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
|
|
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 {
|
|
19
101
|
originator;
|
|
20
102
|
connection;
|
|
21
103
|
events;
|
|
@@ -26,7 +108,7 @@ class H {
|
|
|
26
108
|
eventHandlers: t,
|
|
27
109
|
remoteIdentity: r
|
|
28
110
|
}) {
|
|
29
|
-
this.originator = e, this.events = new
|
|
111
|
+
this.originator = e, this.events = new _(p), this.initEvents(t), this.remote_identity = r;
|
|
30
112
|
}
|
|
31
113
|
get contact() {
|
|
32
114
|
throw new Error("Method not implemented.");
|
|
@@ -154,12 +236,14 @@ class H {
|
|
|
154
236
|
throw new Error("Method not implemented.");
|
|
155
237
|
}
|
|
156
238
|
initEvents(e) {
|
|
157
|
-
e && Object.entries(e).forEach(([t, r]) =>
|
|
239
|
+
e && Object.entries(e).forEach(([t, r]) => {
|
|
240
|
+
this.on(t, r);
|
|
241
|
+
});
|
|
158
242
|
}
|
|
159
243
|
// @ts-expect-error
|
|
160
244
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
161
245
|
on(e, t) {
|
|
162
|
-
return this.events.on(e, t), this;
|
|
246
|
+
return p.includes(e) && this.events.on(e, t), this;
|
|
163
247
|
}
|
|
164
248
|
trigger(e, t) {
|
|
165
249
|
this.events.trigger(e, t);
|
|
@@ -184,7 +268,7 @@ class H {
|
|
|
184
268
|
return !0;
|
|
185
269
|
}
|
|
186
270
|
}
|
|
187
|
-
class
|
|
271
|
+
class st {
|
|
188
272
|
dtmf = null;
|
|
189
273
|
track = null;
|
|
190
274
|
transport = null;
|
|
@@ -227,7 +311,8 @@ class j {
|
|
|
227
311
|
throw new Error("Method not implemented.");
|
|
228
312
|
}
|
|
229
313
|
}
|
|
230
|
-
|
|
314
|
+
const it = ["track"];
|
|
315
|
+
class at {
|
|
231
316
|
senders = [];
|
|
232
317
|
receivers = [];
|
|
233
318
|
canTrickleIceCandidates;
|
|
@@ -256,8 +341,9 @@ class z {
|
|
|
256
341
|
// eslint-disable-next-line unicorn/no-null
|
|
257
342
|
sctp = null;
|
|
258
343
|
signalingState;
|
|
344
|
+
events;
|
|
259
345
|
constructor(e, t) {
|
|
260
|
-
this.receivers = t.map((r) => ({ track: r }));
|
|
346
|
+
this.events = new _(it), this.receivers = t.map((r) => ({ track: r }));
|
|
261
347
|
}
|
|
262
348
|
getRemoteStreams() {
|
|
263
349
|
throw new Error("Method not implemented.");
|
|
@@ -308,10 +394,10 @@ class z {
|
|
|
308
394
|
throw new Error("Method not implemented.");
|
|
309
395
|
}
|
|
310
396
|
addEventListener(e, t, r) {
|
|
311
|
-
|
|
397
|
+
this.events.on(e, t);
|
|
312
398
|
}
|
|
313
399
|
removeEventListener(e, t, r) {
|
|
314
|
-
|
|
400
|
+
this.events.off(e, t);
|
|
315
401
|
}
|
|
316
402
|
dispatchEvent(e) {
|
|
317
403
|
throw new Error("Method not implemented.");
|
|
@@ -319,18 +405,18 @@ class z {
|
|
|
319
405
|
getReceivers = () => this.receivers;
|
|
320
406
|
getSenders = () => this.senders;
|
|
321
407
|
addTrack = (e) => {
|
|
322
|
-
const t = new
|
|
323
|
-
return this.senders.push(t), t;
|
|
408
|
+
const t = new st({ track: e });
|
|
409
|
+
return this.senders.push(t), this.events.trigger("track", { track: e }), t;
|
|
324
410
|
};
|
|
325
411
|
}
|
|
326
|
-
function
|
|
412
|
+
function ct(n) {
|
|
327
413
|
const e = n.match(/(purgatory)|[\d.]+/g);
|
|
328
414
|
if (!e)
|
|
329
415
|
throw new Error("wrong sip url");
|
|
330
416
|
return e[0];
|
|
331
417
|
}
|
|
332
|
-
const
|
|
333
|
-
class i extends
|
|
418
|
+
const f = 400, dt = "777", Et = (n) => n.getVideoTracks().length > 0;
|
|
419
|
+
class i extends ot {
|
|
334
420
|
static presentationError;
|
|
335
421
|
static startPresentationError;
|
|
336
422
|
static countStartPresentationError = Number.POSITIVE_INFINITY;
|
|
@@ -355,23 +441,21 @@ class i extends H {
|
|
|
355
441
|
}, 100), setTimeout(() => {
|
|
356
442
|
this.trigger("confirmed");
|
|
357
443
|
}, 200);
|
|
358
|
-
},
|
|
444
|
+
}, f);
|
|
359
445
|
});
|
|
360
446
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
361
447
|
replaceMediaStream = jest.fn(async (e) => {
|
|
362
448
|
});
|
|
363
449
|
isEndedInner = !1;
|
|
364
450
|
constructor({
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
remoteIdentity: a = new V(
|
|
370
|
-
new h("sip", "caller1", "test1.com", 5060),
|
|
451
|
+
eventHandlers: e,
|
|
452
|
+
originator: t,
|
|
453
|
+
remoteIdentity: r = new k(
|
|
454
|
+
new E("sip", "caller1", "test1.com", 5060),
|
|
371
455
|
"Test Caller 1"
|
|
372
456
|
)
|
|
373
457
|
}) {
|
|
374
|
-
super({ originator:
|
|
458
|
+
super({ originator: t, eventHandlers: e, remoteIdentity: r });
|
|
375
459
|
}
|
|
376
460
|
static setPresentationError(e) {
|
|
377
461
|
this.presentationError = e;
|
|
@@ -401,30 +485,28 @@ class i extends H {
|
|
|
401
485
|
return e ? (this.createPeerconnection(e), !0) : !1;
|
|
402
486
|
}
|
|
403
487
|
createPeerconnection(e) {
|
|
404
|
-
const t =
|
|
488
|
+
const t = W();
|
|
405
489
|
t.id = "mainaudio1";
|
|
406
490
|
const r = [t];
|
|
407
|
-
if (
|
|
408
|
-
const a =
|
|
491
|
+
if (Et(e)) {
|
|
492
|
+
const a = U();
|
|
409
493
|
a.id = "mainvideo1", r.push(a);
|
|
410
494
|
}
|
|
411
|
-
this.connection = new
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
setTimeout(() => {
|
|
418
|
-
this.url.includes(q) ? 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", {
|
|
419
501
|
originator: "remote",
|
|
420
502
|
message: "IncomingResponse",
|
|
421
|
-
cause:
|
|
503
|
+
cause: "Rejected"
|
|
422
504
|
}) : (this.trigger("connecting"), setTimeout(() => {
|
|
423
505
|
this.newInfo({
|
|
424
|
-
originator:
|
|
506
|
+
originator: D.REMOTE,
|
|
425
507
|
// @ts-expect-error
|
|
426
508
|
request: {
|
|
427
|
-
getHeader: (
|
|
509
|
+
getHeader: (s) => s === "content-type" ? "application/vinteo.webrtc.roomname" : s === "x-webrtc-enter-room" ? r : s === "x-webrtc-participant-name" ? "Test Caller 1" : ""
|
|
428
510
|
}
|
|
429
511
|
});
|
|
430
512
|
}, 100), setTimeout(() => {
|
|
@@ -432,7 +514,7 @@ class i extends H {
|
|
|
432
514
|
}, 200), setTimeout(() => {
|
|
433
515
|
this.trigger("confirmed");
|
|
434
516
|
}, 300));
|
|
435
|
-
},
|
|
517
|
+
}, f), this.connection;
|
|
436
518
|
}
|
|
437
519
|
terminate({ status_code: e, cause: t } = {}) {
|
|
438
520
|
return this.status_code = e, this.trigger("ended", { status_code: e, cause: t, originator: "local" }), this.isEndedInner = !1, this;
|
|
@@ -494,7 +576,7 @@ class i extends H {
|
|
|
494
576
|
}
|
|
495
577
|
/* eslint-enable no-param-reassign */
|
|
496
578
|
}
|
|
497
|
-
class
|
|
579
|
+
class ht {
|
|
498
580
|
extraHeaders = [];
|
|
499
581
|
setExtraHeaders(e) {
|
|
500
582
|
this.extraHeaders = e;
|
|
@@ -503,14 +585,14 @@ class $ {
|
|
|
503
585
|
setExtraContactParams() {
|
|
504
586
|
}
|
|
505
587
|
}
|
|
506
|
-
const
|
|
588
|
+
const c = "PASSWORD_CORRECT", C = "PASSWORD_CORRECT_2", mt = "NAME_INCORRECT", d = 400, u = {
|
|
507
589
|
url: "wss://sipServerUrl/webrtc/wss/",
|
|
508
590
|
sip_uri: "sip:sipServerUrl;transport=ws",
|
|
509
591
|
via_transport: "WSS"
|
|
510
|
-
},
|
|
592
|
+
}, R = {
|
|
511
593
|
status_code: 200,
|
|
512
594
|
reason_phrase: "OK"
|
|
513
|
-
},
|
|
595
|
+
}, M = {
|
|
514
596
|
status_code: 401,
|
|
515
597
|
reason_phrase: "Unauthorized"
|
|
516
598
|
};
|
|
@@ -525,7 +607,7 @@ class o {
|
|
|
525
607
|
call = jest.fn(
|
|
526
608
|
(e, t) => {
|
|
527
609
|
const { mediaStream: r, eventHandlers: s } = t;
|
|
528
|
-
return this.session = new i({
|
|
610
|
+
return this.session = new i({ eventHandlers: s, originator: "local" }), this.session.connect(e, { mediaStream: r }), this.session;
|
|
529
611
|
}
|
|
530
612
|
);
|
|
531
613
|
sendOptions = jest.fn(
|
|
@@ -548,8 +630,8 @@ class o {
|
|
|
548
630
|
*/
|
|
549
631
|
stop = jest.fn(() => {
|
|
550
632
|
this.startedTimeout && clearTimeout(this.startedTimeout), this.stopedTimeout && clearTimeout(this.stopedTimeout), this.unregister(), this.isStarted() ? this.stopedTimeout = setTimeout(() => {
|
|
551
|
-
this.trigger("disconnected", { error: !0, socket:
|
|
552
|
-
},
|
|
633
|
+
this.trigger("disconnected", { error: !0, socket: u });
|
|
634
|
+
}, d) : this.trigger("disconnected", { error: !0, socket: u });
|
|
553
635
|
});
|
|
554
636
|
removeAllListeners = jest.fn(() => (this.events.removeEventHandlers(), this));
|
|
555
637
|
once = jest.fn((e, t) => (this.events.once(e, t), this));
|
|
@@ -560,12 +642,12 @@ class o {
|
|
|
560
642
|
isConnectedInner;
|
|
561
643
|
configuration;
|
|
562
644
|
constructor(e) {
|
|
563
|
-
this.events = new
|
|
645
|
+
this.events = new _(O);
|
|
564
646
|
const [t, r] = e.uri.split(":"), [s, a] = r.split("@"), l = {
|
|
565
647
|
...e,
|
|
566
|
-
uri: new
|
|
648
|
+
uri: new E(t, s, a)
|
|
567
649
|
};
|
|
568
|
-
this.configuration = l, this.registratorInner = new
|
|
650
|
+
this.configuration = l, this.registratorInner = new ht();
|
|
569
651
|
}
|
|
570
652
|
static setStartError(e, { count: t = Number.POSITIVE_INFINITY } = {}) {
|
|
571
653
|
o.startError = e, o.countStartError = t;
|
|
@@ -610,13 +692,13 @@ class o {
|
|
|
610
692
|
register() {
|
|
611
693
|
this.startedTimeout && clearTimeout(this.startedTimeout);
|
|
612
694
|
const { password: e, register: t, uri: r } = this.configuration;
|
|
613
|
-
t === !0 && r.user.includes(
|
|
614
|
-
this.trigger("registrationFailed", { response:
|
|
615
|
-
},
|
|
616
|
-
this.trigger("registered", { response:
|
|
617
|
-
},
|
|
618
|
-
this.trigger("registrationFailed", { response:
|
|
619
|
-
},
|
|
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();
|
|
620
702
|
}
|
|
621
703
|
/**
|
|
622
704
|
* unregister
|
|
@@ -624,7 +706,7 @@ class o {
|
|
|
624
706
|
* @returns {undefined}
|
|
625
707
|
*/
|
|
626
708
|
unregister() {
|
|
627
|
-
this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response:
|
|
709
|
+
this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response: R });
|
|
628
710
|
}
|
|
629
711
|
isRegistered() {
|
|
630
712
|
return this.isRegisteredInner === !0;
|
|
@@ -647,122 +729,122 @@ class o {
|
|
|
647
729
|
return this.registratorInner;
|
|
648
730
|
}
|
|
649
731
|
}
|
|
650
|
-
class
|
|
732
|
+
class lt {
|
|
651
733
|
url;
|
|
652
734
|
constructor(e) {
|
|
653
735
|
this.url = e;
|
|
654
736
|
}
|
|
655
737
|
}
|
|
656
|
-
class
|
|
738
|
+
class ut extends b {
|
|
657
739
|
contentType;
|
|
658
740
|
body;
|
|
659
741
|
constructor(e, t) {
|
|
660
742
|
super(), this.contentType = e, this.body = t;
|
|
661
743
|
}
|
|
662
744
|
}
|
|
663
|
-
const
|
|
664
|
-
const t = new
|
|
665
|
-
originator:
|
|
745
|
+
const g = "remote", pt = (n, e) => {
|
|
746
|
+
const t = new T(e), r = {
|
|
747
|
+
originator: g,
|
|
666
748
|
request: t,
|
|
667
|
-
info: new
|
|
749
|
+
info: new ut("", "")
|
|
668
750
|
};
|
|
669
751
|
n.newInfo(r);
|
|
670
|
-
},
|
|
671
|
-
const r = { event: "sipEvent", request: new
|
|
752
|
+
}, gt = (n, e) => {
|
|
753
|
+
const r = { event: "sipEvent", request: new T(e) };
|
|
672
754
|
n.newSipEvent(r);
|
|
673
|
-
},
|
|
755
|
+
}, _t = (n, {
|
|
674
756
|
incomingNumber: e = "1234",
|
|
675
757
|
displayName: t,
|
|
676
758
|
host: r
|
|
677
759
|
}) => {
|
|
678
|
-
const s = new i({ originator:
|
|
679
|
-
s.remote_identity = new
|
|
680
|
-
const l = new
|
|
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([]);
|
|
681
763
|
n.trigger("newRTCSession", {
|
|
682
|
-
originator:
|
|
764
|
+
originator: g,
|
|
683
765
|
session: s,
|
|
684
766
|
request: l
|
|
685
767
|
});
|
|
686
|
-
},
|
|
768
|
+
}, Tt = (n, e) => {
|
|
687
769
|
e ? n.trigger("failed", e) : n.trigger("failed", n);
|
|
688
|
-
},
|
|
689
|
-
triggerNewInfo:
|
|
690
|
-
triggerNewSipEvent:
|
|
691
|
-
triggerIncomingSession:
|
|
692
|
-
triggerFailIncomingSession:
|
|
693
|
-
WebSocketInterface:
|
|
770
|
+
}, P = {
|
|
771
|
+
triggerNewInfo: pt,
|
|
772
|
+
triggerNewSipEvent: gt,
|
|
773
|
+
triggerIncomingSession: _t,
|
|
774
|
+
triggerFailIncomingSession: Tt,
|
|
775
|
+
WebSocketInterface: lt,
|
|
694
776
|
UA: o,
|
|
695
777
|
C: {
|
|
696
778
|
INVITE: "INVITE"
|
|
697
779
|
}
|
|
698
|
-
},
|
|
780
|
+
}, I = "user", h = "displayName", w = "SIP_SERVER_URL", v = "SIP_WEB_SOCKET_SERVER_URL", It = new P.WebSocketInterface(v), S = {
|
|
699
781
|
userAgent: "Chrome",
|
|
700
|
-
sipServerUrl:
|
|
701
|
-
sipWebSocketServerURL:
|
|
702
|
-
},
|
|
703
|
-
...
|
|
704
|
-
},
|
|
705
|
-
...
|
|
706
|
-
user:
|
|
707
|
-
password:
|
|
782
|
+
sipServerUrl: w,
|
|
783
|
+
sipWebSocketServerURL: v
|
|
784
|
+
}, vt = {
|
|
785
|
+
...S
|
|
786
|
+
}, wt = {
|
|
787
|
+
...S,
|
|
788
|
+
user: I,
|
|
789
|
+
password: c,
|
|
708
790
|
register: !0
|
|
709
|
-
},
|
|
710
|
-
...
|
|
711
|
-
displayName:
|
|
712
|
-
},
|
|
713
|
-
...
|
|
714
|
-
displayName:
|
|
791
|
+
}, Dt = {
|
|
792
|
+
...wt,
|
|
793
|
+
displayName: h
|
|
794
|
+
}, Lt = {
|
|
795
|
+
...S,
|
|
796
|
+
displayName: h,
|
|
715
797
|
register: !1
|
|
716
|
-
},
|
|
798
|
+
}, m = {
|
|
717
799
|
session_timers: !1,
|
|
718
|
-
sockets: [
|
|
800
|
+
sockets: [It],
|
|
719
801
|
user_agent: "Chrome",
|
|
720
802
|
sdpSemantics: "unified-plan",
|
|
721
803
|
register_expires: 300,
|
|
722
804
|
connection_recovery_max_interval: 6,
|
|
723
805
|
connection_recovery_min_interval: 2
|
|
724
|
-
},
|
|
725
|
-
...
|
|
726
|
-
password:
|
|
727
|
-
uri: new
|
|
806
|
+
}, yt = {
|
|
807
|
+
...m,
|
|
808
|
+
password: c,
|
|
809
|
+
uri: new E("sip", I, w),
|
|
728
810
|
display_name: "",
|
|
729
811
|
register: !0
|
|
730
|
-
},
|
|
731
|
-
...
|
|
732
|
-
password:
|
|
733
|
-
uri: new
|
|
734
|
-
display_name:
|
|
812
|
+
}, Ft = {
|
|
813
|
+
...m,
|
|
814
|
+
password: c,
|
|
815
|
+
uri: new E("sip", I, w),
|
|
816
|
+
display_name: h,
|
|
735
817
|
register: !0
|
|
736
|
-
},
|
|
737
|
-
...
|
|
738
|
-
display_name:
|
|
818
|
+
}, bt = {
|
|
819
|
+
...m,
|
|
820
|
+
display_name: h,
|
|
739
821
|
register: !1
|
|
740
|
-
},
|
|
741
|
-
...
|
|
822
|
+
}, Vt = {
|
|
823
|
+
...m,
|
|
742
824
|
display_name: "",
|
|
743
825
|
register: !1
|
|
744
|
-
},
|
|
745
|
-
JsSIP:
|
|
826
|
+
}, St = "10.10.10.10", kt = [`X-Vinteo-Remote: ${St}`], Wt = () => new L({
|
|
827
|
+
JsSIP: P
|
|
746
828
|
});
|
|
747
829
|
export {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
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,
|
|
849
|
+
I as user
|
|
768
850
|
};
|