sip-connector 20.4.0 → 20.4.1

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.
@@ -0,0 +1,60 @@
1
+ import { CallStateMachine, TCallActor } from './CallStateMachine';
2
+ import { RTCSession } from '@krivega/jssip';
3
+ import { ConferenceStateManager } from '../ConferenceStateManager';
4
+ import { TEventMap, TEvents } from './events';
5
+ import { TAnswerToIncomingCall, TCallRoleSpectator, TReplaceMediaStream, TStartCall } from './types';
6
+ declare class CallManager {
7
+ readonly events: TEvents;
8
+ readonly callStateMachine: CallStateMachine;
9
+ protected isPendingCall: boolean;
10
+ protected isPendingAnswer: boolean;
11
+ protected rtcSession?: RTCSession;
12
+ private readonly conferenceStateManager;
13
+ private readonly mainRemoteStreamsManager;
14
+ private readonly recvRemoteStreamsManager;
15
+ private readonly roleManager;
16
+ private readonly mcuSession;
17
+ private recvSession?;
18
+ private disposeRecvSessionTrackListener?;
19
+ constructor(conferenceStateManager: ConferenceStateManager);
20
+ get callActor(): TCallActor;
21
+ get requested(): boolean;
22
+ get connection(): RTCPeerConnection | undefined;
23
+ get isCallActive(): boolean;
24
+ getEstablishedRTCSession: () => RTCSession | undefined;
25
+ on<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
26
+ onRace<T extends keyof TEventMap>(eventNames: T[], handler: (data: TEventMap[T], eventName: string) => void): () => void;
27
+ once<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
28
+ onceRace<T extends keyof TEventMap>(eventNames: T[], handler: (data: TEventMap[T], eventName: string) => void): () => void;
29
+ wait<T extends keyof TEventMap>(eventName: T): Promise<TEventMap[T]>;
30
+ off<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): void;
31
+ startCall: TStartCall;
32
+ endCall(): Promise<void>;
33
+ renegotiate(): Promise<boolean>;
34
+ answerToIncomingCall: TAnswerToIncomingCall;
35
+ getMainStream(): MediaStream | undefined;
36
+ getRemoteStreams(): MediaStream[];
37
+ setCallRoleParticipant(): void;
38
+ setCallRoleSpectatorSynthetic(): void;
39
+ setCallRoleSpectator(recvParams: TCallRoleSpectator['recvParams']): void;
40
+ replaceMediaStream(mediaStream: Parameters<TReplaceMediaStream>[0], options?: Parameters<TReplaceMediaStream>[1]): Promise<void>;
41
+ restartIce(options?: {
42
+ useUpdate?: boolean;
43
+ extraHeaders?: string[];
44
+ rtcOfferConstraints?: RTCOfferOptions;
45
+ sendEncodings?: RTCRtpEncodingParameters[];
46
+ degradationPreference?: RTCDegradationPreference;
47
+ }): Promise<boolean>;
48
+ private readonly reset;
49
+ private subscribeCallStatusChange;
50
+ private maybeTriggerCallStatus;
51
+ private subscribeMcuRemoteTrackEvents;
52
+ private addRemoteTrack;
53
+ private emitRemoteStreamsChanged;
54
+ private getActiveStreamsManager;
55
+ private attachRecvSessionTracks;
56
+ private startRecvSession;
57
+ private stopRecvSession;
58
+ private readonly onRoleChanged;
59
+ }
60
+ export default CallManager;
@@ -0,0 +1,59 @@
1
+ import { default as SipOperations, TParametersCheckTelephony } from './SipOperations';
2
+ import { RegisteredEvent, UA, UnRegisteredEvent, WebSocketInterface } from '@krivega/jssip';
3
+ import { TGetUri } from '../CallManager';
4
+ import { TJsSIP } from '../types';
5
+ import { TConnect, TConnectionConfigurationWithUa, TParametersConnection, TSet } from './ConnectionFlow';
6
+ import { TConnectionActor } from './ConnectionStateMachine';
7
+ import { TEventMap, TEvents } from './events';
8
+ type TConnectParameters = (() => Promise<TParametersConnection>) | TParametersConnection;
9
+ type TConnectOptions = Parameters<TConnect>[1] & {
10
+ hasReadyForConnection?: () => boolean;
11
+ };
12
+ export default class ConnectionManager {
13
+ readonly events: TEvents;
14
+ ua?: UA;
15
+ socket?: WebSocketInterface;
16
+ private readonly uaFactory;
17
+ private readonly registrationManager;
18
+ private readonly stateMachine;
19
+ private readonly connectionFlow;
20
+ private readonly sipOperations;
21
+ private readonly configurationManager;
22
+ private readonly JsSIP;
23
+ constructor({ JsSIP }: {
24
+ JsSIP: TJsSIP;
25
+ });
26
+ get requested(): boolean;
27
+ get isPendingConnect(): boolean;
28
+ get isPendingInitUa(): boolean;
29
+ get isIdle(): boolean;
30
+ get isDisconnected(): boolean;
31
+ get isFailed(): boolean;
32
+ get connectionActor(): TConnectionActor;
33
+ get connectionState(): import('./ConnectionStateMachine').EState;
34
+ get isRegistered(): boolean;
35
+ get isRegisterConfig(): boolean;
36
+ connect: (parameters: TConnectParameters, options?: TConnectOptions) => Promise<TConnectionConfigurationWithUa>;
37
+ set: TSet;
38
+ disconnect: () => Promise<void>;
39
+ register(): Promise<RegisteredEvent>;
40
+ unregister(): Promise<UnRegisteredEvent>;
41
+ readonly tryRegister: () => Promise<RegisteredEvent>;
42
+ sendOptions: (target: Parameters<SipOperations["sendOptions"]>[0], body?: Parameters<SipOperations["sendOptions"]>[1], extraHeaders?: Parameters<SipOperations["sendOptions"]>[2]) => Promise<void>;
43
+ ping: (body?: Parameters<SipOperations["ping"]>[0], extraHeaders?: Parameters<SipOperations["ping"]>[1]) => Promise<void>;
44
+ checkTelephony: (parameters: TParametersCheckTelephony) => Promise<void>;
45
+ on<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
46
+ once<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
47
+ onceRace<T extends keyof TEventMap>(eventNames: T[], handler: (data: TEventMap[T], eventName: string) => void): () => void;
48
+ wait<T extends keyof TEventMap>(eventName: T): Promise<TEventMap[T]>;
49
+ off<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): void;
50
+ isConfigured(): boolean;
51
+ getConnectionConfiguration: () => import('./ConfigurationManager').IConnectionConfiguration | undefined;
52
+ destroy(): void;
53
+ getUri: TGetUri;
54
+ readonly getUaProtected: () => UA;
55
+ private readonly getUa;
56
+ private readonly connectWithProcessError;
57
+ private readonly processConnect;
58
+ }
59
+ export {};
@@ -0,0 +1,32 @@
1
+ import { IncomingCallStateMachine, TIncomingActor } from './IncomingCallStateMachine';
2
+ import { RTCSession } from '@krivega/jssip';
3
+ import { ConnectionManager } from '../ConnectionManager';
4
+ import { TEventMap, TEvents } from './events';
5
+ export default class IncomingCallManager {
6
+ readonly events: TEvents;
7
+ readonly incomingStateMachine: IncomingCallStateMachine;
8
+ private incomingRTCSession?;
9
+ private readonly connectionManager;
10
+ constructor(connectionManager: ConnectionManager);
11
+ get incomingActor(): TIncomingActor;
12
+ get remoteCallerData(): TEventMap['incomingCall'];
13
+ get isAvailableIncomingCall(): boolean;
14
+ start(): void;
15
+ stop(): void;
16
+ getIncomingRTCSession: () => RTCSession;
17
+ extractIncomingRTCSession: () => RTCSession;
18
+ declineToIncomingCall({ statusCode, }?: {
19
+ statusCode?: number;
20
+ }): Promise<void>;
21
+ busyIncomingCall(): Promise<void>;
22
+ on<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
23
+ once<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
24
+ onceRace<T extends keyof TEventMap>(eventNames: T[], handler: (data: TEventMap[T], eventName: string) => void): () => void;
25
+ wait<T extends keyof TEventMap>(eventName: T): Promise<TEventMap[T]>;
26
+ off<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): void;
27
+ private subscribe;
28
+ private unsubscribe;
29
+ private readonly handleNewRTCSession;
30
+ private setIncomingSession;
31
+ private removeIncomingSession;
32
+ }
@@ -0,0 +1,53 @@
1
+ import { PresentationStateMachine, TPresentationActor } from './PresentationStateMachine';
2
+ import { CallManager } from '../CallManager';
3
+ import { TEventMap, TEvents } from './events';
4
+ import { TContentHint, TOnAddedTransceiver } from './types';
5
+ export declare const hasCanceledStartPresentationError: (error: unknown) => error is import('repeated-calls').TCanceledError<unknown>;
6
+ declare class PresentationManager {
7
+ readonly events: TEvents;
8
+ readonly presentationStateMachine: PresentationStateMachine;
9
+ promisePendingStartPresentation?: Promise<MediaStream>;
10
+ promisePendingStopPresentation?: Promise<MediaStream | undefined>;
11
+ streamPresentationCurrent?: MediaStream;
12
+ private readonly maxBitrate?;
13
+ private cancelableSendPresentationWithRepeatedCalls;
14
+ private readonly callManager;
15
+ constructor({ callManager, maxBitrate, }: {
16
+ callManager: CallManager;
17
+ maxBitrate?: number;
18
+ });
19
+ get presentationActor(): TPresentationActor;
20
+ get isPendingPresentation(): boolean;
21
+ get isPresentationInProcess(): boolean;
22
+ startPresentation(beforeStartPresentation: () => Promise<void>, stream: MediaStream, { isNeedReinvite, contentHint, sendEncodings, onAddedTransceiver, }?: {
23
+ isNeedReinvite?: boolean;
24
+ contentHint?: TContentHint;
25
+ sendEncodings?: RTCRtpEncodingParameters[];
26
+ onAddedTransceiver?: TOnAddedTransceiver;
27
+ }, options?: {
28
+ callLimit: number;
29
+ }): Promise<MediaStream>;
30
+ stopPresentation(beforeStopPresentation: () => Promise<void>): Promise<MediaStream | undefined>;
31
+ updatePresentation(beforeStartPresentation: () => Promise<void>, stream: MediaStream, { contentHint, sendEncodings, onAddedTransceiver, }?: {
32
+ isP2P?: boolean;
33
+ contentHint?: TContentHint;
34
+ sendEncodings?: RTCRtpEncodingParameters[];
35
+ onAddedTransceiver?: TOnAddedTransceiver;
36
+ }): Promise<MediaStream | undefined>;
37
+ cancelSendPresentationWithRepeatedCalls(): void;
38
+ on<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
39
+ once<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): () => void;
40
+ onceRace<T extends keyof TEventMap>(eventNames: T[], handler: (data: TEventMap[T], eventName: string) => void): () => void;
41
+ wait<T extends keyof TEventMap>(eventName: T): Promise<TEventMap[T]>;
42
+ off<T extends keyof TEventMap>(eventName: T, handler: (data: TEventMap[T]) => void): void;
43
+ private subscribe;
44
+ private sendPresentationWithDuplicatedCalls;
45
+ private sendPresentation;
46
+ private readonly setMaxBitrate;
47
+ private readonly getRtcSessionProtected;
48
+ private readonly handleEnded;
49
+ private reset;
50
+ private resetPresentation;
51
+ private removeStreamPresentationCurrent;
52
+ }
53
+ export default PresentationManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sip-connector",
3
- "version": "20.4.0",
3
+ "version": "20.4.1",
4
4
  "description": "Module for connect to Vinteo server",
5
5
  "keywords": [
6
6
  "webrtc",