sip-connector 10.0.0 → 10.0.1
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-D9yQTGlS.cjs +1 -0
- package/dist/{SipConnector-P-kMtUcq.js → SipConnector-JHUHYEf2.js} +288 -291
- package/dist/__fixtures__/RTCRtpSenderMock.d.ts +1 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +20 -15
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/setParametersToSender/configureEncodings.d.ts +1 -8
- package/package.json +2 -2
- package/dist/SipConnector-93CcnqPF.cjs +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var At = Object.defineProperty;
|
|
2
2
|
var Rt = (s, e, t) => e in s ? At(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var
|
|
4
|
-
import { CancelableRequest as
|
|
5
|
-
import
|
|
6
|
-
import { repeatedCallsAsync as
|
|
3
|
+
var o = (s, e, t) => Rt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CancelableRequest as g, isCanceledError as It } from "@krivega/cancelable-promise";
|
|
5
|
+
import De from "events-constructor";
|
|
6
|
+
import { repeatedCallsAsync as pe } from "repeated-calls";
|
|
7
7
|
import x from "debug";
|
|
8
|
-
const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code", Pt = "Internal Error", Ot = "Busy", He = "Rejected",
|
|
8
|
+
const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code", Pt = "Internal Error", Ot = "Busy", He = "Rejected", Dt = "Redirected", pt = "Unavailable", Mt = "Not Found", vt = "Address Incomplete", yt = "Incompatible SDP", wt = "Missing SDP", bt = "Authentication Error", We = "Terminated", Ut = "WebRTC Error", ke = "Canceled", Lt = "No Answer", Ht = "Expires", Wt = "No ACK", kt = "Dialog Error", Bt = "User Denied Media Access", qt = "Bad Media Description", Ft = "RTP Timeout", cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9
9
|
__proto__: null,
|
|
10
10
|
ADDRESS_INCOMPLETE: vt,
|
|
11
11
|
AUTHENTICATION_ERROR: bt,
|
|
@@ -22,28 +22,28 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
22
22
|
NOT_FOUND: Mt,
|
|
23
23
|
NO_ACK: Wt,
|
|
24
24
|
NO_ANSWER: Lt,
|
|
25
|
-
REDIRECTED:
|
|
25
|
+
REDIRECTED: Dt,
|
|
26
26
|
REJECTED: He,
|
|
27
27
|
REQUEST_TIMEOUT: Le,
|
|
28
28
|
RTP_TIMEOUT: Ft,
|
|
29
29
|
SIP_FAILURE_CODE: mt,
|
|
30
|
-
UNAVAILABLE:
|
|
30
|
+
UNAVAILABLE: pt,
|
|
31
31
|
USER_DENIED_MEDIA_ACCESS: Bt,
|
|
32
32
|
WEBRTC_ERROR: Ut
|
|
33
|
-
}, Symbol.toStringTag, { value: "Module" })), V = "incomingCall", Y = "declinedIncomingCall", G = "failedIncomingCall", $ = "terminatedIncomingCall", H = "connecting", f = "connected", S = "disconnected", M = "newRTCSession", m = "registered",
|
|
33
|
+
}, Symbol.toStringTag, { value: "Module" })), V = "incomingCall", Y = "declinedIncomingCall", G = "failedIncomingCall", $ = "terminatedIncomingCall", H = "connecting", f = "connected", S = "disconnected", M = "newRTCSession", m = "registered", J = "unregistered", P = "registrationFailed", Be = "newMessage", X = "sipEvent", z = "availableSecondRemoteStream", Q = "notAvailableSecondRemoteStream", j = "mustStopPresentation", v = "shareState", K = "enterRoom", Z = "useLicense", ee = "peerconnection:confirmed", te = "peerconnection:ontrack", y = "channels", ne = "channels:notify", se = "ended:fromserver", ie = "main-cam-control", oe = "admin-stop-main-cam", re = "admin-start-main-cam", ae = "admin-stop-mic", ce = "admin-start-mic", w = "admin-force-sync-media-state", _e = "participant:added-to-list-moderators", Ee = "participant:removed-from-list-moderators", de = "participant:move-request-to-stream", he = "participant:move-request-to-spectators", le = "participation:accepting-word-request", Te = "participation:cancelling-word-request", ue = "webcast:started", Se = "webcast:stopped", Ne = "account:changed", ge = "account:deleted", Ce = "conference:participant-token-issued", O = "ended", qe = "sending", Fe = "reinvite", xe = "replaces", Ve = "refer", Ye = "progress", Ge = "accepted", b = "confirmed", U = "peerconnection", A = "failed", $e = "muted", Je = "unmuted", Ae = "newDTMF", Re = "newInfo", Xe = "hold", ze = "unhold", Qe = "update", je = "sdp", Ke = "icecandidate", Ze = "getusermediafailed", et = "peerconnection:createofferfailed", tt = "peerconnection:createanswerfailed", nt = "peerconnection:setlocaldescriptionfailed", st = "peerconnection:setremotedescriptionfailed", it = "presentation:start", ot = "presentation:started", rt = "presentation:end", Ie = "presentation:ended", L = "presentation:failed", at = "SPECTATOR", ct = 1e6, _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
34
34
|
__proto__: null,
|
|
35
35
|
ACCEPTED: Ge,
|
|
36
36
|
ACCOUNT_CHANGED: Ne,
|
|
37
|
-
ACCOUNT_DELETED:
|
|
37
|
+
ACCOUNT_DELETED: ge,
|
|
38
38
|
ADMIN_FORCE_SYNC_MEDIA_STATE: w,
|
|
39
|
-
ADMIN_START_MAIN_CAM:
|
|
39
|
+
ADMIN_START_MAIN_CAM: re,
|
|
40
40
|
ADMIN_START_MIC: ce,
|
|
41
|
-
ADMIN_STOP_MAIN_CAM:
|
|
41
|
+
ADMIN_STOP_MAIN_CAM: oe,
|
|
42
42
|
ADMIN_STOP_MIC: ae,
|
|
43
43
|
AVAILABLE_SECOND_REMOTE_STREAM_EVENT: z,
|
|
44
44
|
CHANNELS: y,
|
|
45
45
|
CHANNELS_NOTIFY: ne,
|
|
46
|
-
CONFERENCE_PARTICIPANT_TOKEN_ISSUED:
|
|
46
|
+
CONFERENCE_PARTICIPANT_TOKEN_ISSUED: Ce,
|
|
47
47
|
CONFIRMED: b,
|
|
48
48
|
CONNECTED: f,
|
|
49
49
|
CONNECTING: H,
|
|
@@ -55,7 +55,7 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
55
55
|
FAILED: A,
|
|
56
56
|
FAILED_INCOMING_CALL: G,
|
|
57
57
|
GET_USER_MEDIA_FAILED: Ze,
|
|
58
|
-
HOLD:
|
|
58
|
+
HOLD: Xe,
|
|
59
59
|
ICE_CANDIDATE: Ke,
|
|
60
60
|
INCOMING_CALL: V,
|
|
61
61
|
MAIN_CAM_CONTROL: ie,
|
|
@@ -72,7 +72,7 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
72
72
|
PARTICIPANT_MOVE_REQUEST_TO_STREAM: de,
|
|
73
73
|
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: Ee,
|
|
74
74
|
PARTICIPATION_ACCEPTING_WORD_REQUEST: le,
|
|
75
|
-
PARTICIPATION_CANCELLING_WORD_REQUEST:
|
|
75
|
+
PARTICIPATION_CANCELLING_WORD_REQUEST: Te,
|
|
76
76
|
PEER_CONNECTION: U,
|
|
77
77
|
PEER_CONNECTION_CONFIRMED: ee,
|
|
78
78
|
PEER_CONNECTION_CREATE_ANSWER_FAILED: tt,
|
|
@@ -80,11 +80,11 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
80
80
|
PEER_CONNECTION_ONTRACK: te,
|
|
81
81
|
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: nt,
|
|
82
82
|
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: st,
|
|
83
|
-
PRESENTATION_END:
|
|
83
|
+
PRESENTATION_END: rt,
|
|
84
84
|
PRESENTATION_ENDED: Ie,
|
|
85
85
|
PRESENTATION_FAILED: L,
|
|
86
86
|
PRESENTATION_START: it,
|
|
87
|
-
PRESENTATION_STARTED:
|
|
87
|
+
PRESENTATION_STARTED: ot,
|
|
88
88
|
PROGRESS: Ye,
|
|
89
89
|
REFER: Ve,
|
|
90
90
|
REGISTERED: m,
|
|
@@ -94,15 +94,15 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
94
94
|
SDP: je,
|
|
95
95
|
SENDING: qe,
|
|
96
96
|
SHARE_STATE: v,
|
|
97
|
-
SIP_EVENT:
|
|
97
|
+
SIP_EVENT: X,
|
|
98
98
|
SPECTATOR: at,
|
|
99
99
|
TERMINATED_INCOMING_CALL: $,
|
|
100
100
|
UNHOLD: ze,
|
|
101
|
-
UNMUTED:
|
|
102
|
-
UNREGISTERED:
|
|
101
|
+
UNMUTED: Je,
|
|
102
|
+
UNREGISTERED: J,
|
|
103
103
|
UPDATE: Qe,
|
|
104
104
|
USE_LICENSE: Z,
|
|
105
|
-
WEBCAST_STARTED:
|
|
105
|
+
WEBCAST_STARTED: ue,
|
|
106
106
|
WEBCAST_STOPPED: Se
|
|
107
107
|
}, Symbol.toStringTag, { value: "Module" })), _t = [
|
|
108
108
|
V,
|
|
@@ -110,13 +110,13 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
110
110
|
$,
|
|
111
111
|
G,
|
|
112
112
|
le,
|
|
113
|
-
|
|
113
|
+
Te,
|
|
114
114
|
de,
|
|
115
115
|
ne,
|
|
116
|
-
ge,
|
|
117
|
-
Ne,
|
|
118
116
|
Ce,
|
|
119
|
-
|
|
117
|
+
Ne,
|
|
118
|
+
ge,
|
|
119
|
+
ue,
|
|
120
120
|
Se,
|
|
121
121
|
_e,
|
|
122
122
|
Ee
|
|
@@ -126,10 +126,10 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
126
126
|
S,
|
|
127
127
|
M,
|
|
128
128
|
m,
|
|
129
|
-
|
|
129
|
+
J,
|
|
130
130
|
P,
|
|
131
131
|
Be,
|
|
132
|
-
|
|
132
|
+
X
|
|
133
133
|
], Et = [
|
|
134
134
|
z,
|
|
135
135
|
Q,
|
|
@@ -142,8 +142,8 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
142
142
|
y,
|
|
143
143
|
se,
|
|
144
144
|
ie,
|
|
145
|
-
oe,
|
|
146
145
|
re,
|
|
146
|
+
oe,
|
|
147
147
|
ae,
|
|
148
148
|
ce,
|
|
149
149
|
w,
|
|
@@ -161,10 +161,10 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
161
161
|
U,
|
|
162
162
|
A,
|
|
163
163
|
$e,
|
|
164
|
-
|
|
164
|
+
Je,
|
|
165
165
|
Ae,
|
|
166
166
|
Re,
|
|
167
|
-
|
|
167
|
+
Xe,
|
|
168
168
|
ze,
|
|
169
169
|
Qe,
|
|
170
170
|
je,
|
|
@@ -175,8 +175,8 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
175
175
|
nt,
|
|
176
176
|
st,
|
|
177
177
|
it,
|
|
178
|
-
rt,
|
|
179
178
|
ot,
|
|
179
|
+
rt,
|
|
180
180
|
Ie,
|
|
181
181
|
L
|
|
182
182
|
], dt = [...fe, ..._t], ht = [
|
|
@@ -193,43 +193,42 @@ const ft = "Connection Error", Le = "Request Timeout", mt = "SIP Failure Code",
|
|
|
193
193
|
}, Symbol.toStringTag, { value: "Module" })), xt = (s) => {
|
|
194
194
|
const e = [];
|
|
195
195
|
return s && e.push(`X-Vinteo-Remote: ${s}`), e;
|
|
196
|
-
}, Vt = "content-type", Yt = "x-webrtc-enter-room",
|
|
196
|
+
}, Vt = "content-type", Yt = "x-webrtc-enter-room", D = "application/vinteo.webrtc.sharedesktop", Gt = "application/vinteo.webrtc.roomname", $t = "application/vinteo.webrtc.channels", Jt = "application/vinteo.webrtc.mediastate", Xt = "application/vinteo.webrtc.refusal", Me = "application/vinteo.webrtc.maincam", zt = "application/vinteo.webrtc.mic", Qt = "application/vinteo.webrtc.uselic", jt = "X-WEBRTC-USE-LICENSE", Kt = "X-WEBRTC-PARTICIPANT-NAME", ve = "X-WEBRTC-INPUT-CHANNELS", ye = "X-WEBRTC-OUTPUT-CHANNELS", Zt = "X-WEBRTC-MAINCAM", en = "X-WEBRTC-MIC", we = "X-WEBRTC-SYNC", tn = "X-WEBRTC-MAINCAM-RESOLUTION", nn = "X-WEBRTC-MEDIA-STATE", sn = "X-Vinteo-Media-Type", on = "X-Vinteo-MainCam-State", rn = "X-Vinteo-Mic-State", an = "application/vinteo.webrtc.partstate", cn = "X-WEBRTC-PARTSTATE", _n = "application/vinteo.webrtc.notify", En = "X-VINTEO-NOTIFY", R = "x-webrtc-share-state", dn = `${R}: LETMESTARTPRESENTATION`, hn = `${R}: STOPPRESENTATION`, lt = "YOUCANRECEIVECONTENT", Tt = "CONTENTEND", ut = "YOUMUSTSTOPSENDCONTENT", ln = `${R}: ${ut}`, Tn = `${R}: ${lt}`, un = `${R}: ${Tt}`, Sn = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", Nn = `${Sn}: LETMESTARTMAINCAM`, Pe = "sip-connector", k = x(Pe), ds = () => {
|
|
197
197
|
x.enable(Pe);
|
|
198
198
|
}, hs = () => {
|
|
199
199
|
x.enable(`-${Pe}`);
|
|
200
|
-
},
|
|
200
|
+
}, gn = (s, e) => {
|
|
201
201
|
s.getVideoTracks().forEach((n) => {
|
|
202
202
|
"contentHint" in n && n.contentHint !== e && (n.contentHint = e);
|
|
203
203
|
});
|
|
204
|
-
},
|
|
204
|
+
}, p = (s, {
|
|
205
205
|
videoMode: e,
|
|
206
206
|
audioMode: t,
|
|
207
207
|
contentHint: n
|
|
208
208
|
} = {}) => {
|
|
209
209
|
if (!s || e === "recvonly" && t === "recvonly")
|
|
210
210
|
return;
|
|
211
|
-
const i = t === "recvonly" ? [] : s.getAudioTracks(),
|
|
212
|
-
return c.getTracks = () => [...c.getAudioTracks(), ...c.getVideoTracks()], n && n !== "none" &&
|
|
211
|
+
const i = t === "recvonly" ? [] : s.getAudioTracks(), r = e === "recvonly" ? [] : s.getVideoTracks(), a = [...i, ...r], c = new MediaStream(a);
|
|
212
|
+
return c.getTracks = () => [...c.getAudioTracks(), ...c.getVideoTracks()], n && n !== "none" && gn(c, n), c;
|
|
213
213
|
};
|
|
214
|
-
var I = /* @__PURE__ */ ((s) => (s.PAUSE_MAIN_CAM = "PAUSEMAINCAM", s.RESUME_MAIN_CAM = "RESUMEMAINCAM", s.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", s.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", s.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", s))(I || {}), B = /* @__PURE__ */ ((s) => (s.ADMIN_STOP_MIC = "ADMINSTOPMIC", s.ADMIN_START_MIC = "ADMINSTARTMIC", s))(B || {}), q = /* @__PURE__ */ ((s) => (s.ADMIN_SYNC_FORCED = "1", s.ADMIN_SYNC_NOT_FORCED = "0", s))(q || {}),
|
|
214
|
+
var I = /* @__PURE__ */ ((s) => (s.PAUSE_MAIN_CAM = "PAUSEMAINCAM", s.RESUME_MAIN_CAM = "RESUMEMAINCAM", s.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", s.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", s.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", s))(I || {}), B = /* @__PURE__ */ ((s) => (s.ADMIN_STOP_MIC = "ADMINSTOPMIC", s.ADMIN_START_MIC = "ADMINSTARTMIC", s))(B || {}), q = /* @__PURE__ */ ((s) => (s.ADMIN_SYNC_FORCED = "1", s.ADMIN_SYNC_NOT_FORCED = "0", s))(q || {}), Cn = /* @__PURE__ */ ((s) => (s.AUDIO = "AUDIO", s.VIDEO = "VIDEO", s.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", s))(Cn || {});
|
|
215
215
|
function An(s) {
|
|
216
216
|
return (e) => `sip:${e}@${s}`;
|
|
217
217
|
}
|
|
218
218
|
const Rn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, be = (s) => s.trim().replaceAll(" ", "_"), In = Rn(1e5, 99999999), fn = (s) => s.some((t) => {
|
|
219
219
|
const { kind: n } = t;
|
|
220
220
|
return n === "video";
|
|
221
|
-
}), mn = "Error decline with 603", Pn = 1006, On = (s) => typeof s == "object" && s !== null && "code" in s && s.code === Pn,
|
|
222
|
-
|
|
223
|
-
t
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
return { ...s, encodings: t };
|
|
221
|
+
}), mn = "Error decline with 603", Pn = 1006, On = (s) => typeof s == "object" && s !== null && "code" in s && s.code === Pn, Dn = (s) => s.message === mn, pn = (s, e) => s.find((t) => t.track && e.getTracks().includes(t.track)), Mn = (s, e) => (s.degradationPreference = e.degradationPreference, s), vn = (s, e) => {
|
|
222
|
+
s.encodings === void 0 && (s.encodings = []);
|
|
223
|
+
for (let t = s.encodings.length; t < e; t += 1)
|
|
224
|
+
s.encodings.push({});
|
|
225
|
+
return s;
|
|
227
226
|
}, St = (s) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== s, yn = St(), wn = (s, e) => {
|
|
228
227
|
if (yn(s, e))
|
|
229
228
|
return s;
|
|
230
229
|
}, bn = (s, e) => {
|
|
231
230
|
const t = s.maxBitrate, n = wn(e, t);
|
|
232
|
-
return n !== void 0
|
|
231
|
+
return n !== void 0 && (s.maxBitrate = n), s;
|
|
233
232
|
}, Nt = 1, Un = St(
|
|
234
233
|
Nt
|
|
235
234
|
), Ln = (s, e) => {
|
|
@@ -244,39 +243,37 @@ const Rn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, be = (s) =>
|
|
|
244
243
|
e,
|
|
245
244
|
t
|
|
246
245
|
);
|
|
247
|
-
return n !== void 0
|
|
246
|
+
return n !== void 0 && (s.scaleResolutionDownBy = n), s;
|
|
248
247
|
}, Wn = (s, e) => {
|
|
249
|
-
var
|
|
250
|
-
const t = ((
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
});
|
|
255
|
-
return { ...n, encodings: i };
|
|
248
|
+
var n;
|
|
249
|
+
const t = ((n = e.encodings) == null ? void 0 : n.length) ?? 0;
|
|
250
|
+
return vn(s, t), s.encodings.forEach((i, r) => {
|
|
251
|
+
const a = ((e == null ? void 0 : e.encodings) ?? [])[r], c = a == null ? void 0 : a.maxBitrate, E = a == null ? void 0 : a.scaleResolutionDownBy;
|
|
252
|
+
bn(i, c), Hn(i, E);
|
|
253
|
+
}), s;
|
|
256
254
|
}, kn = (s, e) => {
|
|
257
|
-
var t, n, i,
|
|
255
|
+
var t, n, i, r, a, c, E, d;
|
|
258
256
|
if (((t = s.codecs) == null ? void 0 : t.length) !== ((n = e.codecs) == null ? void 0 : n.length))
|
|
259
257
|
return !0;
|
|
260
|
-
for (let
|
|
261
|
-
if (JSON.stringify(s.codecs[
|
|
258
|
+
for (let _ = 0; _ < (((i = s.codecs) == null ? void 0 : i.length) ?? 0); _++)
|
|
259
|
+
if (JSON.stringify(s.codecs[_]) !== JSON.stringify(e.codecs[_]))
|
|
262
260
|
return !0;
|
|
263
|
-
if (((
|
|
261
|
+
if (((r = s.headerExtensions) == null ? void 0 : r.length) !== ((a = e.headerExtensions) == null ? void 0 : a.length))
|
|
264
262
|
return !0;
|
|
265
|
-
for (let
|
|
266
|
-
if (JSON.stringify(s.headerExtensions[
|
|
263
|
+
for (let _ = 0; _ < (((c = s.headerExtensions) == null ? void 0 : c.length) ?? 0); _++)
|
|
264
|
+
if (JSON.stringify(s.headerExtensions[_]) !== JSON.stringify(e.headerExtensions[_]))
|
|
267
265
|
return !0;
|
|
268
|
-
if (((
|
|
266
|
+
if (((E = s.encodings) == null ? void 0 : E.length) !== ((d = e.encodings) == null ? void 0 : d.length))
|
|
269
267
|
return !0;
|
|
270
|
-
for (let
|
|
271
|
-
if (JSON.stringify(s.encodings[
|
|
268
|
+
for (let _ = 0; _ < (s.encodings.length ?? 0); _++)
|
|
269
|
+
if (JSON.stringify(s.encodings[_]) !== JSON.stringify(e.encodings[_]))
|
|
272
270
|
return !0;
|
|
273
271
|
return s.rtcp.cname !== e.rtcp.cname || s.rtcp.reducedSize !== e.rtcp.reducedSize || s.degradationPreference !== e.degradationPreference;
|
|
274
272
|
}, Bn = async (s, e) => {
|
|
275
|
-
const t = s.getParameters();
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return i && await s.setParameters(n), { parameters: n, isChanged: i };
|
|
273
|
+
const t = s.getParameters(), n = JSON.parse(JSON.stringify(t));
|
|
274
|
+
Wn(t, e), Mn(t, e);
|
|
275
|
+
const i = kn(n, t);
|
|
276
|
+
return i && await s.setParameters(t), { parameters: t, isChanged: i };
|
|
280
277
|
}, qn = async (s, e, t) => {
|
|
281
278
|
const { isChanged: n, parameters: i } = await Bn(s, {
|
|
282
279
|
encodings: [
|
|
@@ -288,47 +285,47 @@ const Rn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, be = (s) =>
|
|
|
288
285
|
});
|
|
289
286
|
return n && t && t(i), { isChanged: n, parameters: i };
|
|
290
287
|
}, Fn = async (s, e, t) => {
|
|
291
|
-
const n =
|
|
288
|
+
const n = pn(s, e);
|
|
292
289
|
if (n)
|
|
293
290
|
return qn(n, { maxBitrate: t });
|
|
294
291
|
}, xn = 486, Vn = 487, F = "local", Ue = "remote", Yn = 3, Gn = 1, ls = (s = new Error()) => {
|
|
295
292
|
const { originator: e, cause: t } = s;
|
|
296
293
|
return It(s) ? !0 : typeof t == "string" ? t === Le || t === He || e === F && (t === ke || t === We) : !1;
|
|
297
|
-
},
|
|
298
|
-
class
|
|
294
|
+
}, C = "SipConnector", $n = "channels", Jn = "WebcastStarted", Xn = "WebcastStopped", zn = "accountChanged", Qn = "accountDeleted", jn = "addedToListModerators", Kn = "removedFromListModerators", Zn = "ParticipationRequestAccepted", es = "ParticipationRequestRejected", ts = "ParticipantMovedToWebcast", ns = "ConferenceParticipantTokenIssued";
|
|
295
|
+
class Ts {
|
|
299
296
|
constructor({ JsSIP: e }) {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
297
|
+
o(this, "_isRegisterConfig", !1);
|
|
298
|
+
o(this, "_connectionConfiguration", {});
|
|
299
|
+
o(this, "_remoteStreams", {});
|
|
300
|
+
o(this, "JsSIP");
|
|
301
|
+
o(this, "_sessionEvents");
|
|
302
|
+
o(this, "_uaEvents");
|
|
303
|
+
o(this, "_cancelableConnect");
|
|
304
|
+
o(this, "_cancelableConnectWithRepeatedCalls");
|
|
305
|
+
o(this, "_cancelableSendPresentationWithRepeatedCalls");
|
|
306
|
+
o(this, "_cancelableInitUa");
|
|
307
|
+
o(this, "_cancelableDisconnect");
|
|
308
|
+
o(this, "_cancelableSet");
|
|
309
|
+
o(this, "_cancelableCall");
|
|
310
|
+
o(this, "_cancelableAnswer");
|
|
311
|
+
o(this, "_cancelableSendDTMF");
|
|
312
|
+
o(this, "getSipServerUrl", (e) => e);
|
|
313
|
+
o(this, "promisePendingStartPresentation");
|
|
314
|
+
o(this, "promisePendingStopPresentation");
|
|
315
|
+
o(this, "ua");
|
|
316
|
+
o(this, "session");
|
|
317
|
+
o(this, "incomingSession");
|
|
318
|
+
o(this, "_streamPresentationCurrent");
|
|
319
|
+
o(this, "socket");
|
|
320
|
+
o(this, "connect", async (e, t) => (this._cancelRequests(), this._connectWithDuplicatedCalls(e, t)));
|
|
321
|
+
o(this, "initUa", async (e) => this._cancelableInitUa.request(e));
|
|
322
|
+
o(this, "set", async (e) => this._cancelableSet.request(e));
|
|
323
|
+
o(this, "call", async (e) => this._cancelableCall.request(e));
|
|
324
|
+
o(this, "disconnect", async () => (this._cancelRequests(), this._disconnectWithoutCancelRequests()));
|
|
325
|
+
o(this, "answerToIncomingCall", async (e) => this._cancelableAnswer.request(e));
|
|
326
|
+
o(this, "sendDTMF", async (e) => this._cancelableSendDTMF.request(e));
|
|
327
|
+
o(this, "hangUp", async () => (this._cancelRequests(), this._hangUpWithoutCancelRequests()));
|
|
328
|
+
o(this, "tryRegister", async () => {
|
|
332
329
|
if (!this.isRegisterConfig)
|
|
333
330
|
throw new Error("Config is not registered");
|
|
334
331
|
this._uaEvents.trigger(H, void 0);
|
|
@@ -339,25 +336,25 @@ class us {
|
|
|
339
336
|
}
|
|
340
337
|
return this.register();
|
|
341
338
|
});
|
|
342
|
-
|
|
339
|
+
o(this, "declineToIncomingCall", async ({ statusCode: e = Vn } = {}) => new Promise((t, n) => {
|
|
343
340
|
if (!this.isAvailableIncomingCall) {
|
|
344
341
|
n(new Error("no incomingSession"));
|
|
345
342
|
return;
|
|
346
343
|
}
|
|
347
|
-
const i = this.incomingSession,
|
|
348
|
-
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(Y,
|
|
344
|
+
const i = this.incomingSession, r = this.remoteCallerData;
|
|
345
|
+
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(Y, r), t(i.terminate({ status_code: e }));
|
|
349
346
|
}));
|
|
350
|
-
|
|
351
|
-
|
|
347
|
+
o(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: xn }));
|
|
348
|
+
o(this, "removeIncomingSession", () => {
|
|
352
349
|
delete this.incomingSession;
|
|
353
350
|
});
|
|
354
|
-
|
|
355
|
-
const n = async () => this._cancelableConnect.request(e), i = (
|
|
351
|
+
o(this, "_connectWithDuplicatedCalls", async (e, { callLimit: t = Yn } = {}) => {
|
|
352
|
+
const n = async () => this._cancelableConnect.request(e), i = (r) => {
|
|
356
353
|
var d;
|
|
357
|
-
const c = !!((d = this.ua) != null && d.isConnected()) && this.hasEqualConnectionConfiguration(e),
|
|
358
|
-
return c ||
|
|
354
|
+
const c = !!((d = this.ua) != null && d.isConnected()) && this.hasEqualConnectionConfiguration(e), E = !!r && !On(r);
|
|
355
|
+
return c || E;
|
|
359
356
|
};
|
|
360
|
-
return this._cancelableConnectWithRepeatedCalls =
|
|
357
|
+
return this._cancelableConnectWithRepeatedCalls = pe({
|
|
361
358
|
targetFunction: n,
|
|
362
359
|
isComplete: i,
|
|
363
360
|
callLimit: t,
|
|
@@ -366,13 +363,13 @@ class us {
|
|
|
366
363
|
onAfterCancel: () => {
|
|
367
364
|
this._cancelableConnect.cancelRequest();
|
|
368
365
|
}
|
|
369
|
-
}), this._cancelableConnectWithRepeatedCalls.then((
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
372
|
-
throw
|
|
366
|
+
}), this._cancelableConnectWithRepeatedCalls.then((r) => {
|
|
367
|
+
if (r instanceof this.JsSIP.UA)
|
|
368
|
+
return r;
|
|
369
|
+
throw r;
|
|
373
370
|
});
|
|
374
371
|
});
|
|
375
|
-
|
|
372
|
+
o(this, "handleNewRTCSession", ({ originator: e, session: t }) => {
|
|
376
373
|
if (e === Ue) {
|
|
377
374
|
this.incomingSession = t;
|
|
378
375
|
const n = this.remoteCallerData;
|
|
@@ -381,21 +378,21 @@ class us {
|
|
|
381
378
|
}), this._uaEvents.trigger(V, n);
|
|
382
379
|
}
|
|
383
380
|
});
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
o(this, "_connect", async (e) => this.initUa(e).then(async () => this._start()));
|
|
382
|
+
o(this, "_initUa", async ({
|
|
386
383
|
user: e,
|
|
387
384
|
password: t,
|
|
388
385
|
sipServerUrl: n,
|
|
389
386
|
sipWebSocketServerURL: i,
|
|
390
|
-
remoteAddress:
|
|
387
|
+
remoteAddress: r,
|
|
391
388
|
sessionTimers: a,
|
|
392
389
|
registerExpires: c,
|
|
393
|
-
connectionRecoveryMinInterval:
|
|
390
|
+
connectionRecoveryMinInterval: E,
|
|
394
391
|
connectionRecoveryMaxInterval: d,
|
|
395
|
-
userAgent:
|
|
392
|
+
userAgent: _,
|
|
396
393
|
displayName: h = "",
|
|
397
394
|
register: l = !1,
|
|
398
|
-
extraHeaders:
|
|
395
|
+
extraHeaders: T = []
|
|
399
396
|
}) => {
|
|
400
397
|
if (!n)
|
|
401
398
|
throw new Error("sipServerUrl is required");
|
|
@@ -412,7 +409,7 @@ class us {
|
|
|
412
409
|
user: e,
|
|
413
410
|
password: t
|
|
414
411
|
};
|
|
415
|
-
const { configuration: N, helpers:
|
|
412
|
+
const { configuration: N, helpers: u } = this.createUaConfiguration({
|
|
416
413
|
user: e,
|
|
417
414
|
sipServerUrl: n,
|
|
418
415
|
sipWebSocketServerURL: i,
|
|
@@ -421,16 +418,16 @@ class us {
|
|
|
421
418
|
register: l,
|
|
422
419
|
sessionTimers: a,
|
|
423
420
|
registerExpires: c,
|
|
424
|
-
connectionRecoveryMinInterval:
|
|
421
|
+
connectionRecoveryMinInterval: E,
|
|
425
422
|
connectionRecoveryMaxInterval: d,
|
|
426
|
-
userAgent:
|
|
423
|
+
userAgent: _
|
|
427
424
|
});
|
|
428
|
-
return this.getSipServerUrl =
|
|
429
|
-
const Oe = fe.find((
|
|
425
|
+
return this.getSipServerUrl = u.getSipServerUrl, this.socket = u.socket, this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!l, this.ua = this._createUa({ ...N, remoteAddress: r, extraHeaders: T }), this._uaEvents.eachTriggers((W, gt) => {
|
|
426
|
+
const Oe = fe.find((Ct) => Ct === gt);
|
|
430
427
|
Oe && this.ua && this.ua.on(Oe, W);
|
|
431
428
|
}), this.ua;
|
|
432
429
|
});
|
|
433
|
-
|
|
430
|
+
o(this, "_createUa", ({
|
|
434
431
|
remoteAddress: e,
|
|
435
432
|
extraHeaders: t = [],
|
|
436
433
|
...n
|
|
@@ -438,7 +435,7 @@ class us {
|
|
|
438
435
|
const i = new this.JsSIP.UA(n), a = [...e ? xt(e) : [], ...t];
|
|
439
436
|
return a.length > 0 && i.registrator().setExtraHeaders(a), i;
|
|
440
437
|
});
|
|
441
|
-
|
|
438
|
+
o(this, "_start", async () => new Promise((e, t) => {
|
|
442
439
|
const { ua: n } = this;
|
|
443
440
|
if (!n) {
|
|
444
441
|
t(new Error("this.ua is not initialized"));
|
|
@@ -446,32 +443,32 @@ class us {
|
|
|
446
443
|
}
|
|
447
444
|
const i = () => {
|
|
448
445
|
c(), e(n);
|
|
449
|
-
},
|
|
450
|
-
c(), t(
|
|
446
|
+
}, r = (E) => {
|
|
447
|
+
c(), t(E);
|
|
451
448
|
}, a = () => {
|
|
452
|
-
this.isRegisterConfig ? (this.on(m, i), this.on(P,
|
|
449
|
+
this.isRegisterConfig ? (this.on(m, i), this.on(P, r)) : this.on(f, i), this.on(S, r);
|
|
453
450
|
}, c = () => {
|
|
454
|
-
this.off(m, i), this.off(P,
|
|
451
|
+
this.off(m, i), this.off(P, r), this.off(f, i), this.off(S, r);
|
|
455
452
|
};
|
|
456
453
|
a(), this.on(M, this.handleNewRTCSession), n.start();
|
|
457
454
|
}));
|
|
458
|
-
|
|
459
|
-
const { ua:
|
|
460
|
-
if (!
|
|
455
|
+
o(this, "_set", async ({ displayName: e, password: t }) => new Promise((n, i) => {
|
|
456
|
+
const { ua: r } = this;
|
|
457
|
+
if (!r) {
|
|
461
458
|
i(new Error("this.ua is not initialized"));
|
|
462
459
|
return;
|
|
463
460
|
}
|
|
464
461
|
let a = !1, c = !1;
|
|
465
|
-
e !== void 0 && e !== this._connectionConfiguration.displayName && (a =
|
|
466
|
-
const
|
|
462
|
+
e !== void 0 && e !== this._connectionConfiguration.displayName && (a = r.set("display_name", be(e)), this._connectionConfiguration.displayName = e), t !== void 0 && t !== this._connectionConfiguration.password && (c = r.set("password", t), this._connectionConfiguration.password = t);
|
|
463
|
+
const E = a || c;
|
|
467
464
|
c && this.isRegisterConfig ? this.register().then(() => {
|
|
468
|
-
n(
|
|
465
|
+
n(E);
|
|
469
466
|
}).catch((d) => {
|
|
470
467
|
i(d);
|
|
471
|
-
}) :
|
|
468
|
+
}) : E ? n(E) : i(new Error("nothing changed"));
|
|
472
469
|
}));
|
|
473
|
-
|
|
474
|
-
|
|
470
|
+
o(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
|
|
471
|
+
o(this, "_disconnect", async () => {
|
|
475
472
|
this.off(M, this.handleNewRTCSession);
|
|
476
473
|
const e = new Promise((t) => {
|
|
477
474
|
this.once(S, () => {
|
|
@@ -480,29 +477,29 @@ class us {
|
|
|
480
477
|
});
|
|
481
478
|
return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(S, void 0)) : this._uaEvents.trigger(S, void 0), e;
|
|
482
479
|
});
|
|
483
|
-
|
|
480
|
+
o(this, "_call", async ({
|
|
484
481
|
number: e,
|
|
485
482
|
mediaStream: t,
|
|
486
483
|
extraHeaders: n = [],
|
|
487
484
|
ontrack: i,
|
|
488
|
-
iceServers:
|
|
485
|
+
iceServers: r,
|
|
489
486
|
videoMode: a,
|
|
490
487
|
audioMode: c,
|
|
491
|
-
onAddedSender:
|
|
488
|
+
onAddedSender: E,
|
|
492
489
|
contentHint: d,
|
|
493
|
-
offerToReceiveAudio:
|
|
490
|
+
offerToReceiveAudio: _ = !0,
|
|
494
491
|
offerToReceiveVideo: h = !0
|
|
495
|
-
}) => new Promise((l,
|
|
492
|
+
}) => new Promise((l, T) => {
|
|
496
493
|
const { ua: N } = this;
|
|
497
494
|
if (!N) {
|
|
498
|
-
|
|
495
|
+
T(new Error("this.ua is not initialized"));
|
|
499
496
|
return;
|
|
500
497
|
}
|
|
501
|
-
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: i }).then(l).catch((
|
|
502
|
-
u
|
|
498
|
+
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: i }).then(l).catch((u) => {
|
|
499
|
+
T(u);
|
|
503
500
|
}), this.session = N.call(this.getSipServerUrl(e), {
|
|
504
501
|
extraHeaders: n,
|
|
505
|
-
mediaStream:
|
|
502
|
+
mediaStream: p(t, {
|
|
506
503
|
videoMode: a,
|
|
507
504
|
audioMode: c,
|
|
508
505
|
contentHint: d
|
|
@@ -510,50 +507,50 @@ class us {
|
|
|
510
507
|
eventHandlers: this._sessionEvents.triggers,
|
|
511
508
|
videoMode: a,
|
|
512
509
|
audioMode: c,
|
|
513
|
-
onAddedSender:
|
|
510
|
+
onAddedSender: E,
|
|
514
511
|
pcConfig: {
|
|
515
|
-
iceServers:
|
|
512
|
+
iceServers: r
|
|
516
513
|
},
|
|
517
514
|
rtcOfferConstraints: {
|
|
518
|
-
offerToReceiveAudio:
|
|
515
|
+
offerToReceiveAudio: _,
|
|
519
516
|
offerToReceiveVideo: h
|
|
520
517
|
}
|
|
521
518
|
});
|
|
522
519
|
}));
|
|
523
|
-
|
|
520
|
+
o(this, "_answer", async ({
|
|
524
521
|
mediaStream: e,
|
|
525
522
|
ontrack: t,
|
|
526
523
|
extraHeaders: n = [],
|
|
527
524
|
iceServers: i,
|
|
528
|
-
videoMode:
|
|
525
|
+
videoMode: r,
|
|
529
526
|
audioMode: a,
|
|
530
527
|
onAddedSender: c,
|
|
531
|
-
contentHint:
|
|
532
|
-
}) => new Promise((d,
|
|
528
|
+
contentHint: E
|
|
529
|
+
}) => new Promise((d, _) => {
|
|
533
530
|
if (!this.isAvailableIncomingCall) {
|
|
534
|
-
|
|
531
|
+
_(new Error("no incomingSession"));
|
|
535
532
|
return;
|
|
536
533
|
}
|
|
537
534
|
this.session = this.incomingSession, this.removeIncomingSession();
|
|
538
535
|
const { session: h } = this;
|
|
539
536
|
if (!h) {
|
|
540
|
-
|
|
537
|
+
_(new Error("No session established"));
|
|
541
538
|
return;
|
|
542
539
|
}
|
|
543
|
-
this._sessionEvents.eachTriggers((
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = h.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(d).catch((
|
|
547
|
-
|
|
540
|
+
this._sessionEvents.eachTriggers((T, N) => {
|
|
541
|
+
const u = me.find((W) => W === N);
|
|
542
|
+
u && h.on(u, T);
|
|
543
|
+
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = h.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(d).catch((T) => {
|
|
544
|
+
_(T);
|
|
548
545
|
});
|
|
549
|
-
const l =
|
|
550
|
-
videoMode:
|
|
546
|
+
const l = p(e, {
|
|
547
|
+
videoMode: r,
|
|
551
548
|
audioMode: a,
|
|
552
|
-
contentHint:
|
|
549
|
+
contentHint: E
|
|
553
550
|
});
|
|
554
551
|
h.answer({
|
|
555
552
|
extraHeaders: n,
|
|
556
|
-
videoMode:
|
|
553
|
+
videoMode: r,
|
|
557
554
|
audioMode: a,
|
|
558
555
|
onAddedSender: c,
|
|
559
556
|
mediaStream: l,
|
|
@@ -562,45 +559,45 @@ class us {
|
|
|
562
559
|
}
|
|
563
560
|
});
|
|
564
561
|
}));
|
|
565
|
-
|
|
562
|
+
o(this, "_handleCall", async ({ ontrack: e }) => new Promise((t, n) => {
|
|
566
563
|
const i = () => {
|
|
567
|
-
this.onSession(U,
|
|
568
|
-
},
|
|
569
|
-
this.offSession(U,
|
|
564
|
+
this.onSession(U, _), this.onSession(b, h);
|
|
565
|
+
}, r = () => {
|
|
566
|
+
this.offSession(U, _), this.offSession(b, h);
|
|
570
567
|
}, a = () => {
|
|
571
|
-
this.onSession(A,
|
|
568
|
+
this.onSession(A, E), this.onSession(O, E);
|
|
572
569
|
}, c = () => {
|
|
573
|
-
this.offSession(A,
|
|
574
|
-
},
|
|
575
|
-
|
|
570
|
+
this.offSession(A, E), this.offSession(O, E);
|
|
571
|
+
}, E = (l) => {
|
|
572
|
+
r(), c(), n(l);
|
|
576
573
|
};
|
|
577
574
|
let d;
|
|
578
|
-
const
|
|
579
|
-
d = l, d.ontrack = (
|
|
580
|
-
this._sessionEvents.trigger(te, d), e && e(
|
|
575
|
+
const _ = ({ peerconnection: l }) => {
|
|
576
|
+
d = l, d.ontrack = (T) => {
|
|
577
|
+
this._sessionEvents.trigger(te, d), e && e(T);
|
|
581
578
|
};
|
|
582
579
|
}, h = () => {
|
|
583
|
-
d && this._sessionEvents.trigger(ee, d),
|
|
580
|
+
d && this._sessionEvents.trigger(ee, d), r(), c(), t(d);
|
|
584
581
|
};
|
|
585
582
|
i(), a();
|
|
586
583
|
}));
|
|
587
|
-
|
|
584
|
+
o(this, "_restoreSession", () => {
|
|
588
585
|
this._cancelRequestsAndResetPresentation(), delete this._connectionConfiguration.number, delete this.session, this._remoteStreams = {};
|
|
589
586
|
});
|
|
590
|
-
|
|
587
|
+
o(this, "_sendDTMF", async (e) => new Promise((t, n) => {
|
|
591
588
|
const { session: i } = this;
|
|
592
589
|
if (!i) {
|
|
593
590
|
n(new Error("No session established"));
|
|
594
591
|
return;
|
|
595
592
|
}
|
|
596
|
-
this.onceSession(Ae, ({ originator:
|
|
597
|
-
|
|
593
|
+
this.onceSession(Ae, ({ originator: r }) => {
|
|
594
|
+
r === F && t();
|
|
598
595
|
}), i.sendDTMF(e, {
|
|
599
596
|
duration: 120,
|
|
600
597
|
interToneGap: 600
|
|
601
598
|
});
|
|
602
599
|
}));
|
|
603
|
-
|
|
600
|
+
o(this, "_hangUpWithoutCancelRequests", async () => {
|
|
604
601
|
if (this.ua && this.session) {
|
|
605
602
|
const { session: e } = this;
|
|
606
603
|
if (this._streamPresentationCurrent)
|
|
@@ -613,23 +610,23 @@ class us {
|
|
|
613
610
|
return e.terminateAsync();
|
|
614
611
|
}
|
|
615
612
|
});
|
|
616
|
-
|
|
613
|
+
o(this, "_handleShareState", (e) => {
|
|
617
614
|
switch (e) {
|
|
618
615
|
case lt: {
|
|
619
616
|
this._sessionEvents.trigger(z, void 0);
|
|
620
617
|
break;
|
|
621
618
|
}
|
|
622
|
-
case
|
|
619
|
+
case Tt: {
|
|
623
620
|
this._sessionEvents.trigger(Q, void 0);
|
|
624
621
|
break;
|
|
625
622
|
}
|
|
626
|
-
case
|
|
623
|
+
case ut: {
|
|
627
624
|
this._sessionEvents.trigger(j, void 0);
|
|
628
625
|
break;
|
|
629
626
|
}
|
|
630
627
|
}
|
|
631
628
|
});
|
|
632
|
-
|
|
629
|
+
o(this, "_maybeTriggerChannels", (e) => {
|
|
633
630
|
const t = e.getHeader(ve), n = e.getHeader(ye);
|
|
634
631
|
if (t && n) {
|
|
635
632
|
const i = {
|
|
@@ -639,19 +636,19 @@ class us {
|
|
|
639
636
|
this._sessionEvents.trigger(y, i);
|
|
640
637
|
}
|
|
641
638
|
});
|
|
642
|
-
|
|
639
|
+
o(this, "_handleNotify", (e) => {
|
|
643
640
|
switch (e.cmd) {
|
|
644
641
|
case $n: {
|
|
645
642
|
const t = e;
|
|
646
643
|
this._triggerChannelsNotify(t);
|
|
647
644
|
break;
|
|
648
645
|
}
|
|
649
|
-
case
|
|
646
|
+
case Jn: {
|
|
650
647
|
const t = e;
|
|
651
648
|
this._triggerWebcastStartedNotify(t);
|
|
652
649
|
break;
|
|
653
650
|
}
|
|
654
|
-
case
|
|
651
|
+
case Xn: {
|
|
655
652
|
const t = e;
|
|
656
653
|
this._triggerWebcastStoppedNotify(t);
|
|
657
654
|
break;
|
|
@@ -698,7 +695,7 @@ class us {
|
|
|
698
695
|
k("unknown cmd", e.cmd);
|
|
699
696
|
}
|
|
700
697
|
});
|
|
701
|
-
|
|
698
|
+
o(this, "_triggerRemovedFromListModeratorsNotify", ({
|
|
702
699
|
conference: e
|
|
703
700
|
}) => {
|
|
704
701
|
const t = {
|
|
@@ -709,33 +706,33 @@ class us {
|
|
|
709
706
|
t
|
|
710
707
|
);
|
|
711
708
|
});
|
|
712
|
-
|
|
709
|
+
o(this, "_triggerAddedToListModeratorsNotify", ({ conference: e }) => {
|
|
713
710
|
const t = {
|
|
714
711
|
conference: e
|
|
715
712
|
};
|
|
716
713
|
this._uaEvents.trigger(_e, t);
|
|
717
714
|
});
|
|
718
|
-
|
|
715
|
+
o(this, "_triggerWebcastStartedNotify", ({ body: { conference: e, type: t } }) => {
|
|
719
716
|
const n = {
|
|
720
717
|
conference: e,
|
|
721
718
|
type: t
|
|
722
719
|
};
|
|
723
|
-
this._uaEvents.trigger(
|
|
720
|
+
this._uaEvents.trigger(ue, n);
|
|
724
721
|
});
|
|
725
|
-
|
|
722
|
+
o(this, "_triggerWebcastStoppedNotify", ({ body: { conference: e, type: t } }) => {
|
|
726
723
|
const n = {
|
|
727
724
|
conference: e,
|
|
728
725
|
type: t
|
|
729
726
|
};
|
|
730
727
|
this._uaEvents.trigger(Se, n);
|
|
731
728
|
});
|
|
732
|
-
|
|
729
|
+
o(this, "_triggerAccountChangedNotify", () => {
|
|
733
730
|
this._uaEvents.trigger(Ne, void 0);
|
|
734
731
|
});
|
|
735
|
-
|
|
736
|
-
this._uaEvents.trigger(
|
|
732
|
+
o(this, "_triggerAccountDeletedNotify", () => {
|
|
733
|
+
this._uaEvents.trigger(ge, void 0);
|
|
737
734
|
});
|
|
738
|
-
|
|
735
|
+
o(this, "_triggerConferenceParticipantTokenIssued", ({
|
|
739
736
|
body: { conference: e, participant: t, jwt: n }
|
|
740
737
|
}) => {
|
|
741
738
|
const i = {
|
|
@@ -744,18 +741,18 @@ class us {
|
|
|
744
741
|
jwt: n
|
|
745
742
|
};
|
|
746
743
|
this._uaEvents.trigger(
|
|
747
|
-
|
|
744
|
+
Ce,
|
|
748
745
|
i
|
|
749
746
|
);
|
|
750
747
|
});
|
|
751
|
-
|
|
748
|
+
o(this, "_triggerChannelsNotify", (e) => {
|
|
752
749
|
const t = e.input, n = e.output, i = {
|
|
753
750
|
inputChannels: t,
|
|
754
751
|
outputChannels: n
|
|
755
752
|
};
|
|
756
753
|
this._uaEvents.trigger(ne, i);
|
|
757
754
|
});
|
|
758
|
-
|
|
755
|
+
o(this, "_triggerParticipationAcceptingWordRequest", ({
|
|
759
756
|
body: { conference: e }
|
|
760
757
|
}) => {
|
|
761
758
|
const t = {
|
|
@@ -763,15 +760,15 @@ class us {
|
|
|
763
760
|
};
|
|
764
761
|
this._uaEvents.trigger(le, t);
|
|
765
762
|
});
|
|
766
|
-
|
|
763
|
+
o(this, "_triggerParticipationCancellingWordRequest", ({
|
|
767
764
|
body: { conference: e }
|
|
768
765
|
}) => {
|
|
769
766
|
const t = {
|
|
770
767
|
conference: e
|
|
771
768
|
};
|
|
772
|
-
this._uaEvents.trigger(
|
|
769
|
+
this._uaEvents.trigger(Te, t);
|
|
773
770
|
});
|
|
774
|
-
|
|
771
|
+
o(this, "_triggerParticipantMoveRequestToStream", ({
|
|
775
772
|
body: { conference: e }
|
|
776
773
|
}) => {
|
|
777
774
|
const t = {
|
|
@@ -779,43 +776,43 @@ class us {
|
|
|
779
776
|
};
|
|
780
777
|
this._uaEvents.trigger(de, t);
|
|
781
778
|
});
|
|
782
|
-
|
|
779
|
+
o(this, "_triggerEnterRoom", (e) => {
|
|
783
780
|
const t = e.getHeader(Yt), n = e.getHeader(Kt);
|
|
784
781
|
this._sessionEvents.trigger(K, { room: t, participantName: n });
|
|
785
782
|
});
|
|
786
|
-
|
|
783
|
+
o(this, "_triggerShareState", (e) => {
|
|
787
784
|
const t = e.getHeader(R);
|
|
788
785
|
this._sessionEvents.trigger(v, t);
|
|
789
786
|
});
|
|
790
|
-
|
|
787
|
+
o(this, "_maybeTriggerParticipantMoveRequestToSpectators", (e) => {
|
|
791
788
|
e.getHeader(cn) === at && this._sessionEvents.trigger(he, void 0);
|
|
792
789
|
});
|
|
793
|
-
|
|
790
|
+
o(this, "_triggerMainCamControl", (e) => {
|
|
794
791
|
const t = e.getHeader(Zt), n = e.getHeader(we), i = n === q.ADMIN_SYNC_FORCED;
|
|
795
792
|
if (t === I.ADMIN_START_MAIN_CAM) {
|
|
796
|
-
this._sessionEvents.trigger(
|
|
793
|
+
this._sessionEvents.trigger(re, { isSyncForced: i });
|
|
797
794
|
return;
|
|
798
795
|
}
|
|
799
796
|
if (t === I.ADMIN_STOP_MAIN_CAM) {
|
|
800
|
-
this._sessionEvents.trigger(
|
|
797
|
+
this._sessionEvents.trigger(oe, { isSyncForced: i });
|
|
801
798
|
return;
|
|
802
799
|
}
|
|
803
800
|
(t === I.RESUME_MAIN_CAM || t === I.PAUSE_MAIN_CAM) && n && this._sessionEvents.trigger(w, { isSyncForced: i });
|
|
804
|
-
const
|
|
801
|
+
const r = e.getHeader(tn);
|
|
805
802
|
this._sessionEvents.trigger(ie, {
|
|
806
803
|
mainCam: t,
|
|
807
|
-
resolutionMainCam:
|
|
804
|
+
resolutionMainCam: r
|
|
808
805
|
});
|
|
809
806
|
});
|
|
810
|
-
|
|
807
|
+
o(this, "_triggerMicControl", (e) => {
|
|
811
808
|
const t = e.getHeader(en), i = e.getHeader(we) === q.ADMIN_SYNC_FORCED;
|
|
812
809
|
t === B.ADMIN_START_MIC ? this._sessionEvents.trigger(ce, { isSyncForced: i }) : t === B.ADMIN_STOP_MIC && this._sessionEvents.trigger(ae, { isSyncForced: i });
|
|
813
810
|
});
|
|
814
|
-
|
|
811
|
+
o(this, "_triggerUseLicense", (e) => {
|
|
815
812
|
const t = e.getHeader(jt);
|
|
816
813
|
this._sessionEvents.trigger(Z, t);
|
|
817
814
|
});
|
|
818
|
-
|
|
815
|
+
o(this, "_handleNewInfo", (e) => {
|
|
819
816
|
const { originator: t } = e;
|
|
820
817
|
if (t !== "remote")
|
|
821
818
|
return;
|
|
@@ -830,7 +827,7 @@ class us {
|
|
|
830
827
|
this._maybeHandleNotify(n);
|
|
831
828
|
break;
|
|
832
829
|
}
|
|
833
|
-
case
|
|
830
|
+
case D: {
|
|
834
831
|
this._triggerShareState(n);
|
|
835
832
|
break;
|
|
836
833
|
}
|
|
@@ -852,40 +849,40 @@ class us {
|
|
|
852
849
|
}
|
|
853
850
|
}
|
|
854
851
|
});
|
|
855
|
-
|
|
852
|
+
o(this, "_handleSipEvent", ({ request: e }) => {
|
|
856
853
|
this._maybeHandleNotify(e);
|
|
857
854
|
});
|
|
858
|
-
|
|
855
|
+
o(this, "_maybeHandleNotify", (e) => {
|
|
859
856
|
const t = e.getHeader(En);
|
|
860
857
|
if (t) {
|
|
861
858
|
const n = JSON.parse(t);
|
|
862
859
|
this._handleNotify(n);
|
|
863
860
|
}
|
|
864
861
|
});
|
|
865
|
-
|
|
862
|
+
o(this, "_handleEnded", (e) => {
|
|
866
863
|
const { originator: t } = e;
|
|
867
864
|
t === Ue && this._sessionEvents.trigger(se, e), this._restoreSession();
|
|
868
865
|
});
|
|
869
|
-
this.JsSIP = e, this._sessionEvents = new
|
|
866
|
+
this.JsSIP = e, this._sessionEvents = new De(ht), this._uaEvents = new De(dt), this._cancelableConnect = new g(
|
|
870
867
|
this._connect,
|
|
871
868
|
{
|
|
872
|
-
moduleName:
|
|
869
|
+
moduleName: C,
|
|
873
870
|
afterCancelRequest: () => {
|
|
874
871
|
this._cancelableInitUa.cancelRequest(), this._cancelableDisconnect.cancelRequest();
|
|
875
872
|
}
|
|
876
873
|
}
|
|
877
|
-
), this._cancelableInitUa = new
|
|
874
|
+
), this._cancelableInitUa = new g(
|
|
878
875
|
this._initUa,
|
|
879
|
-
{ moduleName:
|
|
880
|
-
), this._cancelableDisconnect = new
|
|
876
|
+
{ moduleName: C }
|
|
877
|
+
), this._cancelableDisconnect = new g(
|
|
881
878
|
this._disconnect,
|
|
882
|
-
{ moduleName:
|
|
883
|
-
), this._cancelableSet = new
|
|
884
|
-
moduleName:
|
|
885
|
-
}), this._cancelableCall = new
|
|
879
|
+
{ moduleName: C }
|
|
880
|
+
), this._cancelableSet = new g(this._set, {
|
|
881
|
+
moduleName: C
|
|
882
|
+
}), this._cancelableCall = new g(
|
|
886
883
|
this._call,
|
|
887
|
-
{ moduleName:
|
|
888
|
-
), this._cancelableAnswer = new
|
|
884
|
+
{ moduleName: C }
|
|
885
|
+
), this._cancelableAnswer = new g(this._answer, { moduleName: C }), this._cancelableSendDTMF = new g(this._sendDTMF, { moduleName: C }), this.onSession(v, this._handleShareState), this.onSession(Re, this._handleNewInfo), this.on(X, this._handleSipEvent), this.onSession(A, this._handleEnded), this.onSession(O, this._handleEnded);
|
|
889
886
|
}
|
|
890
887
|
async register() {
|
|
891
888
|
return new Promise((e, t) => {
|
|
@@ -894,13 +891,13 @@ class us {
|
|
|
894
891
|
}
|
|
895
892
|
async unregister() {
|
|
896
893
|
return new Promise((e, t) => {
|
|
897
|
-
this.isRegistered && this.ua ? (this.ua.on(
|
|
894
|
+
this.isRegistered && this.ua ? (this.ua.on(J, e), this.ua.unregister()) : t(new Error("ua is not registered"));
|
|
898
895
|
});
|
|
899
896
|
}
|
|
900
897
|
async sendOptions(e, t, n) {
|
|
901
898
|
if (!this.ua)
|
|
902
899
|
throw new Error("is not connected");
|
|
903
|
-
return new Promise((i,
|
|
900
|
+
return new Promise((i, r) => {
|
|
904
901
|
try {
|
|
905
902
|
this.ua.sendOptions(e, t, {
|
|
906
903
|
extraHeaders: n,
|
|
@@ -908,11 +905,11 @@ class us {
|
|
|
908
905
|
succeeded: () => {
|
|
909
906
|
i();
|
|
910
907
|
},
|
|
911
|
-
failed:
|
|
908
|
+
failed: r
|
|
912
909
|
}
|
|
913
910
|
});
|
|
914
911
|
} catch (a) {
|
|
915
|
-
|
|
912
|
+
r(a);
|
|
916
913
|
}
|
|
917
914
|
});
|
|
918
915
|
}
|
|
@@ -928,30 +925,30 @@ class us {
|
|
|
928
925
|
displayName: t,
|
|
929
926
|
sipServerUrl: n,
|
|
930
927
|
sipWebSocketServerURL: i,
|
|
931
|
-
remoteAddress:
|
|
928
|
+
remoteAddress: r,
|
|
932
929
|
extraHeaders: a
|
|
933
930
|
}) {
|
|
934
|
-
return new Promise((c,
|
|
931
|
+
return new Promise((c, E) => {
|
|
935
932
|
const { configuration: d } = this.createUaConfiguration({
|
|
936
933
|
sipWebSocketServerURL: i,
|
|
937
934
|
displayName: t,
|
|
938
935
|
userAgent: e,
|
|
939
936
|
sipServerUrl: n
|
|
940
|
-
}),
|
|
941
|
-
const
|
|
942
|
-
|
|
937
|
+
}), _ = this._createUa({ ...d, remoteAddress: r, extraHeaders: a }), h = () => {
|
|
938
|
+
const T = new Error("Telephony is not available");
|
|
939
|
+
E(T);
|
|
943
940
|
};
|
|
944
|
-
|
|
941
|
+
_.once(S, h);
|
|
945
942
|
const l = () => {
|
|
946
|
-
|
|
943
|
+
_.removeAllListeners(), _.once(S, c), _.stop();
|
|
947
944
|
};
|
|
948
|
-
|
|
945
|
+
_.once(f, l), _.start();
|
|
949
946
|
});
|
|
950
947
|
}
|
|
951
948
|
async replaceMediaStream(e, t) {
|
|
952
949
|
if (!this.session)
|
|
953
950
|
throw new Error("No session established");
|
|
954
|
-
const { contentHint: n } = t || {}, i =
|
|
951
|
+
const { contentHint: n } = t || {}, i = p(e, { contentHint: n });
|
|
955
952
|
return this.session.replaceMediaStream(i, t);
|
|
956
953
|
}
|
|
957
954
|
async askPermissionToEnableCam(e = {}) {
|
|
@@ -963,7 +960,7 @@ class us {
|
|
|
963
960
|
...e,
|
|
964
961
|
extraHeaders: t
|
|
965
962
|
}).catch((n) => {
|
|
966
|
-
if (
|
|
963
|
+
if (Dn(n))
|
|
967
964
|
throw n;
|
|
968
965
|
});
|
|
969
966
|
}
|
|
@@ -978,9 +975,9 @@ class us {
|
|
|
978
975
|
callLimit: Gn
|
|
979
976
|
}
|
|
980
977
|
}) {
|
|
981
|
-
const
|
|
982
|
-
return this._cancelableSendPresentationWithRepeatedCalls =
|
|
983
|
-
targetFunction:
|
|
978
|
+
const r = async () => this._sendPresentation(e, t, n), a = () => !!this._streamPresentationCurrent;
|
|
979
|
+
return this._cancelableSendPresentationWithRepeatedCalls = pe({
|
|
980
|
+
targetFunction: r,
|
|
984
981
|
isComplete: a,
|
|
985
982
|
isRejectAsValid: !0,
|
|
986
983
|
...i
|
|
@@ -996,18 +993,18 @@ class us {
|
|
|
996
993
|
password: t,
|
|
997
994
|
sipWebSocketServerURL: n,
|
|
998
995
|
displayName: i = "",
|
|
999
|
-
sipServerUrl:
|
|
996
|
+
sipServerUrl: r,
|
|
1000
997
|
register: a = !1,
|
|
1001
998
|
sessionTimers: c = !1,
|
|
1002
|
-
registerExpires:
|
|
999
|
+
registerExpires: E = 60 * 5,
|
|
1003
1000
|
// 5 minutes in sec
|
|
1004
1001
|
connectionRecoveryMinInterval: d = 2,
|
|
1005
|
-
connectionRecoveryMaxInterval:
|
|
1002
|
+
connectionRecoveryMaxInterval: _ = 6,
|
|
1006
1003
|
userAgent: h
|
|
1007
1004
|
}) {
|
|
1008
1005
|
if (a && !t)
|
|
1009
1006
|
throw new Error("password is required for authorized connection");
|
|
1010
|
-
const l = a && e ? e.trim() : `${In()}`,
|
|
1007
|
+
const l = a && e ? e.trim() : `${In()}`, T = An(r), N = T(l), u = new this.JsSIP.WebSocketInterface(n);
|
|
1011
1008
|
return {
|
|
1012
1009
|
configuration: {
|
|
1013
1010
|
password: t,
|
|
@@ -1016,30 +1013,30 @@ class us {
|
|
|
1016
1013
|
display_name: be(i),
|
|
1017
1014
|
user_agent: h,
|
|
1018
1015
|
sdp_semantics: "unified-plan",
|
|
1019
|
-
sockets: [
|
|
1016
|
+
sockets: [u],
|
|
1020
1017
|
session_timers: c,
|
|
1021
|
-
register_expires:
|
|
1018
|
+
register_expires: E,
|
|
1022
1019
|
connection_recovery_min_interval: d,
|
|
1023
|
-
connection_recovery_max_interval:
|
|
1020
|
+
connection_recovery_max_interval: _
|
|
1024
1021
|
},
|
|
1025
1022
|
helpers: {
|
|
1026
|
-
socket:
|
|
1027
|
-
getSipServerUrl:
|
|
1023
|
+
socket: u,
|
|
1024
|
+
getSipServerUrl: T
|
|
1028
1025
|
}
|
|
1029
1026
|
};
|
|
1030
1027
|
}
|
|
1031
1028
|
async _sendPresentation(e, t, {
|
|
1032
1029
|
maxBitrate: n = ct,
|
|
1033
1030
|
onAddedSender: i,
|
|
1034
|
-
isNeedReinvite:
|
|
1031
|
+
isNeedReinvite: r = !0,
|
|
1035
1032
|
isP2P: a = !1,
|
|
1036
1033
|
contentHint: c = "detail"
|
|
1037
1034
|
}) {
|
|
1038
|
-
const
|
|
1039
|
-
this._streamPresentationCurrent =
|
|
1040
|
-
const d = a ? [
|
|
1035
|
+
const E = p(t, { contentHint: c });
|
|
1036
|
+
this._streamPresentationCurrent = E;
|
|
1037
|
+
const d = a ? [Tn] : [dn], _ = e.sendInfo(D, void 0, {
|
|
1041
1038
|
extraHeaders: d
|
|
1042
|
-
}).then(async () => e.startPresentation(
|
|
1039
|
+
}).then(async () => e.startPresentation(E, r, i)).then(async () => {
|
|
1043
1040
|
const { connection: h } = this;
|
|
1044
1041
|
if (!h || n === void 0)
|
|
1045
1042
|
return;
|
|
@@ -1048,7 +1045,7 @@ class us {
|
|
|
1048
1045
|
}).then(() => t).catch((h) => {
|
|
1049
1046
|
throw this._removeStreamPresentationCurrent(), this._sessionEvents.trigger(L, h), h;
|
|
1050
1047
|
});
|
|
1051
|
-
return this.promisePendingStartPresentation =
|
|
1048
|
+
return this.promisePendingStartPresentation = _, _.finally(() => {
|
|
1052
1049
|
this.promisePendingStartPresentation = void 0;
|
|
1053
1050
|
});
|
|
1054
1051
|
}
|
|
@@ -1056,29 +1053,29 @@ class us {
|
|
|
1056
1053
|
isNeedReinvite: t,
|
|
1057
1054
|
isP2P: n,
|
|
1058
1055
|
maxBitrate: i,
|
|
1059
|
-
onAddedSender:
|
|
1056
|
+
onAddedSender: r,
|
|
1060
1057
|
contentHint: a
|
|
1061
1058
|
} = {}, c) {
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1059
|
+
const E = this.establishedSession;
|
|
1060
|
+
if (!E)
|
|
1064
1061
|
throw new Error("No session established");
|
|
1065
1062
|
if (this._streamPresentationCurrent)
|
|
1066
1063
|
throw new Error("Presentation is already started");
|
|
1067
|
-
return n && await this.sendMustStopPresentation(
|
|
1068
|
-
session:
|
|
1064
|
+
return n && await this.sendMustStopPresentation(E), this._sendPresentationWithDuplicatedCalls({
|
|
1065
|
+
session: E,
|
|
1069
1066
|
stream: e,
|
|
1070
1067
|
presentationOptions: {
|
|
1071
1068
|
isNeedReinvite: t,
|
|
1072
1069
|
isP2P: n,
|
|
1073
1070
|
maxBitrate: i,
|
|
1074
|
-
onAddedSender:
|
|
1071
|
+
onAddedSender: r,
|
|
1075
1072
|
contentHint: a
|
|
1076
1073
|
},
|
|
1077
1074
|
options: c
|
|
1078
1075
|
});
|
|
1079
1076
|
}
|
|
1080
1077
|
async sendMustStopPresentation(e) {
|
|
1081
|
-
await e.sendInfo(
|
|
1078
|
+
await e.sendInfo(D, void 0, {
|
|
1082
1079
|
extraHeaders: [ln]
|
|
1083
1080
|
});
|
|
1084
1081
|
}
|
|
@@ -1088,12 +1085,12 @@ class us {
|
|
|
1088
1085
|
this._cancelSendPresentationWithRepeatedCalls();
|
|
1089
1086
|
const t = this._streamPresentationCurrent;
|
|
1090
1087
|
let n = this.promisePendingStartPresentation ?? Promise.resolve();
|
|
1091
|
-
const i = e ? [
|
|
1092
|
-
return
|
|
1088
|
+
const i = e ? [un] : [hn], r = this.establishedSession;
|
|
1089
|
+
return r && t && (n = n.then(async () => r.sendInfo(D, void 0, {
|
|
1093
1090
|
extraHeaders: i
|
|
1094
|
-
})).then(async () =>
|
|
1091
|
+
})).then(async () => r.stopPresentation(t)).catch((a) => {
|
|
1095
1092
|
throw this._sessionEvents.trigger(L, a), a;
|
|
1096
|
-
})), !
|
|
1093
|
+
})), !r && t && this._sessionEvents.trigger(Ie, t), this.promisePendingStopPresentation = n, n.finally(() => {
|
|
1097
1094
|
this._resetPresentation();
|
|
1098
1095
|
});
|
|
1099
1096
|
}
|
|
@@ -1101,7 +1098,7 @@ class us {
|
|
|
1101
1098
|
isP2P: t,
|
|
1102
1099
|
maxBitrate: n,
|
|
1103
1100
|
onAddedSender: i,
|
|
1104
|
-
contentHint:
|
|
1101
|
+
contentHint: r
|
|
1105
1102
|
} = {}) {
|
|
1106
1103
|
const a = this.establishedSession;
|
|
1107
1104
|
if (!a)
|
|
@@ -1112,7 +1109,7 @@ class us {
|
|
|
1112
1109
|
isP2P: t,
|
|
1113
1110
|
maxBitrate: n,
|
|
1114
1111
|
onAddedSender: i,
|
|
1115
|
-
contentHint:
|
|
1112
|
+
contentHint: r,
|
|
1116
1113
|
isNeedReinvite: !1
|
|
1117
1114
|
});
|
|
1118
1115
|
}
|
|
@@ -1172,11 +1169,11 @@ class us {
|
|
|
1172
1169
|
return (t = this.session) == null ? void 0 : t.connection;
|
|
1173
1170
|
}
|
|
1174
1171
|
get remoteCallerData() {
|
|
1175
|
-
var e, t, n, i,
|
|
1172
|
+
var e, t, n, i, r, a;
|
|
1176
1173
|
return {
|
|
1177
1174
|
displayName: (t = (e = this.incomingSession) == null ? void 0 : e.remote_identity) == null ? void 0 : t.display_name,
|
|
1178
1175
|
host: (i = (n = this.incomingSession) == null ? void 0 : n.remote_identity) == null ? void 0 : i.uri.host,
|
|
1179
|
-
incomingNumber: (a = (
|
|
1176
|
+
incomingNumber: (a = (r = this.incomingSession) == null ? void 0 : r.remote_identity) == null ? void 0 : a.uri.user,
|
|
1180
1177
|
session: this.incomingSession
|
|
1181
1178
|
};
|
|
1182
1179
|
}
|
|
@@ -1212,11 +1209,11 @@ class us {
|
|
|
1212
1209
|
return e.forEach((n, i) => {
|
|
1213
1210
|
if (n.kind === "audio")
|
|
1214
1211
|
return;
|
|
1215
|
-
const
|
|
1212
|
+
const r = n, a = e[i - 1];
|
|
1216
1213
|
let c;
|
|
1217
1214
|
a && a.kind === "audio" && (c = a);
|
|
1218
|
-
const
|
|
1219
|
-
t.push(
|
|
1215
|
+
const E = this._generateStream(r, c);
|
|
1216
|
+
t.push(E);
|
|
1220
1217
|
}), t;
|
|
1221
1218
|
}
|
|
1222
1219
|
_generateAudioStreams(e) {
|
|
@@ -1248,21 +1245,21 @@ class us {
|
|
|
1248
1245
|
async sendChannels({ inputChannels: e, outputChannels: t }) {
|
|
1249
1246
|
if (!this.session)
|
|
1250
1247
|
throw new Error("No session established");
|
|
1251
|
-
const n = `${ve}: ${e}`, i = `${ye}: ${t}`,
|
|
1248
|
+
const n = `${ve}: ${e}`, i = `${ye}: ${t}`, r = [
|
|
1252
1249
|
n,
|
|
1253
1250
|
i
|
|
1254
1251
|
];
|
|
1255
|
-
return this.session.sendInfo($t, void 0, { extraHeaders:
|
|
1252
|
+
return this.session.sendInfo($t, void 0, { extraHeaders: r });
|
|
1256
1253
|
}
|
|
1257
1254
|
async sendMediaState({ cam: e, mic: t }, n = {}) {
|
|
1258
1255
|
if (!this.session)
|
|
1259
1256
|
throw new Error("No session established");
|
|
1260
|
-
const i = `${nn}: currentstate`,
|
|
1257
|
+
const i = `${nn}: currentstate`, r = `${on}: ${Number(e)}`, a = `${rn}: ${Number(t)}`, c = [
|
|
1261
1258
|
i,
|
|
1262
|
-
|
|
1259
|
+
r,
|
|
1263
1260
|
a
|
|
1264
1261
|
];
|
|
1265
|
-
return this.session.sendInfo(
|
|
1262
|
+
return this.session.sendInfo(Jt, void 0, {
|
|
1266
1263
|
noTerminateWhenError: !0,
|
|
1267
1264
|
...n,
|
|
1268
1265
|
extraHeaders: c
|
|
@@ -1272,7 +1269,7 @@ class us {
|
|
|
1272
1269
|
if (!this.session)
|
|
1273
1270
|
throw new Error("No session established");
|
|
1274
1271
|
const c = [`${sn}: ${e === "mic" ? 0 : 1}`];
|
|
1275
|
-
return this.session.sendInfo(
|
|
1272
|
+
return this.session.sendInfo(Xt, void 0, {
|
|
1276
1273
|
noTerminateWhenError: !0,
|
|
1277
1274
|
...t,
|
|
1278
1275
|
extraHeaders: c
|
|
@@ -1294,7 +1291,7 @@ export {
|
|
|
1294
1291
|
I as E,
|
|
1295
1292
|
Mt as N,
|
|
1296
1293
|
He as R,
|
|
1297
|
-
|
|
1294
|
+
Ts as S,
|
|
1298
1295
|
dt as U,
|
|
1299
1296
|
qn as a,
|
|
1300
1297
|
_s as b,
|
|
@@ -1305,7 +1302,7 @@ export {
|
|
|
1305
1302
|
B as g,
|
|
1306
1303
|
ls as h,
|
|
1307
1304
|
q as i,
|
|
1308
|
-
|
|
1305
|
+
Cn as j,
|
|
1309
1306
|
ht as k,
|
|
1310
1307
|
k as l,
|
|
1311
1308
|
Bn as s
|