sip-connector 12.1.0 → 13.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-BxDInUHC.js → SipConnector-B4xLnl6L.js} +284 -278
- package/dist/SipConnector-CE4F15z6.cjs +1 -0
- package/dist/SipConnector.d.ts +9 -17
- package/dist/SipConnectorFacade/SipConnectorFacade.d.ts +14 -6
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +273 -255
- package/dist/tools/generateSimulcastEncodings.d.ts +2 -2
- package/dist/tools/prepareMediaStream.d.ts +3 -3
- package/dist/types.d.ts +4 -1
- package/package.json +12 -12
- package/dist/SipConnector-Ds1fhzNg.cjs +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var It = Object.defineProperty;
|
|
2
2
|
var ft = (s, e, t) => e in s ? It(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var o = (s, e, t) => ft(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { CancelableRequest as
|
|
5
|
-
import
|
|
6
|
-
import { repeatedCallsAsync as
|
|
7
|
-
import
|
|
8
|
-
const mt = "Connection Error",
|
|
4
|
+
import { CancelableRequest as C, isCanceledError as Pt } from "@krivega/cancelable-promise";
|
|
5
|
+
import ve from "events-constructor";
|
|
6
|
+
import { repeatedCallsAsync as ye } from "repeated-calls";
|
|
7
|
+
import G from "debug";
|
|
8
|
+
const mt = "Connection Error", ke = "Request Timeout", Ot = "SIP Failure Code", Dt = "Internal Error", Mt = "Busy", Be = "Rejected", pt = "Redirected", vt = "Unavailable", yt = "Not Found", wt = "Address Incomplete", bt = "Incompatible SDP", Ut = "Missing SDP", Lt = "Authentication Error", qe = "Terminated", Ht = "WebRTC Error", Fe = "Canceled", Wt = "No Answer", kt = "Expires", Bt = "No ACK", qt = "Dialog Error", Ft = "User Denied Media Access", xt = "Bad Media Description", Vt = "RTP Timeout", hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9
9
|
__proto__: null,
|
|
10
10
|
ADDRESS_INCOMPLETE: wt,
|
|
11
11
|
AUTHENTICATION_ERROR: Lt,
|
|
12
12
|
BAD_MEDIA_DESCRIPTION: xt,
|
|
13
|
-
BUSY:
|
|
14
|
-
BYE:
|
|
15
|
-
CANCELED:
|
|
13
|
+
BUSY: Mt,
|
|
14
|
+
BYE: qe,
|
|
15
|
+
CANCELED: Fe,
|
|
16
16
|
CONNECTION_ERROR: mt,
|
|
17
17
|
DIALOG_ERROR: qt,
|
|
18
18
|
EXPIRES: kt,
|
|
@@ -22,152 +22,151 @@ const mt = "Connection Error", We = "Request Timeout", Ot = "SIP Failure Code",
|
|
|
22
22
|
NOT_FOUND: yt,
|
|
23
23
|
NO_ACK: Bt,
|
|
24
24
|
NO_ANSWER: Wt,
|
|
25
|
-
REDIRECTED:
|
|
26
|
-
REJECTED:
|
|
27
|
-
REQUEST_TIMEOUT:
|
|
25
|
+
REDIRECTED: pt,
|
|
26
|
+
REJECTED: Be,
|
|
27
|
+
REQUEST_TIMEOUT: ke,
|
|
28
28
|
RTP_TIMEOUT: Vt,
|
|
29
29
|
SIP_FAILURE_CODE: Ot,
|
|
30
30
|
UNAVAILABLE: vt,
|
|
31
31
|
USER_DENIED_MEDIA_ACCESS: Ft,
|
|
32
32
|
WEBRTC_ERROR: Ht
|
|
33
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
33
|
+
}, Symbol.toStringTag, { value: "Module" })), $ = "incomingCall", J = "declinedIncomingCall", X = "failedIncomingCall", z = "terminatedIncomingCall", k = "connecting", m = "connected", N = "disconnected", y = "newRTCSession", O = "registered", Q = "unregistered", D = "registrationFailed", xe = "newMessage", j = "sipEvent", K = "availableSecondRemoteStream", Z = "notAvailableSecondRemoteStream", ee = "mustStopPresentation", w = "shareState", te = "enterRoom", ne = "useLicense", se = "peerconnection:confirmed", ie = "peerconnection:ontrack", b = "channels", oe = "channels:notify", re = "ended:fromserver", ae = "main-cam-control", ce = "admin-stop-main-cam", _e = "admin-start-main-cam", Ee = "admin-stop-mic", he = "admin-start-mic", U = "admin-force-sync-media-state", de = "participant:added-to-list-moderators", le = "participant:removed-from-list-moderators", Te = "participant:move-request-to-stream", ue = "participant:move-request-to-spectators", Se = "participant:move-request-to-participants", Ne = "participation:accepting-word-request", ge = "participation:cancelling-word-request", Ce = "webcast:started", Ae = "webcast:stopped", Re = "account:changed", Ie = "account:deleted", fe = "conference:participant-token-issued", M = "ended", Ve = "sending", Ye = "reinvite", Ge = "replaces", $e = "refer", Je = "progress", Xe = "accepted", L = "confirmed", H = "peerconnection", R = "failed", ze = "muted", Qe = "unmuted", Pe = "newDTMF", me = "newInfo", je = "hold", Ke = "unhold", Ze = "update", et = "sdp", tt = "icecandidate", nt = "getusermediafailed", st = "peerconnection:createofferfailed", it = "peerconnection:createanswerfailed", ot = "peerconnection:setlocaldescriptionfailed", rt = "peerconnection:setremotedescriptionfailed", at = "presentation:start", ct = "presentation:started", _t = "presentation:end", Oe = "presentation:ended", W = "presentation:failed", Et = "SPECTATOR", ht = "PARTICIPANT", dt = 1e6, ds = /* @__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:
|
|
35
|
+
ACCEPTED: Xe,
|
|
36
|
+
ACCOUNT_CHANGED: Re,
|
|
37
|
+
ACCOUNT_DELETED: Ie,
|
|
38
|
+
ADMIN_FORCE_SYNC_MEDIA_STATE: U,
|
|
39
|
+
ADMIN_START_MAIN_CAM: _e,
|
|
40
|
+
ADMIN_START_MIC: he,
|
|
41
|
+
ADMIN_STOP_MAIN_CAM: ce,
|
|
42
|
+
ADMIN_STOP_MIC: Ee,
|
|
43
|
+
AVAILABLE_SECOND_REMOTE_STREAM_EVENT: K,
|
|
44
|
+
CHANNELS: b,
|
|
45
|
+
CHANNELS_NOTIFY: oe,
|
|
46
|
+
CONFERENCE_PARTICIPANT_TOKEN_ISSUED: fe,
|
|
47
|
+
CONFIRMED: L,
|
|
48
|
+
CONNECTED: m,
|
|
49
|
+
CONNECTING: k,
|
|
50
|
+
DECLINED_INCOMING_CALL: J,
|
|
51
51
|
DISCONNECTED: N,
|
|
52
|
-
ENDED:
|
|
53
|
-
ENDED_FROM_SERVER:
|
|
54
|
-
ENTER_ROOM:
|
|
52
|
+
ENDED: M,
|
|
53
|
+
ENDED_FROM_SERVER: re,
|
|
54
|
+
ENTER_ROOM: te,
|
|
55
55
|
FAILED: R,
|
|
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
|
-
ONE_MEGABIT_IN_BITS:
|
|
70
|
-
PARTICIPANT:
|
|
71
|
-
PARTICIPANT_ADDED_TO_LIST_MODERATORS:
|
|
72
|
-
PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS:
|
|
73
|
-
PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS:
|
|
74
|
-
PARTICIPANT_MOVE_REQUEST_TO_STREAM:
|
|
75
|
-
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS:
|
|
76
|
-
PARTICIPATION_ACCEPTING_WORD_REQUEST:
|
|
77
|
-
PARTICIPATION_CANCELLING_WORD_REQUEST:
|
|
78
|
-
PEER_CONNECTION:
|
|
79
|
-
PEER_CONNECTION_CONFIRMED:
|
|
80
|
-
PEER_CONNECTION_CREATE_ANSWER_FAILED:
|
|
81
|
-
PEER_CONNECTION_CREATE_OFFER_FAILED:
|
|
82
|
-
PEER_CONNECTION_ONTRACK:
|
|
83
|
-
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED:
|
|
84
|
-
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED:
|
|
85
|
-
PRESENTATION_END:
|
|
86
|
-
PRESENTATION_ENDED:
|
|
87
|
-
PRESENTATION_FAILED:
|
|
88
|
-
PRESENTATION_START:
|
|
89
|
-
PRESENTATION_STARTED:
|
|
90
|
-
PROGRESS:
|
|
91
|
-
REFER:
|
|
92
|
-
REGISTERED:
|
|
93
|
-
REGISTRATION_FAILED:
|
|
94
|
-
REINVITE:
|
|
95
|
-
REPLACES:
|
|
96
|
-
SDP:
|
|
97
|
-
SENDING:
|
|
98
|
-
SHARE_STATE:
|
|
99
|
-
SIP_EVENT:
|
|
100
|
-
SPECTATOR:
|
|
101
|
-
TERMINATED_INCOMING_CALL:
|
|
102
|
-
UNHOLD:
|
|
103
|
-
UNMUTED:
|
|
104
|
-
UNREGISTERED:
|
|
105
|
-
UPDATE:
|
|
106
|
-
USE_LICENSE:
|
|
107
|
-
WEBCAST_STARTED:
|
|
108
|
-
WEBCAST_STOPPED:
|
|
109
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
110
|
-
Y,
|
|
111
|
-
G,
|
|
112
|
-
J,
|
|
56
|
+
FAILED_INCOMING_CALL: X,
|
|
57
|
+
GET_USER_MEDIA_FAILED: nt,
|
|
58
|
+
HOLD: je,
|
|
59
|
+
ICE_CANDIDATE: tt,
|
|
60
|
+
INCOMING_CALL: $,
|
|
61
|
+
MAIN_CAM_CONTROL: ae,
|
|
62
|
+
MUST_STOP_PRESENTATION_EVENT: ee,
|
|
63
|
+
MUTED: ze,
|
|
64
|
+
NEW_DTMF: Pe,
|
|
65
|
+
NEW_INFO: me,
|
|
66
|
+
NEW_MESSAGE: xe,
|
|
67
|
+
NEW_RTC_SESSION: y,
|
|
68
|
+
NOT_AVAILABLE_SECOND_REMOTE_STREAM_EVENT: Z,
|
|
69
|
+
ONE_MEGABIT_IN_BITS: dt,
|
|
70
|
+
PARTICIPANT: ht,
|
|
71
|
+
PARTICIPANT_ADDED_TO_LIST_MODERATORS: de,
|
|
72
|
+
PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS: Se,
|
|
73
|
+
PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS: ue,
|
|
74
|
+
PARTICIPANT_MOVE_REQUEST_TO_STREAM: Te,
|
|
75
|
+
PARTICIPANT_REMOVED_FROM_LIST_MODERATORS: le,
|
|
76
|
+
PARTICIPATION_ACCEPTING_WORD_REQUEST: Ne,
|
|
77
|
+
PARTICIPATION_CANCELLING_WORD_REQUEST: ge,
|
|
78
|
+
PEER_CONNECTION: H,
|
|
79
|
+
PEER_CONNECTION_CONFIRMED: se,
|
|
80
|
+
PEER_CONNECTION_CREATE_ANSWER_FAILED: it,
|
|
81
|
+
PEER_CONNECTION_CREATE_OFFER_FAILED: st,
|
|
82
|
+
PEER_CONNECTION_ONTRACK: ie,
|
|
83
|
+
PEER_CONNECTION_SET_LOCAL_DESCRIPTION_FAILED: ot,
|
|
84
|
+
PEER_CONNECTION_SET_REMOTE_DESCRIPTION_FAILED: rt,
|
|
85
|
+
PRESENTATION_END: _t,
|
|
86
|
+
PRESENTATION_ENDED: Oe,
|
|
87
|
+
PRESENTATION_FAILED: W,
|
|
88
|
+
PRESENTATION_START: at,
|
|
89
|
+
PRESENTATION_STARTED: ct,
|
|
90
|
+
PROGRESS: Je,
|
|
91
|
+
REFER: $e,
|
|
92
|
+
REGISTERED: O,
|
|
93
|
+
REGISTRATION_FAILED: D,
|
|
94
|
+
REINVITE: Ye,
|
|
95
|
+
REPLACES: Ge,
|
|
96
|
+
SDP: et,
|
|
97
|
+
SENDING: Ve,
|
|
98
|
+
SHARE_STATE: w,
|
|
99
|
+
SIP_EVENT: j,
|
|
100
|
+
SPECTATOR: Et,
|
|
101
|
+
TERMINATED_INCOMING_CALL: z,
|
|
102
|
+
UNHOLD: Ke,
|
|
103
|
+
UNMUTED: Qe,
|
|
104
|
+
UNREGISTERED: Q,
|
|
105
|
+
UPDATE: Ze,
|
|
106
|
+
USE_LICENSE: ne,
|
|
107
|
+
WEBCAST_STARTED: Ce,
|
|
108
|
+
WEBCAST_STOPPED: Ae
|
|
109
|
+
}, Symbol.toStringTag, { value: "Module" })), lt = [
|
|
113
110
|
$,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
J,
|
|
112
|
+
z,
|
|
113
|
+
X,
|
|
114
|
+
Ne,
|
|
115
|
+
ge,
|
|
116
|
+
Te,
|
|
117
|
+
oe,
|
|
118
|
+
fe,
|
|
118
119
|
Re,
|
|
120
|
+
Ie,
|
|
119
121
|
Ce,
|
|
120
122
|
Ae,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
], me = [
|
|
126
|
-
W,
|
|
127
|
-
P,
|
|
128
|
-
N,
|
|
129
|
-
v,
|
|
123
|
+
de,
|
|
124
|
+
le
|
|
125
|
+
], De = [
|
|
126
|
+
k,
|
|
130
127
|
m,
|
|
131
|
-
|
|
128
|
+
N,
|
|
129
|
+
y,
|
|
132
130
|
O,
|
|
133
|
-
Fe,
|
|
134
|
-
z
|
|
135
|
-
], lt = [
|
|
136
131
|
Q,
|
|
137
|
-
|
|
132
|
+
D,
|
|
133
|
+
xe,
|
|
134
|
+
j
|
|
135
|
+
], Tt = [
|
|
138
136
|
K,
|
|
139
|
-
y,
|
|
140
137
|
Z,
|
|
141
138
|
ee,
|
|
139
|
+
w,
|
|
142
140
|
te,
|
|
143
141
|
ne,
|
|
144
|
-
|
|
142
|
+
se,
|
|
145
143
|
ie,
|
|
146
|
-
|
|
147
|
-
ae,
|
|
144
|
+
b,
|
|
148
145
|
re,
|
|
149
|
-
|
|
146
|
+
ae,
|
|
150
147
|
_e,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
ce,
|
|
149
|
+
Ee,
|
|
150
|
+
he,
|
|
151
|
+
U,
|
|
152
|
+
ue,
|
|
153
|
+
Se
|
|
154
|
+
], Me = [
|
|
155
|
+
M,
|
|
156
|
+
k,
|
|
158
157
|
Ve,
|
|
159
158
|
Ye,
|
|
160
159
|
Ge,
|
|
161
160
|
$e,
|
|
162
161
|
Je,
|
|
163
|
-
|
|
162
|
+
Xe,
|
|
164
163
|
L,
|
|
164
|
+
H,
|
|
165
165
|
R,
|
|
166
|
-
Xe,
|
|
167
166
|
ze,
|
|
168
|
-
Ie,
|
|
169
|
-
fe,
|
|
170
167
|
Qe,
|
|
168
|
+
Pe,
|
|
169
|
+
me,
|
|
171
170
|
je,
|
|
172
171
|
Ke,
|
|
173
172
|
Ze,
|
|
@@ -180,33 +179,34 @@ const mt = "Connection Error", We = "Request Timeout", Ot = "SIP Failure Code",
|
|
|
180
179
|
rt,
|
|
181
180
|
at,
|
|
182
181
|
ct,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
...
|
|
182
|
+
_t,
|
|
183
|
+
Oe,
|
|
184
|
+
W
|
|
185
|
+
], ut = [...De, ...lt], St = [
|
|
186
|
+
...Me,
|
|
187
|
+
...Tt
|
|
188
188
|
], ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
189
189
|
__proto__: null,
|
|
190
|
-
SESSION_EVENT_NAMES:
|
|
191
|
-
SESSION_JSSIP_EVENT_NAMES:
|
|
192
|
-
SESSION_SYNTHETICS_EVENT_NAMES:
|
|
193
|
-
UA_EVENT_NAMES:
|
|
194
|
-
UA_JSSIP_EVENT_NAMES:
|
|
195
|
-
UA_SYNTHETICS_EVENT_NAMES:
|
|
190
|
+
SESSION_EVENT_NAMES: St,
|
|
191
|
+
SESSION_JSSIP_EVENT_NAMES: Me,
|
|
192
|
+
SESSION_SYNTHETICS_EVENT_NAMES: Tt,
|
|
193
|
+
UA_EVENT_NAMES: ut,
|
|
194
|
+
UA_JSSIP_EVENT_NAMES: De,
|
|
195
|
+
UA_SYNTHETICS_EVENT_NAMES: lt
|
|
196
196
|
}, Symbol.toStringTag, { value: "Module" })), Yt = (s) => {
|
|
197
197
|
const e = [];
|
|
198
198
|
return s && e.push(`X-Vinteo-Remote: ${s}`), e;
|
|
199
|
-
}, Gt = "content-type", $t = "x-webrtc-enter-room", p = "application/vinteo.webrtc.sharedesktop", Jt = "application/vinteo.webrtc.roomname", Xt = "application/vinteo.webrtc.channels", zt = "application/vinteo.webrtc.mediastate", Qt = "application/vinteo.webrtc.refusal",
|
|
200
|
-
|
|
199
|
+
}, Gt = "content-type", $t = "x-webrtc-enter-room", p = "application/vinteo.webrtc.sharedesktop", Jt = "application/vinteo.webrtc.roomname", Xt = "application/vinteo.webrtc.channels", zt = "application/vinteo.webrtc.mediastate", Qt = "application/vinteo.webrtc.refusal", we = "application/vinteo.webrtc.maincam", jt = "application/vinteo.webrtc.mic", Kt = "application/vinteo.webrtc.uselic", Zt = "X-WEBRTC-USE-LICENSE", en = "X-WEBRTC-PARTICIPANT-NAME", be = "X-WEBRTC-INPUT-CHANNELS", Ue = "X-WEBRTC-OUTPUT-CHANNELS", tn = "X-WEBRTC-MAINCAM", nn = "X-WEBRTC-MIC", Le = "X-WEBRTC-SYNC", sn = "X-WEBRTC-MAINCAM-RESOLUTION", on = "X-WEBRTC-MEDIA-STATE", rn = "X-Vinteo-Media-Type", an = "X-Vinteo-MainCam-State", cn = "X-Vinteo-Mic-State", _n = "application/vinteo.webrtc.partstate", En = "X-WEBRTC-PARTSTATE", hn = "application/vinteo.webrtc.notify", dn = "X-VINTEO-NOTIFY", I = "x-webrtc-share-state", ln = `${I}: LETMESTARTPRESENTATION`, Tn = `${I}: STOPPRESENTATION`, Nt = "YOUCANRECEIVECONTENT", gt = "CONTENTEND", Ct = "YOUMUSTSTOPSENDCONTENT", un = `${I}: ${Ct}`, Sn = `${I}: ${Nt}`, Nn = `${I}: ${gt}`, gn = "X-WEBRTC-REQUEST-ENABLE-MEDIA-DEVICE", Cn = `${gn}: LETMESTARTMAINCAM`, pe = "sip-connector", F = G(pe), Ts = () => {
|
|
200
|
+
G.enable(pe);
|
|
201
201
|
}, us = () => {
|
|
202
|
-
|
|
202
|
+
G.enable(`-${pe}`);
|
|
203
203
|
}, An = (s, e) => {
|
|
204
204
|
s.getVideoTracks().forEach((n) => {
|
|
205
205
|
"contentHint" in n && n.contentHint !== e && (n.contentHint = e);
|
|
206
206
|
});
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
}, v = (s, {
|
|
208
|
+
directionVideo: e,
|
|
209
|
+
directionAudio: t,
|
|
210
210
|
contentHint: n
|
|
211
211
|
} = {}) => {
|
|
212
212
|
if (!s || e === "recvonly" && t === "recvonly")
|
|
@@ -214,28 +214,28 @@ const mt = "Connection Error", We = "Request Timeout", Ot = "SIP Failure Code",
|
|
|
214
214
|
const i = t === "recvonly" ? [] : s.getAudioTracks(), r = e === "recvonly" ? [] : s.getVideoTracks(), a = [...i, ...r], c = new MediaStream(a);
|
|
215
215
|
return c.getTracks = () => [...c.getAudioTracks(), ...c.getVideoTracks()], n && n !== "none" && An(c, n), c;
|
|
216
216
|
};
|
|
217
|
-
var
|
|
217
|
+
var P = /* @__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))(P || {}), x = /* @__PURE__ */ ((s) => (s.ADMIN_STOP_MIC = "ADMINSTOPMIC", s.ADMIN_START_MIC = "ADMINSTARTMIC", s))(x || {}), V = /* @__PURE__ */ ((s) => (s.ADMIN_SYNC_FORCED = "1", s.ADMIN_SYNC_NOT_FORCED = "0", s))(V || {}), Rn = /* @__PURE__ */ ((s) => (s.AUDIO = "AUDIO", s.VIDEO = "VIDEO", s.AUDIOPLUSPRESENTATION = "AUDIOPLUSPRESENTATION", s))(Rn || {}), In = /* @__PURE__ */ ((s) => (s.VP8 = "video/VP8", s.VP9 = "video/VP9", s.H264 = "video/H264", s.AV1 = "video/AV1", s.rtx = "video/rtx", s.red = "video/red", s.flexfec03 = "video/flexfec-03", s))(In || {});
|
|
218
218
|
function fn(s) {
|
|
219
219
|
return (e) => `sip:${e}@${s}`;
|
|
220
220
|
}
|
|
221
|
-
const Pn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s,
|
|
221
|
+
const Pn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, He = (s) => s.trim().replaceAll(" ", "_"), mn = Pn(1e5, 99999999), On = (s) => s.some((t) => {
|
|
222
222
|
const { kind: n } = t;
|
|
223
223
|
return n === "video";
|
|
224
|
-
}), Dn = "Error decline with 603",
|
|
224
|
+
}), Dn = "Error decline with 603", Mn = 1006, pn = (s) => typeof s == "object" && s !== null && "code" in s && s.code === Mn, vn = (s) => s.message === Dn, yn = (s, e) => s.find((t) => t.track && e.getTracks().includes(t.track)), wn = (s, e) => (s.degradationPreference = e.degradationPreference, s), bn = (s, e) => {
|
|
225
225
|
s.encodings === void 0 && (s.encodings = []);
|
|
226
226
|
for (let t = s.encodings.length; t < e; t += 1)
|
|
227
227
|
s.encodings.push({});
|
|
228
228
|
return s;
|
|
229
|
-
},
|
|
229
|
+
}, At = (s) => (e, t) => t !== void 0 && e !== t || t === void 0 && e !== s, Un = At(), Ln = (s, e) => {
|
|
230
230
|
if (Un(s, e))
|
|
231
231
|
return s;
|
|
232
232
|
}, Hn = (s, e) => {
|
|
233
233
|
const t = s.maxBitrate, n = Ln(e, t);
|
|
234
234
|
return n !== void 0 && (s.maxBitrate = n), s;
|
|
235
|
-
},
|
|
236
|
-
|
|
235
|
+
}, Rt = 1, Wn = At(
|
|
236
|
+
Rt
|
|
237
237
|
), kn = (s, e) => {
|
|
238
|
-
const t = s === void 0 ? void 0 : Math.max(s,
|
|
238
|
+
const t = s === void 0 ? void 0 : Math.max(s, Rt);
|
|
239
239
|
if (t !== void 0 && Wn(
|
|
240
240
|
t,
|
|
241
241
|
e
|
|
@@ -291,10 +291,10 @@ const Pn = (s, e) => () => Math.floor(Math.random() * (e - s)) + s, Le = (s) =>
|
|
|
291
291
|
const n = yn(s, e);
|
|
292
292
|
if (n)
|
|
293
293
|
return Vn(n, { maxBitrate: t });
|
|
294
|
-
}, Gn = 486, $n = 487,
|
|
294
|
+
}, Gn = 486, $n = 487, Y = "local", We = "remote", Jn = 3, Xn = 1, Ss = (s = new Error()) => {
|
|
295
295
|
const { originator: e, cause: t } = s;
|
|
296
|
-
return Pt(s) ? !0 : typeof t == "string" ? t ===
|
|
297
|
-
},
|
|
296
|
+
return Pt(s) ? !0 : typeof t == "string" ? t === ke || t === Be || e === Y && (t === Fe || t === qe) : !1;
|
|
297
|
+
}, A = "SipConnector", zn = "channels", Qn = "WebcastStarted", jn = "WebcastStopped", Kn = "accountChanged", Zn = "accountDeleted", es = "addedToListModerators", ts = "removedFromListModerators", ns = "ParticipationRequestAccepted", ss = "ParticipationRequestRejected", is = "ParticipantMovedToWebcast", os = "ConferenceParticipantTokenIssued";
|
|
298
298
|
class Ns {
|
|
299
299
|
constructor({ JsSIP: e }) {
|
|
300
300
|
o(this, "_isRegisterConfig", !1);
|
|
@@ -331,11 +331,11 @@ class Ns {
|
|
|
331
331
|
o(this, "tryRegister", async () => {
|
|
332
332
|
if (!this.isRegisterConfig)
|
|
333
333
|
throw new Error("Config is not registered");
|
|
334
|
-
this._uaEvents.trigger(
|
|
334
|
+
this._uaEvents.trigger(k, void 0);
|
|
335
335
|
try {
|
|
336
336
|
await this.unregister();
|
|
337
337
|
} catch (e) {
|
|
338
|
-
|
|
338
|
+
F("tryRegister", e);
|
|
339
339
|
}
|
|
340
340
|
return this.register();
|
|
341
341
|
});
|
|
@@ -345,7 +345,7 @@ class Ns {
|
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
const i = this.incomingSession, r = this.remoteCallerData;
|
|
348
|
-
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(
|
|
348
|
+
this._cancelableCall.cancelRequest(), this._cancelableAnswer.cancelRequest(), this.removeIncomingSession(), this._uaEvents.trigger(J, r), t(i.terminate({ status_code: e }));
|
|
349
349
|
}));
|
|
350
350
|
o(this, "busyIncomingCall", async () => this.declineToIncomingCall({ statusCode: Gn }));
|
|
351
351
|
o(this, "removeIncomingSession", () => {
|
|
@@ -354,10 +354,10 @@ class Ns {
|
|
|
354
354
|
o(this, "_connectWithDuplicatedCalls", async (e, { callLimit: t = Jn } = {}) => {
|
|
355
355
|
const n = async () => this._cancelableConnect.request(e), i = (r) => {
|
|
356
356
|
var h;
|
|
357
|
-
const c = !!((h = this.ua) != null && h.isConnected()) && this.hasEqualConnectionConfiguration(e), E = !!r && !
|
|
357
|
+
const c = !!((h = this.ua) != null && h.isConnected()) && this.hasEqualConnectionConfiguration(e), E = !!r && !pn(r);
|
|
358
358
|
return c || E;
|
|
359
359
|
};
|
|
360
|
-
return this._cancelableConnectWithRepeatedCalls =
|
|
360
|
+
return this._cancelableConnectWithRepeatedCalls = ye({
|
|
361
361
|
targetFunction: n,
|
|
362
362
|
isComplete: i,
|
|
363
363
|
callLimit: t,
|
|
@@ -373,12 +373,12 @@ class Ns {
|
|
|
373
373
|
});
|
|
374
374
|
});
|
|
375
375
|
o(this, "handleNewRTCSession", ({ originator: e, session: t }) => {
|
|
376
|
-
if (e ===
|
|
376
|
+
if (e === We) {
|
|
377
377
|
this.incomingSession = t;
|
|
378
378
|
const n = this.remoteCallerData;
|
|
379
379
|
t.on(R, (i) => {
|
|
380
|
-
this.removeIncomingSession(), i.originator ===
|
|
381
|
-
}), this._uaEvents.trigger(
|
|
380
|
+
this.removeIncomingSession(), i.originator === Y ? this._uaEvents.trigger(z, n) : this._uaEvents.trigger(X, n);
|
|
381
|
+
}), this._uaEvents.trigger($, n);
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
384
|
o(this, "_connect", async (e) => this.initUa(e).then(async () => this._start()));
|
|
@@ -425,9 +425,9 @@ class Ns {
|
|
|
425
425
|
connectionRecoveryMaxInterval: h,
|
|
426
426
|
userAgent: _
|
|
427
427
|
});
|
|
428
|
-
return this.getSipServerUrl = S.getSipServerUrl, this.socket = S.socket, this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!d, this.ua = this._createUa({ ...u, remoteAddress: r, extraHeaders: T }), this._uaEvents.eachTriggers((
|
|
429
|
-
const
|
|
430
|
-
|
|
428
|
+
return this.getSipServerUrl = S.getSipServerUrl, this.socket = S.socket, this.ua && await this._disconnectWithoutCancelRequests(), this._isRegisterConfig = !!d, this.ua = this._createUa({ ...u, remoteAddress: r, extraHeaders: T }), this._uaEvents.eachTriggers((g, B) => {
|
|
429
|
+
const f = De.find((q) => q === B);
|
|
430
|
+
f && this.ua && this.ua.on(f, g);
|
|
431
431
|
}), this.ua;
|
|
432
432
|
});
|
|
433
433
|
o(this, "_createUa", ({
|
|
@@ -449,11 +449,11 @@ class Ns {
|
|
|
449
449
|
}, r = (E) => {
|
|
450
450
|
c(), t(E);
|
|
451
451
|
}, a = () => {
|
|
452
|
-
this.isRegisterConfig ? (this.on(
|
|
452
|
+
this.isRegisterConfig ? (this.on(O, i), this.on(D, r)) : this.on(m, i), this.on(N, r);
|
|
453
453
|
}, c = () => {
|
|
454
|
-
this.off(
|
|
454
|
+
this.off(O, i), this.off(D, r), this.off(m, i), this.off(N, r);
|
|
455
455
|
};
|
|
456
|
-
a(), this.on(
|
|
456
|
+
a(), this.on(y, this.handleNewRTCSession), n.start();
|
|
457
457
|
}));
|
|
458
458
|
o(this, "_set", async ({ displayName: e, password: t }) => new Promise((n, i) => {
|
|
459
459
|
const { ua: r } = this;
|
|
@@ -462,7 +462,7 @@ class Ns {
|
|
|
462
462
|
return;
|
|
463
463
|
}
|
|
464
464
|
let a = !1, c = !1;
|
|
465
|
-
e !== void 0 && e !== this._connectionConfiguration.displayName && (a = r.set("display_name",
|
|
465
|
+
e !== void 0 && e !== this._connectionConfiguration.displayName && (a = r.set("display_name", He(e)), this._connectionConfiguration.displayName = e), t !== void 0 && t !== this._connectionConfiguration.password && (c = r.set("password", t), this._connectionConfiguration.password = t);
|
|
466
466
|
const E = a || c;
|
|
467
467
|
c && this.isRegisterConfig ? this.register().then(() => {
|
|
468
468
|
n(E);
|
|
@@ -472,7 +472,7 @@ class Ns {
|
|
|
472
472
|
}));
|
|
473
473
|
o(this, "_disconnectWithoutCancelRequests", async () => this._cancelableDisconnect.request());
|
|
474
474
|
o(this, "_disconnect", async () => {
|
|
475
|
-
this.off(
|
|
475
|
+
this.off(y, this.handleNewRTCSession);
|
|
476
476
|
const e = new Promise((t) => {
|
|
477
477
|
this.once(N, () => {
|
|
478
478
|
delete this.ua, t();
|
|
@@ -486,8 +486,8 @@ class Ns {
|
|
|
486
486
|
extraHeaders: n = [],
|
|
487
487
|
ontrack: i,
|
|
488
488
|
iceServers: r,
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
directionVideo: a,
|
|
490
|
+
directionAudio: c,
|
|
491
491
|
contentHint: E,
|
|
492
492
|
offerToReceiveAudio: h = !0,
|
|
493
493
|
offerToReceiveVideo: _ = !0,
|
|
@@ -499,18 +499,18 @@ class Ns {
|
|
|
499
499
|
u(new Error("this.ua is not initialized"));
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
502
|
-
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: i }).then(T).catch((
|
|
503
|
-
u(
|
|
502
|
+
this._connectionConfiguration.number = e, this._connectionConfiguration.answer = !1, this._handleCall({ ontrack: i }).then(T).catch((g) => {
|
|
503
|
+
u(g);
|
|
504
504
|
}), this.session = S.call(this.getSipServerUrl(e), {
|
|
505
505
|
extraHeaders: n,
|
|
506
|
-
mediaStream:
|
|
507
|
-
|
|
508
|
-
|
|
506
|
+
mediaStream: v(t, {
|
|
507
|
+
directionVideo: a,
|
|
508
|
+
directionAudio: c,
|
|
509
509
|
contentHint: E
|
|
510
510
|
}),
|
|
511
511
|
eventHandlers: this._sessionEvents.triggers,
|
|
512
|
-
|
|
513
|
-
|
|
512
|
+
directionVideo: a,
|
|
513
|
+
directionAudio: c,
|
|
514
514
|
pcConfig: {
|
|
515
515
|
iceServers: r
|
|
516
516
|
},
|
|
@@ -527,64 +527,70 @@ class Ns {
|
|
|
527
527
|
ontrack: t,
|
|
528
528
|
extraHeaders: n = [],
|
|
529
529
|
iceServers: i,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
530
|
+
directionVideo: r,
|
|
531
|
+
directionAudio: a,
|
|
532
|
+
offerToReceiveAudio: c,
|
|
533
|
+
offerToReceiveVideo: E,
|
|
534
|
+
contentHint: h,
|
|
535
|
+
sendEncodings: _,
|
|
536
|
+
onAddedTransceiver: l
|
|
537
|
+
}) => new Promise((d, T) => {
|
|
536
538
|
if (!this.isAvailableIncomingCall) {
|
|
537
|
-
|
|
539
|
+
T(new Error("no incomingSession"));
|
|
538
540
|
return;
|
|
539
541
|
}
|
|
540
542
|
this.session = this.incomingSession, this.removeIncomingSession();
|
|
541
|
-
const { session:
|
|
542
|
-
if (!
|
|
543
|
-
|
|
543
|
+
const { session: u } = this;
|
|
544
|
+
if (!u) {
|
|
545
|
+
T(new Error("No session established"));
|
|
544
546
|
return;
|
|
545
547
|
}
|
|
546
|
-
this._sessionEvents.eachTriggers((
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number =
|
|
550
|
-
|
|
548
|
+
this._sessionEvents.eachTriggers((g, B) => {
|
|
549
|
+
const f = Me.find((q) => q === B);
|
|
550
|
+
f && u.on(f, g);
|
|
551
|
+
}), this._connectionConfiguration.answer = !0, this._connectionConfiguration.number = u.remote_identity.uri.user, this._handleCall({ ontrack: t }).then(d).catch((g) => {
|
|
552
|
+
T(g);
|
|
551
553
|
});
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
contentHint:
|
|
554
|
+
const S = v(e, {
|
|
555
|
+
directionVideo: r,
|
|
556
|
+
directionAudio: a,
|
|
557
|
+
contentHint: h
|
|
556
558
|
});
|
|
557
|
-
|
|
559
|
+
u.answer({
|
|
558
560
|
extraHeaders: n,
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
mediaStream:
|
|
561
|
+
directionVideo: r,
|
|
562
|
+
directionAudio: a,
|
|
563
|
+
mediaStream: S,
|
|
562
564
|
pcConfig: {
|
|
563
565
|
iceServers: i
|
|
564
566
|
},
|
|
565
|
-
|
|
566
|
-
|
|
567
|
+
rtcOfferConstraints: {
|
|
568
|
+
offerToReceiveAudio: c,
|
|
569
|
+
offerToReceiveVideo: E
|
|
570
|
+
},
|
|
571
|
+
sendEncodings: _,
|
|
572
|
+
onAddedTransceiver: l
|
|
567
573
|
});
|
|
568
574
|
}));
|
|
569
575
|
o(this, "_handleCall", async ({ ontrack: e }) => new Promise((t, n) => {
|
|
570
576
|
const i = () => {
|
|
571
|
-
this.onSession(
|
|
577
|
+
this.onSession(H, _), this.onSession(L, l);
|
|
572
578
|
}, r = () => {
|
|
573
|
-
this.offSession(
|
|
579
|
+
this.offSession(H, _), this.offSession(L, l);
|
|
574
580
|
}, a = () => {
|
|
575
|
-
this.onSession(R, E), this.onSession(
|
|
581
|
+
this.onSession(R, E), this.onSession(M, E);
|
|
576
582
|
}, c = () => {
|
|
577
|
-
this.offSession(R, E), this.offSession(
|
|
583
|
+
this.offSession(R, E), this.offSession(M, E);
|
|
578
584
|
}, E = (d) => {
|
|
579
585
|
r(), c(), n(d);
|
|
580
586
|
};
|
|
581
587
|
let h;
|
|
582
588
|
const _ = ({ peerconnection: d }) => {
|
|
583
589
|
h = d, h.ontrack = (T) => {
|
|
584
|
-
this._sessionEvents.trigger(
|
|
590
|
+
this._sessionEvents.trigger(ie, h), e && e(T);
|
|
585
591
|
};
|
|
586
592
|
}, l = () => {
|
|
587
|
-
h && this._sessionEvents.trigger(
|
|
593
|
+
h && this._sessionEvents.trigger(se, h), r(), c(), t(h);
|
|
588
594
|
};
|
|
589
595
|
i(), a();
|
|
590
596
|
}));
|
|
@@ -597,8 +603,8 @@ class Ns {
|
|
|
597
603
|
n(new Error("No session established"));
|
|
598
604
|
return;
|
|
599
605
|
}
|
|
600
|
-
this.onceSession(
|
|
601
|
-
r ===
|
|
606
|
+
this.onceSession(Pe, ({ originator: r }) => {
|
|
607
|
+
r === Y && t();
|
|
602
608
|
}), i.sendDTMF(e, {
|
|
603
609
|
duration: 120,
|
|
604
610
|
interToneGap: 600
|
|
@@ -611,7 +617,7 @@ class Ns {
|
|
|
611
617
|
try {
|
|
612
618
|
await this.stopPresentation();
|
|
613
619
|
} catch (t) {
|
|
614
|
-
|
|
620
|
+
F("error stop presentation: ", t);
|
|
615
621
|
}
|
|
616
622
|
if (this._restoreSession(), !e.isEnded())
|
|
617
623
|
return e.terminateAsync();
|
|
@@ -619,28 +625,28 @@ class Ns {
|
|
|
619
625
|
});
|
|
620
626
|
o(this, "_handleShareState", (e) => {
|
|
621
627
|
switch (e) {
|
|
622
|
-
case St: {
|
|
623
|
-
this._sessionEvents.trigger(Q, void 0);
|
|
624
|
-
break;
|
|
625
|
-
}
|
|
626
628
|
case Nt: {
|
|
627
|
-
this._sessionEvents.trigger(
|
|
629
|
+
this._sessionEvents.trigger(K, void 0);
|
|
628
630
|
break;
|
|
629
631
|
}
|
|
630
632
|
case gt: {
|
|
631
|
-
this._sessionEvents.trigger(
|
|
633
|
+
this._sessionEvents.trigger(Z, void 0);
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
|
+
case Ct: {
|
|
637
|
+
this._sessionEvents.trigger(ee, void 0);
|
|
632
638
|
break;
|
|
633
639
|
}
|
|
634
640
|
}
|
|
635
641
|
});
|
|
636
642
|
o(this, "_maybeTriggerChannels", (e) => {
|
|
637
|
-
const t = e.getHeader(
|
|
643
|
+
const t = e.getHeader(be), n = e.getHeader(Ue);
|
|
638
644
|
if (t && n) {
|
|
639
645
|
const i = {
|
|
640
646
|
inputChannels: t,
|
|
641
647
|
outputChannels: n
|
|
642
648
|
};
|
|
643
|
-
this._sessionEvents.trigger(
|
|
649
|
+
this._sessionEvents.trigger(b, i);
|
|
644
650
|
}
|
|
645
651
|
});
|
|
646
652
|
o(this, "_handleNotify", (e) => {
|
|
@@ -699,7 +705,7 @@ class Ns {
|
|
|
699
705
|
break;
|
|
700
706
|
}
|
|
701
707
|
default:
|
|
702
|
-
|
|
708
|
+
F("unknown cmd", e.cmd);
|
|
703
709
|
}
|
|
704
710
|
});
|
|
705
711
|
o(this, "_triggerRemovedFromListModeratorsNotify", ({
|
|
@@ -709,7 +715,7 @@ class Ns {
|
|
|
709
715
|
conference: e
|
|
710
716
|
};
|
|
711
717
|
this._uaEvents.trigger(
|
|
712
|
-
|
|
718
|
+
le,
|
|
713
719
|
t
|
|
714
720
|
);
|
|
715
721
|
});
|
|
@@ -717,27 +723,27 @@ class Ns {
|
|
|
717
723
|
const t = {
|
|
718
724
|
conference: e
|
|
719
725
|
};
|
|
720
|
-
this._uaEvents.trigger(
|
|
726
|
+
this._uaEvents.trigger(de, t);
|
|
721
727
|
});
|
|
722
728
|
o(this, "_triggerWebcastStartedNotify", ({ body: { conference: e, type: t } }) => {
|
|
723
729
|
const n = {
|
|
724
730
|
conference: e,
|
|
725
731
|
type: t
|
|
726
732
|
};
|
|
727
|
-
this._uaEvents.trigger(
|
|
733
|
+
this._uaEvents.trigger(Ce, n);
|
|
728
734
|
});
|
|
729
735
|
o(this, "_triggerWebcastStoppedNotify", ({ body: { conference: e, type: t } }) => {
|
|
730
736
|
const n = {
|
|
731
737
|
conference: e,
|
|
732
738
|
type: t
|
|
733
739
|
};
|
|
734
|
-
this._uaEvents.trigger(
|
|
740
|
+
this._uaEvents.trigger(Ae, n);
|
|
735
741
|
});
|
|
736
742
|
o(this, "_triggerAccountChangedNotify", () => {
|
|
737
|
-
this._uaEvents.trigger(
|
|
743
|
+
this._uaEvents.trigger(Re, void 0);
|
|
738
744
|
});
|
|
739
745
|
o(this, "_triggerAccountDeletedNotify", () => {
|
|
740
|
-
this._uaEvents.trigger(
|
|
746
|
+
this._uaEvents.trigger(Ie, void 0);
|
|
741
747
|
});
|
|
742
748
|
o(this, "_triggerConferenceParticipantTokenIssued", ({
|
|
743
749
|
body: { conference: e, participant: t, jwt: n }
|
|
@@ -748,7 +754,7 @@ class Ns {
|
|
|
748
754
|
jwt: n
|
|
749
755
|
};
|
|
750
756
|
this._uaEvents.trigger(
|
|
751
|
-
|
|
757
|
+
fe,
|
|
752
758
|
i
|
|
753
759
|
);
|
|
754
760
|
});
|
|
@@ -757,7 +763,7 @@ class Ns {
|
|
|
757
763
|
inputChannels: t,
|
|
758
764
|
outputChannels: n
|
|
759
765
|
};
|
|
760
|
-
this._uaEvents.trigger(
|
|
766
|
+
this._uaEvents.trigger(oe, i);
|
|
761
767
|
});
|
|
762
768
|
o(this, "_triggerParticipationAcceptingWordRequest", ({
|
|
763
769
|
body: { conference: e }
|
|
@@ -765,7 +771,7 @@ class Ns {
|
|
|
765
771
|
const t = {
|
|
766
772
|
conference: e
|
|
767
773
|
};
|
|
768
|
-
this._uaEvents.trigger(
|
|
774
|
+
this._uaEvents.trigger(Ne, t);
|
|
769
775
|
});
|
|
770
776
|
o(this, "_triggerParticipationCancellingWordRequest", ({
|
|
771
777
|
body: { conference: e }
|
|
@@ -773,7 +779,7 @@ class Ns {
|
|
|
773
779
|
const t = {
|
|
774
780
|
conference: e
|
|
775
781
|
};
|
|
776
|
-
this._uaEvents.trigger(
|
|
782
|
+
this._uaEvents.trigger(ge, t);
|
|
777
783
|
});
|
|
778
784
|
o(this, "_triggerParticipantMoveRequestToStream", ({
|
|
779
785
|
body: { conference: e }
|
|
@@ -781,44 +787,44 @@ class Ns {
|
|
|
781
787
|
const t = {
|
|
782
788
|
conference: e
|
|
783
789
|
};
|
|
784
|
-
this._uaEvents.trigger(
|
|
790
|
+
this._uaEvents.trigger(Te, t);
|
|
785
791
|
});
|
|
786
792
|
o(this, "_triggerEnterRoom", (e) => {
|
|
787
793
|
const t = e.getHeader($t), n = e.getHeader(en);
|
|
788
|
-
this._sessionEvents.trigger(
|
|
794
|
+
this._sessionEvents.trigger(te, { room: t, participantName: n });
|
|
789
795
|
});
|
|
790
796
|
o(this, "_triggerShareState", (e) => {
|
|
791
797
|
const t = e.getHeader(I);
|
|
792
|
-
this._sessionEvents.trigger(
|
|
798
|
+
this._sessionEvents.trigger(w, t);
|
|
793
799
|
});
|
|
794
800
|
o(this, "_maybeTriggerParticipantMoveRequest", (e) => {
|
|
795
801
|
const t = e.getHeader(En);
|
|
796
|
-
t ===
|
|
802
|
+
t === Et && this._sessionEvents.trigger(ue, void 0), t === ht && this._sessionEvents.trigger(Se, void 0);
|
|
797
803
|
});
|
|
798
804
|
o(this, "_triggerMainCamControl", (e) => {
|
|
799
|
-
const t = e.getHeader(tn), n = e.getHeader(
|
|
800
|
-
if (t ===
|
|
801
|
-
this._sessionEvents.trigger(
|
|
805
|
+
const t = e.getHeader(tn), n = e.getHeader(Le), i = n === V.ADMIN_SYNC_FORCED;
|
|
806
|
+
if (t === P.ADMIN_START_MAIN_CAM) {
|
|
807
|
+
this._sessionEvents.trigger(_e, { isSyncForced: i });
|
|
802
808
|
return;
|
|
803
809
|
}
|
|
804
|
-
if (t ===
|
|
805
|
-
this._sessionEvents.trigger(
|
|
810
|
+
if (t === P.ADMIN_STOP_MAIN_CAM) {
|
|
811
|
+
this._sessionEvents.trigger(ce, { isSyncForced: i });
|
|
806
812
|
return;
|
|
807
813
|
}
|
|
808
|
-
(t ===
|
|
814
|
+
(t === P.RESUME_MAIN_CAM || t === P.PAUSE_MAIN_CAM) && n && this._sessionEvents.trigger(U, { isSyncForced: i });
|
|
809
815
|
const r = e.getHeader(sn);
|
|
810
|
-
this._sessionEvents.trigger(
|
|
816
|
+
this._sessionEvents.trigger(ae, {
|
|
811
817
|
mainCam: t,
|
|
812
818
|
resolutionMainCam: r
|
|
813
819
|
});
|
|
814
820
|
});
|
|
815
821
|
o(this, "_triggerMicControl", (e) => {
|
|
816
|
-
const t = e.getHeader(nn), i = e.getHeader(
|
|
817
|
-
t ===
|
|
822
|
+
const t = e.getHeader(nn), i = e.getHeader(Le) === V.ADMIN_SYNC_FORCED;
|
|
823
|
+
t === x.ADMIN_START_MIC ? this._sessionEvents.trigger(he, { isSyncForced: i }) : t === x.ADMIN_STOP_MIC && this._sessionEvents.trigger(Ee, { isSyncForced: i });
|
|
818
824
|
});
|
|
819
825
|
o(this, "_triggerUseLicense", (e) => {
|
|
820
826
|
const t = e.getHeader(Zt);
|
|
821
|
-
this._sessionEvents.trigger(
|
|
827
|
+
this._sessionEvents.trigger(ne, t);
|
|
822
828
|
});
|
|
823
829
|
o(this, "_handleNewInfo", (e) => {
|
|
824
830
|
const { originator: t } = e;
|
|
@@ -839,7 +845,7 @@ class Ns {
|
|
|
839
845
|
this._triggerShareState(n);
|
|
840
846
|
break;
|
|
841
847
|
}
|
|
842
|
-
case
|
|
848
|
+
case we: {
|
|
843
849
|
this._triggerMainCamControl(n);
|
|
844
850
|
break;
|
|
845
851
|
}
|
|
@@ -869,37 +875,37 @@ class Ns {
|
|
|
869
875
|
});
|
|
870
876
|
o(this, "_handleEnded", (e) => {
|
|
871
877
|
const { originator: t } = e;
|
|
872
|
-
t ===
|
|
878
|
+
t === We && this._sessionEvents.trigger(re, e), this._restoreSession();
|
|
873
879
|
});
|
|
874
|
-
this.JsSIP = e, this._sessionEvents = new
|
|
880
|
+
this.JsSIP = e, this._sessionEvents = new ve(St), this._uaEvents = new ve(ut), this._cancelableConnect = new C(
|
|
875
881
|
this._connect,
|
|
876
882
|
{
|
|
877
|
-
moduleName:
|
|
883
|
+
moduleName: A,
|
|
878
884
|
afterCancelRequest: () => {
|
|
879
885
|
this._cancelableInitUa.cancelRequest(), this._cancelableDisconnect.cancelRequest();
|
|
880
886
|
}
|
|
881
887
|
}
|
|
882
|
-
), this._cancelableInitUa = new
|
|
888
|
+
), this._cancelableInitUa = new C(
|
|
883
889
|
this._initUa,
|
|
884
|
-
{ moduleName:
|
|
885
|
-
), this._cancelableDisconnect = new
|
|
890
|
+
{ moduleName: A }
|
|
891
|
+
), this._cancelableDisconnect = new C(
|
|
886
892
|
this._disconnect,
|
|
887
|
-
{ moduleName:
|
|
888
|
-
), this._cancelableSet = new
|
|
889
|
-
moduleName:
|
|
890
|
-
}), this._cancelableCall = new
|
|
893
|
+
{ moduleName: A }
|
|
894
|
+
), this._cancelableSet = new C(this._set, {
|
|
895
|
+
moduleName: A
|
|
896
|
+
}), this._cancelableCall = new C(
|
|
891
897
|
this._call,
|
|
892
|
-
{ moduleName:
|
|
893
|
-
), this._cancelableAnswer = new
|
|
898
|
+
{ moduleName: A }
|
|
899
|
+
), this._cancelableAnswer = new C(this._answer, { moduleName: A }), this._cancelableSendDTMF = new C(this._sendDTMF, { moduleName: A }), this.onSession(w, this._handleShareState), this.onSession(me, this._handleNewInfo), this.on(j, this._handleSipEvent), this.onSession(R, this._handleEnded), this.onSession(M, this._handleEnded);
|
|
894
900
|
}
|
|
895
901
|
async register() {
|
|
896
902
|
return new Promise((e, t) => {
|
|
897
|
-
this.isRegisterConfig && this.ua ? (this.ua.on(
|
|
903
|
+
this.isRegisterConfig && this.ua ? (this.ua.on(O, e), this.ua.on(D, t), this.ua.register()) : t(new Error("Config is not registered"));
|
|
898
904
|
});
|
|
899
905
|
}
|
|
900
906
|
async unregister() {
|
|
901
907
|
return new Promise((e, t) => {
|
|
902
|
-
this.isRegistered && this.ua ? (this.ua.on(
|
|
908
|
+
this.isRegistered && this.ua ? (this.ua.on(Q, e), this.ua.unregister()) : t(new Error("ua is not registered"));
|
|
903
909
|
});
|
|
904
910
|
}
|
|
905
911
|
async sendOptions(e, t, n) {
|
|
@@ -950,20 +956,20 @@ class Ns {
|
|
|
950
956
|
const d = () => {
|
|
951
957
|
_.removeAllListeners(), _.once(N, c), _.stop();
|
|
952
958
|
};
|
|
953
|
-
_.once(
|
|
959
|
+
_.once(m, d), _.start();
|
|
954
960
|
});
|
|
955
961
|
}
|
|
956
962
|
async replaceMediaStream(e, t) {
|
|
957
963
|
if (!this.session)
|
|
958
964
|
throw new Error("No session established");
|
|
959
|
-
const { contentHint: n } = t ?? {}, i =
|
|
965
|
+
const { contentHint: n } = t ?? {}, i = v(e, { contentHint: n });
|
|
960
966
|
return this.session.replaceMediaStream(i, t);
|
|
961
967
|
}
|
|
962
968
|
async askPermissionToEnableCam(e = {}) {
|
|
963
969
|
if (!this.session)
|
|
964
970
|
throw new Error("No session established");
|
|
965
971
|
const t = [Cn];
|
|
966
|
-
return this.session.sendInfo(
|
|
972
|
+
return this.session.sendInfo(we, void 0, {
|
|
967
973
|
noTerminateWhenError: !0,
|
|
968
974
|
...e,
|
|
969
975
|
extraHeaders: t
|
|
@@ -984,7 +990,7 @@ class Ns {
|
|
|
984
990
|
}
|
|
985
991
|
}) {
|
|
986
992
|
const r = async () => this._sendPresentation(e, t, n), a = () => !!this._streamPresentationCurrent;
|
|
987
|
-
return this._cancelableSendPresentationWithRepeatedCalls =
|
|
993
|
+
return this._cancelableSendPresentationWithRepeatedCalls = ye({
|
|
988
994
|
targetFunction: r,
|
|
989
995
|
isComplete: a,
|
|
990
996
|
isRejectAsValid: !0,
|
|
@@ -1018,7 +1024,7 @@ class Ns {
|
|
|
1018
1024
|
password: t,
|
|
1019
1025
|
register: a,
|
|
1020
1026
|
uri: u,
|
|
1021
|
-
display_name:
|
|
1027
|
+
display_name: He(i),
|
|
1022
1028
|
user_agent: l,
|
|
1023
1029
|
sdp_semantics: "unified-plan",
|
|
1024
1030
|
sockets: [S],
|
|
@@ -1034,14 +1040,14 @@ class Ns {
|
|
|
1034
1040
|
};
|
|
1035
1041
|
}
|
|
1036
1042
|
async _sendPresentation(e, t, {
|
|
1037
|
-
maxBitrate: n =
|
|
1043
|
+
maxBitrate: n = dt,
|
|
1038
1044
|
isNeedReinvite: i = !0,
|
|
1039
1045
|
isP2P: r = !1,
|
|
1040
1046
|
contentHint: a = "detail",
|
|
1041
1047
|
sendEncodings: c,
|
|
1042
1048
|
onAddedTransceiver: E
|
|
1043
1049
|
}) {
|
|
1044
|
-
const h =
|
|
1050
|
+
const h = v(t, { contentHint: a });
|
|
1045
1051
|
this._streamPresentationCurrent = h;
|
|
1046
1052
|
const _ = r ? [Sn] : [ln], l = e.sendInfo(p, void 0, {
|
|
1047
1053
|
extraHeaders: _
|
|
@@ -1055,7 +1061,7 @@ class Ns {
|
|
|
1055
1061
|
const T = d.getSenders();
|
|
1056
1062
|
await Yn(T, t, n);
|
|
1057
1063
|
}).then(() => t).catch((d) => {
|
|
1058
|
-
throw this._removeStreamPresentationCurrent(), this._sessionEvents.trigger(
|
|
1064
|
+
throw this._removeStreamPresentationCurrent(), this._sessionEvents.trigger(W, d), d;
|
|
1059
1065
|
});
|
|
1060
1066
|
return this.promisePendingStartPresentation = l, l.finally(() => {
|
|
1061
1067
|
this.promisePendingStartPresentation = void 0;
|
|
@@ -1103,8 +1109,8 @@ class Ns {
|
|
|
1103
1109
|
return r && t && (n = n.then(async () => r.sendInfo(p, void 0, {
|
|
1104
1110
|
extraHeaders: i
|
|
1105
1111
|
})).then(async () => r.stopPresentation(t)).catch((a) => {
|
|
1106
|
-
throw this._sessionEvents.trigger(
|
|
1107
|
-
})), !r && t && this._sessionEvents.trigger(
|
|
1112
|
+
throw this._sessionEvents.trigger(W, a), a;
|
|
1113
|
+
})), !r && t && this._sessionEvents.trigger(Oe, t), this.promisePendingStopPresentation = n, n.finally(() => {
|
|
1108
1114
|
this._resetPresentation();
|
|
1109
1115
|
});
|
|
1110
1116
|
}
|
|
@@ -1253,15 +1259,15 @@ class Ns {
|
|
|
1253
1259
|
this._cancelableAnswer.cancelRequest(), this._cancelableSendDTMF.cancelRequest();
|
|
1254
1260
|
}
|
|
1255
1261
|
async waitChannels() {
|
|
1256
|
-
return this.waitSession(
|
|
1262
|
+
return this.waitSession(b);
|
|
1257
1263
|
}
|
|
1258
1264
|
async waitSyncMediaState() {
|
|
1259
|
-
return this.waitSession(
|
|
1265
|
+
return this.waitSession(U);
|
|
1260
1266
|
}
|
|
1261
1267
|
async sendChannels({ inputChannels: e, outputChannels: t }) {
|
|
1262
1268
|
if (!this.session)
|
|
1263
1269
|
throw new Error("No session established");
|
|
1264
|
-
const n = `${
|
|
1270
|
+
const n = `${be}: ${e}`, i = `${Ue}: ${t}`, r = [
|
|
1265
1271
|
n,
|
|
1266
1272
|
i
|
|
1267
1273
|
];
|
|
@@ -1304,25 +1310,25 @@ class Ns {
|
|
|
1304
1310
|
}
|
|
1305
1311
|
export {
|
|
1306
1312
|
xt as B,
|
|
1307
|
-
|
|
1313
|
+
P as E,
|
|
1308
1314
|
yt as N,
|
|
1309
|
-
|
|
1310
|
-
|
|
1315
|
+
ue as P,
|
|
1316
|
+
Be as R,
|
|
1311
1317
|
Ns as S,
|
|
1312
|
-
|
|
1318
|
+
ut as U,
|
|
1313
1319
|
xn as a,
|
|
1314
|
-
|
|
1320
|
+
Se as b,
|
|
1315
1321
|
hs as c,
|
|
1316
1322
|
ds as d,
|
|
1317
1323
|
ls as e,
|
|
1318
1324
|
us as f,
|
|
1319
1325
|
Ts as g,
|
|
1320
1326
|
Ss as h,
|
|
1321
|
-
|
|
1322
|
-
|
|
1327
|
+
x as i,
|
|
1328
|
+
V as j,
|
|
1323
1329
|
Rn as k,
|
|
1324
|
-
|
|
1330
|
+
F as l,
|
|
1325
1331
|
In as m,
|
|
1326
|
-
|
|
1332
|
+
St as n,
|
|
1327
1333
|
Vn as s
|
|
1328
1334
|
};
|