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