sip-connector 14.1.0 → 14.1.2-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-BHvTGgmw.js +1352 -0
- package/dist/SipConnector-ChW25Tx9.cjs +1 -0
- package/dist/doMock.cjs +1 -1
- package/dist/doMock.js +328 -327
- package/dist/index.cjs +1 -1
- package/dist/index.js +280 -270
- package/dist/src/SipConnector.d.ts +235 -0
- package/dist/{SipConnectorFacade → src/SipConnectorFacade}/SipConnectorFacade.d.ts +7 -7
- package/dist/{__fixtures__ → src/__fixtures__}/BaseSession.mock.d.ts +22 -34
- package/dist/{__fixtures__ → src/__fixtures__}/RTCPeerConnectionMock.d.ts +15 -15
- package/dist/{__fixtures__ → src/__fixtures__}/RTCRtpSenderMock.d.ts +2 -2
- package/dist/{__fixtures__ → src/__fixtures__}/RTCSessionMock.d.ts +34 -38
- package/dist/{__fixtures__ → src/__fixtures__}/UA.mock.d.ts +25 -44
- package/dist/{__fixtures__ → src/__fixtures__}/channelsNotify.d.ts +2 -2
- package/dist/{__fixtures__ → src/__fixtures__}/jssip.mock.d.ts +1 -1
- package/dist/{__fixtures__ → src/__fixtures__}/participantNotify.d.ts +2 -2
- package/dist/{tools → src/tools}/index.d.ts +2 -2
- package/dist/{tools → src/tools}/sendDTMFAccumulated.d.ts +2 -2
- package/dist/{types.d.ts → src/types.d.ts} +2 -1
- package/dist/src/videoSendingBalancer/scaleBitrate.d.ts +2 -0
- package/package.json +27 -26
- package/dist/SipConnector-BPIL3yLc.js +0 -1343
- package/dist/SipConnector-BUbfMgHs.cjs +0 -1
- package/dist/SipConnector.d.ts +0 -315
- package/dist/utils.d.ts +0 -4
- package/dist/videoSendingBalancer/scaleBitrate.d.ts +0 -2
- /package/dist/{SipConnectorFacade → src/SipConnectorFacade}/index.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/Registrator.mock.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/Request.mock.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/WebSocketInterface.mock.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/accountNotify.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/channels.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/conferenceParticipantTokenIssuedNotify.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/delayPromise.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/enterRoom.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/index.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/mediaState.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/participantMoveRequests.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/remoteCallerData.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/utils.d.ts +0 -0
- /package/dist/{__fixtures__ → src/__fixtures__}/webcastNotify.d.ts +0 -0
- /package/dist/{causes.d.ts → src/causes.d.ts} +0 -0
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/dist/{doMock.d.ts → src/doMock.d.ts} +0 -0
- /package/dist/{eventNames.d.ts → src/eventNames.d.ts} +0 -0
- /package/dist/{getExtraHeadersRemoteAddress.d.ts → src/getExtraHeadersRemoteAddress.d.ts} +0 -0
- /package/dist/{headers.d.ts → src/headers.d.ts} +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{logger.d.ts → src/logger.d.ts} +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureDegradationPreference.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureEmptyEncodings.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureEncodings.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureMaxBitrate.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/configureScaleResolutionDownBy.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/hasChangedRTCRtpSendParameters.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/index.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/resolveHasNeedToUpdateItemEncoding.d.ts +0 -0
- /package/dist/{setParametersToSender → src/setParametersToSender}/setParametersToSender.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/call.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/connectToServer.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/hasValidUri.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/permissions.d.ts +0 -0
- /package/dist/{tools → src/tools}/__fixtures__/processRequest.d.ts +0 -0
- /package/dist/{tools → src/tools}/__tests-utils__/parseObject.d.ts +0 -0
- /package/dist/{tools → src/tools}/__tests-utils__/resolveParseArray.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/getLinkError.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/getTypeFromError.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/getValuesFromError.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/index.d.ts +0 -0
- /package/dist/{tools → src/tools}/error/stringifyMessage.d.ts +0 -0
- /package/dist/{tools → src/tools}/generateSimulcastEncodings.d.ts +0 -0
- /package/dist/{tools → src/tools}/getExtraHeaders.d.ts +0 -0
- /package/dist/{tools → src/tools}/getUserAgent.d.ts +0 -0
- /package/dist/{tools → src/tools}/hasPurgatory.d.ts +0 -0
- /package/dist/{tools → src/tools}/prepareMediaStream.d.ts +0 -0
- /package/dist/{tools → src/tools}/resolveUpdateTransceiver.d.ts +0 -0
- /package/dist/{tools → src/tools}/setVideoTrackContentHints.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/index.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStartMainCam.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStartMic.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStopMainCam.d.ts +0 -0
- /package/dist/{tools → src/tools}/syncMediaState/resolveOnStopMic.d.ts +0 -0
- /package/dist/{utils → src/utils}/errors.d.ts +0 -0
- /package/dist/{utils → src/utils}/findSenderByStream.d.ts +0 -0
- /package/dist/{utils → src/utils}/findVideoSender.d.ts +0 -0
- /package/dist/{utils → src/utils}/findVideoTrack.d.ts +0 -0
- /package/dist/{utils → src/utils}/getCodecFromSender.d.ts +0 -0
- /package/dist/{utils → src/utils}/replaceForbiddenSymbolsWithUnderscore.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/balance.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/getMaxBitrateByWidth.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/getMaxBitrateByWidthAndCodec.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/hasAv1Codec.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/hasIncludesString.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/index.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/processSender.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/scaleBitrateByCodec.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/scaleResolutionAndBitrate.d.ts +0 -0
- /package/dist/{videoSendingBalancer → src/videoSendingBalancer}/setEncodingsToSender.d.ts +0 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { RTCSession, RegisteredEvent, UA, URI, UnRegisteredEvent, WebSocketInterface } from '@krivega/jssip';
|
|
2
|
+
import { TEventSession, TEventUA } from './eventNames';
|
|
3
|
+
import { TContentHint, TJsSIP, TOnAddedTransceiver } from './types';
|
|
4
|
+
export declare const hasCanceledCallError: (error: unknown) => boolean;
|
|
5
|
+
export declare const hasCanceledStartPresentationError: (error: unknown) => error is import('node_modules/repeated-calls/dist/utils').TCanceledError<unknown>;
|
|
6
|
+
type TChannels = {
|
|
7
|
+
inputChannels: string;
|
|
8
|
+
outputChannels: string;
|
|
9
|
+
};
|
|
10
|
+
type TMediaState = {
|
|
11
|
+
cam: boolean;
|
|
12
|
+
mic: boolean;
|
|
13
|
+
};
|
|
14
|
+
type TOptionsInfoMediaState = {
|
|
15
|
+
noTerminateWhenError?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type TOptionsExtraHeaders = {
|
|
18
|
+
extraHeaders?: string[];
|
|
19
|
+
};
|
|
20
|
+
type TOntrack = (track: RTCTrackEvent) => void;
|
|
21
|
+
type TParametersConnection = TOptionsExtraHeaders & {
|
|
22
|
+
displayName?: string;
|
|
23
|
+
user?: string;
|
|
24
|
+
password?: string;
|
|
25
|
+
register?: boolean;
|
|
26
|
+
sipServerUrl: string;
|
|
27
|
+
sipWebSocketServerURL: string;
|
|
28
|
+
remoteAddress?: string;
|
|
29
|
+
sessionTimers?: boolean;
|
|
30
|
+
registerExpires?: number;
|
|
31
|
+
connectionRecoveryMinInterval?: number;
|
|
32
|
+
connectionRecoveryMaxInterval?: number;
|
|
33
|
+
userAgent?: string;
|
|
34
|
+
};
|
|
35
|
+
type TParametersCheckTelephony = {
|
|
36
|
+
displayName: string;
|
|
37
|
+
sipServerUrl: string;
|
|
38
|
+
sipWebSocketServerURL: string;
|
|
39
|
+
userAgent?: string;
|
|
40
|
+
remoteAddress?: string;
|
|
41
|
+
extraHeaders?: string[];
|
|
42
|
+
};
|
|
43
|
+
type TConnect = (parameters: TParametersConnection, options?: {
|
|
44
|
+
callLimit?: number;
|
|
45
|
+
}) => Promise<UA>;
|
|
46
|
+
type TSet = ({ displayName, password, }: {
|
|
47
|
+
displayName?: string;
|
|
48
|
+
password?: string;
|
|
49
|
+
}) => Promise<boolean>;
|
|
50
|
+
type TParametersAnswerToIncomingCall = {
|
|
51
|
+
mediaStream: MediaStream;
|
|
52
|
+
extraHeaders?: TOptionsExtraHeaders['extraHeaders'];
|
|
53
|
+
ontrack?: TOntrack;
|
|
54
|
+
iceServers?: RTCIceServer[];
|
|
55
|
+
directionVideo?: RTCRtpTransceiverDirection;
|
|
56
|
+
directionAudio?: RTCRtpTransceiverDirection;
|
|
57
|
+
contentHint?: TContentHint;
|
|
58
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
59
|
+
offerToReceiveAudio?: boolean;
|
|
60
|
+
offerToReceiveVideo?: boolean;
|
|
61
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
62
|
+
};
|
|
63
|
+
type TParametersCall = TParametersAnswerToIncomingCall & {
|
|
64
|
+
number: string;
|
|
65
|
+
};
|
|
66
|
+
type TCall = (parameters: TParametersCall) => Promise<RTCPeerConnection>;
|
|
67
|
+
type TAnswerToIncomingCall = (parameters: TParametersAnswerToIncomingCall) => Promise<RTCPeerConnection>;
|
|
68
|
+
type TSendDTMF = (tone: number | string) => Promise<void>;
|
|
69
|
+
type THangUp = () => Promise<void>;
|
|
70
|
+
export default class SipConnector {
|
|
71
|
+
promisePendingStartPresentation?: Promise<MediaStream>;
|
|
72
|
+
promisePendingStopPresentation?: Promise<MediaStream | undefined>;
|
|
73
|
+
ua?: UA;
|
|
74
|
+
rtcSession?: RTCSession;
|
|
75
|
+
incomingRTCSession?: RTCSession;
|
|
76
|
+
streamPresentationCurrent?: MediaStream;
|
|
77
|
+
socket?: WebSocketInterface;
|
|
78
|
+
private isRegisterConfigInner;
|
|
79
|
+
private connectionConfiguration;
|
|
80
|
+
private remoteStreams;
|
|
81
|
+
private readonly JsSIP;
|
|
82
|
+
private readonly sessionEvents;
|
|
83
|
+
private readonly uaEvents;
|
|
84
|
+
private cancelableConnectWithRepeatedCalls;
|
|
85
|
+
private cancelableSendPresentationWithRepeatedCalls;
|
|
86
|
+
private isPendingConnect;
|
|
87
|
+
private isPendingInitUa;
|
|
88
|
+
private isPendingCall;
|
|
89
|
+
private isPendingAnswer;
|
|
90
|
+
constructor({ JsSIP }: {
|
|
91
|
+
JsSIP: TJsSIP;
|
|
92
|
+
});
|
|
93
|
+
get connection(): RTCPeerConnection | undefined;
|
|
94
|
+
get remoteCallerData(): {
|
|
95
|
+
displayName: string | undefined;
|
|
96
|
+
host: string | undefined;
|
|
97
|
+
incomingNumber: string | undefined;
|
|
98
|
+
rtcSession: RTCSession | undefined;
|
|
99
|
+
};
|
|
100
|
+
get requested(): boolean;
|
|
101
|
+
get establishedRTCSession(): RTCSession | undefined;
|
|
102
|
+
get isRegistered(): boolean;
|
|
103
|
+
get isRegisterConfig(): boolean;
|
|
104
|
+
get isCallActive(): boolean;
|
|
105
|
+
get isAvailableIncomingCall(): boolean;
|
|
106
|
+
get isPendingPresentation(): boolean;
|
|
107
|
+
connect: TConnect;
|
|
108
|
+
hangUp: THangUp;
|
|
109
|
+
register(): Promise<RegisteredEvent>;
|
|
110
|
+
unregister(): Promise<UnRegisteredEvent>;
|
|
111
|
+
readonly tryRegister: () => Promise<RegisteredEvent>;
|
|
112
|
+
sendOptions(target: URI | string, body?: string, extraHeaders?: string[]): Promise<void>;
|
|
113
|
+
ping(body?: string, extraHeaders?: string[]): Promise<void>;
|
|
114
|
+
checkTelephony({ userAgent, displayName, sipServerUrl, sipWebSocketServerURL, remoteAddress, extraHeaders, }: TParametersCheckTelephony): Promise<void>;
|
|
115
|
+
replaceMediaStream(mediaStream: MediaStream, options?: {
|
|
116
|
+
deleteExisting?: boolean;
|
|
117
|
+
addMissing?: boolean;
|
|
118
|
+
forceRenegotiation?: boolean;
|
|
119
|
+
contentHint?: TContentHint;
|
|
120
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
121
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
122
|
+
}): Promise<void>;
|
|
123
|
+
declineToIncomingCall: ({ statusCode, }?: {
|
|
124
|
+
statusCode?: number;
|
|
125
|
+
}) => Promise<void>;
|
|
126
|
+
busyIncomingCall: () => Promise<void>;
|
|
127
|
+
askPermissionToEnableCam(options?: TOptionsInfoMediaState): Promise<void>;
|
|
128
|
+
startPresentation(stream: MediaStream, { isNeedReinvite, isP2P, maxBitrate, contentHint, sendEncodings, onAddedTransceiver, }?: {
|
|
129
|
+
isNeedReinvite?: boolean;
|
|
130
|
+
isP2P?: boolean;
|
|
131
|
+
maxBitrate?: number;
|
|
132
|
+
contentHint?: TContentHint;
|
|
133
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
134
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
135
|
+
}, options?: {
|
|
136
|
+
callLimit: number;
|
|
137
|
+
}): Promise<MediaStream>;
|
|
138
|
+
stopPresentation({ isP2P, }?: {
|
|
139
|
+
isP2P?: boolean;
|
|
140
|
+
}): Promise<MediaStream | undefined>;
|
|
141
|
+
updatePresentation(stream: MediaStream, { isP2P, maxBitrate, contentHint, sendEncodings, onAddedTransceiver, }?: {
|
|
142
|
+
isP2P?: boolean;
|
|
143
|
+
maxBitrate?: number;
|
|
144
|
+
contentHint?: TContentHint;
|
|
145
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
146
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
147
|
+
}): Promise<MediaStream | undefined>;
|
|
148
|
+
on<T>(eventName: TEventUA, handler: (data: T) => void): () => void;
|
|
149
|
+
once<T>(eventName: TEventUA, handler: (data: T) => void): () => void;
|
|
150
|
+
onceRace<T>(eventNames: TEventUA[], handler: (data: T, eventName: string) => void): () => void;
|
|
151
|
+
wait<T>(eventName: TEventUA): Promise<T>;
|
|
152
|
+
off<T>(eventName: TEventUA, handler: (data: T) => void): void;
|
|
153
|
+
onSession<T>(eventName: TEventSession, handler: (data: T) => void): () => void;
|
|
154
|
+
onceSession<T>(eventName: TEventSession, handler: (data: T) => void): () => void;
|
|
155
|
+
onceRaceSession<T>(eventNames: TEventSession[], handler: (data: T, eventName: string) => void): () => void;
|
|
156
|
+
waitSession<T>(eventName: TEventSession): Promise<T>;
|
|
157
|
+
offSession<T>(eventName: TEventSession, handler: (data: T) => void): void;
|
|
158
|
+
isConfigured(): boolean;
|
|
159
|
+
getConnectionConfiguration(): {
|
|
160
|
+
sipServerUrl?: string;
|
|
161
|
+
displayName?: string;
|
|
162
|
+
register?: boolean;
|
|
163
|
+
user?: string;
|
|
164
|
+
password?: string;
|
|
165
|
+
number?: string;
|
|
166
|
+
answer?: boolean;
|
|
167
|
+
};
|
|
168
|
+
getRemoteStreams(): MediaStream[] | undefined;
|
|
169
|
+
getIncomingRTCSession(): RTCSession;
|
|
170
|
+
set: TSet;
|
|
171
|
+
disconnect: () => Promise<void>;
|
|
172
|
+
call: TCall;
|
|
173
|
+
answerToIncomingCall: TAnswerToIncomingCall;
|
|
174
|
+
sendDTMF: TSendDTMF;
|
|
175
|
+
cancelSendPresentationWithRepeatedCalls(): void;
|
|
176
|
+
waitChannels(): Promise<TChannels>;
|
|
177
|
+
waitSyncMediaState(): Promise<{
|
|
178
|
+
isSyncForced: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
sendChannels({ inputChannels, outputChannels }: TChannels): Promise<void>;
|
|
181
|
+
sendMediaState({ cam, mic }: TMediaState, options?: TOptionsInfoMediaState): Promise<void>;
|
|
182
|
+
sendRefusalToTurnOn(type: 'cam' | 'mic', options?: TOptionsInfoMediaState): Promise<void>;
|
|
183
|
+
sendRefusalToTurnOnMic(options?: TOptionsInfoMediaState): Promise<void>;
|
|
184
|
+
sendRefusalToTurnOnCam(options?: TOptionsInfoMediaState): Promise<void>;
|
|
185
|
+
private readonly removeIncomingSession;
|
|
186
|
+
private getSipServerUrl;
|
|
187
|
+
private sendMustStopPresentation;
|
|
188
|
+
private readonly connectWithDuplicatedCalls;
|
|
189
|
+
private sendPresentationWithDuplicatedCalls;
|
|
190
|
+
private hasEqualConnectionConfiguration;
|
|
191
|
+
private createUaConfiguration;
|
|
192
|
+
private sendPresentation;
|
|
193
|
+
private removeStreamPresentationCurrent;
|
|
194
|
+
private resetPresentation;
|
|
195
|
+
private cancelRequestsAndResetPresentation;
|
|
196
|
+
private readonly handleNewRTCSession;
|
|
197
|
+
private readonly connectInner;
|
|
198
|
+
private readonly initUa;
|
|
199
|
+
private readonly createUa;
|
|
200
|
+
private readonly start;
|
|
201
|
+
private readonly handleCall;
|
|
202
|
+
private readonly restoreSession;
|
|
203
|
+
private generateStream;
|
|
204
|
+
private generateAudioStream;
|
|
205
|
+
private generateStreams;
|
|
206
|
+
private generateAudioStreams;
|
|
207
|
+
private readonly hangUpWithoutCancelRequests;
|
|
208
|
+
private cancelRequests;
|
|
209
|
+
private cancelConnectWithRepeatedCalls;
|
|
210
|
+
private readonly handleShareState;
|
|
211
|
+
private readonly maybeTriggerChannels;
|
|
212
|
+
private readonly handleNotify;
|
|
213
|
+
private readonly triggerRemovedFromListModeratorsNotify;
|
|
214
|
+
private readonly triggerAddedToListModeratorsNotify;
|
|
215
|
+
private readonly triggerWebcastStartedNotify;
|
|
216
|
+
private readonly triggerWebcastStoppedNotify;
|
|
217
|
+
private readonly triggerAccountChangedNotify;
|
|
218
|
+
private readonly triggerAccountDeletedNotify;
|
|
219
|
+
private readonly triggerConferenceParticipantTokenIssued;
|
|
220
|
+
private readonly triggerChannelsNotify;
|
|
221
|
+
private readonly triggerParticipationAcceptingWordRequest;
|
|
222
|
+
private readonly triggerParticipationCancellingWordRequest;
|
|
223
|
+
private readonly triggerParticipantMoveRequestToStream;
|
|
224
|
+
private readonly triggerEnterRoom;
|
|
225
|
+
private readonly triggerShareState;
|
|
226
|
+
private readonly maybeTriggerParticipantMoveRequest;
|
|
227
|
+
private readonly triggerMainCamControl;
|
|
228
|
+
private readonly triggerMicControl;
|
|
229
|
+
private readonly triggerUseLicense;
|
|
230
|
+
private readonly handleNewInfo;
|
|
231
|
+
private readonly handleSipEvent;
|
|
232
|
+
private readonly maybeHandleNotify;
|
|
233
|
+
private readonly handleEnded;
|
|
234
|
+
}
|
|
235
|
+
export {};
|
|
@@ -24,9 +24,6 @@ interface IProxyMethods {
|
|
|
24
24
|
isRegistered: SipConnector['isRegistered'];
|
|
25
25
|
}
|
|
26
26
|
declare class SipConnectorFacade implements IProxyMethods {
|
|
27
|
-
readonly sipConnector: SipConnector;
|
|
28
|
-
private readonly preferredMimeTypesVideoCodecs?;
|
|
29
|
-
private readonly excludeMimeTypesVideoCodecs?;
|
|
30
27
|
on: IProxyMethods['on'];
|
|
31
28
|
once: IProxyMethods['once'];
|
|
32
29
|
onceRace: IProxyMethods['onceRace'];
|
|
@@ -47,6 +44,9 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
47
44
|
connection: IProxyMethods['connection'];
|
|
48
45
|
isConfigured: IProxyMethods['isConfigured'];
|
|
49
46
|
isRegistered: IProxyMethods['isRegistered'];
|
|
47
|
+
readonly sipConnector: SipConnector;
|
|
48
|
+
private readonly preferredMimeTypesVideoCodecs?;
|
|
49
|
+
private readonly excludeMimeTypesVideoCodecs?;
|
|
50
50
|
constructor(sipConnector: SipConnector, { preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }?: {
|
|
51
51
|
preferredMimeTypesVideoCodecs?: string[];
|
|
52
52
|
excludeMimeTypesVideoCodecs?: string[];
|
|
@@ -118,7 +118,7 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
118
118
|
isSuccessProgressCall: boolean;
|
|
119
119
|
}) => void;
|
|
120
120
|
onEndedCall?: () => void;
|
|
121
|
-
}) => Promise<RTCPeerConnection |
|
|
121
|
+
}) => Promise<RTCPeerConnection | undefined>;
|
|
122
122
|
updatePresentation: ({ mediaStream, isP2P, maxBitrate, contentHint, simulcastEncodings, degradationPreference, sendEncodings, preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }: {
|
|
123
123
|
mediaStream: MediaStream;
|
|
124
124
|
isP2P: boolean;
|
|
@@ -129,7 +129,7 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
129
129
|
sendEncodings?: RTCRtpEncodingParameters[];
|
|
130
130
|
preferredMimeTypesVideoCodecs?: string[];
|
|
131
131
|
excludeMimeTypesVideoCodecs?: string[];
|
|
132
|
-
}) => Promise<MediaStream |
|
|
132
|
+
}) => Promise<MediaStream | undefined>;
|
|
133
133
|
startPresentation: ({ mediaStream, isP2P, maxBitrate, contentHint, simulcastEncodings, degradationPreference, sendEncodings, preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }: {
|
|
134
134
|
mediaStream: MediaStream;
|
|
135
135
|
isP2P: boolean;
|
|
@@ -142,10 +142,10 @@ declare class SipConnectorFacade implements IProxyMethods {
|
|
|
142
142
|
excludeMimeTypesVideoCodecs?: string[];
|
|
143
143
|
}, options?: {
|
|
144
144
|
callLimit: number;
|
|
145
|
-
}) => Promise<MediaStream |
|
|
145
|
+
}) => Promise<MediaStream | undefined>;
|
|
146
146
|
stopShareSipConnector: ({ isP2P }?: {
|
|
147
147
|
isP2P?: boolean;
|
|
148
|
-
}) => Promise<void | MediaStream>;
|
|
148
|
+
}) => Promise<void | MediaStream | undefined>;
|
|
149
149
|
sendRefusalToTurnOnMic: () => Promise<void>;
|
|
150
150
|
sendRefusalToTurnOnCam: () => Promise<void>;
|
|
151
151
|
sendMediaState: ({ isEnabledCam, isEnabledMic, }: {
|
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
import { AnswerOptions, ExtraHeaders, HoldOptions, MediaStreamTypes, NameAddrHeader, OnHoldResult, RTCPeerConnectionDeprecated, RTCSession, ReferOptions, RenegotiateOptions, SessionDirection, SessionStatus, TerminateOptions, URI, C as constants } from '@krivega/jssip';
|
|
2
2
|
import { default as Events } from 'events-constructor';
|
|
3
3
|
import { TEventSession, SESSION_EVENT_NAMES } from '../eventNames';
|
|
4
|
-
|
|
5
|
-
* BaseSession
|
|
6
|
-
* @class
|
|
7
|
-
*/
|
|
4
|
+
export type TEventHandlers = Record<string, (data: unknown) => void>;
|
|
8
5
|
declare class BaseSession implements RTCSession {
|
|
9
6
|
originator: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
connection: RTCPeerConnectionDeprecated;
|
|
8
|
+
events: Events<typeof SESSION_EVENT_NAMES>;
|
|
9
|
+
remote_identity: NameAddrHeader;
|
|
10
|
+
mutedOptions: {
|
|
14
11
|
audio: boolean;
|
|
15
12
|
video: boolean;
|
|
16
13
|
};
|
|
17
|
-
constructor({ originator, eventHandlers }: {
|
|
18
|
-
originator?: string
|
|
19
|
-
eventHandlers:
|
|
14
|
+
constructor({ originator, eventHandlers, }: {
|
|
15
|
+
originator?: string;
|
|
16
|
+
eventHandlers: TEventHandlers;
|
|
20
17
|
});
|
|
21
|
-
get C(): SessionStatus;
|
|
22
|
-
get causes(): constants.causes;
|
|
23
|
-
get id(): string;
|
|
24
|
-
set data(_data: any);
|
|
25
|
-
get data(): any;
|
|
26
|
-
get connection(): RTCPeerConnectionDeprecated;
|
|
27
18
|
get contact(): string;
|
|
28
19
|
get direction(): SessionDirection;
|
|
29
20
|
get local_identity(): NameAddrHeader;
|
|
30
|
-
get remote_identity(): NameAddrHeader;
|
|
31
21
|
get start_time(): Date;
|
|
32
22
|
get end_time(): Date;
|
|
33
23
|
get status(): SessionStatus;
|
|
24
|
+
get C(): SessionStatus;
|
|
25
|
+
get causes(): constants.causes;
|
|
26
|
+
get id(): string;
|
|
27
|
+
get data(): unknown;
|
|
28
|
+
set data(_data: unknown);
|
|
34
29
|
isInProgress(): boolean;
|
|
35
30
|
isEnded(): boolean;
|
|
36
31
|
isReadyToReOffer(): boolean;
|
|
@@ -50,30 +45,23 @@ declare class BaseSession implements RTCSession {
|
|
|
50
45
|
deleteExisting: boolean;
|
|
51
46
|
addMissing: boolean;
|
|
52
47
|
}): Promise<void>;
|
|
53
|
-
addListener(_event: string | symbol, _listener: (...arguments_:
|
|
54
|
-
once(_event: string | symbol, _listener: (...arguments_:
|
|
55
|
-
removeListener(_event: string | symbol, _listener: (...arguments_:
|
|
56
|
-
off(_event: string | symbol, _listener: (...arguments_:
|
|
48
|
+
addListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
49
|
+
once(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
50
|
+
removeListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
51
|
+
off(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
57
52
|
removeAllListeners(_event?: string | symbol): this;
|
|
58
53
|
setMaxListeners(_n: number): this;
|
|
59
54
|
getMaxListeners(): number;
|
|
60
55
|
listeners(_event: string | symbol): (() => void)[];
|
|
61
56
|
rawListeners(_event: string | symbol): (() => void)[];
|
|
62
|
-
emit(_event: string | symbol, ..._arguments_:
|
|
57
|
+
emit(_event: string | symbol, ..._arguments_: unknown[]): boolean;
|
|
63
58
|
listenerCount(_event: string | symbol): number;
|
|
64
|
-
prependListener(_event: string | symbol, _listener: (...arguments_:
|
|
65
|
-
prependOnceListener(_event: string | symbol, _listener: (...arguments_:
|
|
59
|
+
prependListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
60
|
+
prependOnceListener(_event: string | symbol, _listener: (...arguments_: unknown[]) => void): this;
|
|
66
61
|
eventNames(): (string | symbol)[];
|
|
67
|
-
|
|
68
|
-
* initEvents
|
|
69
|
-
*
|
|
70
|
-
* @param {Array} [eventHandlers=[] - ] The event handlers
|
|
71
|
-
*
|
|
72
|
-
* @returns {undefined}
|
|
73
|
-
*/
|
|
74
|
-
initEvents(eventHandlers?: never[]): void;
|
|
62
|
+
initEvents(eventHandlers: TEventHandlers): void;
|
|
75
63
|
on<T>(eventName: string, handler: (data: T) => void): this;
|
|
76
|
-
trigger(eventName: TEventSession, data?:
|
|
64
|
+
trigger(eventName: TEventSession, data?: unknown): void;
|
|
77
65
|
/**
|
|
78
66
|
* sendDTMF
|
|
79
67
|
*
|
|
@@ -2,9 +2,8 @@ import { RTCPeerConnectionDeprecated } from '@krivega/jssip';
|
|
|
2
2
|
import { MediaStreamTrackMock } from 'webrtc-mock';
|
|
3
3
|
import { default as RTCRtpSenderMock } from './RTCRtpSenderMock';
|
|
4
4
|
declare class RTCPeerConnectionMock implements RTCPeerConnectionDeprecated {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(_configuration?: RTCConfiguration, tracks: MediaStreamTrackMock[]);
|
|
5
|
+
senders: RTCRtpSender[];
|
|
6
|
+
receivers: RTCRtpReceiver[];
|
|
8
7
|
canTrickleIceCandidates: boolean | null;
|
|
9
8
|
connectionState: RTCPeerConnectionState;
|
|
10
9
|
currentLocalDescription: RTCSessionDescription | null;
|
|
@@ -14,21 +13,22 @@ declare class RTCPeerConnectionMock implements RTCPeerConnectionDeprecated {
|
|
|
14
13
|
idpErrorInfo: string | null;
|
|
15
14
|
idpLoginUrl: string | null;
|
|
16
15
|
localDescription: RTCSessionDescription | null;
|
|
17
|
-
onconnectionstatechange: ((this: RTCPeerConnection, event_: Event) =>
|
|
18
|
-
ondatachannel: ((this: RTCPeerConnection, event_: RTCDataChannelEvent) =>
|
|
19
|
-
onicecandidate: ((this: RTCPeerConnection, event_: RTCPeerConnectionIceEvent) =>
|
|
20
|
-
onicecandidateerror: ((this: RTCPeerConnection, event_: Event) =>
|
|
21
|
-
oniceconnectionstatechange: ((this: RTCPeerConnection, event_: Event) =>
|
|
22
|
-
onicegatheringstatechange: ((this: RTCPeerConnection, event_: Event) =>
|
|
23
|
-
onnegotiationneeded: ((this: RTCPeerConnection, event_: Event) =>
|
|
24
|
-
onsignalingstatechange: ((this: RTCPeerConnection, event_: Event) =>
|
|
25
|
-
ontrack: ((this: RTCPeerConnection, event_: RTCTrackEvent) =>
|
|
16
|
+
onconnectionstatechange: ((this: RTCPeerConnection, event_: Event) => unknown) | null;
|
|
17
|
+
ondatachannel: ((this: RTCPeerConnection, event_: RTCDataChannelEvent) => unknown) | null;
|
|
18
|
+
onicecandidate: ((this: RTCPeerConnection, event_: RTCPeerConnectionIceEvent) => unknown) | null;
|
|
19
|
+
onicecandidateerror: ((this: RTCPeerConnection, event_: Event) => unknown) | null;
|
|
20
|
+
oniceconnectionstatechange: ((this: RTCPeerConnection, event_: Event) => unknown) | null;
|
|
21
|
+
onicegatheringstatechange: ((this: RTCPeerConnection, event_: Event) => unknown) | null;
|
|
22
|
+
onnegotiationneeded: ((this: RTCPeerConnection, event_: Event) => unknown) | null;
|
|
23
|
+
onsignalingstatechange: ((this: RTCPeerConnection, event_: Event) => unknown) | null;
|
|
24
|
+
ontrack: ((this: RTCPeerConnection, event_: RTCTrackEvent) => unknown) | null;
|
|
26
25
|
peerIdentity: undefined;
|
|
27
26
|
pendingLocalDescription: RTCSessionDescription | null;
|
|
28
27
|
pendingRemoteDescription: RTCSessionDescription | null;
|
|
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;
|
|
@@ -47,12 +47,12 @@ declare class RTCPeerConnectionMock implements RTCPeerConnectionDeprecated {
|
|
|
47
47
|
setConfiguration(_configuration: RTCConfiguration): void;
|
|
48
48
|
setLocalDescription(_description: RTCSessionDescriptionInit): Promise<void>;
|
|
49
49
|
setRemoteDescription(_description: RTCSessionDescriptionInit): Promise<void>;
|
|
50
|
-
addEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, event_: RTCPeerConnectionEventMap[K]) =>
|
|
50
|
+
addEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, event_: RTCPeerConnectionEventMap[K]) => unknown, options?: AddEventListenerOptions | boolean): void;
|
|
51
51
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
|
|
52
|
-
removeEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, event_: RTCPeerConnectionEventMap[K]) =>
|
|
52
|
+
removeEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, event_: RTCPeerConnectionEventMap[K]) => unknown, options?: EventListenerOptions | boolean): void;
|
|
53
53
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
|
|
54
54
|
dispatchEvent(_event: Event): boolean;
|
|
55
|
-
getReceivers: () =>
|
|
55
|
+
getReceivers: () => RTCRtpReceiver[];
|
|
56
56
|
getSenders: () => RTCRtpSender[];
|
|
57
57
|
addTrack: (track: MediaStreamTrack) => RTCRtpSenderMock;
|
|
58
58
|
}
|
|
@@ -3,8 +3,8 @@ declare class RTCRtpSenderMock implements RTCRtpSender {
|
|
|
3
3
|
track: MediaStreamTrack | null;
|
|
4
4
|
transport: RTCDtlsTransport | null;
|
|
5
5
|
transform: RTCRtpTransform | null;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
6
|
+
private parameters;
|
|
7
|
+
private parametersGets?;
|
|
8
8
|
constructor({ track }?: {
|
|
9
9
|
track?: MediaStreamTrack;
|
|
10
10
|
});
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { IncomingInfoEvent } from '@krivega/jssip';
|
|
2
|
-
import { default as BaseSession } from './BaseSession.mock';
|
|
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
|
-
url: string;
|
|
7
|
-
status_code?: number;
|
|
8
|
-
private _isEnded;
|
|
9
6
|
private static startPresentationError?;
|
|
10
7
|
private static countStartPresentationError;
|
|
11
8
|
private static countStartsPresentation;
|
|
9
|
+
url: string;
|
|
10
|
+
status_code?: number;
|
|
11
|
+
/**
|
|
12
|
+
* answer
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} arg1 - The argument 1
|
|
15
|
+
* @param {Object} arg1.mediaStream - The media stream
|
|
16
|
+
* @param {Array} arg1.eventHandlers - The event handlers
|
|
17
|
+
|
|
18
|
+
* @returns {undefined}
|
|
19
|
+
*/
|
|
20
|
+
answer: jest.Mock<void, [{
|
|
21
|
+
mediaStream: MediaStream;
|
|
22
|
+
}], any>;
|
|
23
|
+
private isEndedInner;
|
|
12
24
|
constructor({ url, mediaStream, eventHandlers, originator, }: {
|
|
13
25
|
url?: string;
|
|
14
|
-
mediaStream?:
|
|
15
|
-
eventHandlers
|
|
26
|
+
mediaStream?: MediaStream;
|
|
27
|
+
eventHandlers: TEventHandlers;
|
|
16
28
|
originator: string;
|
|
17
29
|
});
|
|
18
30
|
static setStartPresentationError(startPresentationError: Error, { count }?: {
|
|
@@ -20,54 +32,38 @@ declare class RTCSessionMock extends BaseSession {
|
|
|
20
32
|
}): void;
|
|
21
33
|
static resetStartPresentationError(): void;
|
|
22
34
|
startPresentation(stream: MediaStream): Promise<MediaStream>;
|
|
23
|
-
initPeerconnection(mediaStream:
|
|
24
|
-
createPeerconnection(sendedStream:
|
|
35
|
+
initPeerconnection(mediaStream: MediaStream | undefined): boolean;
|
|
36
|
+
createPeerconnection(sendedStream: MediaStream): void;
|
|
25
37
|
connect(target: string): void;
|
|
26
|
-
|
|
27
|
-
* answer
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} arg1 - The argument 1
|
|
30
|
-
* @param {Object} arg1.mediaStream - The media stream
|
|
31
|
-
* @param {Array} arg1.eventHandlers - The event handlers
|
|
32
|
-
|
|
33
|
-
* @returns {undefined}
|
|
34
|
-
*/
|
|
35
|
-
answer: jest.Mock<void, [any], any>;
|
|
36
|
-
terminate({ status_code }?: {
|
|
38
|
+
terminate({ status_code, cause }?: {
|
|
37
39
|
status_code?: number;
|
|
40
|
+
cause?: string;
|
|
38
41
|
}): this;
|
|
39
|
-
terminateAsync({ status_code }?: {
|
|
42
|
+
terminateAsync({ status_code, cause, }?: {
|
|
40
43
|
status_code?: number;
|
|
44
|
+
cause?: string;
|
|
41
45
|
}): Promise<void>;
|
|
42
46
|
terminateRemote({ status_code }?: {
|
|
43
47
|
status_code?: number;
|
|
44
48
|
}): this;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}): void;
|
|
50
|
-
({ track }: {
|
|
51
|
-
track: any;
|
|
52
|
-
}): void;
|
|
53
|
-
(argument0: any): void;
|
|
54
|
-
}): RTCRtpSender[];
|
|
55
|
-
_toggleMuteAudio(mute: boolean): void;
|
|
56
|
-
_toggleMuteVideo(mute: boolean): void;
|
|
49
|
+
addStream(stream: MediaStream, action?: 'getTracks' | 'getAudioTracks' | 'getVideoTracks'): void;
|
|
50
|
+
forEachSenders(callback: (sender: RTCRtpSender) => void): RTCRtpSender[];
|
|
51
|
+
toggleMuteAudio(mute: boolean): void;
|
|
52
|
+
toggleMuteVideo(mute: boolean): void;
|
|
57
53
|
mute(options: {
|
|
58
|
-
audio:
|
|
59
|
-
video:
|
|
54
|
+
audio: boolean;
|
|
55
|
+
video: boolean;
|
|
60
56
|
}): void;
|
|
61
57
|
unmute(options: {
|
|
62
|
-
audio:
|
|
63
|
-
video:
|
|
58
|
+
audio: boolean;
|
|
59
|
+
video: boolean;
|
|
64
60
|
}): void;
|
|
65
61
|
isMuted(): {
|
|
66
62
|
audio: boolean;
|
|
67
63
|
video: boolean;
|
|
68
64
|
};
|
|
69
|
-
replaceMediaStream(
|
|
70
|
-
|
|
65
|
+
replaceMediaStream(_mediaStream: MediaStream): Promise<void>;
|
|
66
|
+
onmute({ audio, video }: {
|
|
71
67
|
audio: boolean;
|
|
72
68
|
video: boolean;
|
|
73
69
|
}): void;
|
|
@@ -1,43 +1,36 @@
|
|
|
1
|
-
import { UA as IUA, IncomingRequest, UAConfiguration, UAConfigurationParams } from '@krivega/jssip';
|
|
1
|
+
import { DisconnectEvent, UA as IUA, IncomingRequest, UAConfiguration, UAConfigurationParams, UAEventMap } from '@krivega/jssip';
|
|
2
2
|
import { default as Events } from 'events-constructor';
|
|
3
|
-
import {
|
|
3
|
+
import { TEventHandlers } from './BaseSession.mock';
|
|
4
4
|
import { default as Registrator } from './Registrator.mock';
|
|
5
5
|
import { default as RTCSessionMock } from './RTCSessionMock';
|
|
6
6
|
export declare const PASSWORD_CORRECT = "PASSWORD_CORRECT";
|
|
7
7
|
export declare const PASSWORD_CORRECT_2 = "PASSWORD_CORRECT_2";
|
|
8
8
|
export declare const NAME_INCORRECT = "NAME_INCORRECT";
|
|
9
|
-
export declare const createWebsocketHandshakeTimeoutError: (sipServerUrl: string) =>
|
|
10
|
-
socket: {
|
|
11
|
-
_url: string;
|
|
12
|
-
_sip_uri: string;
|
|
13
|
-
_via_transport: string;
|
|
14
|
-
_ws: null;
|
|
15
|
-
};
|
|
16
|
-
error: boolean;
|
|
17
|
-
code: number;
|
|
18
|
-
reason: string;
|
|
19
|
-
};
|
|
9
|
+
export declare const createWebsocketHandshakeTimeoutError: (sipServerUrl: string) => DisconnectEvent;
|
|
20
10
|
declare class UA implements IUA {
|
|
21
11
|
private static isAvailableTelephony;
|
|
22
12
|
private static startError?;
|
|
23
13
|
private static countStartError;
|
|
24
14
|
private static countStarts;
|
|
25
|
-
|
|
15
|
+
events: Events<readonly (keyof UAEventMap)[]>;
|
|
16
|
+
readonly registratorInner: Registrator;
|
|
17
|
+
call: jest.Mock<RTCSessionMock, [url: string, parameters: {
|
|
18
|
+
mediaStream: MediaStream;
|
|
19
|
+
eventHandlers: TEventHandlers;
|
|
20
|
+
}], any>;
|
|
21
|
+
private startedTimeout?;
|
|
22
|
+
private stopedTimeout?;
|
|
23
|
+
private session?;
|
|
24
|
+
private isRegisteredInner?;
|
|
25
|
+
private isConnectedInner?;
|
|
26
|
+
private configuration;
|
|
27
|
+
constructor(_configuration: UAConfigurationParams);
|
|
28
|
+
static setStartError(startError: DisconnectEvent, { count }?: {
|
|
26
29
|
count?: number;
|
|
27
30
|
}): void;
|
|
28
31
|
static resetStartError(): void;
|
|
29
32
|
static setAvailableTelephony(): void;
|
|
30
33
|
static setNotAvailableTelephony(): void;
|
|
31
|
-
_events: Events<typeof UA_EVENT_NAMES>;
|
|
32
|
-
_startedTimeout?: ReturnType<typeof setTimeout>;
|
|
33
|
-
_stopedTimeout?: ReturnType<typeof setTimeout>;
|
|
34
|
-
session?: RTCSessionMock;
|
|
35
|
-
_isRegistered?: boolean;
|
|
36
|
-
_isConnected?: boolean;
|
|
37
|
-
configuration: UAConfiguration;
|
|
38
|
-
_registrator: Registrator;
|
|
39
|
-
constructor(_configuration: UAConfigurationParams);
|
|
40
|
-
isConnected(): boolean;
|
|
41
34
|
/**
|
|
42
35
|
* start
|
|
43
36
|
*
|
|
@@ -50,27 +43,18 @@ declare class UA implements IUA {
|
|
|
50
43
|
* @returns {undefined}
|
|
51
44
|
*/
|
|
52
45
|
stop(): void;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
off(eventName: TEventUA, handler: any): this;
|
|
46
|
+
on<T extends keyof UAEventMap>(eventName: T, handler: UAEventMap[T]): this;
|
|
47
|
+
once<T extends keyof UAEventMap>(eventName: T, handler: UAEventMap[T]): this;
|
|
48
|
+
off<T extends keyof UAEventMap>(eventName: T, handler: UAEventMap[T]): this;
|
|
57
49
|
removeAllListeners(): this;
|
|
58
|
-
trigger(eventName:
|
|
50
|
+
trigger<T extends keyof UAEventMap>(eventName: T, data: Parameters<UAEventMap[T]>[0]): void;
|
|
59
51
|
/**
|
|
60
52
|
* terminateSessions
|
|
61
53
|
*
|
|
62
54
|
* @returns {undefined}
|
|
63
55
|
*/
|
|
64
56
|
terminateSessions(): void;
|
|
65
|
-
|
|
66
|
-
* set
|
|
67
|
-
*
|
|
68
|
-
* @param {string} key - key
|
|
69
|
-
* @param {string} value - value
|
|
70
|
-
*
|
|
71
|
-
* @returns {boolean} true
|
|
72
|
-
*/
|
|
73
|
-
set(key: string, value: any): boolean;
|
|
57
|
+
set(key: keyof UAConfiguration, value: UAConfiguration[keyof UAConfiguration]): boolean;
|
|
74
58
|
/**
|
|
75
59
|
* register
|
|
76
60
|
*
|
|
@@ -83,21 +67,18 @@ declare class UA implements IUA {
|
|
|
83
67
|
* @returns {undefined}
|
|
84
68
|
*/
|
|
85
69
|
unregister(): void;
|
|
86
|
-
/**
|
|
87
|
-
* isRegistered
|
|
88
|
-
*
|
|
89
|
-
* @returns {boolean} isRegistered
|
|
90
|
-
*/
|
|
91
70
|
isRegistered(): boolean;
|
|
71
|
+
isConnected(): boolean;
|
|
92
72
|
/**
|
|
93
73
|
* isStarted
|
|
94
74
|
*
|
|
95
75
|
* @returns {boolean} isStarted
|
|
96
76
|
*/
|
|
97
77
|
isStarted(): boolean;
|
|
98
|
-
registrator(): Registrator;
|
|
99
78
|
newSipEvent(data: {
|
|
79
|
+
event: unknown;
|
|
100
80
|
request: IncomingRequest;
|
|
101
81
|
}): void;
|
|
82
|
+
registrator(): Registrator;
|
|
102
83
|
}
|
|
103
84
|
export default UA;
|