sip-connector 7.0.10 → 8.0.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-3gRIidBJ.js → SipConnector-4t573yj1.js} +389 -394
- package/dist/SipConnector-zjYmhYTk.cjs +1 -0
- package/dist/SipConnector.d.ts +1 -3
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +33 -35
- package/dist/tools/__fixtures__/connectToServer.d.ts +0 -10
- package/dist/tools/connectToServer.d.ts +0 -1
- package/dist/types.d.ts +0 -1
- package/package.json +1 -1
- package/dist/SipConnector-3pnvrFP5.cjs +0 -1
|
@@ -1,168 +1,169 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (r, e, t) =>
|
|
4
|
-
import { CancelableRequest as
|
|
1
|
+
var gt = Object.defineProperty;
|
|
2
|
+
var At = (r, e, t) => e in r ? gt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var i = (r, e, t) => At(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CancelableRequest as C, isCanceledError as Rt } from "@krivega/cancelable-promise";
|
|
5
5
|
import Oe from "events-constructor";
|
|
6
|
-
import { repeatedCallsAsync as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
6
|
+
import { repeatedCallsAsync as It } from "repeated-calls";
|
|
7
|
+
import F from "debug";
|
|
8
|
+
const mt = "Connection Error", be = "Request Timeout", ft = "SIP Failure Code", Ot = "Internal Error", pt = "Busy", Ue = "Rejected", Pt = "Redirected", Dt = "Unavailable", Mt = "Not Found", vt = "Address Incomplete", yt = "Incompatible SDP", wt = "Missing SDP", bt = "Authentication Error", Le = "Terminated", Ut = "WebRTC Error", He = "Canceled", Lt = "No Answer", Ht = "Expires", Wt = "No ACK", kt = "Dialog Error", qt = "User Denied Media Access", Ft = "Bad Media Description", Bt = "RTP Timeout", Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9
9
|
__proto__: null,
|
|
10
|
-
ADDRESS_INCOMPLETE:
|
|
11
|
-
AUTHENTICATION_ERROR:
|
|
12
|
-
BAD_MEDIA_DESCRIPTION:
|
|
13
|
-
BUSY:
|
|
14
|
-
BYE:
|
|
15
|
-
CANCELED:
|
|
16
|
-
CONNECTION_ERROR:
|
|
17
|
-
DIALOG_ERROR:
|
|
18
|
-
EXPIRES:
|
|
19
|
-
INCOMPATIBLE_SDP:
|
|
10
|
+
ADDRESS_INCOMPLETE: vt,
|
|
11
|
+
AUTHENTICATION_ERROR: bt,
|
|
12
|
+
BAD_MEDIA_DESCRIPTION: Ft,
|
|
13
|
+
BUSY: pt,
|
|
14
|
+
BYE: Le,
|
|
15
|
+
CANCELED: He,
|
|
16
|
+
CONNECTION_ERROR: mt,
|
|
17
|
+
DIALOG_ERROR: kt,
|
|
18
|
+
EXPIRES: Ht,
|
|
19
|
+
INCOMPATIBLE_SDP: yt,
|
|
20
20
|
INTERNAL_ERROR: Ot,
|
|
21
|
-
MISSING_SDP:
|
|
22
|
-
NOT_FOUND:
|
|
23
|
-
NO_ACK:
|
|
24
|
-
NO_ANSWER:
|
|
25
|
-
REDIRECTED:
|
|
26
|
-
REJECTED:
|
|
27
|
-
REQUEST_TIMEOUT:
|
|
28
|
-
RTP_TIMEOUT:
|
|
29
|
-
SIP_FAILURE_CODE:
|
|
30
|
-
UNAVAILABLE:
|
|
31
|
-
USER_DENIED_MEDIA_ACCESS:
|
|
32
|
-
WEBRTC_ERROR:
|
|
33
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
21
|
+
MISSING_SDP: wt,
|
|
22
|
+
NOT_FOUND: Mt,
|
|
23
|
+
NO_ACK: Wt,
|
|
24
|
+
NO_ANSWER: Lt,
|
|
25
|
+
REDIRECTED: Pt,
|
|
26
|
+
REJECTED: Ue,
|
|
27
|
+
REQUEST_TIMEOUT: be,
|
|
28
|
+
RTP_TIMEOUT: Bt,
|
|
29
|
+
SIP_FAILURE_CODE: ft,
|
|
30
|
+
UNAVAILABLE: Dt,
|
|
31
|
+
USER_DENIED_MEDIA_ACCESS: qt,
|
|
32
|
+
WEBRTC_ERROR: Ut
|
|
33
|
+
}, Symbol.toStringTag, { value: "Module" })), B = "incomingCall", V = "declinedIncomingCall", Y = "failedIncomingCall", x = "terminatedIncomingCall", L = "connecting", m = "connected", S = "disconnected", D = "newRTCSession", f = "registered", G = "unregistered", O = "registrationFailed", We = "newMessage", $ = "sipEvent", X = "availableSecondRemoteStream", J = "notAvailableSecondRemoteStream", z = "mustStopPresentation", M = "shareState", Q = "enterRoom", j = "useLicense", K = "peerconnection:confirmed", Z = "peerconnection:ontrack", v = "channels", ee = "channels:notify", te = "ended:fromserver", se = "main-cam-control", ne = "admin-stop-main-cam", ie = "admin-start-main-cam", re = "admin-stop-mic", oe = "admin-start-mic", y = "admin-force-sync-media-state", ae = "participant:added-to-list-moderators", ce = "participant:removed-from-list-moderators", Ee = "participant:move-request-to-stream", _e = "participant:move-request-to-spectators", he = "participation:accepting-word-request", de = "participation:cancelling-word-request", le = "webcast:started", Te = "webcast:stopped", Se = "account:changed", ue = "account:deleted", Ne = "conference:participant-token-issued", p = "ended", ke = "sending", qe = "reinvite", Fe = "replaces", Be = "refer", Ve = "progress", Ye = "accepted", w = "confirmed", b = "peerconnection", A = "failed", xe = "muted", Ge = "unmuted", Ce = "newDTMF", ge = "newInfo", $e = "hold", Xe = "unhold", Je = "update", ze = "sdp", Qe = "icecandidate", je = "getusermediafailed", Ke = "peerconnection:createofferfailed", Ze = "peerconnection:createanswerfailed", et = "peerconnection:setlocaldescriptionfailed", tt = "peerconnection:setremotedescriptionfailed", st = "presentation:start", nt = "presentation:started", it = "presentation:end", Ae = "presentation:ended", U = "presentation:failed", rt = "SPECTATOR", en = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
34
34
|
__proto__: null,
|
|
35
|
-
ACCEPTED:
|
|
36
|
-
ACCOUNT_CHANGED:
|
|
37
|
-
ACCOUNT_DELETED:
|
|
38
|
-
ADMIN_FORCE_SYNC_MEDIA_STATE:
|
|
39
|
-
ADMIN_START_MAIN_CAM:
|
|
40
|
-
ADMIN_START_MIC:
|
|
41
|
-
ADMIN_STOP_MAIN_CAM:
|
|
42
|
-
ADMIN_STOP_MIC:
|
|
43
|
-
AVAILABLE_SECOND_REMOTE_STREAM_EVENT:
|
|
44
|
-
CHANNELS:
|
|
45
|
-
CHANNELS_NOTIFY:
|
|
46
|
-
CONFERENCE_PARTICIPANT_TOKEN_ISSUED:
|
|
47
|
-
CONFIRMED:
|
|
48
|
-
CONNECTED:
|
|
49
|
-
CONNECTING:
|
|
50
|
-
DECLINED_INCOMING_CALL:
|
|
51
|
-
DISCONNECTED:
|
|
52
|
-
ENDED:
|
|
53
|
-
ENDED_FROM_SERVER:
|
|
54
|
-
ENTER_ROOM:
|
|
55
|
-
FAILED:
|
|
56
|
-
FAILED_INCOMING_CALL:
|
|
57
|
-
GET_USER_MEDIA_FAILED:
|
|
58
|
-
HOLD:
|
|
59
|
-
ICE_CANDIDATE:
|
|
60
|
-
INCOMING_CALL:
|
|
61
|
-
MAIN_CAM_CONTROL:
|
|
62
|
-
MUST_STOP_PRESENTATION_EVENT:
|
|
63
|
-
MUTED:
|
|
64
|
-
NEW_DTMF:
|
|
65
|
-
NEW_INFO:
|
|
66
|
-
NEW_MESSAGE:
|
|
67
|
-
NEW_RTC_SESSION:
|
|
68
|
-
NOT_AVAILABLE_SECOND_REMOTE_STREAM_EVENT:
|
|
69
|
-
PARTICIPANT_ADDED_TO_LIST_MODERATORS:
|
|
70
|
-
PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS:
|
|
71
|
-
PARTICIPANT_MOVE_REQUEST_TO_STREAM:
|
|
72
|
-
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS:
|
|
73
|
-
PARTICIPATION_ACCEPTING_WORD_REQUEST:
|
|
74
|
-
PARTICIPATION_CANCELLING_WORD_REQUEST:
|
|
75
|
-
PEER_CONNECTION:
|
|
76
|
-
PEER_CONNECTION_CONFIRMED:
|
|
77
|
-
PEER_CONNECTION_CREATE_ANSWER_FAILED:
|
|
78
|
-
PEER_CONNECTION_CREATE_OFFER_FAILED:
|
|
79
|
-
PEER_CONNECTION_ONTRACK:
|
|
80
|
-
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED:
|
|
81
|
-
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED:
|
|
82
|
-
PRESENTATION_END:
|
|
83
|
-
PRESENTATION_ENDED:
|
|
84
|
-
PRESENTATION_FAILED:
|
|
85
|
-
PRESENTATION_START:
|
|
86
|
-
PRESENTATION_STARTED:
|
|
87
|
-
PROGRESS:
|
|
88
|
-
REFER:
|
|
89
|
-
REGISTERED:
|
|
35
|
+
ACCEPTED: Ye,
|
|
36
|
+
ACCOUNT_CHANGED: Se,
|
|
37
|
+
ACCOUNT_DELETED: ue,
|
|
38
|
+
ADMIN_FORCE_SYNC_MEDIA_STATE: y,
|
|
39
|
+
ADMIN_START_MAIN_CAM: ie,
|
|
40
|
+
ADMIN_START_MIC: oe,
|
|
41
|
+
ADMIN_STOP_MAIN_CAM: ne,
|
|
42
|
+
ADMIN_STOP_MIC: re,
|
|
43
|
+
AVAILABLE_SECOND_REMOTE_STREAM_EVENT: X,
|
|
44
|
+
CHANNELS: v,
|
|
45
|
+
CHANNELS_NOTIFY: ee,
|
|
46
|
+
CONFERENCE_PARTICIPANT_TOKEN_ISSUED: Ne,
|
|
47
|
+
CONFIRMED: w,
|
|
48
|
+
CONNECTED: m,
|
|
49
|
+
CONNECTING: L,
|
|
50
|
+
DECLINED_INCOMING_CALL: V,
|
|
51
|
+
DISCONNECTED: S,
|
|
52
|
+
ENDED: p,
|
|
53
|
+
ENDED_FROM_SERVER: te,
|
|
54
|
+
ENTER_ROOM: Q,
|
|
55
|
+
FAILED: A,
|
|
56
|
+
FAILED_INCOMING_CALL: Y,
|
|
57
|
+
GET_USER_MEDIA_FAILED: je,
|
|
58
|
+
HOLD: $e,
|
|
59
|
+
ICE_CANDIDATE: Qe,
|
|
60
|
+
INCOMING_CALL: B,
|
|
61
|
+
MAIN_CAM_CONTROL: se,
|
|
62
|
+
MUST_STOP_PRESENTATION_EVENT: z,
|
|
63
|
+
MUTED: xe,
|
|
64
|
+
NEW_DTMF: Ce,
|
|
65
|
+
NEW_INFO: ge,
|
|
66
|
+
NEW_MESSAGE: We,
|
|
67
|
+
NEW_RTC_SESSION: D,
|
|
68
|
+
NOT_AVAILABLE_SECOND_REMOTE_STREAM_EVENT: J,
|
|
69
|
+
PARTICIPANT_ADDED_TO_LIST_MODERATORS: ae,
|
|
70
|
+
PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS: _e,
|
|
71
|
+
PARTICIPANT_MOVE_REQUEST_TO_STREAM: Ee,
|
|
72
|
+
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: ce,
|
|
73
|
+
PARTICIPATION_ACCEPTING_WORD_REQUEST: he,
|
|
74
|
+
PARTICIPATION_CANCELLING_WORD_REQUEST: de,
|
|
75
|
+
PEER_CONNECTION: b,
|
|
76
|
+
PEER_CONNECTION_CONFIRMED: K,
|
|
77
|
+
PEER_CONNECTION_CREATE_ANSWER_FAILED: Ze,
|
|
78
|
+
PEER_CONNECTION_CREATE_OFFER_FAILED: Ke,
|
|
79
|
+
PEER_CONNECTION_ONTRACK: Z,
|
|
80
|
+
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: et,
|
|
81
|
+
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: tt,
|
|
82
|
+
PRESENTATION_END: it,
|
|
83
|
+
PRESENTATION_ENDED: Ae,
|
|
84
|
+
PRESENTATION_FAILED: U,
|
|
85
|
+
PRESENTATION_START: st,
|
|
86
|
+
PRESENTATION_STARTED: nt,
|
|
87
|
+
PROGRESS: Ve,
|
|
88
|
+
REFER: Be,
|
|
89
|
+
REGISTERED: f,
|
|
90
90
|
REGISTRATION_FAILED: O,
|
|
91
|
-
REINVITE:
|
|
92
|
-
REPLACES:
|
|
93
|
-
SDP:
|
|
94
|
-
SENDING:
|
|
95
|
-
SHARE_STATE:
|
|
96
|
-
SIP_EVENT:
|
|
97
|
-
SPECTATOR:
|
|
98
|
-
TERMINATED_INCOMING_CALL:
|
|
99
|
-
UNHOLD:
|
|
100
|
-
UNMUTED:
|
|
101
|
-
UNREGISTERED:
|
|
102
|
-
UPDATE:
|
|
103
|
-
USE_LICENSE:
|
|
104
|
-
WEBCAST_STARTED:
|
|
105
|
-
WEBCAST_STOPPED:
|
|
106
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
91
|
+
REINVITE: qe,
|
|
92
|
+
REPLACES: Fe,
|
|
93
|
+
SDP: ze,
|
|
94
|
+
SENDING: ke,
|
|
95
|
+
SHARE_STATE: M,
|
|
96
|
+
SIP_EVENT: $,
|
|
97
|
+
SPECTATOR: rt,
|
|
98
|
+
TERMINATED_INCOMING_CALL: x,
|
|
99
|
+
UNHOLD: Xe,
|
|
100
|
+
UNMUTED: Ge,
|
|
101
|
+
UNREGISTERED: G,
|
|
102
|
+
UPDATE: Je,
|
|
103
|
+
USE_LICENSE: j,
|
|
104
|
+
WEBCAST_STARTED: le,
|
|
105
|
+
WEBCAST_STOPPED: Te
|
|
106
|
+
}, Symbol.toStringTag, { value: "Module" })), ot = [
|
|
107
|
+
B,
|
|
107
108
|
V,
|
|
108
|
-
Y,
|
|
109
|
-
G,
|
|
110
109
|
x,
|
|
110
|
+
Y,
|
|
111
|
+
he,
|
|
111
112
|
de,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
te,
|
|
115
|
-
Ce,
|
|
116
|
-
ue,
|
|
113
|
+
Ee,
|
|
114
|
+
ee,
|
|
117
115
|
Ne,
|
|
118
|
-
Te,
|
|
119
116
|
Se,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
ue,
|
|
118
|
+
le,
|
|
119
|
+
Te,
|
|
120
|
+
ae,
|
|
121
|
+
ce
|
|
122
|
+
], Re = [
|
|
123
|
+
L,
|
|
124
|
+
m,
|
|
125
|
+
S,
|
|
126
|
+
D,
|
|
124
127
|
f,
|
|
125
|
-
|
|
126
|
-
M,
|
|
127
|
-
p,
|
|
128
|
-
$,
|
|
128
|
+
G,
|
|
129
129
|
O,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
],
|
|
130
|
+
We,
|
|
131
|
+
$
|
|
132
|
+
], at = [
|
|
133
|
+
X,
|
|
133
134
|
J,
|
|
134
135
|
z,
|
|
136
|
+
M,
|
|
135
137
|
Q,
|
|
136
|
-
v,
|
|
137
138
|
j,
|
|
138
139
|
K,
|
|
139
140
|
Z,
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
v,
|
|
142
|
+
te,
|
|
142
143
|
se,
|
|
144
|
+
ie,
|
|
143
145
|
ne,
|
|
144
146
|
re,
|
|
145
|
-
ie,
|
|
146
147
|
oe,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
y,
|
|
149
|
+
_e
|
|
150
|
+
], Ie = [
|
|
151
|
+
p,
|
|
152
|
+
L,
|
|
153
|
+
ke,
|
|
153
154
|
qe,
|
|
154
155
|
Fe,
|
|
155
156
|
Be,
|
|
156
157
|
Ve,
|
|
157
158
|
Ye,
|
|
158
|
-
|
|
159
|
+
w,
|
|
159
160
|
b,
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
A,
|
|
162
|
+
xe,
|
|
162
163
|
Ge,
|
|
163
|
-
|
|
164
|
+
Ce,
|
|
164
165
|
ge,
|
|
165
|
-
|
|
166
|
+
$e,
|
|
166
167
|
Xe,
|
|
167
168
|
Je,
|
|
168
169
|
ze,
|
|
@@ -175,33 +176,32 @@ const ft = "Connection Error", Ue = "Request Timeout", pt = "SIP Failure Code",
|
|
|
175
176
|
st,
|
|
176
177
|
nt,
|
|
177
178
|
it,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
...
|
|
183
|
-
|
|
184
|
-
], sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
179
|
+
Ae,
|
|
180
|
+
U
|
|
181
|
+
], ct = [...Re, ...ot], Et = [
|
|
182
|
+
...Ie,
|
|
183
|
+
...at
|
|
184
|
+
], tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
185
185
|
__proto__: null,
|
|
186
|
-
SESSION_EVENT_NAMES:
|
|
187
|
-
SESSION_JSSIP_EVENT_NAMES:
|
|
188
|
-
SESSION_SYNTHETICS_EVENT_NAMES:
|
|
189
|
-
UA_EVENT_NAMES:
|
|
190
|
-
UA_JSSIP_EVENT_NAMES:
|
|
191
|
-
UA_SYNTHETICS_EVENT_NAMES:
|
|
192
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
186
|
+
SESSION_EVENT_NAMES: Et,
|
|
187
|
+
SESSION_JSSIP_EVENT_NAMES: Ie,
|
|
188
|
+
SESSION_SYNTHETICS_EVENT_NAMES: at,
|
|
189
|
+
UA_EVENT_NAMES: ct,
|
|
190
|
+
UA_JSSIP_EVENT_NAMES: Re,
|
|
191
|
+
UA_SYNTHETICS_EVENT_NAMES: ot
|
|
192
|
+
}, Symbol.toStringTag, { value: "Module" })), Vt = (r) => {
|
|
193
193
|
const e = [];
|
|
194
194
|
return r && e.push(`X-Vinteo-Remote: ${r}`), e;
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
|
|
195
|
+
}, Yt = "content-type", xt = "x-webrtc-enter-room", P = "application/vinteo.webrtc.sharedesktop", Gt = "application/vinteo.webrtc.roomname", $t = "application/vinteo.webrtc.channels", Xt = "application/vinteo.webrtc.mediastate", Jt = "application/vinteo.webrtc.refusal", pe = "application/vinteo.webrtc.maincam", zt = "application/vinteo.webrtc.mic", Qt = "application/vinteo.webrtc.uselic", jt = "X-WEBRTC-USE-LICENSE", Kt = "X-WEBRTC-PARTICIPANT-NAME", Pe = "X-WEBRTC-INPUT-CHANNELS", De = "X-WEBRTC-OUTPUT-CHANNELS", Zt = "X-WEBRTC-MAINCAM", es = "X-WEBRTC-MIC", Me = "X-WEBRTC-SYNC", ts = "X-WEBRTC-MAINCAM-RESOLUTION", ss = "X-WEBRTC-MEDIA-STATE", ns = "X-Vinteo-Media-Type", is = "X-Vinteo-MainCam-State", rs = "X-Vinteo-Mic-State", os = "application/vinteo.webrtc.partstate", as = "X-WEBRTC-PARTSTATE", cs = "application/vinteo.webrtc.notify", Es = "X-VINTEO-NOTIFY", R = "x-webrtc-share-state", _s = `${R}: LETMESTARTPRESENTATION`, hs = `${R}: STOPPRESENTATION`, _t = "YOUCANRECEIVECONTENT", ht = "CONTENTEND", dt = "YOUMUSTSTOPSENDCONTENT", ds = `${R}: ${dt}`, ls = `${R}: ${_t}`, Ts = `${R}: ${ht}`, Ss = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", us = `${Ss}: LETMESTARTMAINCAM`, me = "sip-connector", ve = F(me), sn = () => {
|
|
196
|
+
F.enable(me);
|
|
197
|
+
}, nn = () => {
|
|
198
|
+
F.enable(`-${me}`);
|
|
199
199
|
};
|
|
200
|
-
var
|
|
201
|
-
function
|
|
200
|
+
var I = /* @__PURE__ */ ((r) => (r.PAUSE_MAIN_CAM = "PAUSEMAINCAM", r.RESUME_MAIN_CAM = "RESUMEMAINCAM", r.MAX_MAIN_CAM_RESOLUTION = "MAXMAINCAMRESOLUTION", r.ADMIN_STOP_MAIN_CAM = "ADMINSTOPMAINCAM", r.ADMIN_START_MAIN_CAM = "ADMINSTARTMAINCAM", r))(I || {}), W = /* @__PURE__ */ ((r) => (r.ADMIN_STOP_MIC = "ADMINSTOPMIC", r.ADMIN_START_MIC = "ADMINSTARTMIC", r))(W || {}), k = /* @__PURE__ */ ((r) => (r.ADMIN_SYNC_FORCED = "1", r.ADMIN_SYNC_NOT_FORCED = "0", r))(k || {}), Ns = /* @__PURE__ */ ((r) => (r.AUDIO = "AUDIO", r.VIDEO = "VIDEO", r.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", r))(Ns || {});
|
|
201
|
+
function Cs(r) {
|
|
202
202
|
return (e) => `sip:${e}@${r}`;
|
|
203
203
|
}
|
|
204
|
-
const
|
|
204
|
+
const gs = (r, e) => () => Math.floor(Math.random() * (e - r)) + r, ye = (r) => r.trim().replaceAll(" ", "_"), As = gs(1e5, 99999999), H = (r, {
|
|
205
205
|
videoMode: e,
|
|
206
206
|
audioMode: t
|
|
207
207
|
} = {}) => {
|
|
@@ -209,41 +209,41 @@ const As = (r, e) => () => Math.floor(Math.random() * (e - r)) + r, we = (r) =>
|
|
|
209
209
|
return;
|
|
210
210
|
const s = t === "recvonly" ? [] : r.getAudioTracks(), n = e === "recvonly" ? [] : r.getVideoTracks(), o = [...s, ...n], a = new MediaStream(o);
|
|
211
211
|
return a.getTracks = () => [...a.getAudioTracks(), ...a.getVideoTracks()], a;
|
|
212
|
-
},
|
|
212
|
+
}, Rs = (r) => r.some((t) => {
|
|
213
213
|
const { kind: s } = t;
|
|
214
214
|
return s === "video";
|
|
215
|
-
}),
|
|
216
|
-
|
|
217
|
-
),
|
|
218
|
-
const t = r === void 0 ? void 0 : Math.max(r,
|
|
219
|
-
if (t !== void 0 &&
|
|
215
|
+
}), Is = "Error decline with 603", ms = 1006, fs = (r) => typeof r == "object" && r !== null && "code" in r && r.code === ms, Os = (r) => r.message === Is, ps = (r, e) => r.find((t) => t.track && e.getTracks().includes(t.track)), lt = 1, Tt = (r) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== r, Ps = Tt(
|
|
216
|
+
lt
|
|
217
|
+
), Ds = (r, e) => {
|
|
218
|
+
const t = r === void 0 ? void 0 : Math.max(r, lt);
|
|
219
|
+
if (t !== void 0 && Ps(
|
|
220
220
|
t,
|
|
221
221
|
e
|
|
222
222
|
))
|
|
223
223
|
return t;
|
|
224
|
-
},
|
|
225
|
-
if (
|
|
224
|
+
}, Ms = Tt(), vs = (r, e) => {
|
|
225
|
+
if (Ms(r, e))
|
|
226
226
|
return r;
|
|
227
|
-
},
|
|
227
|
+
}, ys = async (r, e, t) => {
|
|
228
228
|
const s = r.getParameters();
|
|
229
229
|
(s.encodings === void 0 || s.encodings.length === 0) && (s.encodings = [{}]);
|
|
230
|
-
const [n] = s.encodings, o = n.scaleResolutionDownBy, a =
|
|
230
|
+
const [n] = s.encodings, o = n.scaleResolutionDownBy, a = Ds(
|
|
231
231
|
e.scaleResolutionDownBy,
|
|
232
232
|
o
|
|
233
233
|
);
|
|
234
234
|
let c = !1;
|
|
235
235
|
a !== void 0 && (s.encodings[0].scaleResolutionDownBy = a, c = !0);
|
|
236
|
-
const
|
|
237
|
-
return
|
|
238
|
-
},
|
|
239
|
-
const s =
|
|
236
|
+
const E = n.maxBitrate, _ = vs(e.maxBitrate, E);
|
|
237
|
+
return _ !== void 0 && (s.encodings[0].maxBitrate = _, c = !0), c ? (t && t(s), r.setParameters(s).then(() => ({ parameters: s, isChanged: c }))) : { parameters: s, isChanged: c };
|
|
238
|
+
}, ws = async (r, e, t) => {
|
|
239
|
+
const s = ps(r, e);
|
|
240
240
|
if (s)
|
|
241
|
-
return
|
|
242
|
-
},
|
|
241
|
+
return ys(s, { maxBitrate: t });
|
|
242
|
+
}, bs = 486, Us = 487, q = "local", we = "remote", Ls = 3, rn = (r = new Error()) => {
|
|
243
243
|
const { originator: e, cause: t } = r;
|
|
244
|
-
return
|
|
245
|
-
},
|
|
246
|
-
class
|
|
244
|
+
return Rt(r) ? !0 : typeof t == "string" ? t === be || t === Ue || e === q && (t === He || t === Le) : !1;
|
|
245
|
+
}, g = "SipConnector", Hs = "channels", Ws = "WebcastStarted", ks = "WebcastStopped", qs = "accountChanged", Fs = "accountDeleted", Bs = "addedToListModerators", Vs = "removedFromListModerators", Ys = "ParticipationRequestAccepted", xs = "ParticipationRequestRejected", Gs = "ParticipantMovedToWebcast", $s = "ConferenceParticipantTokenIssued";
|
|
246
|
+
class on {
|
|
247
247
|
constructor({ JsSIP: e }) {
|
|
248
248
|
i(this, "_isRegisterConfig", !1);
|
|
249
249
|
i(this, "_connectionConfiguration", {});
|
|
@@ -278,34 +278,34 @@ class an {
|
|
|
278
278
|
i(this, "tryRegister", async () => {
|
|
279
279
|
if (!this.isRegisterConfig)
|
|
280
280
|
throw new Error("Config is not registered");
|
|
281
|
-
this._uaEvents.trigger(
|
|
281
|
+
this._uaEvents.trigger(L, void 0);
|
|
282
282
|
try {
|
|
283
283
|
await this.unregister();
|
|
284
284
|
} catch (e) {
|
|
285
|
-
|
|
285
|
+
ve("tryRegister", e);
|
|
286
286
|
}
|
|
287
287
|
return this.register();
|
|
288
288
|
});
|
|
289
|
-
i(this, "declineToIncomingCall", async ({ statusCode: e =
|
|
289
|
+
i(this, "declineToIncomingCall", async ({ statusCode: e = Us } = {}) => new Promise((t, s) => {
|
|
290
290
|
if (!this.isAvailableIncomingCall) {
|
|
291
291
|
s(new Error("no incomingSession"));
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
294
|
const n = this.incomingSession, o = this.remoteCallerData;
|
|
295
|
-
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(
|
|
295
|
+
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(V, o), t(n.terminate({ status_code: e }));
|
|
296
296
|
}));
|
|
297
|
-
i(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode:
|
|
297
|
+
i(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: bs }));
|
|
298
298
|
i(this, "removeIncomingSession", () => {
|
|
299
299
|
delete this.incomingSession;
|
|
300
300
|
});
|
|
301
|
-
i(this, "_connectWithDuplicatedCalls", async (e, { callLimit: t =
|
|
301
|
+
i(this, "_connectWithDuplicatedCalls", async (e, { callLimit: t = Ls } = {}) => {
|
|
302
302
|
let s = !0;
|
|
303
303
|
const n = async () => (s = !1, this._cancelableConnect.request(e)), o = (a) => {
|
|
304
304
|
var h;
|
|
305
|
-
const c = !!((h = this.ua) != null && h.isConnected()),
|
|
306
|
-
return
|
|
305
|
+
const c = !!((h = this.ua) != null && h.isConnected()), E = !s && c && this.hasEqualConnectionConfiguration(e), _ = !!a && !fs(a);
|
|
306
|
+
return E || _;
|
|
307
307
|
};
|
|
308
|
-
return this._cancelableConnectWithRepeatedCalls =
|
|
308
|
+
return this._cancelableConnectWithRepeatedCalls = It({
|
|
309
309
|
targetFunction: n,
|
|
310
310
|
isComplete: o,
|
|
311
311
|
callLimit: t,
|
|
@@ -320,12 +320,12 @@ class an {
|
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
i(this, "handleNewRTCSession", ({ originator: e, session: t }) => {
|
|
323
|
-
if (e ===
|
|
323
|
+
if (e === we) {
|
|
324
324
|
this.incomingSession = t;
|
|
325
325
|
const s = this.remoteCallerData;
|
|
326
|
-
t.on(
|
|
327
|
-
this.removeIncomingSession(), n.originator ===
|
|
328
|
-
}), this._uaEvents.trigger(
|
|
326
|
+
t.on(A, (n) => {
|
|
327
|
+
this.removeIncomingSession(), n.originator === q ? this._uaEvents.trigger(x, s) : this._uaEvents.trigger(Y, s);
|
|
328
|
+
}), this._uaEvents.trigger(B, s);
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
i(this, "_connect", async (e) => this.initUa(e).then(async () => this._start()));
|
|
@@ -335,51 +335,49 @@ class an {
|
|
|
335
335
|
sipServerUrl: s,
|
|
336
336
|
sipWebSocketServerURL: n,
|
|
337
337
|
remoteAddress: o,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
registerExpires: _,
|
|
338
|
+
sessionTimers: a,
|
|
339
|
+
registerExpires: c,
|
|
341
340
|
connectionRecoveryMinInterval: E,
|
|
342
|
-
connectionRecoveryMaxInterval:
|
|
343
|
-
userAgent:
|
|
344
|
-
displayName:
|
|
345
|
-
register:
|
|
346
|
-
extraHeaders:
|
|
341
|
+
connectionRecoveryMaxInterval: _,
|
|
342
|
+
userAgent: h,
|
|
343
|
+
displayName: l = "",
|
|
344
|
+
register: d = !1,
|
|
345
|
+
extraHeaders: T = []
|
|
347
346
|
}) => {
|
|
348
347
|
if (!s)
|
|
349
348
|
throw new Error("sipServerUrl is required");
|
|
350
349
|
if (!n)
|
|
351
350
|
throw new Error("sipWebSocketServerURL is required");
|
|
352
|
-
if (
|
|
351
|
+
if (d && !e)
|
|
353
352
|
throw new Error("user is required for authorized connection");
|
|
354
|
-
if (
|
|
353
|
+
if (d && !t)
|
|
355
354
|
throw new Error("password is required for authorized connection");
|
|
356
355
|
this._connectionConfiguration = {
|
|
357
356
|
sipServerUrl: s,
|
|
358
|
-
displayName:
|
|
359
|
-
register:
|
|
357
|
+
displayName: l,
|
|
358
|
+
register: d,
|
|
360
359
|
user: e,
|
|
361
360
|
password: t
|
|
362
361
|
};
|
|
363
|
-
const { configuration:
|
|
362
|
+
const { configuration: u, helpers: N } = this.createUaConfiguration({
|
|
364
363
|
user: e,
|
|
365
364
|
sipServerUrl: s,
|
|
366
365
|
sipWebSocketServerURL: n,
|
|
367
366
|
password: t,
|
|
368
|
-
displayName:
|
|
369
|
-
register:
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
registerExpires: _,
|
|
367
|
+
displayName: l,
|
|
368
|
+
register: d,
|
|
369
|
+
sessionTimers: a,
|
|
370
|
+
registerExpires: c,
|
|
373
371
|
connectionRecoveryMinInterval: E,
|
|
374
|
-
connectionRecoveryMaxInterval:
|
|
375
|
-
userAgent:
|
|
372
|
+
connectionRecoveryMaxInterval: _,
|
|
373
|
+
userAgent: h
|
|
376
374
|
});
|
|
377
|
-
this.getSipServerUrl =
|
|
378
|
-
const
|
|
379
|
-
|
|
375
|
+
this.getSipServerUrl = N.getSipServerUrl, this.socket = N.socket, this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!d, this.ua = this._createUa(u), this._uaEvents.eachTriggers((ut, Nt) => {
|
|
376
|
+
const fe = Re.find((Ct) => Ct === Nt);
|
|
377
|
+
fe && this.ua && this.ua.on(fe, ut);
|
|
380
378
|
});
|
|
381
|
-
const
|
|
382
|
-
return this.ua.registrator().setExtraHeaders(
|
|
379
|
+
const St = [...Vt(o), ...T];
|
|
380
|
+
return this.ua.registrator().setExtraHeaders(St), this.ua;
|
|
383
381
|
});
|
|
384
382
|
i(this, "_createUa", (e) => new this.JsSIP.UA(e));
|
|
385
383
|
i(this, "_start", async () => new Promise((e, t) => {
|
|
@@ -390,14 +388,14 @@ class an {
|
|
|
390
388
|
}
|
|
391
389
|
const n = () => {
|
|
392
390
|
c(), e(s);
|
|
393
|
-
}, o = (
|
|
394
|
-
c(), t(
|
|
391
|
+
}, o = (E) => {
|
|
392
|
+
c(), t(E);
|
|
395
393
|
}, a = () => {
|
|
396
|
-
this.isRegisterConfig ? (this.on(
|
|
394
|
+
this.isRegisterConfig ? (this.on(f, n), this.on(O, o)) : this.on(m, n), this.on(S, o);
|
|
397
395
|
}, c = () => {
|
|
398
|
-
this.off(
|
|
396
|
+
this.off(f, n), this.off(O, o), this.off(m, n), this.off(S, o);
|
|
399
397
|
};
|
|
400
|
-
a(), this.on(
|
|
398
|
+
a(), this.on(D, this.handleNewRTCSession), s.start();
|
|
401
399
|
}));
|
|
402
400
|
i(this, "_set", async ({ displayName: e, password: t }) => new Promise((s, n) => {
|
|
403
401
|
const { ua: o } = this;
|
|
@@ -406,23 +404,23 @@ class an {
|
|
|
406
404
|
return;
|
|
407
405
|
}
|
|
408
406
|
let a = !1, c = !1;
|
|
409
|
-
e !== void 0 && e !== this._connectionConfiguration.displayName && (a = o.set("display_name",
|
|
410
|
-
const
|
|
407
|
+
e !== void 0 && e !== this._connectionConfiguration.displayName && (a = o.set("display_name", ye(e)), this._connectionConfiguration.displayName = e), t !== void 0 && t !== this._connectionConfiguration.password && (c = o.set("password", t), this._connectionConfiguration.password = t);
|
|
408
|
+
const E = a || c;
|
|
411
409
|
c && this.isRegisterConfig ? this.register().then(() => {
|
|
412
|
-
s(
|
|
413
|
-
}).catch((
|
|
414
|
-
n(
|
|
415
|
-
}) :
|
|
410
|
+
s(E);
|
|
411
|
+
}).catch((_) => {
|
|
412
|
+
n(_);
|
|
413
|
+
}) : E ? s(E) : n(new Error("nothing changed"));
|
|
416
414
|
}));
|
|
417
415
|
i(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
|
|
418
416
|
i(this, "_disconnect", async () => {
|
|
419
|
-
this.off(
|
|
417
|
+
this.off(D, this.handleNewRTCSession);
|
|
420
418
|
const e = new Promise((t) => {
|
|
421
|
-
this.once(
|
|
419
|
+
this.once(S, () => {
|
|
422
420
|
delete this.ua, t();
|
|
423
421
|
});
|
|
424
422
|
});
|
|
425
|
-
return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(
|
|
423
|
+
return this.ua ? (await this._hangUpWithoutCancelRequests(), this.ua ? this.ua.stop() : this._uaEvents.trigger(S, void 0)) : this._uaEvents.trigger(S, void 0), e;
|
|
426
424
|
});
|
|
427
425
|
i(this, "_call", async ({
|
|
428
426
|
number: e,
|
|
@@ -432,8 +430,8 @@ class an {
|
|
|
432
430
|
iceServers: o,
|
|
433
431
|
videoMode: a,
|
|
434
432
|
audioMode: c,
|
|
435
|
-
degradationPreference:
|
|
436
|
-
offerToReceiveAudio:
|
|
433
|
+
degradationPreference: E,
|
|
434
|
+
offerToReceiveAudio: _ = !0,
|
|
437
435
|
offerToReceiveVideo: h = !0
|
|
438
436
|
}) => new Promise((l, d) => {
|
|
439
437
|
const { ua: T } = this;
|
|
@@ -441,23 +439,23 @@ class an {
|
|
|
441
439
|
d(new Error("this.ua is not initialized"));
|
|
442
440
|
return;
|
|
443
441
|
}
|
|
444
|
-
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: n }).then(l).catch((
|
|
445
|
-
d(
|
|
442
|
+
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: n }).then(l).catch((u) => {
|
|
443
|
+
d(u);
|
|
446
444
|
}), this.session = T.call(this.getSipServerUrl(e), {
|
|
447
445
|
extraHeaders: s,
|
|
448
|
-
mediaStream:
|
|
446
|
+
mediaStream: H(t, {
|
|
449
447
|
videoMode: a,
|
|
450
448
|
audioMode: c
|
|
451
449
|
}),
|
|
452
450
|
eventHandlers: this._sessionEvents.triggers,
|
|
453
451
|
videoMode: a,
|
|
454
452
|
audioMode: c,
|
|
455
|
-
degradationPreference:
|
|
453
|
+
degradationPreference: E,
|
|
456
454
|
pcConfig: {
|
|
457
455
|
iceServers: o
|
|
458
456
|
},
|
|
459
457
|
rtcOfferConstraints: {
|
|
460
|
-
offerToReceiveAudio:
|
|
458
|
+
offerToReceiveAudio: _,
|
|
461
459
|
offerToReceiveVideo: h
|
|
462
460
|
}
|
|
463
461
|
});
|
|
@@ -470,24 +468,24 @@ class an {
|
|
|
470
468
|
videoMode: o,
|
|
471
469
|
audioMode: a,
|
|
472
470
|
degradationPreference: c
|
|
473
|
-
}) => new Promise((
|
|
471
|
+
}) => new Promise((E, _) => {
|
|
474
472
|
if (!this.isAvailableIncomingCall) {
|
|
475
|
-
|
|
473
|
+
_(new Error("no incomingSession"));
|
|
476
474
|
return;
|
|
477
475
|
}
|
|
478
476
|
this.session = this.incomingSession, this.removeIncomingSession();
|
|
479
477
|
const { session: h } = this;
|
|
480
478
|
if (!h) {
|
|
481
|
-
|
|
479
|
+
_(new Error("No session established"));
|
|
482
480
|
return;
|
|
483
481
|
}
|
|
484
482
|
this._sessionEvents.eachTriggers((d, T) => {
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = h.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(
|
|
488
|
-
|
|
483
|
+
const u = Ie.find((N) => N === T);
|
|
484
|
+
u && h.on(u, d);
|
|
485
|
+
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = h.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(E).catch((d) => {
|
|
486
|
+
_(d);
|
|
489
487
|
});
|
|
490
|
-
const l =
|
|
488
|
+
const l = H(e, {
|
|
491
489
|
videoMode: o,
|
|
492
490
|
audioMode: a
|
|
493
491
|
});
|
|
@@ -504,23 +502,23 @@ class an {
|
|
|
504
502
|
}));
|
|
505
503
|
i(this, "_handleCall", async ({ ontrack: e }) => new Promise((t, s) => {
|
|
506
504
|
const n = () => {
|
|
507
|
-
this.onSession(
|
|
505
|
+
this.onSession(b, h), this.onSession(w, l);
|
|
508
506
|
}, o = () => {
|
|
509
|
-
this.offSession(
|
|
507
|
+
this.offSession(b, h), this.offSession(w, l);
|
|
510
508
|
}, a = () => {
|
|
511
|
-
this.onSession(
|
|
509
|
+
this.onSession(A, E), this.onSession(p, E);
|
|
512
510
|
}, c = () => {
|
|
513
|
-
this.offSession(
|
|
514
|
-
},
|
|
511
|
+
this.offSession(A, E), this.offSession(p, E);
|
|
512
|
+
}, E = (d) => {
|
|
515
513
|
o(), c(), s(d);
|
|
516
514
|
};
|
|
517
|
-
let
|
|
515
|
+
let _;
|
|
518
516
|
const h = ({ peerconnection: d }) => {
|
|
519
|
-
|
|
520
|
-
this._sessionEvents.trigger(
|
|
517
|
+
_ = d, _.ontrack = (T) => {
|
|
518
|
+
this._sessionEvents.trigger(Z, _), e && e(T);
|
|
521
519
|
};
|
|
522
520
|
}, l = () => {
|
|
523
|
-
|
|
521
|
+
_ && this._sessionEvents.trigger(K, _), o(), c(), t(_);
|
|
524
522
|
};
|
|
525
523
|
n(), a();
|
|
526
524
|
}));
|
|
@@ -533,8 +531,8 @@ class an {
|
|
|
533
531
|
s(new Error("No session established"));
|
|
534
532
|
return;
|
|
535
533
|
}
|
|
536
|
-
this.onceSession(
|
|
537
|
-
o ===
|
|
534
|
+
this.onceSession(Ce, ({ originator: o }) => {
|
|
535
|
+
o === q && t();
|
|
538
536
|
}), n.sendDTMF(e, {
|
|
539
537
|
duration: 120,
|
|
540
538
|
interToneGap: 600
|
|
@@ -549,6 +547,10 @@ class an {
|
|
|
549
547
|
});
|
|
550
548
|
i(this, "_handleShareState", (e) => {
|
|
551
549
|
switch (e) {
|
|
550
|
+
case _t: {
|
|
551
|
+
this._sessionEvents.trigger(X, void 0);
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
552
554
|
case ht: {
|
|
553
555
|
this._sessionEvents.trigger(J, void 0);
|
|
554
556
|
break;
|
|
@@ -557,79 +559,75 @@ class an {
|
|
|
557
559
|
this._sessionEvents.trigger(z, void 0);
|
|
558
560
|
break;
|
|
559
561
|
}
|
|
560
|
-
case lt: {
|
|
561
|
-
this._sessionEvents.trigger(Q, void 0);
|
|
562
|
-
break;
|
|
563
|
-
}
|
|
564
562
|
}
|
|
565
563
|
});
|
|
566
564
|
i(this, "_maybeTriggerChannels", (e) => {
|
|
567
|
-
const t = e.getHeader(
|
|
565
|
+
const t = e.getHeader(Pe), s = e.getHeader(De);
|
|
568
566
|
if (t && s) {
|
|
569
567
|
const n = {
|
|
570
568
|
inputChannels: t,
|
|
571
569
|
outputChannels: s
|
|
572
570
|
};
|
|
573
|
-
this._sessionEvents.trigger(
|
|
571
|
+
this._sessionEvents.trigger(v, n);
|
|
574
572
|
}
|
|
575
573
|
});
|
|
576
574
|
i(this, "_handleNotify", (e) => {
|
|
577
575
|
switch (e.cmd) {
|
|
578
|
-
case
|
|
576
|
+
case Hs: {
|
|
579
577
|
const t = e;
|
|
580
578
|
this._triggerChannelsNotify(t);
|
|
581
579
|
break;
|
|
582
580
|
}
|
|
583
|
-
case
|
|
581
|
+
case Ws: {
|
|
584
582
|
const t = e;
|
|
585
583
|
this._triggerWebcastStartedNotify(t);
|
|
586
584
|
break;
|
|
587
585
|
}
|
|
588
|
-
case
|
|
586
|
+
case ks: {
|
|
589
587
|
const t = e;
|
|
590
588
|
this._triggerWebcastStoppedNotify(t);
|
|
591
589
|
break;
|
|
592
590
|
}
|
|
593
|
-
case
|
|
591
|
+
case Bs: {
|
|
594
592
|
const t = e;
|
|
595
593
|
this._triggerAddedToListModeratorsNotify(t);
|
|
596
594
|
break;
|
|
597
595
|
}
|
|
598
|
-
case
|
|
596
|
+
case Vs: {
|
|
599
597
|
const t = e;
|
|
600
598
|
this._triggerRemovedFromListModeratorsNotify(t);
|
|
601
599
|
break;
|
|
602
600
|
}
|
|
603
|
-
case
|
|
601
|
+
case Ys: {
|
|
604
602
|
const t = e;
|
|
605
603
|
this._triggerParticipationAcceptingWordRequest(t);
|
|
606
604
|
break;
|
|
607
605
|
}
|
|
608
|
-
case
|
|
606
|
+
case xs: {
|
|
609
607
|
const t = e;
|
|
610
608
|
this._triggerParticipationCancellingWordRequest(t);
|
|
611
609
|
break;
|
|
612
610
|
}
|
|
613
|
-
case
|
|
611
|
+
case Gs: {
|
|
614
612
|
const t = e;
|
|
615
613
|
this._triggerParticipantMoveRequestToStream(t);
|
|
616
614
|
break;
|
|
617
615
|
}
|
|
618
|
-
case
|
|
616
|
+
case qs: {
|
|
619
617
|
this._triggerAccountChangedNotify();
|
|
620
618
|
break;
|
|
621
619
|
}
|
|
622
|
-
case
|
|
620
|
+
case Fs: {
|
|
623
621
|
this._triggerAccountDeletedNotify();
|
|
624
622
|
break;
|
|
625
623
|
}
|
|
626
|
-
case
|
|
624
|
+
case $s: {
|
|
627
625
|
const t = e;
|
|
628
626
|
this._triggerConferenceParticipantTokenIssued(t);
|
|
629
627
|
break;
|
|
630
628
|
}
|
|
631
629
|
default:
|
|
632
|
-
|
|
630
|
+
ve("unknown cmd", e.cmd);
|
|
633
631
|
}
|
|
634
632
|
});
|
|
635
633
|
i(this, "_triggerRemovedFromListModeratorsNotify", ({
|
|
@@ -639,7 +637,7 @@ class an {
|
|
|
639
637
|
conference: e
|
|
640
638
|
};
|
|
641
639
|
this._uaEvents.trigger(
|
|
642
|
-
|
|
640
|
+
ce,
|
|
643
641
|
t
|
|
644
642
|
);
|
|
645
643
|
});
|
|
@@ -647,27 +645,27 @@ class an {
|
|
|
647
645
|
const t = {
|
|
648
646
|
conference: e
|
|
649
647
|
};
|
|
650
|
-
this._uaEvents.trigger(
|
|
648
|
+
this._uaEvents.trigger(ae, t);
|
|
651
649
|
});
|
|
652
650
|
i(this, "_triggerWebcastStartedNotify", ({ body: { conference: e, type: t } }) => {
|
|
653
651
|
const s = {
|
|
654
652
|
conference: e,
|
|
655
653
|
type: t
|
|
656
654
|
};
|
|
657
|
-
this._uaEvents.trigger(
|
|
655
|
+
this._uaEvents.trigger(le, s);
|
|
658
656
|
});
|
|
659
657
|
i(this, "_triggerWebcastStoppedNotify", ({ body: { conference: e, type: t } }) => {
|
|
660
658
|
const s = {
|
|
661
659
|
conference: e,
|
|
662
660
|
type: t
|
|
663
661
|
};
|
|
664
|
-
this._uaEvents.trigger(
|
|
662
|
+
this._uaEvents.trigger(Te, s);
|
|
665
663
|
});
|
|
666
664
|
i(this, "_triggerAccountChangedNotify", () => {
|
|
667
|
-
this._uaEvents.trigger(
|
|
665
|
+
this._uaEvents.trigger(Se, void 0);
|
|
668
666
|
});
|
|
669
667
|
i(this, "_triggerAccountDeletedNotify", () => {
|
|
670
|
-
this._uaEvents.trigger(
|
|
668
|
+
this._uaEvents.trigger(ue, void 0);
|
|
671
669
|
});
|
|
672
670
|
i(this, "_triggerConferenceParticipantTokenIssued", ({
|
|
673
671
|
body: { conference: e, participant: t, jwt: s }
|
|
@@ -678,7 +676,7 @@ class an {
|
|
|
678
676
|
jwt: s
|
|
679
677
|
};
|
|
680
678
|
this._uaEvents.trigger(
|
|
681
|
-
|
|
679
|
+
Ne,
|
|
682
680
|
n
|
|
683
681
|
);
|
|
684
682
|
});
|
|
@@ -687,7 +685,7 @@ class an {
|
|
|
687
685
|
inputChannels: t,
|
|
688
686
|
outputChannels: s
|
|
689
687
|
};
|
|
690
|
-
this._uaEvents.trigger(
|
|
688
|
+
this._uaEvents.trigger(ee, n);
|
|
691
689
|
});
|
|
692
690
|
i(this, "_triggerParticipationAcceptingWordRequest", ({
|
|
693
691
|
body: { conference: e }
|
|
@@ -695,7 +693,7 @@ class an {
|
|
|
695
693
|
const t = {
|
|
696
694
|
conference: e
|
|
697
695
|
};
|
|
698
|
-
this._uaEvents.trigger(
|
|
696
|
+
this._uaEvents.trigger(he, t);
|
|
699
697
|
});
|
|
700
698
|
i(this, "_triggerParticipationCancellingWordRequest", ({
|
|
701
699
|
body: { conference: e }
|
|
@@ -703,7 +701,7 @@ class an {
|
|
|
703
701
|
const t = {
|
|
704
702
|
conference: e
|
|
705
703
|
};
|
|
706
|
-
this._uaEvents.trigger(
|
|
704
|
+
this._uaEvents.trigger(de, t);
|
|
707
705
|
});
|
|
708
706
|
i(this, "_triggerParticipantMoveRequestToStream", ({
|
|
709
707
|
body: { conference: e }
|
|
@@ -711,76 +709,76 @@ class an {
|
|
|
711
709
|
const t = {
|
|
712
710
|
conference: e
|
|
713
711
|
};
|
|
714
|
-
this._uaEvents.trigger(
|
|
712
|
+
this._uaEvents.trigger(Ee, t);
|
|
715
713
|
});
|
|
716
714
|
i(this, "_triggerEnterRoom", (e) => {
|
|
717
|
-
const t = e.getHeader(
|
|
718
|
-
this._sessionEvents.trigger(
|
|
715
|
+
const t = e.getHeader(xt), s = e.getHeader(Kt);
|
|
716
|
+
this._sessionEvents.trigger(Q, { room: t, participantName: s });
|
|
719
717
|
});
|
|
720
718
|
i(this, "_triggerShareState", (e) => {
|
|
721
|
-
const t = e.getHeader(
|
|
722
|
-
this._sessionEvents.trigger(
|
|
719
|
+
const t = e.getHeader(R);
|
|
720
|
+
this._sessionEvents.trigger(M, t);
|
|
723
721
|
});
|
|
724
722
|
i(this, "_maybeTriggerParticipantMoveRequestToSpectators", (e) => {
|
|
725
|
-
e.getHeader(
|
|
723
|
+
e.getHeader(as) === rt && this._sessionEvents.trigger(_e, void 0);
|
|
726
724
|
});
|
|
727
725
|
i(this, "_triggerMainCamControl", (e) => {
|
|
728
|
-
const t = e.getHeader(
|
|
729
|
-
if (t ===
|
|
730
|
-
this._sessionEvents.trigger(
|
|
726
|
+
const t = e.getHeader(Zt), s = e.getHeader(Me), n = s === k.ADMIN_SYNC_FORCED;
|
|
727
|
+
if (t === I.ADMIN_START_MAIN_CAM) {
|
|
728
|
+
this._sessionEvents.trigger(ie, { isSyncForced: n });
|
|
731
729
|
return;
|
|
732
730
|
}
|
|
733
|
-
if (t ===
|
|
734
|
-
this._sessionEvents.trigger(
|
|
731
|
+
if (t === I.ADMIN_STOP_MAIN_CAM) {
|
|
732
|
+
this._sessionEvents.trigger(ne, { isSyncForced: n });
|
|
735
733
|
return;
|
|
736
734
|
}
|
|
737
|
-
(t ===
|
|
738
|
-
const o = e.getHeader(
|
|
739
|
-
this._sessionEvents.trigger(
|
|
735
|
+
(t === I.RESUME_MAIN_CAM || t === I.PAUSE_MAIN_CAM) && s && this._sessionEvents.trigger(y, { isSyncForced: n });
|
|
736
|
+
const o = e.getHeader(ts);
|
|
737
|
+
this._sessionEvents.trigger(se, {
|
|
740
738
|
mainCam: t,
|
|
741
739
|
resolutionMainCam: o
|
|
742
740
|
});
|
|
743
741
|
});
|
|
744
742
|
i(this, "_triggerMicControl", (e) => {
|
|
745
|
-
const t = e.getHeader(
|
|
746
|
-
t ===
|
|
743
|
+
const t = e.getHeader(es), n = e.getHeader(Me) === k.ADMIN_SYNC_FORCED;
|
|
744
|
+
t === W.ADMIN_START_MIC ? this._sessionEvents.trigger(oe, { isSyncForced: n }) : t === W.ADMIN_STOP_MIC && this._sessionEvents.trigger(re, { isSyncForced: n });
|
|
747
745
|
});
|
|
748
746
|
i(this, "_triggerUseLicense", (e) => {
|
|
749
|
-
const t = e.getHeader(
|
|
750
|
-
this._sessionEvents.trigger(
|
|
747
|
+
const t = e.getHeader(jt);
|
|
748
|
+
this._sessionEvents.trigger(j, t);
|
|
751
749
|
});
|
|
752
750
|
i(this, "_handleNewInfo", (e) => {
|
|
753
751
|
const { originator: t } = e;
|
|
754
752
|
if (t !== "remote")
|
|
755
753
|
return;
|
|
756
|
-
const { request: s } = e, n = s.getHeader(
|
|
754
|
+
const { request: s } = e, n = s.getHeader(Yt);
|
|
757
755
|
if (n)
|
|
758
756
|
switch (n) {
|
|
759
|
-
case
|
|
757
|
+
case Gt: {
|
|
760
758
|
this._triggerEnterRoom(s), this._maybeTriggerChannels(s);
|
|
761
759
|
break;
|
|
762
760
|
}
|
|
763
|
-
case
|
|
761
|
+
case cs: {
|
|
764
762
|
this._maybeHandleNotify(s);
|
|
765
763
|
break;
|
|
766
764
|
}
|
|
767
|
-
case
|
|
765
|
+
case P: {
|
|
768
766
|
this._triggerShareState(s);
|
|
769
767
|
break;
|
|
770
768
|
}
|
|
771
|
-
case
|
|
769
|
+
case pe: {
|
|
772
770
|
this._triggerMainCamControl(s);
|
|
773
771
|
break;
|
|
774
772
|
}
|
|
775
|
-
case
|
|
773
|
+
case zt: {
|
|
776
774
|
this._triggerMicControl(s);
|
|
777
775
|
break;
|
|
778
776
|
}
|
|
779
|
-
case
|
|
777
|
+
case Qt: {
|
|
780
778
|
this._triggerUseLicense(s);
|
|
781
779
|
break;
|
|
782
780
|
}
|
|
783
|
-
case
|
|
781
|
+
case os: {
|
|
784
782
|
this._maybeTriggerParticipantMoveRequestToSpectators(s);
|
|
785
783
|
break;
|
|
786
784
|
}
|
|
@@ -790,7 +788,7 @@ class an {
|
|
|
790
788
|
this._maybeHandleNotify(e);
|
|
791
789
|
});
|
|
792
790
|
i(this, "_maybeHandleNotify", (e) => {
|
|
793
|
-
const t = e.getHeader(
|
|
791
|
+
const t = e.getHeader(Es);
|
|
794
792
|
if (t) {
|
|
795
793
|
const s = JSON.parse(t);
|
|
796
794
|
this._handleNotify(s);
|
|
@@ -798,37 +796,37 @@ class an {
|
|
|
798
796
|
});
|
|
799
797
|
i(this, "_handleEnded", (e) => {
|
|
800
798
|
const { originator: t } = e;
|
|
801
|
-
t ===
|
|
799
|
+
t === we && this._sessionEvents.trigger(te, e), this._restoreSession();
|
|
802
800
|
});
|
|
803
|
-
this.JsSIP = e, this._sessionEvents = new Oe(
|
|
801
|
+
this.JsSIP = e, this._sessionEvents = new Oe(Et), this._uaEvents = new Oe(ct), this._cancelableConnect = new C(
|
|
804
802
|
this._connect,
|
|
805
803
|
{
|
|
806
|
-
moduleName:
|
|
804
|
+
moduleName: g,
|
|
807
805
|
afterCancelRequest: () => {
|
|
808
806
|
this._cancelableInitUa.cancelRequest(), this._cancelableDisconnect.cancelRequest();
|
|
809
807
|
}
|
|
810
808
|
}
|
|
811
|
-
), this._cancelableInitUa = new
|
|
809
|
+
), this._cancelableInitUa = new C(
|
|
812
810
|
this._initUa,
|
|
813
|
-
{ moduleName:
|
|
814
|
-
), this._cancelableDisconnect = new
|
|
811
|
+
{ moduleName: g }
|
|
812
|
+
), this._cancelableDisconnect = new C(
|
|
815
813
|
this._disconnect,
|
|
816
|
-
{ moduleName:
|
|
817
|
-
), this._cancelableSet = new
|
|
818
|
-
moduleName:
|
|
819
|
-
}), this._cancelableCall = new
|
|
814
|
+
{ moduleName: g }
|
|
815
|
+
), this._cancelableSet = new C(this._set, {
|
|
816
|
+
moduleName: g
|
|
817
|
+
}), this._cancelableCall = new C(
|
|
820
818
|
this._call,
|
|
821
|
-
{ moduleName:
|
|
822
|
-
), this._cancelableAnswer = new
|
|
819
|
+
{ moduleName: g }
|
|
820
|
+
), this._cancelableAnswer = new C(this._answer, { moduleName: g }), this._cancelableSendDTMF = new C(this._sendDTMF, { moduleName: g }), this.onSession(M, this._handleShareState), this.onSession(ge, this._handleNewInfo), this.on($, this._handleSipEvent), this.onSession(A, this._handleEnded), this.onSession(p, this._handleEnded);
|
|
823
821
|
}
|
|
824
822
|
async register() {
|
|
825
823
|
return new Promise((e, t) => {
|
|
826
|
-
this.isRegisterConfig && this.ua ? (this.ua.on(
|
|
824
|
+
this.isRegisterConfig && this.ua ? (this.ua.on(f, e), this.ua.on(O, t), this.ua.register()) : t(new Error("Config is not registered"));
|
|
827
825
|
});
|
|
828
826
|
}
|
|
829
827
|
async unregister() {
|
|
830
828
|
return new Promise((e, t) => {
|
|
831
|
-
this.isRegistered && this.ua ? (this.ua.on(
|
|
829
|
+
this.isRegistered && this.ua ? (this.ua.on(G, e), this.ua.unregister()) : t(new Error("ua is not registered"));
|
|
832
830
|
});
|
|
833
831
|
}
|
|
834
832
|
async sendOptions(e, t, s) {
|
|
@@ -861,25 +859,23 @@ class an {
|
|
|
861
859
|
userAgent: e,
|
|
862
860
|
displayName: t,
|
|
863
861
|
sipServerUrl: s,
|
|
864
|
-
sipWebSocketServerURL: n
|
|
865
|
-
sdpSemantics: o
|
|
862
|
+
sipWebSocketServerURL: n
|
|
866
863
|
}) {
|
|
867
|
-
return new Promise((
|
|
868
|
-
const { configuration:
|
|
864
|
+
return new Promise((o, a) => {
|
|
865
|
+
const { configuration: c } = this.createUaConfiguration({
|
|
869
866
|
sipWebSocketServerURL: n,
|
|
870
867
|
displayName: t,
|
|
871
|
-
sdpSemantics: o,
|
|
872
868
|
userAgent: e,
|
|
873
869
|
sipServerUrl: s
|
|
874
|
-
}), E = this._createUa(
|
|
875
|
-
const
|
|
876
|
-
|
|
870
|
+
}), E = this._createUa(c), _ = () => {
|
|
871
|
+
const l = new Error("Telephony is not available");
|
|
872
|
+
a(l);
|
|
877
873
|
};
|
|
878
|
-
E.once(
|
|
879
|
-
const
|
|
880
|
-
E.removeAllListeners(), E.once(
|
|
874
|
+
E.once(S, _);
|
|
875
|
+
const h = () => {
|
|
876
|
+
E.removeAllListeners(), E.once(S, o), E.stop();
|
|
881
877
|
};
|
|
882
|
-
E.once(
|
|
878
|
+
E.once(m, h), E.start();
|
|
883
879
|
});
|
|
884
880
|
}
|
|
885
881
|
async replaceMediaStream(e, t) {
|
|
@@ -890,8 +886,8 @@ class an {
|
|
|
890
886
|
async askPermissionToEnableCam(e = {}) {
|
|
891
887
|
if (!this.session)
|
|
892
888
|
throw new Error("No session established");
|
|
893
|
-
const t = [
|
|
894
|
-
return this.session.sendInfo(
|
|
889
|
+
const t = [us];
|
|
890
|
+
return this.session.sendInfo(pe, void 0, {
|
|
895
891
|
noTerminateWhenError: !0,
|
|
896
892
|
...e,
|
|
897
893
|
extraHeaders: t
|
|
@@ -906,7 +902,7 @@ class an {
|
|
|
906
902
|
hasEqualConnectionConfiguration(e) {
|
|
907
903
|
var n;
|
|
908
904
|
const { configuration: t } = this.createUaConfiguration(e), s = (n = this.ua) == null ? void 0 : n.configuration;
|
|
909
|
-
return (s == null ? void 0 : s.password) === t.password && (s == null ? void 0 : s.register) === t.register && (s == null ? void 0 : s.uri.toString()) === t.uri && (s == null ? void 0 : s.display_name) === t.display_name && (s == null ? void 0 : s.user_agent) === t.user_agent && (s == null ? void 0 : s.
|
|
905
|
+
return (s == null ? void 0 : s.password) === t.password && (s == null ? void 0 : s.register) === t.register && (s == null ? void 0 : s.uri.toString()) === t.uri && (s == null ? void 0 : s.display_name) === t.display_name && (s == null ? void 0 : s.user_agent) === t.user_agent && (s == null ? void 0 : s.sockets) === t.sockets && (s == null ? void 0 : s.session_timers) === t.session_timers && (s == null ? void 0 : s.register_expires) === t.register_expires && (s == null ? void 0 : s.connection_recovery_min_interval) === t.connection_recovery_min_interval && (s == null ? void 0 : s.connection_recovery_max_interval) === t.connection_recovery_max_interval;
|
|
910
906
|
}
|
|
911
907
|
createUaConfiguration({
|
|
912
908
|
user: e,
|
|
@@ -915,34 +911,33 @@ class an {
|
|
|
915
911
|
displayName: n = "",
|
|
916
912
|
sipServerUrl: o,
|
|
917
913
|
register: a = !1,
|
|
918
|
-
|
|
919
|
-
sessionTimers: _ = !1,
|
|
914
|
+
sessionTimers: c = !1,
|
|
920
915
|
registerExpires: E = 60 * 5,
|
|
921
916
|
// 5 minutes in sec
|
|
922
|
-
connectionRecoveryMinInterval:
|
|
923
|
-
connectionRecoveryMaxInterval:
|
|
924
|
-
userAgent:
|
|
917
|
+
connectionRecoveryMinInterval: _ = 2,
|
|
918
|
+
connectionRecoveryMaxInterval: h = 6,
|
|
919
|
+
userAgent: l
|
|
925
920
|
}) {
|
|
926
921
|
if (a && !t)
|
|
927
922
|
throw new Error("password is required for authorized connection");
|
|
928
|
-
const
|
|
923
|
+
const d = a && e ? e.trim() : `${As()}`, T = Cs(o), u = T(d), N = new this.JsSIP.WebSocketInterface(s);
|
|
929
924
|
return {
|
|
930
925
|
configuration: {
|
|
931
926
|
password: t,
|
|
932
927
|
register: a,
|
|
933
|
-
uri:
|
|
934
|
-
display_name:
|
|
935
|
-
user_agent:
|
|
936
|
-
sdp_semantics:
|
|
937
|
-
sockets: [
|
|
938
|
-
session_timers:
|
|
928
|
+
uri: u,
|
|
929
|
+
display_name: ye(n),
|
|
930
|
+
user_agent: l,
|
|
931
|
+
sdp_semantics: "unified-plan",
|
|
932
|
+
sockets: [N],
|
|
933
|
+
session_timers: c,
|
|
939
934
|
register_expires: E,
|
|
940
|
-
connection_recovery_min_interval:
|
|
941
|
-
connection_recovery_max_interval:
|
|
935
|
+
connection_recovery_min_interval: _,
|
|
936
|
+
connection_recovery_max_interval: h
|
|
942
937
|
},
|
|
943
938
|
helpers: {
|
|
944
|
-
socket:
|
|
945
|
-
getSipServerUrl:
|
|
939
|
+
socket: N,
|
|
940
|
+
getSipServerUrl: T
|
|
946
941
|
}
|
|
947
942
|
};
|
|
948
943
|
}
|
|
@@ -952,10 +947,10 @@ class an {
|
|
|
952
947
|
isNeedReinvite: o = !0,
|
|
953
948
|
isP2P: a = !1
|
|
954
949
|
}) {
|
|
955
|
-
const c =
|
|
950
|
+
const c = H(t);
|
|
956
951
|
this._streamPresentationCurrent = c;
|
|
957
|
-
const
|
|
958
|
-
extraHeaders:
|
|
952
|
+
const E = a ? [ls] : [_s], _ = e.sendInfo(P, void 0, {
|
|
953
|
+
extraHeaders: E
|
|
959
954
|
}).then(async () => e.startPresentation(
|
|
960
955
|
c,
|
|
961
956
|
o,
|
|
@@ -965,11 +960,11 @@ class an {
|
|
|
965
960
|
if (!h || s === void 0)
|
|
966
961
|
return;
|
|
967
962
|
const l = h.getSenders();
|
|
968
|
-
await
|
|
963
|
+
await ws(l, t, s);
|
|
969
964
|
}).then(() => t).catch((h) => {
|
|
970
|
-
throw this._sessionEvents.trigger(
|
|
965
|
+
throw this._sessionEvents.trigger(U, h), h;
|
|
971
966
|
});
|
|
972
|
-
return this.promisePendingStartPresentation =
|
|
967
|
+
return this.promisePendingStartPresentation = _, _.finally(() => {
|
|
973
968
|
this.promisePendingStartPresentation = void 0;
|
|
974
969
|
});
|
|
975
970
|
}
|
|
@@ -992,8 +987,8 @@ class an {
|
|
|
992
987
|
});
|
|
993
988
|
}
|
|
994
989
|
async sendMustStopPresentation(e) {
|
|
995
|
-
await e.sendInfo(
|
|
996
|
-
extraHeaders: [
|
|
990
|
+
await e.sendInfo(P, void 0, {
|
|
991
|
+
extraHeaders: [ds]
|
|
997
992
|
});
|
|
998
993
|
}
|
|
999
994
|
async stopPresentation({
|
|
@@ -1001,12 +996,12 @@ class an {
|
|
|
1001
996
|
} = {}) {
|
|
1002
997
|
const t = this._streamPresentationCurrent;
|
|
1003
998
|
let s = this.promisePendingStartPresentation ?? Promise.resolve();
|
|
1004
|
-
const n = e ? [
|
|
1005
|
-
return o && t && (s = s.then(async () => o.sendInfo(
|
|
999
|
+
const n = e ? [Ts] : [hs], o = this.establishedSession;
|
|
1000
|
+
return o && t && (s = s.then(async () => o.sendInfo(P, void 0, {
|
|
1006
1001
|
extraHeaders: n
|
|
1007
1002
|
})).then(async () => o.stopPresentation(t)).catch((a) => {
|
|
1008
|
-
throw this._sessionEvents.trigger(
|
|
1009
|
-
})), !o && t && this._sessionEvents.trigger(
|
|
1003
|
+
throw this._sessionEvents.trigger(U, a), a;
|
|
1004
|
+
})), !o && t && this._sessionEvents.trigger(Ae, t), this.promisePendingStopPresentation = s, s.finally(() => {
|
|
1010
1005
|
this._resetPresentation();
|
|
1011
1006
|
});
|
|
1012
1007
|
}
|
|
@@ -1070,7 +1065,7 @@ class an {
|
|
|
1070
1065
|
if (!this.connection)
|
|
1071
1066
|
return;
|
|
1072
1067
|
const t = this.connection.getReceivers().map(({ track: s }) => s);
|
|
1073
|
-
return
|
|
1068
|
+
return Rs(t) ? this._generateStreams(t) : this._generateAudioStreams(t);
|
|
1074
1069
|
}
|
|
1075
1070
|
get connection() {
|
|
1076
1071
|
var t;
|
|
@@ -1120,8 +1115,8 @@ class an {
|
|
|
1120
1115
|
const o = s, a = e[n - 1];
|
|
1121
1116
|
let c;
|
|
1122
1117
|
a && a.kind === "audio" && (c = a);
|
|
1123
|
-
const
|
|
1124
|
-
t.push(
|
|
1118
|
+
const E = this._generateStream(o, c);
|
|
1119
|
+
t.push(E);
|
|
1125
1120
|
}), t;
|
|
1126
1121
|
}
|
|
1127
1122
|
_generateAudioStreams(e) {
|
|
@@ -1141,29 +1136,29 @@ class an {
|
|
|
1141
1136
|
this._cancelableAnswer.cancelRequest(), this._cancelableSendDTMF.cancelRequest();
|
|
1142
1137
|
}
|
|
1143
1138
|
async waitChannels() {
|
|
1144
|
-
return this.waitSession(
|
|
1139
|
+
return this.waitSession(v);
|
|
1145
1140
|
}
|
|
1146
1141
|
async waitSyncMediaState() {
|
|
1147
|
-
return this.waitSession(
|
|
1142
|
+
return this.waitSession(y);
|
|
1148
1143
|
}
|
|
1149
1144
|
async sendChannels({ inputChannels: e, outputChannels: t }) {
|
|
1150
1145
|
if (!this.session)
|
|
1151
1146
|
throw new Error("No session established");
|
|
1152
|
-
const s = `${
|
|
1147
|
+
const s = `${Pe}: ${e}`, n = `${De}: ${t}`, o = [
|
|
1153
1148
|
s,
|
|
1154
1149
|
n
|
|
1155
1150
|
];
|
|
1156
|
-
return this.session.sendInfo(
|
|
1151
|
+
return this.session.sendInfo($t, void 0, { extraHeaders: o });
|
|
1157
1152
|
}
|
|
1158
1153
|
async sendMediaState({ cam: e, mic: t }, s = {}) {
|
|
1159
1154
|
if (!this.session)
|
|
1160
1155
|
throw new Error("No session established");
|
|
1161
|
-
const n = `${
|
|
1156
|
+
const n = `${ss}: currentstate`, o = `${is}: ${Number(e)}`, a = `${rs}: ${Number(t)}`, c = [
|
|
1162
1157
|
n,
|
|
1163
1158
|
o,
|
|
1164
1159
|
a
|
|
1165
1160
|
];
|
|
1166
|
-
return this.session.sendInfo(
|
|
1161
|
+
return this.session.sendInfo(Xt, void 0, {
|
|
1167
1162
|
noTerminateWhenError: !0,
|
|
1168
1163
|
...s,
|
|
1169
1164
|
extraHeaders: c
|
|
@@ -1172,8 +1167,8 @@ class an {
|
|
|
1172
1167
|
async _sendRefusalToTurnOn(e, t = {}) {
|
|
1173
1168
|
if (!this.session)
|
|
1174
1169
|
throw new Error("No session established");
|
|
1175
|
-
const c = [`${
|
|
1176
|
-
return this.session.sendInfo(
|
|
1170
|
+
const c = [`${ns}: ${e === "mic" ? 0 : 1}`];
|
|
1171
|
+
return this.session.sendInfo(Jt, void 0, {
|
|
1177
1172
|
noTerminateWhenError: !0,
|
|
1178
1173
|
...t,
|
|
1179
1174
|
extraHeaders: c
|
|
@@ -1191,22 +1186,22 @@ class an {
|
|
|
1191
1186
|
}
|
|
1192
1187
|
}
|
|
1193
1188
|
export {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1189
|
+
Ft as B,
|
|
1190
|
+
I as E,
|
|
1191
|
+
Mt as N,
|
|
1192
|
+
Ue as R,
|
|
1193
|
+
on as S,
|
|
1194
|
+
ct as U,
|
|
1195
|
+
en as a,
|
|
1196
|
+
sn as b,
|
|
1197
|
+
Zs as c,
|
|
1198
|
+
nn as d,
|
|
1199
|
+
tn as e,
|
|
1200
|
+
W as f,
|
|
1201
|
+
k as g,
|
|
1202
|
+
rn as h,
|
|
1203
|
+
Ns as i,
|
|
1204
|
+
Et as j,
|
|
1205
|
+
ve as l,
|
|
1206
|
+
ys as s
|
|
1212
1207
|
};
|