sip-connector 14.0.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 +439 -419
- package/dist/index.cjs +1 -1
- package/dist/index.js +708 -623
- 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 +107 -0
- package/dist/{SipConnectorFacade → src/SipConnectorFacade}/SipConnectorFacade.d.ts +34 -25
- package/dist/{__fixtures__ → src/__fixtures__}/BaseSession.mock.d.ts +23 -35
- package/dist/{__fixtures__ → src/__fixtures__}/RTCPeerConnectionMock.d.ts +15 -15
- package/dist/{__fixtures__ → src/__fixtures__}/RTCRtpSenderMock.d.ts +2 -2
- package/dist/src/__fixtures__/RTCSessionMock.d.ts +79 -0
- package/dist/src/__fixtures__/UA.mock.d.ts +82 -0
- package/dist/{__fixtures__ → src/__fixtures__}/channelsNotify.d.ts +2 -2
- package/dist/{__fixtures__ → src/__fixtures__}/index.d.ts +4 -4
- package/dist/{__fixtures__ → src/__fixtures__}/jssip.mock.d.ts +4 -4
- package/dist/{__fixtures__ → src/__fixtures__}/participantNotify.d.ts +2 -2
- package/dist/{constants.d.ts → src/constants.d.ts} +5 -0
- package/dist/{doMock.d.ts → src/doMock.d.ts} +1 -0
- package/dist/{index.d.ts → src/index.d.ts} +3 -1
- package/dist/{tools → src/tools}/__fixtures__/connectToServer.d.ts +2 -2
- package/dist/{tools → src/tools}/index.d.ts +2 -2
- package/dist/{tools/sendDTMFAccumulated.d.ts → src/tools/sendDtmfFAccumulated.d.ts} +2 -2
- package/dist/{types.d.ts → src/types.d.ts} +2 -1
- package/package.json +40 -37
- package/dist/SipConnector-Cc1z-VjV.js +0 -1335
- package/dist/SipConnector-K7IHfEEm.cjs +0 -1
- package/dist/SipConnector.d.ts +0 -314
- package/dist/__fixtures__/RTCSessionMock.d.ts +0 -78
- package/dist/__fixtures__/UA.mock.d.ts +0 -103
- package/dist/utils.d.ts +0 -4
- /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__}/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/{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/{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__/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}/scaleBitrate.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,83 @@
|
|
|
1
|
+
import { UA, WebSocketInterface } from '@krivega/jssip';
|
|
2
|
+
import { default as Events } from 'events-constructor';
|
|
3
|
+
import { TGetServerUrl, TJsSIP } from '../types';
|
|
4
|
+
import { default as ConnectionStateMachine } from './ConnectionStateMachine';
|
|
5
|
+
import { EVENT_NAMES } from './eventNames';
|
|
6
|
+
import { default as RegistrationManager } from './RegistrationManager';
|
|
7
|
+
import { default as UAFactory } from './UAFactory';
|
|
8
|
+
export type TOptionsExtraHeaders = {
|
|
9
|
+
extraHeaders?: string[];
|
|
10
|
+
};
|
|
11
|
+
export type TParametersConnection = TOptionsExtraHeaders & {
|
|
12
|
+
displayName?: string;
|
|
13
|
+
user?: string;
|
|
14
|
+
password?: string;
|
|
15
|
+
register?: boolean;
|
|
16
|
+
sipServerUrl: string;
|
|
17
|
+
sipWebSocketServerURL: string;
|
|
18
|
+
remoteAddress?: string;
|
|
19
|
+
sessionTimers?: boolean;
|
|
20
|
+
registerExpires?: number;
|
|
21
|
+
connectionRecoveryMinInterval?: number;
|
|
22
|
+
connectionRecoveryMaxInterval?: number;
|
|
23
|
+
userAgent?: string;
|
|
24
|
+
};
|
|
25
|
+
export type TConnect = (parameters: TParametersConnection, options?: {
|
|
26
|
+
callLimit?: number;
|
|
27
|
+
}) => Promise<UA>;
|
|
28
|
+
export type TSet = (parameters: {
|
|
29
|
+
displayName?: string;
|
|
30
|
+
}) => Promise<boolean>;
|
|
31
|
+
interface IDependencies {
|
|
32
|
+
JsSIP: TJsSIP;
|
|
33
|
+
events: Events<typeof EVENT_NAMES>;
|
|
34
|
+
uaFactory: UAFactory;
|
|
35
|
+
stateMachine: ConnectionStateMachine;
|
|
36
|
+
registrationManager: RegistrationManager;
|
|
37
|
+
getUa: () => UA | undefined;
|
|
38
|
+
setUa: (ua: UA | undefined) => void;
|
|
39
|
+
getConnectionConfiguration: () => {
|
|
40
|
+
sipServerUrl?: string;
|
|
41
|
+
displayName?: string;
|
|
42
|
+
register?: boolean;
|
|
43
|
+
user?: string;
|
|
44
|
+
password?: string;
|
|
45
|
+
};
|
|
46
|
+
setConnectionConfiguration: (config: {
|
|
47
|
+
sipServerUrl?: string;
|
|
48
|
+
displayName?: string;
|
|
49
|
+
register?: boolean;
|
|
50
|
+
user?: string;
|
|
51
|
+
password?: string;
|
|
52
|
+
}) => void;
|
|
53
|
+
updateConnectionConfiguration: (key: 'displayName', value: string) => void;
|
|
54
|
+
setSipServerUrl: (getSipServerUrl: TGetServerUrl) => void;
|
|
55
|
+
setSocket: (socket: WebSocketInterface) => void;
|
|
56
|
+
}
|
|
57
|
+
export default class ConnectionFlow {
|
|
58
|
+
private cancelableConnectWithRepeatedCalls;
|
|
59
|
+
private readonly JsSIP;
|
|
60
|
+
private readonly events;
|
|
61
|
+
private readonly uaFactory;
|
|
62
|
+
private readonly stateMachine;
|
|
63
|
+
private readonly registrationManager;
|
|
64
|
+
private readonly getUa;
|
|
65
|
+
private readonly setUa;
|
|
66
|
+
private readonly getConnectionConfiguration;
|
|
67
|
+
private readonly setConnectionConfiguration;
|
|
68
|
+
private readonly updateConnectionConfiguration;
|
|
69
|
+
private readonly setSipServerUrl;
|
|
70
|
+
private readonly setSocket;
|
|
71
|
+
constructor(dependencies: IDependencies);
|
|
72
|
+
connect: TConnect;
|
|
73
|
+
set: TSet;
|
|
74
|
+
disconnect: () => Promise<void>;
|
|
75
|
+
cancelRequests(): void;
|
|
76
|
+
private readonly connectWithDuplicatedCalls;
|
|
77
|
+
private hasEqualConnectionConfiguration;
|
|
78
|
+
private readonly connectInner;
|
|
79
|
+
private readonly initUa;
|
|
80
|
+
private readonly start;
|
|
81
|
+
private cancelConnectWithRepeatedCalls;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { default as Events } from 'events-constructor';
|
|
2
|
+
import { EVENT_NAMES } from './eventNames';
|
|
3
|
+
export declare enum EEvents {
|
|
4
|
+
START_CONNECT = "START_CONNECT",
|
|
5
|
+
START_INIT_UA = "START_INIT_UA",
|
|
6
|
+
UA_CONNECTED = "UA_CONNECTED",
|
|
7
|
+
UA_REGISTERED = "UA_REGISTERED",
|
|
8
|
+
UA_UNREGISTERED = "UA_UNREGISTERED",
|
|
9
|
+
UA_DISCONNECTED = "UA_DISCONNECTED",
|
|
10
|
+
CONNECTION_FAILED = "CONNECTION_FAILED",
|
|
11
|
+
RESET = "RESET"
|
|
12
|
+
}
|
|
13
|
+
type TConnectionMachineEvent = `${EEvents}`;
|
|
14
|
+
export declare enum EState {
|
|
15
|
+
IDLE = "idle",
|
|
16
|
+
CONNECTING = "connecting",
|
|
17
|
+
INITIALIZING = "initializing",
|
|
18
|
+
CONNECTED = "connected",
|
|
19
|
+
REGISTERED = "registered",
|
|
20
|
+
DISCONNECTED = "disconnected",
|
|
21
|
+
FAILED = "failed"
|
|
22
|
+
}
|
|
23
|
+
export default class ConnectionStateMachine {
|
|
24
|
+
private readonly actor;
|
|
25
|
+
private readonly stateChangeListeners;
|
|
26
|
+
private readonly events;
|
|
27
|
+
private unsubscribeFromEvents?;
|
|
28
|
+
private readonly actorSubscription?;
|
|
29
|
+
constructor(events: Events<typeof EVENT_NAMES>);
|
|
30
|
+
get state(): EState;
|
|
31
|
+
get isIdle(): boolean;
|
|
32
|
+
get isConnecting(): boolean;
|
|
33
|
+
get isInitializing(): boolean;
|
|
34
|
+
get isConnected(): boolean;
|
|
35
|
+
get isRegistered(): boolean;
|
|
36
|
+
get isDisconnected(): boolean;
|
|
37
|
+
get isFailed(): boolean;
|
|
38
|
+
get isPending(): boolean;
|
|
39
|
+
get isPendingConnect(): boolean;
|
|
40
|
+
get isPendingInitUa(): boolean;
|
|
41
|
+
get isActiveConnection(): boolean;
|
|
42
|
+
startConnect(): void;
|
|
43
|
+
startInitUa(): void;
|
|
44
|
+
reset(): void;
|
|
45
|
+
destroy(): void;
|
|
46
|
+
onStateChange(listener: (state: EState) => void): () => void;
|
|
47
|
+
canTransition(event: TConnectionMachineEvent): boolean;
|
|
48
|
+
getValidEvents(): TConnectionMachineEvent[];
|
|
49
|
+
private hasState;
|
|
50
|
+
private sendEvent;
|
|
51
|
+
private readonly toStartConnect;
|
|
52
|
+
private readonly toStartInitUa;
|
|
53
|
+
private readonly toConnected;
|
|
54
|
+
private readonly toRegistered;
|
|
55
|
+
private readonly toUnregistered;
|
|
56
|
+
private readonly toDisconnected;
|
|
57
|
+
private readonly toFailed;
|
|
58
|
+
private readonly toIdle;
|
|
59
|
+
private subscribeToEvents;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RegisteredEvent, UA, UnRegisteredEvent } from '@krivega/jssip';
|
|
2
|
+
import { default as Events } from 'events-constructor';
|
|
3
|
+
import { EVENT_NAMES } from './eventNames';
|
|
4
|
+
interface IDependencies {
|
|
5
|
+
events: Events<typeof EVENT_NAMES>;
|
|
6
|
+
getUaProtected: () => UA;
|
|
7
|
+
}
|
|
8
|
+
export default class RegistrationManager {
|
|
9
|
+
private readonly events;
|
|
10
|
+
private readonly getUaProtected;
|
|
11
|
+
constructor(dependencies: IDependencies);
|
|
12
|
+
register(): Promise<RegisteredEvent>;
|
|
13
|
+
unregister(): Promise<UnRegisteredEvent>;
|
|
14
|
+
tryRegister(): Promise<RegisteredEvent>;
|
|
15
|
+
subscribeToStartEvents(onSuccess: () => void, onError: (error: Error) => void): () => void;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { UA, URI } from '@krivega/jssip';
|
|
2
|
+
import { default as UAFactory } from './UAFactory';
|
|
3
|
+
export type TParametersCheckTelephony = {
|
|
4
|
+
displayName: string;
|
|
5
|
+
sipServerUrl: string;
|
|
6
|
+
sipWebSocketServerURL: string;
|
|
7
|
+
userAgent?: string;
|
|
8
|
+
remoteAddress?: string;
|
|
9
|
+
extraHeaders?: string[];
|
|
10
|
+
};
|
|
11
|
+
interface IDependencies {
|
|
12
|
+
uaFactory: UAFactory;
|
|
13
|
+
getUaProtected: () => UA;
|
|
14
|
+
}
|
|
15
|
+
export default class SipOperations {
|
|
16
|
+
private readonly uaFactory;
|
|
17
|
+
private readonly getUaProtected;
|
|
18
|
+
constructor(dependencies: IDependencies);
|
|
19
|
+
/**
|
|
20
|
+
* Отправляет SIP OPTIONS запрос к указанному адресу
|
|
21
|
+
*/
|
|
22
|
+
sendOptions(target: URI | string, body?: string, extraHeaders?: string[]): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Отправляет SIP OPTIONS запрос к собственному URI (ping)
|
|
25
|
+
*/
|
|
26
|
+
ping(body?: string, extraHeaders?: string[]): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Проверяет доступность телефонии, создавая временное соединение
|
|
29
|
+
*/
|
|
30
|
+
checkTelephony({ userAgent, displayName, sipServerUrl, sipWebSocketServerURL, remoteAddress, extraHeaders, }: TParametersCheckTelephony): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UA, UAConfigurationParams, WebSocketInterface } from '@krivega/jssip';
|
|
2
|
+
import { TJsSIP } from '../types';
|
|
3
|
+
export type TUAConfiguration = {
|
|
4
|
+
configuration: UAConfigurationParams;
|
|
5
|
+
helpers: {
|
|
6
|
+
socket: WebSocketInterface;
|
|
7
|
+
getSipServerUrl: (id: string) => string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type TCreateUAParameters = UAConfigurationParams & {
|
|
11
|
+
remoteAddress?: string;
|
|
12
|
+
extraHeaders?: string[];
|
|
13
|
+
};
|
|
14
|
+
type TParametersCreateUaConfiguration = {
|
|
15
|
+
sipWebSocketServerURL: string;
|
|
16
|
+
displayName?: string;
|
|
17
|
+
sipServerUrl: string;
|
|
18
|
+
user?: string;
|
|
19
|
+
register?: boolean;
|
|
20
|
+
password?: string;
|
|
21
|
+
sessionTimers?: boolean;
|
|
22
|
+
registerExpires?: number;
|
|
23
|
+
connectionRecoveryMinInterval?: number;
|
|
24
|
+
connectionRecoveryMaxInterval?: number;
|
|
25
|
+
userAgent?: string;
|
|
26
|
+
};
|
|
27
|
+
export default class UAFactory {
|
|
28
|
+
private readonly JsSIP;
|
|
29
|
+
constructor(JsSIP: TJsSIP);
|
|
30
|
+
static isRegisteredUA(ua?: UA): boolean;
|
|
31
|
+
private static validateConfiguration;
|
|
32
|
+
private static resolveAuthorizationUser;
|
|
33
|
+
private static buildExtraHeaders;
|
|
34
|
+
createConfiguration({ user, password, sipWebSocketServerURL, displayName, sipServerUrl, register, sessionTimers, registerExpires, // 5 minutes in sec
|
|
35
|
+
connectionRecoveryMinInterval, connectionRecoveryMaxInterval, userAgent, }: TParametersCreateUaConfiguration): TUAConfiguration;
|
|
36
|
+
createUA({ remoteAddress, extraHeaders, ...parameters }: TCreateUAParameters): UA;
|
|
37
|
+
/**
|
|
38
|
+
* Создает UA с полным жизненным циклом - конфигурация + создание + настройка событий
|
|
39
|
+
*/
|
|
40
|
+
createUAWithConfiguration(parameters: TParametersCreateUaConfiguration & {
|
|
41
|
+
remoteAddress?: string;
|
|
42
|
+
extraHeaders?: string[];
|
|
43
|
+
}, events: {
|
|
44
|
+
eachTriggers: (callback: (trigger: (...args: unknown[]) => void, eventName: string) => void) => void;
|
|
45
|
+
}): {
|
|
46
|
+
ua: UA;
|
|
47
|
+
helpers: TUAConfiguration['helpers'];
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as Events } from 'events-constructor';
|
|
2
|
+
export declare enum EEvent {
|
|
3
|
+
CONNECTING = "connecting",
|
|
4
|
+
CONNECTED = "connected",
|
|
5
|
+
DISCONNECTED = "disconnected",
|
|
6
|
+
NEW_RTC_SESSION = "newRTCSession",
|
|
7
|
+
REGISTERED = "registered",
|
|
8
|
+
UNREGISTERED = "unregistered",
|
|
9
|
+
REGISTRATION_FAILED = "registrationFailed",
|
|
10
|
+
NEW_MESSAGE = "newMessage",
|
|
11
|
+
SIP_EVENT = "sipEvent"
|
|
12
|
+
}
|
|
13
|
+
export declare const UA_EVENT_NAMES: readonly ["connecting", "connected", "disconnected", "newRTCSession", "registered", "unregistered", "registrationFailed", "newMessage", "sipEvent"];
|
|
14
|
+
export declare const EVENT_NAMES: ("connecting" | "connected" | "disconnected" | "newRTCSession" | "registered" | "unregistered" | "registrationFailed" | "newMessage" | "sipEvent")[];
|
|
15
|
+
export type TEvent = (typeof EVENT_NAMES)[number];
|
|
16
|
+
export type TEvents = Events<typeof EVENT_NAMES>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as ConnectionManager } from './@ConnectionManager';
|
|
2
|
+
export { EVENT_NAMES as CONNECTION_MANAGER_EVENT_NAMES, EEvent as EConnectionManagerEvent, } from './eventNames';
|
|
3
|
+
export type { TEvent as TConnectionManagerEvent, TEvents as TConnectionManagerEvents, } from './eventNames';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RTCSession } from '@krivega/jssip';
|
|
2
|
+
import { ConnectionManager } from '../ConnectionManager';
|
|
3
|
+
import { TEvent } from './eventNames';
|
|
4
|
+
type TRemoteCallerData = {
|
|
5
|
+
displayName?: string;
|
|
6
|
+
host?: string;
|
|
7
|
+
incomingNumber?: string;
|
|
8
|
+
rtcSession?: RTCSession;
|
|
9
|
+
};
|
|
10
|
+
export default class IncomingCallManager {
|
|
11
|
+
private incomingRTCSession?;
|
|
12
|
+
private readonly connectionManager;
|
|
13
|
+
private readonly events;
|
|
14
|
+
constructor(connectionManager: ConnectionManager);
|
|
15
|
+
get remoteCallerData(): TRemoteCallerData;
|
|
16
|
+
get isAvailableIncomingCall(): boolean;
|
|
17
|
+
start(): void;
|
|
18
|
+
stop(): void;
|
|
19
|
+
getIncomingRTCSession: () => RTCSession;
|
|
20
|
+
extractIncomingRTCSession: () => RTCSession;
|
|
21
|
+
declineToIncomingCall({ statusCode, }?: {
|
|
22
|
+
statusCode?: number;
|
|
23
|
+
}): Promise<void>;
|
|
24
|
+
busyIncomingCall(): Promise<void>;
|
|
25
|
+
on<T>(eventName: TEvent, handler: (data: T) => void): () => void;
|
|
26
|
+
once<T>(eventName: TEvent, handler: (data: T) => void): () => void;
|
|
27
|
+
onceRace<T>(eventNames: TEvent[], handler: (data: T, eventName: string) => void): () => void;
|
|
28
|
+
wait<T>(eventName: TEvent): Promise<T>;
|
|
29
|
+
off<T>(eventName: TEvent, handler: (data: T) => void): void;
|
|
30
|
+
private subscribe;
|
|
31
|
+
private unsubscribe;
|
|
32
|
+
private readonly handleNewRTCSession;
|
|
33
|
+
private setIncomingSession;
|
|
34
|
+
private removeIncomingSession;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum EEvent {
|
|
2
|
+
INCOMING_CALL = "incomingCall",
|
|
3
|
+
DECLINED_INCOMING_CALL = "declinedIncomingCall",
|
|
4
|
+
TERMINATED_INCOMING_CALL = "terminatedIncomingCall",
|
|
5
|
+
FAILED_INCOMING_CALL = "failedIncomingCall"
|
|
6
|
+
}
|
|
7
|
+
export declare enum Originator {
|
|
8
|
+
LOCAL = "local",
|
|
9
|
+
REMOTE = "remote",
|
|
10
|
+
SYSTEM = "system"
|
|
11
|
+
}
|
|
12
|
+
export declare const EVENT_NAMES: readonly ["incomingCall", "declinedIncomingCall", "terminatedIncomingCall", "failedIncomingCall"];
|
|
13
|
+
export type TEvent = (typeof EVENT_NAMES)[number];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CallManager } from '../CallManager';
|
|
2
|
+
import { TEvent } from './eventNames';
|
|
3
|
+
import { TContentHint, TOnAddedTransceiver } from './types';
|
|
4
|
+
export declare const hasCanceledStartPresentationError: (error: unknown) => error is import('repeated-calls').TCanceledError<unknown>;
|
|
5
|
+
declare class PresentationManager {
|
|
6
|
+
promisePendingStartPresentation?: Promise<MediaStream>;
|
|
7
|
+
promisePendingStopPresentation?: Promise<MediaStream | undefined>;
|
|
8
|
+
streamPresentationCurrent?: MediaStream;
|
|
9
|
+
private readonly events;
|
|
10
|
+
private cancelableSendPresentationWithRepeatedCalls;
|
|
11
|
+
private readonly callManager;
|
|
12
|
+
constructor({ callManager }: {
|
|
13
|
+
callManager: CallManager;
|
|
14
|
+
});
|
|
15
|
+
get isPendingPresentation(): boolean;
|
|
16
|
+
startPresentation(beforeStartPresentation: () => Promise<void>, stream: MediaStream, { isNeedReinvite, maxBitrate, contentHint, sendEncodings, onAddedTransceiver, }?: {
|
|
17
|
+
isNeedReinvite?: boolean;
|
|
18
|
+
maxBitrate?: number;
|
|
19
|
+
contentHint?: TContentHint;
|
|
20
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
21
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
22
|
+
}, options?: {
|
|
23
|
+
callLimit: number;
|
|
24
|
+
}): Promise<MediaStream>;
|
|
25
|
+
stopPresentation(beforeStopPresentation: () => Promise<void>): Promise<MediaStream | undefined>;
|
|
26
|
+
updatePresentation(beforeStartPresentation: () => Promise<void>, stream: MediaStream, { contentHint, sendEncodings, onAddedTransceiver, }?: {
|
|
27
|
+
isP2P?: boolean;
|
|
28
|
+
contentHint?: TContentHint;
|
|
29
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
30
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
31
|
+
}): Promise<MediaStream | undefined>;
|
|
32
|
+
cancelSendPresentationWithRepeatedCalls(): void;
|
|
33
|
+
on<T>(eventName: TEvent, handler: (data: T) => void): () => void;
|
|
34
|
+
once<T>(eventName: TEvent, handler: (data: T) => void): () => void;
|
|
35
|
+
onceRace<T>(eventNames: TEvent[], handler: (data: T, eventName: string) => void): () => void;
|
|
36
|
+
wait<T>(eventName: TEvent): Promise<T>;
|
|
37
|
+
off<T>(eventName: TEvent, handler: (data: T) => void): void;
|
|
38
|
+
private subscribe;
|
|
39
|
+
private sendPresentationWithDuplicatedCalls;
|
|
40
|
+
private sendPresentation;
|
|
41
|
+
private readonly getRtcSessionProtected;
|
|
42
|
+
private readonly handleEnded;
|
|
43
|
+
private reset;
|
|
44
|
+
private resetPresentation;
|
|
45
|
+
private removeStreamPresentationCurrent;
|
|
46
|
+
}
|
|
47
|
+
export default PresentationManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ONE_MEGABIT_IN_BITS = 1000000;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as Events } from 'events-constructor';
|
|
2
|
+
export declare enum EEvent {
|
|
3
|
+
START_PRESENTATION = "presentation:start",
|
|
4
|
+
STARTED_PRESENTATION = "presentation:started",
|
|
5
|
+
END_PRESENTATION = "presentation:end",
|
|
6
|
+
ENDED_PRESENTATION = "presentation:ended",
|
|
7
|
+
FAILED_PRESENTATION = "presentation:failed"
|
|
8
|
+
}
|
|
9
|
+
export declare const EVENT_NAMES: readonly ["presentation:start", "presentation:started", "presentation:end", "presentation:ended", "presentation:failed"];
|
|
10
|
+
export type TEvent = (typeof EVENT_NAMES)[number];
|
|
11
|
+
export type TEvents = Events<typeof EVENT_NAMES>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { hasCanceledStartPresentationError, default as PresentationManager, } from './@PresentationManager';
|
|
@@ -0,0 +1,107 @@
|
|
|
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;
|
|
14
|
+
constructor({ JsSIP }: {
|
|
15
|
+
JsSIP: TJsSIP;
|
|
16
|
+
});
|
|
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?: {
|
|
66
|
+
isP2P?: boolean;
|
|
67
|
+
isNeedReinvite?: boolean;
|
|
68
|
+
maxBitrate?: number;
|
|
69
|
+
contentHint?: TContentHint;
|
|
70
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
71
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
72
|
+
callLimit?: number;
|
|
73
|
+
}): Promise<MediaStream>;
|
|
74
|
+
stopPresentation(options?: {
|
|
75
|
+
isP2P?: boolean;
|
|
76
|
+
}): Promise<MediaStream | undefined>;
|
|
77
|
+
updatePresentation(stream: MediaStream, options?: {
|
|
78
|
+
isP2P?: boolean;
|
|
79
|
+
isNeedReinvite?: boolean;
|
|
80
|
+
maxBitrate?: number;
|
|
81
|
+
contentHint?: TContentHint;
|
|
82
|
+
sendEncodings?: RTCRtpEncodingParameters[];
|
|
83
|
+
onAddedTransceiver?: TOnAddedTransceiver;
|
|
84
|
+
}): Promise<MediaStream | undefined>;
|
|
85
|
+
waitChannels(...args: Parameters<ApiManager['waitChannels']>): Promise<import('./ApiManager/types').TChannels>;
|
|
86
|
+
waitSyncMediaState(...args: Parameters<ApiManager['waitSyncMediaState']>): Promise<{
|
|
87
|
+
isSyncForced: boolean;
|
|
88
|
+
}>;
|
|
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;
|
|
106
|
+
}
|
|
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, }: {
|