sip-connector 14.0.1-0 → 14.1.0-alpha.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-CK3GgjXE.js +2492 -0
- package/dist/SipConnector-CwI8aFEA.cjs +1 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +248 -217
- package/dist/index.cjs +1 -1
- package/dist/index.js +529 -436
- package/dist/src/ApiManager/@ApiManager.d.ts +58 -0
- package/dist/src/ApiManager/constants.d.ts +71 -0
- package/dist/src/ApiManager/eventNames.d.ts +33 -0
- package/dist/src/ApiManager/index.d.ts +2 -0
- package/dist/src/ApiManager/types.d.ts +99 -0
- package/dist/src/CallManager/@CallManager.d.ts +26 -0
- package/dist/src/CallManager/AbstractCallStrategy.d.ts +47 -0
- package/dist/src/CallManager/MCUCallStrategy.d.ts +30 -0
- package/dist/src/CallManager/RemoteStreamsManager.d.ts +8 -0
- package/dist/src/CallManager/causes.d.ts +12 -0
- package/dist/src/CallManager/eventNames.d.ts +45 -0
- package/dist/src/CallManager/hasCanceledCallError.d.ts +2 -0
- package/dist/src/CallManager/index.d.ts +5 -0
- package/dist/src/CallManager/types.d.ts +59 -0
- package/dist/src/ConnectionManager/@ConnectionManager.d.ts +47 -0
- package/dist/src/ConnectionManager/ConfigurationManager.d.ts +60 -0
- package/dist/src/ConnectionManager/ConnectionFlow.d.ts +83 -0
- package/dist/src/ConnectionManager/ConnectionStateMachine.d.ts +61 -0
- package/dist/src/ConnectionManager/RegistrationManager.d.ts +17 -0
- package/dist/src/ConnectionManager/SipOperations.d.ts +32 -0
- package/dist/src/ConnectionManager/UAFactory.d.ts +50 -0
- package/dist/src/ConnectionManager/eventNames.d.ts +16 -0
- package/dist/src/ConnectionManager/index.d.ts +3 -0
- package/dist/src/IncomingCallManager/@IncomingCallManager.d.ts +36 -0
- package/dist/src/IncomingCallManager/eventNames.d.ts +13 -0
- package/dist/src/IncomingCallManager/index.d.ts +2 -0
- package/dist/src/PresentationManager/@PresentationManager.d.ts +47 -0
- package/dist/src/PresentationManager/constants.d.ts +1 -0
- package/dist/src/PresentationManager/eventNames.d.ts +11 -0
- package/dist/src/PresentationManager/index.d.ts +1 -0
- package/dist/src/PresentationManager/types.d.ts +2 -0
- package/dist/src/SipConnector.d.ts +89 -283
- package/dist/src/SipConnectorFacade/SipConnectorFacade.d.ts +34 -25
- package/dist/src/__fixtures__/BaseSession.mock.d.ts +9 -9
- package/dist/src/__fixtures__/RTCPeerConnectionMock.d.ts +1 -1
- package/dist/src/__fixtures__/RTCSessionMock.d.ts +25 -20
- package/dist/src/__fixtures__/UA.mock.d.ts +23 -25
- package/dist/src/__fixtures__/index.d.ts +4 -4
- package/dist/src/__fixtures__/jssip.mock.d.ts +3 -3
- package/dist/src/doMock.d.ts +1 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/tools/__fixtures__/connectToServer.d.ts +2 -2
- package/dist/src/tools/index.d.ts +2 -2
- package/dist/src/tools/{sendDTMFAccumulated.d.ts → sendDtmfFAccumulated.d.ts} +2 -2
- package/package.json +17 -14
- package/dist/SipConnector-CJN8qKAC.js +0 -1316
- package/dist/SipConnector-DO0YvSq6.cjs +0 -1
|
@@ -1,301 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
noTerminateWhenError?: boolean;
|
|
15
|
-
};
|
|
16
|
-
declare const CMD_CHANNELS = "channels";
|
|
17
|
-
declare const CMD_WEBCAST_STARTED = "WebcastStarted";
|
|
18
|
-
declare const CMD_ADDED_TO_LIST_MODERATORS = "addedToListModerators";
|
|
19
|
-
declare const CMD_REMOVED_FROM_LIST_MODERATORS = "removedFromListModerators";
|
|
20
|
-
declare const CMD_ACCEPTING_WORD_REQUEST = "ParticipationRequestAccepted";
|
|
21
|
-
declare const CMD_CANCELLING_WORD_REQUEST = "ParticipationRequestRejected";
|
|
22
|
-
declare const CMD_MOVE_REQUEST_TO_STREAM = "ParticipantMovedToWebcast";
|
|
23
|
-
declare const CMD_CONFERENCE_PARTICIPANT_TOKEN_ISSUED = "ConferenceParticipantTokenIssued";
|
|
24
|
-
type TAddedToListModeratorsInfoNotify = {
|
|
25
|
-
cmd: typeof CMD_ADDED_TO_LIST_MODERATORS;
|
|
26
|
-
conference: string;
|
|
27
|
-
};
|
|
28
|
-
type TRemovedFromListModeratorsInfoNotify = {
|
|
29
|
-
cmd: typeof CMD_REMOVED_FROM_LIST_MODERATORS;
|
|
30
|
-
conference: string;
|
|
31
|
-
};
|
|
32
|
-
type TAcceptingWordRequestInfoNotify = {
|
|
33
|
-
cmd: typeof CMD_ACCEPTING_WORD_REQUEST;
|
|
34
|
-
body: {
|
|
35
|
-
conference: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
type TCancellingWordRequestInfoNotify = {
|
|
39
|
-
cmd: typeof CMD_CANCELLING_WORD_REQUEST;
|
|
40
|
-
body: {
|
|
41
|
-
conference: string;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
type TMoveRequestToStreamInfoNotify = {
|
|
45
|
-
cmd: typeof CMD_MOVE_REQUEST_TO_STREAM;
|
|
46
|
-
body: {
|
|
47
|
-
conference: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
type TConferenceParticipantTokenIssued = {
|
|
51
|
-
cmd: typeof CMD_CONFERENCE_PARTICIPANT_TOKEN_ISSUED;
|
|
52
|
-
body: {
|
|
53
|
-
conference: string;
|
|
54
|
-
participant: string;
|
|
55
|
-
jwt: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
type TWebcastInfoNotify = {
|
|
59
|
-
cmd: typeof CMD_WEBCAST_STARTED;
|
|
60
|
-
body: {
|
|
61
|
-
conference: string;
|
|
62
|
-
type: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
type TChannelsInfoNotify = {
|
|
66
|
-
cmd: typeof CMD_CHANNELS;
|
|
67
|
-
input: string;
|
|
68
|
-
output: string;
|
|
69
|
-
};
|
|
70
|
-
type TInfoNotify = Omit<TAddedToListModeratorsInfoNotify | TChannelsInfoNotify | TRemovedFromListModeratorsInfoNotify, 'cmd'> & {
|
|
71
|
-
cmd: string;
|
|
72
|
-
};
|
|
73
|
-
type TOptionsExtraHeaders = {
|
|
74
|
-
extraHeaders?: string[];
|
|
75
|
-
};
|
|
76
|
-
type TOntrack = (track: RTCTrackEvent) => void;
|
|
77
|
-
type TParametersConnection = TOptionsExtraHeaders & {
|
|
78
|
-
displayName?: string;
|
|
79
|
-
user?: string;
|
|
80
|
-
password?: string;
|
|
81
|
-
register?: boolean;
|
|
82
|
-
sipServerUrl: string;
|
|
83
|
-
sipWebSocketServerURL: string;
|
|
84
|
-
remoteAddress?: string;
|
|
85
|
-
sessionTimers?: boolean;
|
|
86
|
-
registerExpires?: number;
|
|
87
|
-
connectionRecoveryMinInterval?: number;
|
|
88
|
-
connectionRecoveryMaxInterval?: number;
|
|
89
|
-
userAgent?: string;
|
|
90
|
-
};
|
|
91
|
-
type TParametersCheckTelephony = {
|
|
92
|
-
displayName: string;
|
|
93
|
-
sipServerUrl: string;
|
|
94
|
-
sipWebSocketServerURL: string;
|
|
95
|
-
userAgent?: string;
|
|
96
|
-
remoteAddress?: string;
|
|
97
|
-
extraHeaders?: string[];
|
|
98
|
-
};
|
|
99
|
-
type TParametersCreateUa = UAConfigurationParams & {
|
|
100
|
-
remoteAddress?: string;
|
|
101
|
-
extraHeaders?: string[];
|
|
102
|
-
};
|
|
103
|
-
type TConnect = (parameters: TParametersConnection, options?: {
|
|
104
|
-
callLimit?: number;
|
|
105
|
-
}) => Promise<UA>;
|
|
106
|
-
type TInitUa = (parameters: TParametersConnection) => Promise<UA>;
|
|
107
|
-
type TCreateUa = (parameters: TParametersCreateUa) => UA;
|
|
108
|
-
type TStart = () => Promise<UA>;
|
|
109
|
-
type TSet = ({ displayName, password, }: {
|
|
110
|
-
displayName?: string;
|
|
111
|
-
password?: string;
|
|
112
|
-
}) => Promise<boolean>;
|
|
113
|
-
type TParametersAnswerToIncomingCall = {
|
|
114
|
-
mediaStream: MediaStream;
|
|
115
|
-
extraHeaders?: TOptionsExtraHeaders['extraHeaders'];
|
|
116
|
-
ontrack?: TOntrack;
|
|
117
|
-
iceServers?: RTCIceServer[];
|
|
118
|
-
directionVideo?: RTCRtpTransceiverDirection;
|
|
119
|
-
directionAudio?: RTCRtpTransceiverDirection;
|
|
120
|
-
contentHint?: TContentHint;
|
|
121
|
-
sendEncodings?: RTCRtpEncodingParameters[];
|
|
122
|
-
offerToReceiveAudio?: boolean;
|
|
123
|
-
offerToReceiveVideo?: boolean;
|
|
124
|
-
onAddedTransceiver?: TOnAddedTransceiver;
|
|
125
|
-
};
|
|
126
|
-
type TParametersCall = TParametersAnswerToIncomingCall & {
|
|
127
|
-
number: string;
|
|
128
|
-
};
|
|
129
|
-
type TCall = (parameters: TParametersCall) => Promise<RTCPeerConnection>;
|
|
130
|
-
type TAnswerToIncomingCall = (parameters: TParametersAnswerToIncomingCall) => Promise<RTCPeerConnection>;
|
|
131
|
-
type TSendDTMF = (tone: number | string) => Promise<void>;
|
|
132
|
-
type THangUp = () => Promise<void>;
|
|
133
|
-
export default class SipConnector {
|
|
134
|
-
private isRegisterConfigInner;
|
|
135
|
-
private connectionConfiguration;
|
|
136
|
-
private remoteStreams;
|
|
137
|
-
private readonly JsSIP;
|
|
138
|
-
private readonly sessionEvents;
|
|
139
|
-
private readonly uaEvents;
|
|
140
|
-
private getSipServerUrl;
|
|
141
|
-
private cancelableConnectWithRepeatedCalls;
|
|
142
|
-
private cancelableSendPresentationWithRepeatedCalls;
|
|
143
|
-
private isPendingConnect;
|
|
144
|
-
private isPendingInitUa;
|
|
145
|
-
private isPendingCall;
|
|
146
|
-
private isPendingAnswer;
|
|
147
|
-
promisePendingStartPresentation?: Promise<MediaStream>;
|
|
148
|
-
promisePendingStopPresentation?: Promise<MediaStream | void>;
|
|
149
|
-
ua?: UA;
|
|
150
|
-
rtcSession?: RTCSession;
|
|
151
|
-
incomingRTCSession?: RTCSession;
|
|
152
|
-
streamPresentationCurrent?: MediaStream;
|
|
153
|
-
socket?: WebSocketInterface;
|
|
1
|
+
import { TApiEvent, ApiManager } from './ApiManager';
|
|
2
|
+
import { TCallEvent, CallManager } from './CallManager';
|
|
3
|
+
import { TConnectionManagerEvent, ConnectionManager } from './ConnectionManager';
|
|
4
|
+
import { TIncomingCallEvent, IncomingCallManager } from './IncomingCallManager';
|
|
5
|
+
import { PresentationManager } from './PresentationManager';
|
|
6
|
+
import { TContentHint, TOnAddedTransceiver } from './PresentationManager/types';
|
|
7
|
+
import { TGetServerUrl, TJsSIP } from './types';
|
|
8
|
+
declare class SipConnector {
|
|
9
|
+
readonly connectionManager: ConnectionManager;
|
|
10
|
+
readonly callManager: CallManager;
|
|
11
|
+
readonly apiManager: ApiManager;
|
|
12
|
+
readonly incomingCallManager: IncomingCallManager;
|
|
13
|
+
readonly presentationManager: PresentationManager;
|
|
154
14
|
constructor({ JsSIP }: {
|
|
155
15
|
JsSIP: TJsSIP;
|
|
156
16
|
});
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
17
|
+
get requestedConnection(): boolean;
|
|
18
|
+
get isPendingConnect(): boolean;
|
|
19
|
+
get isPendingInitUa(): boolean;
|
|
20
|
+
get connectionState(): import('./ConnectionManager/ConnectionStateMachine').EState;
|
|
21
|
+
get isRegistered(): boolean;
|
|
22
|
+
get isRegisterConfig(): boolean;
|
|
23
|
+
get socket(): import('@krivega/jssip').WebSocketInterface | undefined;
|
|
24
|
+
get requestedCall(): boolean;
|
|
25
|
+
get connection(): RTCPeerConnection | undefined;
|
|
26
|
+
get establishedRTCSession(): import('@krivega/jssip').RTCSession | undefined;
|
|
27
|
+
get isCallActive(): boolean;
|
|
28
|
+
get remoteCallerData(): IncomingCallManager['remoteCallerData'];
|
|
29
|
+
get isAvailableIncomingCall(): IncomingCallManager['isAvailableIncomingCall'];
|
|
30
|
+
connect: ConnectionManager['connect'];
|
|
31
|
+
set: ConnectionManager['set'];
|
|
32
|
+
disconnect: () => Promise<void>;
|
|
33
|
+
register: () => Promise<import('@krivega/jssip').RegisteredEvent>;
|
|
34
|
+
unregister: () => Promise<import('@krivega/jssip').UnRegisteredEvent>;
|
|
35
|
+
tryRegister: () => Promise<import('@krivega/jssip').RegisteredEvent>;
|
|
36
|
+
sendOptions: (target: Parameters<ConnectionManager["sendOptions"]>[0], body?: Parameters<ConnectionManager["sendOptions"]>[1], extraHeaders?: Parameters<ConnectionManager["sendOptions"]>[2]) => Promise<void>;
|
|
37
|
+
ping: (body?: Parameters<ConnectionManager["ping"]>[0], extraHeaders?: Parameters<ConnectionManager["ping"]>[1]) => Promise<void>;
|
|
38
|
+
checkTelephony: ConnectionManager['checkTelephony'];
|
|
39
|
+
onConnection<T>(eventName: TConnectionManagerEvent, handler: (data: T) => void): () => void;
|
|
40
|
+
onceConnection<T>(eventName: TConnectionManagerEvent, handler: (data: T) => void): () => void;
|
|
41
|
+
onceRaceConnection<T>(eventNames: TConnectionManagerEvent[], handler: (data: T, eventName: string) => void): () => void;
|
|
42
|
+
waitConnection<T>(eventName: TConnectionManagerEvent): Promise<T>;
|
|
43
|
+
offConnection<T>(eventName: TConnectionManagerEvent, handler: (data: T) => void): void;
|
|
44
|
+
isConfigured: () => boolean;
|
|
45
|
+
getConnectionConfiguration: () => import('./ConnectionManager/ConfigurationManager').IConnectionConfiguration;
|
|
46
|
+
getSipServerUrl: TGetServerUrl;
|
|
47
|
+
call: (params: Parameters<CallManager["startCall"]>[2]) => Promise<RTCPeerConnection>;
|
|
48
|
+
hangUp: CallManager['endCall'];
|
|
49
|
+
answerToIncomingCall: (params: Parameters<CallManager["answerToIncomingCall"]>[1]) => Promise<RTCPeerConnection>;
|
|
50
|
+
declineToIncomingCall: IncomingCallManager['declineToIncomingCall'];
|
|
51
|
+
getEstablishedRTCSession: CallManager['getEstablishedRTCSession'];
|
|
52
|
+
getCallConfiguration: CallManager['getCallConfiguration'];
|
|
53
|
+
getRemoteStreams: CallManager['getRemoteStreams'];
|
|
54
|
+
replaceMediaStream: CallManager['replaceMediaStream'];
|
|
55
|
+
onCall<T>(eventName: TCallEvent, handler: (data: T) => void): () => void;
|
|
56
|
+
onceCall<T>(eventName: TCallEvent, handler: (data: T) => void): () => void;
|
|
57
|
+
onceRaceCall<T>(eventNames: TCallEvent[], handler: (data: T, eventName: string) => void): () => void;
|
|
58
|
+
waitCall<T>(eventName: TCallEvent): Promise<T>;
|
|
59
|
+
offIncomingCall<T>(eventName: TIncomingCallEvent, handler: (data: T) => void): void;
|
|
60
|
+
onIncomingCall<T>(eventName: TIncomingCallEvent, handler: (data: T) => void): () => void;
|
|
61
|
+
onceIncomingCall<T>(eventName: TIncomingCallEvent, handler: (data: T) => void): () => void;
|
|
62
|
+
onceRaceIncomingCall<T>(eventNames: TIncomingCallEvent[], handler: (data: T, eventName: string) => void): () => void;
|
|
63
|
+
waitIncomingCall<T>(eventName: TIncomingCallEvent): Promise<T>;
|
|
64
|
+
offCall<T>(eventName: TCallEvent, handler: (data: T) => void): void;
|
|
65
|
+
startPresentation(stream: MediaStream, options?: {
|
|
187
66
|
isP2P?: boolean;
|
|
67
|
+
isNeedReinvite?: boolean;
|
|
188
68
|
maxBitrate?: number;
|
|
189
69
|
contentHint?: TContentHint;
|
|
190
70
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
191
71
|
onAddedTransceiver?: TOnAddedTransceiver;
|
|
192
|
-
|
|
193
|
-
callLimit: number;
|
|
72
|
+
callLimit?: number;
|
|
194
73
|
}): Promise<MediaStream>;
|
|
195
|
-
|
|
196
|
-
stopPresentation({ isP2P, }?: {
|
|
74
|
+
stopPresentation(options?: {
|
|
197
75
|
isP2P?: boolean;
|
|
198
|
-
}): Promise<MediaStream |
|
|
199
|
-
updatePresentation(stream: MediaStream,
|
|
76
|
+
}): Promise<MediaStream | undefined>;
|
|
77
|
+
updatePresentation(stream: MediaStream, options?: {
|
|
200
78
|
isP2P?: boolean;
|
|
79
|
+
isNeedReinvite?: boolean;
|
|
201
80
|
maxBitrate?: number;
|
|
202
81
|
contentHint?: TContentHint;
|
|
203
82
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
204
83
|
onAddedTransceiver?: TOnAddedTransceiver;
|
|
205
|
-
}): Promise<MediaStream |
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
cancelRequestsAndResetPresentation(): void;
|
|
209
|
-
handleNewRTCSession: ({ originator, session: rtcSession }: IncomingRTCSessionEvent) => void;
|
|
210
|
-
on<T>(eventName: TEventUA, handler: (data: T) => void): () => void;
|
|
211
|
-
once<T>(eventName: TEventUA, handler: (data: T) => void): () => void;
|
|
212
|
-
onceRace<T>(eventNames: TEventUA[], handler: (data: T, eventName: string) => void): () => void;
|
|
213
|
-
wait<T>(eventName: TEventUA): Promise<T>;
|
|
214
|
-
off<T>(eventName: TEventUA, handler: (data: T) => void): void;
|
|
215
|
-
onSession<T>(eventName: TEventSession, handler: (data: T) => void): () => void;
|
|
216
|
-
onceSession<T>(eventName: TEventSession, handler: (data: T) => void): () => void;
|
|
217
|
-
onceRaceSession<T>(eventNames: TEventSession[], handler: (data: T, eventName: string) => void): () => void;
|
|
218
|
-
waitSession<T>(eventName: TEventSession): Promise<T>;
|
|
219
|
-
offSession<T>(eventName: TEventSession, handler: (data: T) => void): void;
|
|
220
|
-
isConfigured(): boolean;
|
|
221
|
-
getConnectionConfiguration(): {
|
|
222
|
-
sipServerUrl?: string;
|
|
223
|
-
displayName?: string;
|
|
224
|
-
register?: boolean;
|
|
225
|
-
user?: string;
|
|
226
|
-
password?: string;
|
|
227
|
-
number?: string;
|
|
228
|
-
answer?: boolean;
|
|
229
|
-
};
|
|
230
|
-
getRemoteStreams(): MediaStream[] | undefined;
|
|
231
|
-
get connection(): RTCPeerConnection | undefined;
|
|
232
|
-
get remoteCallerData(): {
|
|
233
|
-
displayName: string | undefined;
|
|
234
|
-
host: string | undefined;
|
|
235
|
-
incomingNumber: string | undefined;
|
|
236
|
-
rtcSession: RTCSession | undefined;
|
|
237
|
-
};
|
|
238
|
-
get requested(): boolean;
|
|
239
|
-
get establishedRTCSession(): RTCSession | undefined;
|
|
240
|
-
get isRegistered(): boolean;
|
|
241
|
-
get isRegisterConfig(): boolean;
|
|
242
|
-
get isCallActive(): boolean;
|
|
243
|
-
get isAvailableIncomingCall(): boolean;
|
|
244
|
-
connectInner: TConnect;
|
|
245
|
-
initUa: TInitUa;
|
|
246
|
-
createUa: TCreateUa;
|
|
247
|
-
start: TStart;
|
|
248
|
-
set: TSet;
|
|
249
|
-
disconnect: () => Promise<void>;
|
|
250
|
-
call: TCall;
|
|
251
|
-
answerToIncomingCall: TAnswerToIncomingCall;
|
|
252
|
-
handleCall: ({ ontrack }: {
|
|
253
|
-
ontrack?: TOntrack;
|
|
254
|
-
}) => Promise<RTCPeerConnection>;
|
|
255
|
-
restoreSession: () => void;
|
|
256
|
-
sendDTMF: TSendDTMF;
|
|
257
|
-
generateStream(videoTrack: MediaStreamTrack, audioTrack?: MediaStreamTrack): MediaStream;
|
|
258
|
-
generateAudioStream(audioTrack: MediaStreamTrack): MediaStream;
|
|
259
|
-
generateStreams(remoteTracks: MediaStreamTrack[]): MediaStream[];
|
|
260
|
-
generateAudioStreams(remoteTracks: MediaStreamTrack[]): MediaStream[];
|
|
261
|
-
hangUpWithoutCancelRequests: THangUp;
|
|
262
|
-
cancelRequests(): void;
|
|
263
|
-
cancelConnectWithRepeatedCalls(): void;
|
|
264
|
-
cancelSendPresentationWithRepeatedCalls(): void;
|
|
265
|
-
handleShareState: (eventName: string) => void;
|
|
266
|
-
maybeTriggerChannels: (request: IncomingRequest) => void;
|
|
267
|
-
handleNotify: (header: TInfoNotify) => void;
|
|
268
|
-
triggerRemovedFromListModeratorsNotify: ({ conference, }: TRemovedFromListModeratorsInfoNotify) => void;
|
|
269
|
-
triggerAddedToListModeratorsNotify: ({ conference }: TAddedToListModeratorsInfoNotify) => void;
|
|
270
|
-
triggerWebcastStartedNotify: ({ body: { conference, type } }: TWebcastInfoNotify) => void;
|
|
271
|
-
triggerWebcastStoppedNotify: ({ body: { conference, type } }: TWebcastInfoNotify) => void;
|
|
272
|
-
triggerAccountChangedNotify: () => void;
|
|
273
|
-
triggerAccountDeletedNotify: () => void;
|
|
274
|
-
triggerConferenceParticipantTokenIssued: ({ body: { conference, participant, jwt }, }: TConferenceParticipantTokenIssued) => void;
|
|
275
|
-
triggerChannelsNotify: (channelsInfo: TChannelsInfoNotify) => void;
|
|
276
|
-
triggerParticipationAcceptingWordRequest: ({ body: { conference }, }: TAcceptingWordRequestInfoNotify) => void;
|
|
277
|
-
triggerParticipationCancellingWordRequest: ({ body: { conference }, }: TCancellingWordRequestInfoNotify) => void;
|
|
278
|
-
triggerParticipantMoveRequestToStream: ({ body: { conference }, }: TMoveRequestToStreamInfoNotify) => void;
|
|
279
|
-
triggerEnterRoom: (request: IncomingRequest) => void;
|
|
280
|
-
triggerShareState: (request: IncomingRequest) => void;
|
|
281
|
-
maybeTriggerParticipantMoveRequest: (request: IncomingRequest) => void;
|
|
282
|
-
triggerMainCamControl: (request: IncomingRequest) => void;
|
|
283
|
-
triggerMicControl: (request: IncomingRequest) => void;
|
|
284
|
-
triggerUseLicense: (request: IncomingRequest) => void;
|
|
285
|
-
handleNewInfo: (info: IncomingInfoEvent | OutgoingInfoEvent) => void;
|
|
286
|
-
handleSipEvent: ({ request }: {
|
|
287
|
-
request: IncomingRequest;
|
|
288
|
-
}) => void;
|
|
289
|
-
maybeHandleNotify: (request: IncomingRequest) => void;
|
|
290
|
-
waitChannels(): Promise<TChannels>;
|
|
291
|
-
waitSyncMediaState(): Promise<{
|
|
84
|
+
}): Promise<MediaStream | undefined>;
|
|
85
|
+
waitChannels(...args: Parameters<ApiManager['waitChannels']>): Promise<import('./ApiManager/types').TChannels>;
|
|
86
|
+
waitSyncMediaState(...args: Parameters<ApiManager['waitSyncMediaState']>): Promise<{
|
|
292
87
|
isSyncForced: boolean;
|
|
293
88
|
}>;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
89
|
+
sendDTMF(...args: Parameters<ApiManager['sendDTMF']>): Promise<void>;
|
|
90
|
+
sendChannels(...args: Parameters<ApiManager['sendChannels']>): Promise<void>;
|
|
91
|
+
sendMediaState(...args: Parameters<ApiManager['sendMediaState']>): Promise<void>;
|
|
92
|
+
sendRefusalToTurnOn(...args: Parameters<ApiManager['sendRefusalToTurnOn']>): Promise<void>;
|
|
93
|
+
sendRefusalToTurnOnMic(...args: Parameters<ApiManager['sendRefusalToTurnOnMic']>): Promise<void>;
|
|
94
|
+
sendRefusalToTurnOnCam(...args: Parameters<ApiManager['sendRefusalToTurnOnCam']>): Promise<void>;
|
|
95
|
+
sendMustStopPresentationP2P(...args: Parameters<ApiManager['sendMustStopPresentationP2P']>): Promise<void>;
|
|
96
|
+
sendStoppedPresentationP2P(...args: Parameters<ApiManager['sendStoppedPresentationP2P']>): Promise<void>;
|
|
97
|
+
sendStoppedPresentation(...args: Parameters<ApiManager['sendStoppedPresentation']>): Promise<void>;
|
|
98
|
+
askPermissionToStartPresentationP2P(...args: Parameters<ApiManager['askPermissionToStartPresentationP2P']>): Promise<void>;
|
|
99
|
+
askPermissionToStartPresentation(...args: Parameters<ApiManager['askPermissionToStartPresentation']>): Promise<void>;
|
|
100
|
+
askPermissionToEnableCam(...args: Parameters<ApiManager['askPermissionToEnableCam']>): Promise<void>;
|
|
101
|
+
onApi<T>(eventName: TApiEvent, handler: (data: T) => void): () => void;
|
|
102
|
+
onceApi<T>(eventName: TApiEvent, handler: (data: T) => void): () => void;
|
|
103
|
+
onceRaceApi<T>(eventNames: TApiEvent[], handler: (data: T, eventName: string) => void): () => void;
|
|
104
|
+
waitApi<T>(eventName: TApiEvent): Promise<T>;
|
|
105
|
+
offApi<T>(eventName: TApiEvent, handler: (data: T) => void): void;
|
|
300
106
|
}
|
|
301
|
-
export
|
|
107
|
+
export default SipConnector;
|
|
@@ -2,16 +2,21 @@ import { UA } from '@krivega/jssip';
|
|
|
2
2
|
import { default as SipConnector } from '../SipConnector';
|
|
3
3
|
import { EUseLicense, TContentHint, TSimulcastEncoding } from '../types';
|
|
4
4
|
interface IProxyMethods {
|
|
5
|
-
on: SipConnector['
|
|
6
|
-
once: SipConnector['
|
|
7
|
-
onceRace: SipConnector['
|
|
8
|
-
wait: SipConnector['
|
|
9
|
-
off: SipConnector['
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
on: SipConnector['onConnection'];
|
|
6
|
+
once: SipConnector['onceConnection'];
|
|
7
|
+
onceRace: SipConnector['onceRaceConnection'];
|
|
8
|
+
wait: SipConnector['waitConnection'];
|
|
9
|
+
off: SipConnector['offConnection'];
|
|
10
|
+
onCall: SipConnector['onCall'];
|
|
11
|
+
onceCall: SipConnector['onceCall'];
|
|
12
|
+
onceRaceCall: SipConnector['onceRaceCall'];
|
|
13
|
+
waitCall: SipConnector['waitCall'];
|
|
14
|
+
offCall: SipConnector['offCall'];
|
|
15
|
+
onIncomingCall: SipConnector['onIncomingCall'];
|
|
16
|
+
onceIncomingCall: SipConnector['onceIncomingCall'];
|
|
17
|
+
onceRaceIncomingCall: SipConnector['onceRaceIncomingCall'];
|
|
18
|
+
waitIncomingCall: SipConnector['waitIncomingCall'];
|
|
19
|
+
offIncomingCall: SipConnector['offIncomingCall'];
|
|
15
20
|
sendDTMF: SipConnector['sendDTMF'];
|
|
16
21
|
hangUp: SipConnector['hangUp'];
|
|
17
22
|
declineToIncomingCall: SipConnector['declineToIncomingCall'];
|
|
@@ -24,19 +29,21 @@ interface IProxyMethods {
|
|
|
24
29
|
isRegistered: SipConnector['isRegistered'];
|
|
25
30
|
}
|
|
26
31
|
declare class SipConnectorFacade implements IProxyMethods {
|
|
27
|
-
readonly sipConnector: SipConnector;
|
|
28
|
-
private readonly preferredMimeTypesVideoCodecs?;
|
|
29
|
-
private readonly excludeMimeTypesVideoCodecs?;
|
|
30
32
|
on: IProxyMethods['on'];
|
|
31
33
|
once: IProxyMethods['once'];
|
|
32
34
|
onceRace: IProxyMethods['onceRace'];
|
|
33
35
|
wait: IProxyMethods['wait'];
|
|
34
36
|
off: IProxyMethods['off'];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
onCall: IProxyMethods['onCall'];
|
|
38
|
+
onceCall: IProxyMethods['onceCall'];
|
|
39
|
+
onceRaceCall: IProxyMethods['onceRaceCall'];
|
|
40
|
+
waitCall: IProxyMethods['waitCall'];
|
|
41
|
+
offCall: IProxyMethods['offCall'];
|
|
42
|
+
onIncomingCall: IProxyMethods['onIncomingCall'];
|
|
43
|
+
onceIncomingCall: IProxyMethods['onceIncomingCall'];
|
|
44
|
+
onceRaceIncomingCall: IProxyMethods['onceRaceIncomingCall'];
|
|
45
|
+
waitIncomingCall: IProxyMethods['waitIncomingCall'];
|
|
46
|
+
offIncomingCall: IProxyMethods['offIncomingCall'];
|
|
40
47
|
sendDTMF: IProxyMethods['sendDTMF'];
|
|
41
48
|
hangUp: IProxyMethods['hangUp'];
|
|
42
49
|
declineToIncomingCall: IProxyMethods['declineToIncomingCall'];
|
|
@@ -47,6 +54,9 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
47
54
|
connection: IProxyMethods['connection'];
|
|
48
55
|
isConfigured: IProxyMethods['isConfigured'];
|
|
49
56
|
isRegistered: IProxyMethods['isRegistered'];
|
|
57
|
+
readonly sipConnector: SipConnector;
|
|
58
|
+
private readonly preferredMimeTypesVideoCodecs?;
|
|
59
|
+
private readonly excludeMimeTypesVideoCodecs?;
|
|
50
60
|
constructor(sipConnector: SipConnector, { preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }?: {
|
|
51
61
|
preferredMimeTypesVideoCodecs?: string[];
|
|
52
62
|
excludeMimeTypesVideoCodecs?: string[];
|
|
@@ -94,7 +104,7 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
94
104
|
disconnectFromServer: () => Promise<{
|
|
95
105
|
isSuccessful: boolean;
|
|
96
106
|
}>;
|
|
97
|
-
|
|
107
|
+
answerToIncomingCall: (parameters: {
|
|
98
108
|
mediaStream: MediaStream;
|
|
99
109
|
extraHeaders?: string[] | undefined;
|
|
100
110
|
iceServers?: RTCIceServer[];
|
|
@@ -118,7 +128,7 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
118
128
|
isSuccessProgressCall: boolean;
|
|
119
129
|
}) => void;
|
|
120
130
|
onEndedCall?: () => void;
|
|
121
|
-
}) => Promise<RTCPeerConnection |
|
|
131
|
+
}) => Promise<RTCPeerConnection | undefined>;
|
|
122
132
|
updatePresentation: ({ mediaStream, isP2P, maxBitrate, contentHint, simulcastEncodings, degradationPreference, sendEncodings, preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }: {
|
|
123
133
|
mediaStream: MediaStream;
|
|
124
134
|
isP2P: boolean;
|
|
@@ -129,8 +139,8 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
129
139
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
130
140
|
preferredMimeTypesVideoCodecs?: string[];
|
|
131
141
|
excludeMimeTypesVideoCodecs?: string[];
|
|
132
|
-
}) => Promise<MediaStream |
|
|
133
|
-
startPresentation: ({ mediaStream, isP2P, maxBitrate, contentHint, simulcastEncodings, degradationPreference, sendEncodings, preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }: {
|
|
142
|
+
}) => Promise<MediaStream | undefined>;
|
|
143
|
+
startPresentation: ({ mediaStream, isP2P, maxBitrate, contentHint, simulcastEncodings, degradationPreference, sendEncodings, preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, callLimit, }: {
|
|
134
144
|
mediaStream: MediaStream;
|
|
135
145
|
isP2P: boolean;
|
|
136
146
|
maxBitrate?: number;
|
|
@@ -140,12 +150,11 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
140
150
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
141
151
|
preferredMimeTypesVideoCodecs?: string[];
|
|
142
152
|
excludeMimeTypesVideoCodecs?: string[];
|
|
143
|
-
}, options?: {
|
|
144
153
|
callLimit: number;
|
|
145
|
-
}) => Promise<MediaStream |
|
|
154
|
+
}) => Promise<MediaStream | undefined>;
|
|
146
155
|
stopShareSipConnector: ({ isP2P }?: {
|
|
147
156
|
isP2P?: boolean;
|
|
148
|
-
}) => Promise<void | MediaStream>;
|
|
157
|
+
}) => Promise<void | MediaStream | undefined>;
|
|
149
158
|
sendRefusalToTurnOnMic: () => Promise<void>;
|
|
150
159
|
sendRefusalToTurnOnCam: () => Promise<void>;
|
|
151
160
|
sendMediaState: ({ isEnabledCam, isEnabledMic, }: {
|
|
@@ -11,21 +11,22 @@ declare class BaseSession implements RTCSession {
|
|
|
11
11
|
audio: boolean;
|
|
12
12
|
video: boolean;
|
|
13
13
|
};
|
|
14
|
-
constructor({ originator, eventHandlers, }: {
|
|
14
|
+
constructor({ originator, eventHandlers, remoteIdentity, }: {
|
|
15
15
|
originator?: string;
|
|
16
16
|
eventHandlers: TEventHandlers;
|
|
17
|
+
remoteIdentity: NameAddrHeader;
|
|
17
18
|
});
|
|
18
|
-
get C(): SessionStatus;
|
|
19
|
-
get causes(): constants.causes;
|
|
20
|
-
get id(): string;
|
|
21
|
-
set data(_data: unknown);
|
|
22
|
-
get data(): unknown;
|
|
23
19
|
get contact(): string;
|
|
24
20
|
get direction(): SessionDirection;
|
|
25
21
|
get local_identity(): NameAddrHeader;
|
|
26
22
|
get start_time(): Date;
|
|
27
23
|
get end_time(): Date;
|
|
28
24
|
get status(): SessionStatus;
|
|
25
|
+
get C(): SessionStatus;
|
|
26
|
+
get causes(): constants.causes;
|
|
27
|
+
get id(): string;
|
|
28
|
+
get data(): unknown;
|
|
29
|
+
set data(_data: unknown);
|
|
29
30
|
isInProgress(): boolean;
|
|
30
31
|
isEnded(): boolean;
|
|
31
32
|
isReadyToReOffer(): boolean;
|
|
@@ -48,7 +49,7 @@ declare class BaseSession implements RTCSession {
|
|
|
48
49
|
addListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
49
50
|
once(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
50
51
|
removeListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
51
|
-
off(
|
|
52
|
+
off(eventName: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
52
53
|
removeAllListeners(_event?: string | symbol): this;
|
|
53
54
|
setMaxListeners(_n: number): this;
|
|
54
55
|
getMaxListeners(): number;
|
|
@@ -59,7 +60,7 @@ declare class BaseSession implements RTCSession {
|
|
|
59
60
|
prependListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
60
61
|
prependOnceListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
61
62
|
eventNames(): (string | symbol)[];
|
|
62
|
-
initEvents(eventHandlers
|
|
63
|
+
initEvents(eventHandlers?: TEventHandlers): void;
|
|
63
64
|
on<T>(eventName: string, handler: (data: T) => void): this;
|
|
64
65
|
trigger(eventName: TEventSession, data?: unknown): void;
|
|
65
66
|
/**
|
|
@@ -71,7 +72,6 @@ declare class BaseSession implements RTCSession {
|
|
|
71
72
|
*/
|
|
72
73
|
sendDTMF(): void;
|
|
73
74
|
startPresentation(stream: MediaStream): Promise<MediaStream>;
|
|
74
|
-
updatePresentation(stream: MediaStream): Promise<MediaStream>;
|
|
75
75
|
stopPresentation(stream: MediaStream): Promise<MediaStream>;
|
|
76
76
|
isEstablished(): boolean;
|
|
77
77
|
}
|
|
@@ -4,7 +4,6 @@ import { default as RTCRtpSenderMock } from './RTCRtpSenderMock';
|
|
|
4
4
|
declare class RTCPeerConnectionMock implements RTCPeerConnectionDeprecated {
|
|
5
5
|
senders: RTCRtpSender[];
|
|
6
6
|
receivers: RTCRtpReceiver[];
|
|
7
|
-
constructor(_configuration?: RTCConfiguration, tracks: MediaStreamTrackMock[]);
|
|
8
7
|
canTrickleIceCandidates: boolean | null;
|
|
9
8
|
connectionState: RTCPeerConnectionState;
|
|
10
9
|
currentLocalDescription: RTCSessionDescription | null;
|
|
@@ -29,6 +28,7 @@ declare class RTCPeerConnectionMock implements RTCPeerConnectionDeprecated {
|
|
|
29
28
|
remoteDescription: RTCSessionDescription | null;
|
|
30
29
|
sctp: null;
|
|
31
30
|
signalingState: RTCSignalingState;
|
|
31
|
+
constructor(_configuration?: RTCConfiguration, tracks: MediaStreamTrackMock[]);
|
|
32
32
|
getRemoteStreams(): MediaStream[];
|
|
33
33
|
addIceCandidate(_candidate: RTCIceCandidate | RTCIceCandidateInit): Promise<void>;
|
|
34
34
|
addTransceiver(_trackOrKind: MediaStreamTrack | string, _init?: RTCRtpTransceiverInit): RTCRtpTransceiver;
|
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import { IncomingInfoEvent } from '@krivega/jssip';
|
|
1
|
+
import { IncomingInfoEvent, NameAddrHeader } from '@krivega/jssip';
|
|
2
2
|
import { TEventHandlers, default as BaseSession } from './BaseSession.mock';
|
|
3
3
|
export declare const FAILED_CONFERENCE_NUMBER = "777";
|
|
4
4
|
export declare const createDeclineStartPresentationError: () => Error;
|
|
5
5
|
declare class RTCSessionMock extends BaseSession {
|
|
6
|
-
|
|
7
|
-
status_code?: number;
|
|
8
|
-
private isEndedInner;
|
|
6
|
+
private static presentationError?;
|
|
9
7
|
private static startPresentationError?;
|
|
10
8
|
private static countStartPresentationError;
|
|
11
9
|
private static countStartsPresentation;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
mediaStream?: MediaStream;
|
|
15
|
-
eventHandlers: TEventHandlers;
|
|
16
|
-
originator: string;
|
|
17
|
-
});
|
|
18
|
-
static setStartPresentationError(startPresentationError: Error, { count }?: {
|
|
19
|
-
count?: number;
|
|
20
|
-
}): void;
|
|
21
|
-
static resetStartPresentationError(): void;
|
|
22
|
-
startPresentation(stream: MediaStream): Promise<MediaStream>;
|
|
23
|
-
initPeerconnection(mediaStream: MediaStream | undefined): boolean;
|
|
24
|
-
createPeerconnection(sendedStream: MediaStream): void;
|
|
25
|
-
connect(target: string): void;
|
|
10
|
+
url: string;
|
|
11
|
+
status_code?: number;
|
|
26
12
|
/**
|
|
27
13
|
* answer
|
|
28
14
|
*
|
|
@@ -35,11 +21,31 @@ declare class RTCSessionMock extends BaseSession {
|
|
|
35
21
|
answer: jest.Mock<void, [{
|
|
36
22
|
mediaStream: MediaStream;
|
|
37
23
|
}], any>;
|
|
24
|
+
replaceMediaStream: jest.Mock<Promise<void>, [_mediaStream: MediaStream], any>;
|
|
25
|
+
private isEndedInner;
|
|
26
|
+
constructor({ url, mediaStream, eventHandlers, originator, remoteIdentity, }: {
|
|
27
|
+
url?: string;
|
|
28
|
+
mediaStream?: MediaStream;
|
|
29
|
+
eventHandlers: TEventHandlers;
|
|
30
|
+
originator: string;
|
|
31
|
+
remoteIdentity?: NameAddrHeader;
|
|
32
|
+
});
|
|
33
|
+
static setPresentationError(presentationError: Error): void;
|
|
34
|
+
static resetPresentationError(): void;
|
|
35
|
+
static setStartPresentationError(startPresentationError: Error, { count }?: {
|
|
36
|
+
count?: number;
|
|
37
|
+
}): void;
|
|
38
|
+
static resetStartPresentationError(): void;
|
|
39
|
+
startPresentation: (stream: MediaStream) => Promise<MediaStream>;
|
|
40
|
+
stopPresentation: (stream: MediaStream) => Promise<MediaStream>;
|
|
41
|
+
initPeerconnection(mediaStream: MediaStream | undefined): boolean;
|
|
42
|
+
createPeerconnection(sendedStream: MediaStream): void;
|
|
43
|
+
connect(target: string): void;
|
|
38
44
|
terminate({ status_code, cause }?: {
|
|
39
45
|
status_code?: number;
|
|
40
46
|
cause?: string;
|
|
41
47
|
}): this;
|
|
42
|
-
terminateAsync({ status_code, cause }?: {
|
|
48
|
+
terminateAsync({ status_code, cause, }?: {
|
|
43
49
|
status_code?: number;
|
|
44
50
|
cause?: string;
|
|
45
51
|
}): Promise<void>;
|
|
@@ -62,7 +68,6 @@ declare class RTCSessionMock extends BaseSession {
|
|
|
62
68
|
audio: boolean;
|
|
63
69
|
video: boolean;
|
|
64
70
|
};
|
|
65
|
-
replaceMediaStream(_mediaStream: MediaStream): Promise<void>;
|
|
66
71
|
onmute({ audio, video }: {
|
|
67
72
|
audio: boolean;
|
|
68
73
|
video: boolean;
|