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