sip-connector 14.1.0 → 14.1.2-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.
- package/dist/SipConnector-BHvTGgmw.js +1352 -0
- package/dist/SipConnector-ChW25Tx9.cjs +1 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +328 -327
- package/dist/index.cjs +1 -1
- package/dist/index.js +280 -270
- package/dist/src/SipConnector.d.ts +235 -0
- package/dist/{SipConnectorFacade → src/SipConnectorFacade}/SipConnectorFacade.d.ts +7 -7
- package/dist/{__fixtures__ → src/__fixtures__}/BaseSession.mock.d.ts +22 -34
- package/dist/{__fixtures__ → src/__fixtures__}/RTCPeerConnectionMock.d.ts +15 -15
- package/dist/{__fixtures__ → src/__fixtures__}/RTCRtpSenderMock.d.ts +2 -2
- package/dist/{__fixtures__ → src/__fixtures__}/RTCSessionMock.d.ts +34 -38
- package/dist/{__fixtures__ → src/__fixtures__}/UA.mock.d.ts +25 -44
- package/dist/{__fixtures__ → src/__fixtures__}/channelsNotify.d.ts +2 -2
- package/dist/{__fixtures__ → src/__fixtures__}/jssip.mock.d.ts +1 -1
- package/dist/{__fixtures__ → src/__fixtures__}/participantNotify.d.ts +2 -2
- package/dist/{tools → src/tools}/index.d.ts +2 -2
- package/dist/{tools → src/tools}/sendDTMFAccumulated.d.ts +2 -2
- package/dist/{types.d.ts → src/types.d.ts} +2 -1
- package/dist/src/videoSendingBalancer/scaleBitrate.d.ts +2 -0
- package/package.json +27 -26
- package/dist/SipConnector-BPIL3yLc.js +0 -1343
- package/dist/SipConnector-BUbfMgHs.cjs +0 -1
- package/dist/SipConnector.d.ts +0 -315
- package/dist/utils.d.ts +0 -4
- package/dist/videoSendingBalancer/scaleBitrate.d.ts +0 -2
- /package/dist/{SipConnectorFacade → src/SipConnectorFacade}/index.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/Registrator.mock.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/Request.mock.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/WebSocketInterface.mock.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/accountNotify.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/channels.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/conferenceParticipantTokenIssuedNotify.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/delayPromise.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/enterRoom.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/index.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/mediaState.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/participantMoveRequests.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/remoteCallerData.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/utils.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/webcastNotify.d.ts +0 -0
- /package/dist/{causes.d.ts → src/causes.d.ts} +0 -0
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/dist/{doMock.d.ts → src/doMock.d.ts} +0 -0
- /package/dist/{eventNames.d.ts → src/eventNames.d.ts} +0 -0
- /package/dist/{getExtraHeadersRemoteAddress.d.ts → src/getExtraHeadersRemoteAddress.d.ts} +0 -0
- /package/dist/{headers.d.ts → src/headers.d.ts} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{logger.d.ts → src/logger.d.ts} +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureDegradationPreference.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureEmptyEncodings.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureEncodings.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureMaxBitrate.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureScaleResolutionDownBy.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/hasChangedRTCRtpSendParameters.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/index.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/resolveHasNeedToUpdateItemEncoding.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/setParametersToSender.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/call.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/connectToServer.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/hasValidUri.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/permissions.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/processRequest.d.ts +0 -0
- /package/dist/{tools → src/tools}/__tests-utils__/parseObject.d.ts +0 -0
- /package/dist/{tools → src/tools}/__tests-utils__/resolveParseArray.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/getLinkError.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/getTypeFromError.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/getValuesFromError.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/index.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/stringifyMessage.d.ts +0 -0
- /package/dist/{tools → src/tools}/generateSimulcastEncodings.d.ts +0 -0
- /package/dist/{tools → src/tools}/getExtraHeaders.d.ts +0 -0
- /package/dist/{tools → src/tools}/getUserAgent.d.ts +0 -0
- /package/dist/{tools → src/tools}/hasPurgatory.d.ts +0 -0
- /package/dist/{tools → src/tools}/prepareMediaStream.d.ts +0 -0
- /package/dist/{tools → src/tools}/resolveUpdateTransceiver.d.ts +0 -0
- /package/dist/{tools → src/tools}/setVideoTrackContentHints.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/index.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStartMainCam.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStartMic.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStopMainCam.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStopMic.d.ts +0 -0
- /package/dist/{utils → src/utils}/errors.d.ts +0 -0
- /package/dist/{utils → src/utils}/findSenderByStream.d.ts +0 -0
- /package/dist/{utils → src/utils}/findVideoSender.d.ts +0 -0
- /package/dist/{utils → src/utils}/findVideoTrack.d.ts +0 -0
- /package/dist/{utils → src/utils}/getCodecFromSender.d.ts +0 -0
- /package/dist/{utils → src/utils}/replaceForbiddenSymbolsWithUnderscore.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/balance.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/getMaxBitrateByWidth.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/getMaxBitrateByWidthAndCodec.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/hasAv1Codec.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/hasIncludesString.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/index.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/processSender.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/scaleBitrateByCodec.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/scaleResolutionAndBitrate.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/setEncodingsToSender.d.ts +0 -0
package/dist/doMock.js
CHANGED
|
@@ -1,73 +1,69 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (o,
|
|
4
|
-
import { o as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { EventEmitter as
|
|
8
|
-
import { IncomingRequest as
|
|
9
|
-
import { createAudioMediaStreamTrackMock as
|
|
10
|
-
import
|
|
11
|
-
import { URI as
|
|
12
|
-
class
|
|
13
|
-
constructor(
|
|
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
14
|
super();
|
|
15
15
|
r(this, "headers");
|
|
16
|
-
this.headers = new Headers(
|
|
16
|
+
this.headers = new Headers(t);
|
|
17
17
|
}
|
|
18
|
-
getHeader(
|
|
19
|
-
return this.headers.get(
|
|
18
|
+
getHeader(t) {
|
|
19
|
+
return this.headers.get(t) ?? "";
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
class Y {
|
|
23
|
+
constructor({
|
|
24
|
+
originator: e = "local",
|
|
25
|
+
eventHandlers: t
|
|
26
|
+
}) {
|
|
25
27
|
r(this, "originator");
|
|
26
|
-
r(this, "
|
|
27
|
-
r(this, "
|
|
28
|
-
r(this, "
|
|
29
|
-
r(this, "
|
|
30
|
-
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);
|
|
31
33
|
}
|
|
32
|
-
|
|
33
|
-
get C() {
|
|
34
|
+
get contact() {
|
|
34
35
|
throw new Error("Method not implemented.");
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
get causes() {
|
|
37
|
+
get direction() {
|
|
38
38
|
throw new Error("Method not implemented.");
|
|
39
39
|
}
|
|
40
|
-
get
|
|
40
|
+
get local_identity() {
|
|
41
41
|
throw new Error("Method not implemented.");
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
get start_time() {
|
|
44
44
|
throw new Error("Method not implemented.");
|
|
45
45
|
}
|
|
46
|
-
get
|
|
46
|
+
get end_time() {
|
|
47
47
|
throw new Error("Method not implemented.");
|
|
48
48
|
}
|
|
49
|
-
get
|
|
50
|
-
return this._connection;
|
|
51
|
-
}
|
|
52
|
-
get contact() {
|
|
49
|
+
get status() {
|
|
53
50
|
throw new Error("Method not implemented.");
|
|
54
51
|
}
|
|
55
|
-
|
|
52
|
+
// @ts-expect-error
|
|
53
|
+
get C() {
|
|
56
54
|
throw new Error("Method not implemented.");
|
|
57
55
|
}
|
|
58
|
-
|
|
56
|
+
// @ts-expect-error
|
|
57
|
+
get causes() {
|
|
59
58
|
throw new Error("Method not implemented.");
|
|
60
59
|
}
|
|
61
|
-
get
|
|
62
|
-
return this._remote_identity;
|
|
63
|
-
}
|
|
64
|
-
get start_time() {
|
|
60
|
+
get id() {
|
|
65
61
|
throw new Error("Method not implemented.");
|
|
66
62
|
}
|
|
67
|
-
get
|
|
63
|
+
get data() {
|
|
68
64
|
throw new Error("Method not implemented.");
|
|
69
65
|
}
|
|
70
|
-
|
|
66
|
+
set data(e) {
|
|
71
67
|
throw new Error("Method not implemented.");
|
|
72
68
|
}
|
|
73
69
|
isInProgress() {
|
|
@@ -79,104 +75,97 @@ class x {
|
|
|
79
75
|
isReadyToReOffer() {
|
|
80
76
|
throw new Error("Method not implemented.");
|
|
81
77
|
}
|
|
82
|
-
answer(
|
|
78
|
+
answer(e) {
|
|
83
79
|
throw new Error("Method not implemented.");
|
|
84
80
|
}
|
|
85
|
-
terminate(
|
|
81
|
+
terminate(e) {
|
|
86
82
|
throw new Error("Method not implemented.");
|
|
87
83
|
}
|
|
88
|
-
async sendInfo(
|
|
84
|
+
async sendInfo(e, t, n) {
|
|
89
85
|
throw new Error("Method not implemented.");
|
|
90
86
|
}
|
|
91
|
-
hold(
|
|
87
|
+
hold(e, t) {
|
|
92
88
|
throw new Error("Method not implemented.");
|
|
93
89
|
}
|
|
94
|
-
unhold(
|
|
90
|
+
unhold(e, t) {
|
|
95
91
|
throw new Error("Method not implemented.");
|
|
96
92
|
}
|
|
97
|
-
async renegotiate(
|
|
93
|
+
async renegotiate(e, t) {
|
|
98
94
|
throw new Error("Method not implemented.");
|
|
99
95
|
}
|
|
100
96
|
isOnHold() {
|
|
101
97
|
throw new Error("Method not implemented.");
|
|
102
98
|
}
|
|
103
|
-
mute(
|
|
99
|
+
mute(e) {
|
|
104
100
|
throw new Error("Method not implemented.");
|
|
105
101
|
}
|
|
106
|
-
unmute(
|
|
102
|
+
unmute(e) {
|
|
107
103
|
throw new Error("Method not implemented.");
|
|
108
104
|
}
|
|
109
105
|
isMuted() {
|
|
110
106
|
throw new Error("Method not implemented.");
|
|
111
107
|
}
|
|
112
|
-
refer(
|
|
108
|
+
refer(e, t) {
|
|
113
109
|
throw new Error("Method not implemented.");
|
|
114
110
|
}
|
|
115
111
|
resetLocalMedia() {
|
|
116
112
|
throw new Error("Method not implemented.");
|
|
117
113
|
}
|
|
118
|
-
async replaceMediaStream(
|
|
114
|
+
async replaceMediaStream(e, t) {
|
|
119
115
|
throw new Error("Method not implemented.");
|
|
120
116
|
}
|
|
121
|
-
addListener(
|
|
117
|
+
addListener(e, t) {
|
|
122
118
|
throw new Error("Method not implemented.");
|
|
123
119
|
}
|
|
124
|
-
once(
|
|
120
|
+
once(e, t) {
|
|
125
121
|
throw new Error("Method not implemented.");
|
|
126
122
|
}
|
|
127
|
-
removeListener(
|
|
123
|
+
removeListener(e, t) {
|
|
128
124
|
throw new Error("Method not implemented.");
|
|
129
125
|
}
|
|
130
|
-
off(
|
|
126
|
+
off(e, t) {
|
|
131
127
|
throw new Error("Method not implemented.");
|
|
132
128
|
}
|
|
133
|
-
removeAllListeners(
|
|
129
|
+
removeAllListeners(e) {
|
|
134
130
|
throw new Error("Method not implemented.");
|
|
135
131
|
}
|
|
136
|
-
setMaxListeners(
|
|
132
|
+
setMaxListeners(e) {
|
|
137
133
|
throw new Error("Method not implemented.");
|
|
138
134
|
}
|
|
139
135
|
getMaxListeners() {
|
|
140
136
|
throw new Error("Method not implemented.");
|
|
141
137
|
}
|
|
142
|
-
listeners(
|
|
138
|
+
listeners(e) {
|
|
143
139
|
throw new Error("Method not implemented.");
|
|
144
140
|
}
|
|
145
|
-
rawListeners(
|
|
141
|
+
rawListeners(e) {
|
|
146
142
|
throw new Error("Method not implemented.");
|
|
147
143
|
}
|
|
148
|
-
emit(
|
|
144
|
+
emit(e, ...t) {
|
|
149
145
|
throw new Error("Method not implemented.");
|
|
150
146
|
}
|
|
151
|
-
listenerCount(
|
|
147
|
+
listenerCount(e) {
|
|
152
148
|
throw new Error("Method not implemented.");
|
|
153
149
|
}
|
|
154
|
-
prependListener(
|
|
150
|
+
prependListener(e, t) {
|
|
155
151
|
throw new Error("Method not implemented.");
|
|
156
152
|
}
|
|
157
|
-
prependOnceListener(
|
|
153
|
+
prependOnceListener(e, t) {
|
|
158
154
|
throw new Error("Method not implemented.");
|
|
159
155
|
}
|
|
160
156
|
eventNames() {
|
|
161
157
|
throw new Error("Method not implemented.");
|
|
162
158
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
*
|
|
166
|
-
* @param {Array} [eventHandlers=[] - ] The event handlers
|
|
167
|
-
*
|
|
168
|
-
* @returns {undefined}
|
|
169
|
-
*/
|
|
170
|
-
initEvents(t = []) {
|
|
171
|
-
Object.entries(t).forEach(([e, n]) => this.on(e, n));
|
|
159
|
+
initEvents(e) {
|
|
160
|
+
Object.entries(e).forEach(([t, n]) => this.on(t, n));
|
|
172
161
|
}
|
|
173
162
|
// @ts-expect-error
|
|
174
163
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
175
|
-
on(
|
|
176
|
-
return this.
|
|
164
|
+
on(e, t) {
|
|
165
|
+
return this.events.on(e, t), this;
|
|
177
166
|
}
|
|
178
|
-
trigger(
|
|
179
|
-
this.
|
|
167
|
+
trigger(e, t) {
|
|
168
|
+
this.events.trigger(e, t);
|
|
180
169
|
}
|
|
181
170
|
/**
|
|
182
171
|
* sendDTMF
|
|
@@ -188,64 +177,66 @@ class x {
|
|
|
188
177
|
sendDTMF() {
|
|
189
178
|
this.trigger("newDTMF", { originator: this.originator });
|
|
190
179
|
}
|
|
191
|
-
async startPresentation(
|
|
192
|
-
return
|
|
180
|
+
async startPresentation(e) {
|
|
181
|
+
return e;
|
|
193
182
|
}
|
|
194
|
-
async updatePresentation(
|
|
195
|
-
return
|
|
183
|
+
async updatePresentation(e) {
|
|
184
|
+
return e;
|
|
196
185
|
}
|
|
197
|
-
async stopPresentation(
|
|
198
|
-
return
|
|
186
|
+
async stopPresentation(e) {
|
|
187
|
+
return e;
|
|
199
188
|
}
|
|
200
189
|
isEstablished() {
|
|
201
190
|
return !0;
|
|
202
191
|
}
|
|
203
192
|
}
|
|
204
|
-
class
|
|
205
|
-
constructor({ track:
|
|
193
|
+
class q {
|
|
194
|
+
constructor({ track: e } = {}) {
|
|
206
195
|
r(this, "dtmf", null);
|
|
207
196
|
r(this, "track", null);
|
|
208
197
|
r(this, "transport", null);
|
|
209
198
|
r(this, "transform", null);
|
|
210
|
-
r(this, "
|
|
199
|
+
r(this, "parameters", {
|
|
211
200
|
encodings: [{}],
|
|
212
201
|
transactionId: "0",
|
|
213
202
|
codecs: [],
|
|
214
203
|
headerExtensions: [],
|
|
215
204
|
rtcp: {}
|
|
216
205
|
});
|
|
217
|
-
r(this, "
|
|
218
|
-
this.track =
|
|
206
|
+
r(this, "parametersGets");
|
|
207
|
+
this.track = e ?? null;
|
|
219
208
|
}
|
|
209
|
+
// eslint-disable-next-line class-methods-use-this
|
|
220
210
|
async getStats() {
|
|
221
211
|
throw new Error("Method not implemented.");
|
|
222
212
|
}
|
|
223
|
-
async replaceTrack(
|
|
224
|
-
this.track =
|
|
213
|
+
async replaceTrack(e) {
|
|
214
|
+
this.track = e ?? null;
|
|
225
215
|
}
|
|
226
|
-
async setParameters(
|
|
227
|
-
if (
|
|
216
|
+
async setParameters(e) {
|
|
217
|
+
if (e !== this.parametersGets)
|
|
228
218
|
throw new Error(
|
|
229
219
|
"Failed to execute 'setParameters' on 'RTCRtpSender': Read-only field modified in setParameters()."
|
|
230
220
|
);
|
|
231
|
-
const { transactionId:
|
|
232
|
-
this.
|
|
233
|
-
...this.
|
|
234
|
-
...
|
|
235
|
-
transactionId: `${Number(
|
|
221
|
+
const { transactionId: t } = this.parameters;
|
|
222
|
+
this.parameters = {
|
|
223
|
+
...this.parameters,
|
|
224
|
+
...e,
|
|
225
|
+
transactionId: `${Number(t) + 1}`
|
|
236
226
|
};
|
|
237
227
|
}
|
|
238
228
|
getParameters() {
|
|
239
|
-
return this.
|
|
229
|
+
return this.parametersGets = { ...this.parameters }, this.parametersGets;
|
|
240
230
|
}
|
|
231
|
+
// eslint-disable-next-line class-methods-use-this
|
|
241
232
|
setStreams() {
|
|
242
233
|
throw new Error("Method not implemented.");
|
|
243
234
|
}
|
|
244
235
|
}
|
|
245
|
-
class
|
|
246
|
-
constructor(
|
|
247
|
-
r(this, "
|
|
248
|
-
r(this, "
|
|
236
|
+
class G {
|
|
237
|
+
constructor(e, t) {
|
|
238
|
+
r(this, "senders", []);
|
|
239
|
+
r(this, "receivers", []);
|
|
249
240
|
r(this, "canTrickleIceCandidates");
|
|
250
241
|
r(this, "connectionState");
|
|
251
242
|
r(this, "currentLocalDescription");
|
|
@@ -258,6 +249,7 @@ class H {
|
|
|
258
249
|
r(this, "onconnectionstatechange");
|
|
259
250
|
r(this, "ondatachannel");
|
|
260
251
|
r(this, "onicecandidate");
|
|
252
|
+
// eslint-disable-next-line unicorn/no-null
|
|
261
253
|
r(this, "onicecandidateerror", null);
|
|
262
254
|
r(this, "oniceconnectionstatechange");
|
|
263
255
|
r(this, "onicegatheringstatechange");
|
|
@@ -268,23 +260,24 @@ class H {
|
|
|
268
260
|
r(this, "pendingLocalDescription");
|
|
269
261
|
r(this, "pendingRemoteDescription");
|
|
270
262
|
r(this, "remoteDescription");
|
|
263
|
+
// eslint-disable-next-line unicorn/no-null
|
|
271
264
|
r(this, "sctp", null);
|
|
272
265
|
r(this, "signalingState");
|
|
273
|
-
r(this, "getReceivers", () => this.
|
|
274
|
-
r(this, "getSenders", () => this.
|
|
275
|
-
r(this, "addTrack", (
|
|
276
|
-
const
|
|
277
|
-
return this.
|
|
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;
|
|
278
271
|
});
|
|
279
|
-
this.
|
|
272
|
+
this.receivers = t.map((n) => ({ track: n }));
|
|
280
273
|
}
|
|
281
274
|
getRemoteStreams() {
|
|
282
275
|
throw new Error("Method not implemented.");
|
|
283
276
|
}
|
|
284
|
-
async addIceCandidate(
|
|
277
|
+
async addIceCandidate(e) {
|
|
285
278
|
throw new Error("Method not implemented.");
|
|
286
279
|
}
|
|
287
|
-
addTransceiver(
|
|
280
|
+
addTransceiver(e, t) {
|
|
288
281
|
throw new Error("Method not implemented.");
|
|
289
282
|
}
|
|
290
283
|
close() {
|
|
@@ -293,13 +286,13 @@ class H {
|
|
|
293
286
|
restartIce() {
|
|
294
287
|
throw new Error("Method not implemented.");
|
|
295
288
|
}
|
|
296
|
-
async createAnswer(
|
|
289
|
+
async createAnswer(e, t) {
|
|
297
290
|
throw new Error("Method not implemented.");
|
|
298
291
|
}
|
|
299
|
-
createDataChannel(
|
|
292
|
+
createDataChannel(e, t) {
|
|
300
293
|
throw new Error("Method not implemented.");
|
|
301
294
|
}
|
|
302
|
-
async createOffer(
|
|
295
|
+
async createOffer(e, t, n) {
|
|
303
296
|
throw new Error("Method not implemented.");
|
|
304
297
|
}
|
|
305
298
|
getConfiguration() {
|
|
@@ -308,43 +301,43 @@ class H {
|
|
|
308
301
|
async getIdentityAssertion() {
|
|
309
302
|
throw new Error("Method not implemented.");
|
|
310
303
|
}
|
|
311
|
-
async getStats(
|
|
304
|
+
async getStats(e) {
|
|
312
305
|
throw new Error("Method not implemented.");
|
|
313
306
|
}
|
|
314
307
|
getTransceivers() {
|
|
315
308
|
throw new Error("Method not implemented.");
|
|
316
309
|
}
|
|
317
|
-
removeTrack(
|
|
310
|
+
removeTrack(e) {
|
|
318
311
|
throw new Error("Method not implemented.");
|
|
319
312
|
}
|
|
320
|
-
setConfiguration(
|
|
313
|
+
setConfiguration(e) {
|
|
321
314
|
throw new Error("Method not implemented.");
|
|
322
315
|
}
|
|
323
|
-
async setLocalDescription(
|
|
316
|
+
async setLocalDescription(e) {
|
|
324
317
|
throw new Error("Method not implemented.");
|
|
325
318
|
}
|
|
326
|
-
async setRemoteDescription(
|
|
319
|
+
async setRemoteDescription(e) {
|
|
327
320
|
throw new Error("Method not implemented.");
|
|
328
321
|
}
|
|
329
|
-
addEventListener(
|
|
322
|
+
addEventListener(e, t, n) {
|
|
330
323
|
throw new Error("Method not implemented.");
|
|
331
324
|
}
|
|
332
|
-
removeEventListener(
|
|
325
|
+
removeEventListener(e, t, n) {
|
|
333
326
|
throw new Error("Method not implemented.");
|
|
334
327
|
}
|
|
335
|
-
dispatchEvent(
|
|
328
|
+
dispatchEvent(e) {
|
|
336
329
|
throw new Error("Method not implemented.");
|
|
337
330
|
}
|
|
338
331
|
}
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
if (!
|
|
332
|
+
function J(o) {
|
|
333
|
+
const e = o.match(/(purgatory)|[\d.]+/g);
|
|
334
|
+
if (!e)
|
|
342
335
|
throw new Error("wrong sip url");
|
|
343
|
-
return
|
|
336
|
+
return e[0];
|
|
344
337
|
}
|
|
345
|
-
const
|
|
338
|
+
const g = 400, $ = "777", j = (o) => o.getVideoTracks().length > 0, a = class a extends Y {
|
|
346
339
|
constructor({
|
|
347
|
-
url:
|
|
340
|
+
url: t = "",
|
|
348
341
|
mediaStream: n,
|
|
349
342
|
eventHandlers: i,
|
|
350
343
|
originator: d
|
|
@@ -352,7 +345,6 @@ const p = 400, Y = "777", q = (o) => o.getVideoTracks().length > 0, a = class a
|
|
|
352
345
|
super({ originator: d, eventHandlers: i });
|
|
353
346
|
r(this, "url");
|
|
354
347
|
r(this, "status_code");
|
|
355
|
-
r(this, "_isEnded", !1);
|
|
356
348
|
/**
|
|
357
349
|
* answer
|
|
358
350
|
*
|
|
@@ -362,52 +354,53 @@ const p = 400, Y = "777", q = (o) => o.getVideoTracks().length > 0, a = class a
|
|
|
362
354
|
|
|
363
355
|
* @returns {undefined}
|
|
364
356
|
*/
|
|
365
|
-
r(this, "answer", jest.fn(({ mediaStream:
|
|
357
|
+
r(this, "answer", jest.fn(({ mediaStream: t }) => {
|
|
366
358
|
if (this.originator !== "remote")
|
|
367
359
|
throw new Error("answer available only for remote sessions");
|
|
368
|
-
this.initPeerconnection(
|
|
360
|
+
this.initPeerconnection(t), setTimeout(() => {
|
|
369
361
|
this.trigger("connecting"), setTimeout(() => {
|
|
370
362
|
this.trigger("accepted");
|
|
371
363
|
}, 100), setTimeout(() => {
|
|
372
364
|
this.trigger("confirmed");
|
|
373
365
|
}, 200);
|
|
374
|
-
},
|
|
366
|
+
}, g);
|
|
375
367
|
}));
|
|
376
|
-
this
|
|
368
|
+
r(this, "isEndedInner", !1);
|
|
369
|
+
this.url = t, this.initPeerconnection(n);
|
|
377
370
|
}
|
|
378
|
-
static setStartPresentationError(
|
|
379
|
-
this.startPresentationError =
|
|
371
|
+
static setStartPresentationError(t, { count: n = Number.POSITIVE_INFINITY } = {}) {
|
|
372
|
+
this.startPresentationError = t, this.countStartPresentationError = n;
|
|
380
373
|
}
|
|
381
374
|
static resetStartPresentationError() {
|
|
382
375
|
this.startPresentationError = void 0, this.countStartPresentationError = Number.POSITIVE_INFINITY, this.countStartsPresentation = 0;
|
|
383
376
|
}
|
|
384
|
-
async startPresentation(
|
|
377
|
+
async startPresentation(t) {
|
|
385
378
|
if (a.countStartsPresentation += 1, a.startPresentationError && a.countStartsPresentation < a.countStartPresentationError)
|
|
386
379
|
throw a.startPresentationError;
|
|
387
|
-
return super.startPresentation(
|
|
380
|
+
return super.startPresentation(t);
|
|
388
381
|
}
|
|
389
|
-
initPeerconnection(
|
|
390
|
-
return
|
|
382
|
+
initPeerconnection(t) {
|
|
383
|
+
return t ? (this.createPeerconnection(t), !0) : !1;
|
|
391
384
|
}
|
|
392
|
-
createPeerconnection(
|
|
393
|
-
const n =
|
|
385
|
+
createPeerconnection(t) {
|
|
386
|
+
const n = H();
|
|
394
387
|
n.id = "mainaudio1";
|
|
395
388
|
const i = [n];
|
|
396
|
-
if (
|
|
397
|
-
const
|
|
398
|
-
|
|
389
|
+
if (j(t)) {
|
|
390
|
+
const c = z();
|
|
391
|
+
c.id = "mainvideo1", i.push(c);
|
|
399
392
|
}
|
|
400
|
-
this.
|
|
393
|
+
this.connection = new G(void 0, i), this.addStream(t), setTimeout(() => {
|
|
401
394
|
this.trigger("peerconnection", { peerconnection: this.connection });
|
|
402
|
-
},
|
|
395
|
+
}, g);
|
|
403
396
|
}
|
|
404
|
-
connect(
|
|
405
|
-
const n =
|
|
397
|
+
connect(t) {
|
|
398
|
+
const n = J(t);
|
|
406
399
|
setTimeout(() => {
|
|
407
|
-
this.url.includes(
|
|
400
|
+
this.url.includes($) ? this.trigger("failed", {
|
|
408
401
|
originator: "remote",
|
|
409
402
|
message: "IncomingResponse",
|
|
410
|
-
cause:
|
|
403
|
+
cause: D
|
|
411
404
|
}) : (this.trigger("connecting"), setTimeout(() => {
|
|
412
405
|
this.trigger("enterRoom", { room: n });
|
|
413
406
|
}, 100), setTimeout(() => {
|
|
@@ -415,103 +408,120 @@ const p = 400, Y = "777", q = (o) => o.getVideoTracks().length > 0, a = class a
|
|
|
415
408
|
}, 200), setTimeout(() => {
|
|
416
409
|
this.trigger("confirmed");
|
|
417
410
|
}, 300));
|
|
418
|
-
},
|
|
411
|
+
}, g);
|
|
419
412
|
}
|
|
420
|
-
terminate({ status_code:
|
|
421
|
-
return this.status_code =
|
|
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;
|
|
422
415
|
}
|
|
423
|
-
async terminateAsync({
|
|
424
|
-
|
|
416
|
+
async terminateAsync({
|
|
417
|
+
status_code: t,
|
|
418
|
+
cause: n
|
|
419
|
+
} = {}) {
|
|
420
|
+
this.terminate({ status_code: t, cause: n });
|
|
425
421
|
}
|
|
426
|
-
terminateRemote({ status_code:
|
|
427
|
-
return this.status_code =
|
|
422
|
+
terminateRemote({ status_code: t } = {}) {
|
|
423
|
+
return this.status_code = t, this.trigger("ended", { status_code: t, originator: "remote" }), this;
|
|
428
424
|
}
|
|
429
|
-
|
|
430
|
-
|
|
425
|
+
addStream(t, n = "getTracks") {
|
|
426
|
+
t[n]().forEach((i) => this.connection.addTrack(i));
|
|
431
427
|
}
|
|
432
|
-
|
|
428
|
+
forEachSenders(t) {
|
|
433
429
|
const n = this.connection.getSenders();
|
|
434
430
|
for (const i of n)
|
|
435
|
-
|
|
431
|
+
t(i);
|
|
436
432
|
return n;
|
|
437
433
|
}
|
|
438
434
|
/* eslint-disable no-param-reassign */
|
|
439
|
-
|
|
440
|
-
this.
|
|
441
|
-
n && n.kind === "audio" && (n.enabled = !
|
|
435
|
+
toggleMuteAudio(t) {
|
|
436
|
+
this.forEachSenders(({ track: n }) => {
|
|
437
|
+
n && n.kind === "audio" && (n.enabled = !t);
|
|
442
438
|
});
|
|
443
439
|
}
|
|
444
440
|
/* eslint-enable no-param-reassign */
|
|
445
441
|
/* eslint-disable no-param-reassign */
|
|
446
|
-
|
|
447
|
-
this.
|
|
448
|
-
n && n.kind === "video" && (n.enabled = !
|
|
442
|
+
toggleMuteVideo(t) {
|
|
443
|
+
this.forEachSenders(({ track: n }) => {
|
|
444
|
+
n && n.kind === "video" && (n.enabled = !t);
|
|
449
445
|
});
|
|
450
446
|
}
|
|
451
|
-
mute(
|
|
452
|
-
|
|
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);
|
|
453
449
|
}
|
|
454
|
-
unmute(
|
|
455
|
-
|
|
450
|
+
unmute(t) {
|
|
451
|
+
t.audio && (this.mutedOptions.audio = !1), t.video && (this.mutedOptions.video = !1), this.trigger("unmuted", t);
|
|
456
452
|
}
|
|
457
453
|
isMuted() {
|
|
458
|
-
return this.
|
|
454
|
+
return this.mutedOptions;
|
|
459
455
|
}
|
|
460
|
-
|
|
461
|
-
|
|
456
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function, class-methods-use-this
|
|
457
|
+
async replaceMediaStream(t) {
|
|
462
458
|
}
|
|
463
|
-
|
|
459
|
+
onmute({ audio: t, video: n }) {
|
|
464
460
|
this.trigger("muted", {
|
|
465
|
-
audio:
|
|
461
|
+
audio: t,
|
|
466
462
|
video: n
|
|
467
463
|
});
|
|
468
464
|
}
|
|
465
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
|
|
469
466
|
async sendInfo() {
|
|
470
467
|
}
|
|
471
468
|
isEnded() {
|
|
472
|
-
return this.
|
|
469
|
+
return this.isEndedInner;
|
|
473
470
|
}
|
|
474
|
-
newInfo(
|
|
475
|
-
this.trigger("newInfo",
|
|
471
|
+
newInfo(t) {
|
|
472
|
+
this.trigger("newInfo", t);
|
|
476
473
|
}
|
|
477
474
|
/* eslint-enable no-param-reassign */
|
|
478
475
|
};
|
|
479
476
|
r(a, "startPresentationError"), r(a, "countStartPresentationError", Number.POSITIVE_INFINITY), r(a, "countStartsPresentation", 0);
|
|
480
477
|
let u = a;
|
|
481
|
-
class
|
|
478
|
+
class B {
|
|
482
479
|
constructor() {
|
|
483
480
|
r(this, "extraHeaders", []);
|
|
484
481
|
}
|
|
485
|
-
setExtraHeaders(
|
|
486
|
-
this.extraHeaders =
|
|
482
|
+
setExtraHeaders(e) {
|
|
483
|
+
this.extraHeaders = e;
|
|
487
484
|
}
|
|
485
|
+
// eslint-disable-next-line class-methods-use-this
|
|
488
486
|
setExtraContactParams() {
|
|
489
487
|
}
|
|
490
488
|
}
|
|
491
|
-
const
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
489
|
+
const h = "PASSWORD_CORRECT", R = "PASSWORD_CORRECT_2", K = "NAME_INCORRECT", m = 400, w = {
|
|
490
|
+
url: "wss://sipServerUrl/webrtc/wss/",
|
|
491
|
+
sip_uri: "sip:sipServerUrl;transport=ws",
|
|
492
|
+
via_transport: "WSS"
|
|
493
|
+
}, C = {
|
|
494
|
+
status_code: 200,
|
|
495
|
+
reason_phrase: "OK"
|
|
496
|
+
}, y = {
|
|
497
|
+
status_code: 401,
|
|
498
|
+
reason_phrase: "Unauthorized"
|
|
499
|
+
}, s = class s {
|
|
500
|
+
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");
|
|
496
512
|
r(this, "session");
|
|
497
|
-
r(this, "
|
|
498
|
-
r(this, "
|
|
513
|
+
r(this, "isRegisteredInner");
|
|
514
|
+
r(this, "isConnectedInner");
|
|
499
515
|
r(this, "configuration");
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return this.session = new u({ url: t, mediaStream: n, eventHandlers: i, originator: "local" }), this.session.connect(t), this.session;
|
|
505
|
-
}));
|
|
506
|
-
this._events = new v(A);
|
|
507
|
-
const [e, n] = t.uri.split(":"), [i, d] = n.split("@"), h = {
|
|
508
|
-
...t,
|
|
509
|
-
uri: new E(e, i, d)
|
|
516
|
+
this.events = new N(L);
|
|
517
|
+
const [t, n] = e.uri.split(":"), [i, d] = n.split("@"), c = {
|
|
518
|
+
...e,
|
|
519
|
+
uri: new _(t, i, d)
|
|
510
520
|
};
|
|
511
|
-
this.configuration =
|
|
521
|
+
this.configuration = c, this.registratorInner = new B();
|
|
512
522
|
}
|
|
513
|
-
static setStartError(
|
|
514
|
-
this.startError =
|
|
523
|
+
static setStartError(e, { count: t = Number.POSITIVE_INFINITY } = {}) {
|
|
524
|
+
this.startError = e, this.countStartError = t;
|
|
515
525
|
}
|
|
516
526
|
static resetStartError() {
|
|
517
527
|
this.startError = void 0, this.countStartError = Number.POSITIVE_INFINITY, this.countStarts = 0;
|
|
@@ -522,9 +532,6 @@ const c = "PASSWORD_CORRECT", T = "PASSWORD_CORRECT_2", j = "NAME_INCORRECT", m
|
|
|
522
532
|
static setNotAvailableTelephony() {
|
|
523
533
|
this.isAvailableTelephony = !1;
|
|
524
534
|
}
|
|
525
|
-
isConnected() {
|
|
526
|
-
return !!this._isConnected;
|
|
527
|
-
}
|
|
528
535
|
/**
|
|
529
536
|
* start
|
|
530
537
|
*
|
|
@@ -543,27 +550,24 @@ const c = "PASSWORD_CORRECT", T = "PASSWORD_CORRECT_2", j = "NAME_INCORRECT", m
|
|
|
543
550
|
* @returns {undefined}
|
|
544
551
|
*/
|
|
545
552
|
stop() {
|
|
546
|
-
this.
|
|
547
|
-
this.trigger("disconnected", { error:
|
|
548
|
-
}, m) : this.trigger("disconnected", { error:
|
|
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 });
|
|
549
556
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
return this._events.on(t, e), this;
|
|
557
|
+
on(e, t) {
|
|
558
|
+
return this.events.on(e, t), this;
|
|
553
559
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
return this._events.once(t, e), this;
|
|
560
|
+
once(e, t) {
|
|
561
|
+
return this.events.once(e, t), this;
|
|
557
562
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
return this._events.off(t, e), this;
|
|
563
|
+
off(e, t) {
|
|
564
|
+
return this.events.off(e, t), this;
|
|
561
565
|
}
|
|
562
566
|
removeAllListeners() {
|
|
563
|
-
return this.
|
|
567
|
+
return this.events.removeEventHandlers(), this;
|
|
564
568
|
}
|
|
565
|
-
trigger(
|
|
566
|
-
this.
|
|
569
|
+
trigger(e, t) {
|
|
570
|
+
this.events.trigger(e, t);
|
|
567
571
|
}
|
|
568
572
|
/**
|
|
569
573
|
* terminateSessions
|
|
@@ -571,18 +575,11 @@ const c = "PASSWORD_CORRECT", T = "PASSWORD_CORRECT_2", j = "NAME_INCORRECT", m
|
|
|
571
575
|
* @returns {undefined}
|
|
572
576
|
*/
|
|
573
577
|
terminateSessions() {
|
|
574
|
-
|
|
578
|
+
var e;
|
|
579
|
+
(e = this.session) == null || e.terminate();
|
|
575
580
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
*
|
|
579
|
-
* @param {string} key - key
|
|
580
|
-
* @param {string} value - value
|
|
581
|
-
*
|
|
582
|
-
* @returns {boolean} true
|
|
583
|
-
*/
|
|
584
|
-
set(t, e) {
|
|
585
|
-
return this.configuration[t] = e, !0;
|
|
581
|
+
set(e, t) {
|
|
582
|
+
return this.configuration[e] = t, !0;
|
|
586
583
|
}
|
|
587
584
|
/**
|
|
588
585
|
* register
|
|
@@ -590,15 +587,15 @@ const c = "PASSWORD_CORRECT", T = "PASSWORD_CORRECT_2", j = "NAME_INCORRECT", m
|
|
|
590
587
|
* @returns {undefined}
|
|
591
588
|
*/
|
|
592
589
|
register() {
|
|
593
|
-
this.
|
|
594
|
-
const { password:
|
|
595
|
-
|
|
596
|
-
this.trigger("registrationFailed", { response:
|
|
597
|
-
}, m)) : !this.
|
|
598
|
-
this.trigger("registered");
|
|
599
|
-
}, m)) :
|
|
600
|
-
this.trigger("registrationFailed", { response:
|
|
601
|
-
}, m)), s.isAvailableTelephony ? (this.trigger("connected"), this.
|
|
590
|
+
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();
|
|
602
599
|
}
|
|
603
600
|
/**
|
|
604
601
|
* unregister
|
|
@@ -606,15 +603,13 @@ const c = "PASSWORD_CORRECT", T = "PASSWORD_CORRECT_2", j = "NAME_INCORRECT", m
|
|
|
606
603
|
* @returns {undefined}
|
|
607
604
|
*/
|
|
608
605
|
unregister() {
|
|
609
|
-
this.
|
|
606
|
+
this.isRegisteredInner = !1, this.isConnectedInner = !1, this.trigger("unregistered", { response: C });
|
|
610
607
|
}
|
|
611
|
-
/**
|
|
612
|
-
* isRegistered
|
|
613
|
-
*
|
|
614
|
-
* @returns {boolean} isRegistered
|
|
615
|
-
*/
|
|
616
608
|
isRegistered() {
|
|
617
|
-
return
|
|
609
|
+
return this.isRegisteredInner === !0;
|
|
610
|
+
}
|
|
611
|
+
isConnected() {
|
|
612
|
+
return this.isConnectedInner === !0;
|
|
618
613
|
}
|
|
619
614
|
/**
|
|
620
615
|
* isStarted
|
|
@@ -622,127 +617,133 @@ const c = "PASSWORD_CORRECT", T = "PASSWORD_CORRECT_2", j = "NAME_INCORRECT", m
|
|
|
622
617
|
* @returns {boolean} isStarted
|
|
623
618
|
*/
|
|
624
619
|
isStarted() {
|
|
625
|
-
return this.configuration
|
|
620
|
+
return this.configuration.register === !0 && this.isRegisteredInner === !0 || this.configuration.register !== !0 && this.isConnectedInner === !0;
|
|
626
621
|
}
|
|
627
|
-
|
|
628
|
-
|
|
622
|
+
newSipEvent(e) {
|
|
623
|
+
this.trigger("sipEvent", e);
|
|
629
624
|
}
|
|
630
|
-
|
|
631
|
-
this.
|
|
625
|
+
registrator() {
|
|
626
|
+
return this.registratorInner;
|
|
632
627
|
}
|
|
633
628
|
};
|
|
634
629
|
r(s, "isAvailableTelephony", !0), r(s, "startError"), r(s, "countStartError", Number.POSITIVE_INFINITY), r(s, "countStarts", 0);
|
|
635
|
-
let
|
|
636
|
-
class
|
|
637
|
-
constructor(
|
|
630
|
+
let E = s;
|
|
631
|
+
class X {
|
|
632
|
+
constructor(e) {
|
|
638
633
|
r(this, "url");
|
|
639
|
-
this.url =
|
|
634
|
+
this.url = e;
|
|
640
635
|
}
|
|
641
636
|
}
|
|
642
|
-
class
|
|
643
|
-
constructor(
|
|
637
|
+
class Q extends x {
|
|
638
|
+
constructor(t, n) {
|
|
644
639
|
super();
|
|
645
640
|
r(this, "contentType");
|
|
646
641
|
r(this, "body");
|
|
647
|
-
this.contentType =
|
|
642
|
+
this.contentType = t, this.body = n;
|
|
648
643
|
}
|
|
649
644
|
}
|
|
650
|
-
const
|
|
651
|
-
const
|
|
652
|
-
originator:
|
|
653
|
-
request:
|
|
654
|
-
info: new
|
|
645
|
+
const f = "remote", Z = (o, e) => {
|
|
646
|
+
const t = new S(e), n = {
|
|
647
|
+
originator: f,
|
|
648
|
+
request: t,
|
|
649
|
+
info: new Q("", "")
|
|
655
650
|
};
|
|
656
651
|
o.newInfo(n);
|
|
657
|
-
},
|
|
658
|
-
const n = { request: new
|
|
652
|
+
}, ee = (o, e) => {
|
|
653
|
+
const n = { event: "sipEvent", request: new S(e) };
|
|
659
654
|
o.newSipEvent(n);
|
|
660
|
-
},
|
|
661
|
-
incomingNumber:
|
|
662
|
-
displayName:
|
|
655
|
+
}, te = (o, {
|
|
656
|
+
incomingNumber: e = "1234",
|
|
657
|
+
displayName: t,
|
|
663
658
|
host: n
|
|
664
659
|
}) => {
|
|
665
|
-
const i = new u({ originator:
|
|
666
|
-
i.
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
|
667
|
+
});
|
|
668
|
+
}, re = (o, e) => {
|
|
669
|
+
e ? o.trigger("failed", e) : o.trigger("failed", o);
|
|
670
|
+
}, P = {
|
|
671
|
+
triggerNewInfo: Z,
|
|
672
|
+
triggerNewSipEvent: ee,
|
|
673
|
+
triggerIncomingSession: te,
|
|
674
|
+
triggerFailIncomingSession: re,
|
|
675
|
+
WebSocketInterface: X,
|
|
676
|
+
UA: E,
|
|
676
677
|
C: {
|
|
677
678
|
INVITE: "INVITE"
|
|
678
679
|
}
|
|
679
|
-
},
|
|
680
|
+
}, I = "user", l = "displayName", M = "SIP_SERVER_URL", O = "SIP_WEB_SOCKET_SERVER_URL", ne = new P.WebSocketInterface(O), v = {
|
|
680
681
|
userAgent: "Chrome",
|
|
681
|
-
sipServerUrl:
|
|
682
|
-
sipWebSocketServerURL:
|
|
683
|
-
},
|
|
684
|
-
...
|
|
685
|
-
},
|
|
686
|
-
...
|
|
687
|
-
user:
|
|
688
|
-
password:
|
|
682
|
+
sipServerUrl: M,
|
|
683
|
+
sipWebSocketServerURL: O
|
|
684
|
+
}, ge = {
|
|
685
|
+
...v
|
|
686
|
+
}, oe = {
|
|
687
|
+
...v,
|
|
688
|
+
user: I,
|
|
689
|
+
password: h,
|
|
689
690
|
register: !0
|
|
690
|
-
},
|
|
691
|
-
...
|
|
691
|
+
}, we = {
|
|
692
|
+
...oe,
|
|
692
693
|
displayName: l
|
|
693
|
-
},
|
|
694
|
-
...
|
|
694
|
+
}, Ee = {
|
|
695
|
+
...v,
|
|
695
696
|
displayName: l,
|
|
696
697
|
register: !1
|
|
697
|
-
},
|
|
698
|
+
}, p = {
|
|
698
699
|
session_timers: !1,
|
|
699
|
-
sockets: [
|
|
700
|
+
sockets: [ne],
|
|
700
701
|
user_agent: "Chrome",
|
|
701
702
|
sdp_semantics: "unified-plan",
|
|
702
703
|
register_expires: 300,
|
|
703
704
|
connection_recovery_max_interval: 6,
|
|
704
705
|
connection_recovery_min_interval: 2
|
|
705
|
-
},
|
|
706
|
-
...
|
|
707
|
-
password:
|
|
708
|
-
uri: new
|
|
706
|
+
}, fe = {
|
|
707
|
+
...p,
|
|
708
|
+
password: h,
|
|
709
|
+
uri: new _("sip", I, M),
|
|
709
710
|
display_name: "",
|
|
710
711
|
register: !0
|
|
711
|
-
},
|
|
712
|
-
...
|
|
713
|
-
password:
|
|
714
|
-
uri: new
|
|
712
|
+
}, _e = {
|
|
713
|
+
...p,
|
|
714
|
+
password: h,
|
|
715
|
+
uri: new _("sip", I, M),
|
|
715
716
|
display_name: l,
|
|
716
717
|
register: !0
|
|
717
|
-
},
|
|
718
|
-
...
|
|
718
|
+
}, Se = {
|
|
719
|
+
...p,
|
|
719
720
|
display_name: l,
|
|
720
721
|
register: !1
|
|
721
|
-
},
|
|
722
|
-
...
|
|
722
|
+
}, Ie = {
|
|
723
|
+
...p,
|
|
723
724
|
display_name: "",
|
|
724
725
|
register: !1
|
|
725
|
-
},
|
|
726
|
-
JsSIP:
|
|
726
|
+
}, ie = "10.10.10.10", Me = [`X-Vinteo-Remote: ${ie}`], ve = () => new W({
|
|
727
|
+
JsSIP: P
|
|
727
728
|
});
|
|
728
729
|
export {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
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,
|
|
739
740
|
l as displayName,
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
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,
|
|
748
|
+
I as user
|
|
748
749
|
};
|