sip-connector 6.21.4 → 6.21.6
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/__fixtures__/BaseSession.mock.d.ts +91 -0
- package/dist/__fixtures__/RTCPeerConnectionMock.d.ts +58 -0
- package/dist/__fixtures__/RTCRtpSenderMock.d.ts +12 -0
- package/dist/__fixtures__/Registrator.mock.d.ts +7 -0
- package/dist/__fixtures__/Request.mock.d.ts +8 -0
- package/dist/__fixtures__/Session.mock.d.ts +67 -0
- package/dist/__fixtures__/UA.mock.d.ts +80 -0
- package/dist/__fixtures__/WebSocketInterface.mock.d.ts +5 -0
- package/dist/__fixtures__/accountNotify.d.ts +2 -0
- package/dist/__fixtures__/channels.d.ts +8 -0
- package/dist/__fixtures__/channelsNotify.d.ts +5 -0
- package/dist/__fixtures__/conferenceParticipantTokenIssuedNotify.d.ts +6 -0
- package/dist/__fixtures__/delayPromise.d.ts +2 -0
- package/dist/__fixtures__/index.d.ts +83 -0
- package/dist/__fixtures__/jssip.mock.d.ts +29 -0
- package/dist/__fixtures__/mediaState.d.ts +7 -0
- package/dist/__fixtures__/participantMoveRequests.d.ts +12 -0
- package/dist/__fixtures__/participantNotify.d.ts +8 -0
- package/dist/__fixtures__/remoteCallerData.d.ts +7 -0
- package/dist/__fixtures__/utils.d.ts +1 -0
- package/dist/__fixtures__/webcastNotify.d.ts +10 -0
- package/dist/tools/__fixtures__/call.d.ts +10 -0
- package/dist/tools/__fixtures__/connectToServer.d.ts +129 -0
- package/dist/tools/__fixtures__/hasValidUri.d.ts +9 -0
- package/dist/tools/__fixtures__/permissions.d.ts +8 -0
- package/dist/tools/__fixtures__/processRequest.d.ts +11 -0
- package/package.json +5 -5
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { AnswerOptions, ExtraHeaders, HoldOptions, MediaConstraints, NameAddrHeader, OnHoldResult, RTCPeerConnectionDeprecated, RTCSession, ReferOptions, RenegotiateOptions, SessionDirection, SessionStatus, TerminateOptions, URI, C as constants } from '@krivega/jssip';
|
|
2
|
+
import Events from 'events-constructor';
|
|
3
|
+
import type { TEventSession } from '../eventNames';
|
|
4
|
+
import { SESSION_EVENT_NAMES } from '../eventNames';
|
|
5
|
+
/**
|
|
6
|
+
* BaseSession
|
|
7
|
+
* @class
|
|
8
|
+
*/
|
|
9
|
+
declare class BaseSession implements RTCSession {
|
|
10
|
+
originator: string;
|
|
11
|
+
_connection: RTCPeerConnectionDeprecated;
|
|
12
|
+
_events: Events<typeof SESSION_EVENT_NAMES>;
|
|
13
|
+
_remote_identity: NameAddrHeader;
|
|
14
|
+
_mutedOptions: {
|
|
15
|
+
audio: boolean;
|
|
16
|
+
video: boolean;
|
|
17
|
+
};
|
|
18
|
+
constructor({ originator, eventHandlers }: {
|
|
19
|
+
originator?: string | undefined;
|
|
20
|
+
eventHandlers: any;
|
|
21
|
+
});
|
|
22
|
+
get C(): SessionStatus;
|
|
23
|
+
get causes(): constants.causes;
|
|
24
|
+
get id(): string;
|
|
25
|
+
set data(_data: any);
|
|
26
|
+
get data(): any;
|
|
27
|
+
get connection(): RTCPeerConnectionDeprecated;
|
|
28
|
+
get contact(): string;
|
|
29
|
+
get direction(): SessionDirection;
|
|
30
|
+
get local_identity(): NameAddrHeader;
|
|
31
|
+
get remote_identity(): NameAddrHeader;
|
|
32
|
+
get start_time(): Date;
|
|
33
|
+
get end_time(): Date;
|
|
34
|
+
get status(): SessionStatus;
|
|
35
|
+
isInProgress(): boolean;
|
|
36
|
+
isEnded(): boolean;
|
|
37
|
+
isReadyToReOffer(): boolean;
|
|
38
|
+
answer(_options?: AnswerOptions): void;
|
|
39
|
+
terminate(_options?: TerminateOptions): void;
|
|
40
|
+
sendInfo(_contentType: string, _body?: string, _options?: ExtraHeaders): Promise<void>;
|
|
41
|
+
hold(_options?: HoldOptions, _done?: VoidFunction): boolean;
|
|
42
|
+
unhold(_options?: HoldOptions, _done?: VoidFunction): boolean;
|
|
43
|
+
renegotiate(_options?: RenegotiateOptions, _done?: VoidFunction): Promise<boolean>;
|
|
44
|
+
isOnHold(): OnHoldResult;
|
|
45
|
+
mute(_options?: MediaConstraints): void;
|
|
46
|
+
unmute(_options?: MediaConstraints): void;
|
|
47
|
+
isMuted(): MediaConstraints;
|
|
48
|
+
refer(_target: URI | string, _options?: ReferOptions): void;
|
|
49
|
+
resetLocalMedia(): void;
|
|
50
|
+
replaceMediaStream(_stream: MediaStream, _options?: {
|
|
51
|
+
deleteExisting: boolean;
|
|
52
|
+
addMissing: boolean;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
addListener(_event: string | symbol, _listener: (...arguments_: any[]) => void): this;
|
|
55
|
+
once(_event: string | symbol, _listener: (...arguments_: any[]) => void): this;
|
|
56
|
+
removeListener(_event: string | symbol, _listener: (...arguments_: any[]) => void): this;
|
|
57
|
+
off(_event: string | symbol, _listener: (...arguments_: any[]) => void): this;
|
|
58
|
+
removeAllListeners(_event?: string | symbol): this;
|
|
59
|
+
setMaxListeners(_n: number): this;
|
|
60
|
+
getMaxListeners(): number;
|
|
61
|
+
listeners(_event: string | symbol): (() => void)[];
|
|
62
|
+
rawListeners(_event: string | symbol): (() => void)[];
|
|
63
|
+
emit(_event: string | symbol, ..._arguments_: any[]): boolean;
|
|
64
|
+
listenerCount(_event: string | symbol): number;
|
|
65
|
+
prependListener(_event: string | symbol, _listener: (...arguments_: any[]) => void): this;
|
|
66
|
+
prependOnceListener(_event: string | symbol, _listener: (...arguments_: any[]) => void): this;
|
|
67
|
+
eventNames(): (string | symbol)[];
|
|
68
|
+
/**
|
|
69
|
+
* initEvents
|
|
70
|
+
*
|
|
71
|
+
* @param {Array} [eventHandlers=[] - ] The event handlers
|
|
72
|
+
*
|
|
73
|
+
* @returns {undefined}
|
|
74
|
+
*/
|
|
75
|
+
initEvents(eventHandlers?: never[]): void;
|
|
76
|
+
on<T>(eventName: string, handler: (data: T) => void): this;
|
|
77
|
+
trigger(eventName: TEventSession, data?: any): void;
|
|
78
|
+
/**
|
|
79
|
+
* sendDTMF
|
|
80
|
+
*
|
|
81
|
+
* @param {object} options - options
|
|
82
|
+
*
|
|
83
|
+
* @returns {undefined}
|
|
84
|
+
*/
|
|
85
|
+
sendDTMF(): void;
|
|
86
|
+
startPresentation(stream: MediaStream): Promise<MediaStream>;
|
|
87
|
+
updatePresentation(stream: MediaStream): Promise<MediaStream>;
|
|
88
|
+
stopPresentation(stream: MediaStream): Promise<MediaStream>;
|
|
89
|
+
isEstablished(): boolean;
|
|
90
|
+
}
|
|
91
|
+
export default BaseSession;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RTCPeerConnectionDeprecated } from '@krivega/jssip';
|
|
2
|
+
import type { MediaStreamTrackMock } from 'webrtc-mock';
|
|
3
|
+
declare class RTCPeerConnectionMock implements RTCPeerConnectionDeprecated {
|
|
4
|
+
_senders: RTCRtpSender[];
|
|
5
|
+
_receivers: any[];
|
|
6
|
+
constructor(_configuration?: RTCConfiguration, tracks: MediaStreamTrackMock[]);
|
|
7
|
+
canTrickleIceCandidates: boolean | null;
|
|
8
|
+
connectionState: RTCPeerConnectionState;
|
|
9
|
+
currentLocalDescription: RTCSessionDescription | null;
|
|
10
|
+
currentRemoteDescription: RTCSessionDescription | null;
|
|
11
|
+
iceConnectionState: RTCIceConnectionState;
|
|
12
|
+
iceGatheringState: RTCIceGatheringState;
|
|
13
|
+
idpErrorInfo: string | null;
|
|
14
|
+
idpLoginUrl: string | null;
|
|
15
|
+
localDescription: RTCSessionDescription | null;
|
|
16
|
+
onconnectionstatechange: ((this: RTCPeerConnection, event_: Event) => any) | null;
|
|
17
|
+
ondatachannel: ((this: RTCPeerConnection, event_: RTCDataChannelEvent) => any) | null;
|
|
18
|
+
onicecandidate: ((this: RTCPeerConnection, event_: RTCPeerConnectionIceEvent) => any) | null;
|
|
19
|
+
onicecandidateerror: ((this: RTCPeerConnection, event_: Event) => any) | null;
|
|
20
|
+
oniceconnectionstatechange: ((this: RTCPeerConnection, event_: Event) => any) | null;
|
|
21
|
+
onicegatheringstatechange: ((this: RTCPeerConnection, event_: Event) => any) | null;
|
|
22
|
+
onnegotiationneeded: ((this: RTCPeerConnection, event_: Event) => any) | null;
|
|
23
|
+
onsignalingstatechange: ((this: RTCPeerConnection, event_: Event) => any) | null;
|
|
24
|
+
ontrack: ((this: RTCPeerConnection, event_: RTCTrackEvent) => any) | null;
|
|
25
|
+
peerIdentity: undefined;
|
|
26
|
+
pendingLocalDescription: RTCSessionDescription | null;
|
|
27
|
+
pendingRemoteDescription: RTCSessionDescription | null;
|
|
28
|
+
remoteDescription: RTCSessionDescription | null;
|
|
29
|
+
sctp: null;
|
|
30
|
+
signalingState: RTCSignalingState;
|
|
31
|
+
getRemoteStreams(): MediaStream[];
|
|
32
|
+
addIceCandidate(_candidate: RTCIceCandidate | RTCIceCandidateInit): Promise<void>;
|
|
33
|
+
addTransceiver(_trackOrKind: MediaStreamTrack | string, _init?: RTCRtpTransceiverInit): RTCRtpTransceiver;
|
|
34
|
+
close(): void;
|
|
35
|
+
restartIce(): void;
|
|
36
|
+
createAnswer(options?: RTCAnswerOptions): Promise<RTCSessionDescriptionInit>;
|
|
37
|
+
createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback): Promise<void>;
|
|
38
|
+
createDataChannel(_label: string, _dataChannelDict?: RTCDataChannelInit): RTCDataChannel;
|
|
39
|
+
createOffer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;
|
|
40
|
+
createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise<void>;
|
|
41
|
+
getConfiguration(): RTCConfiguration;
|
|
42
|
+
getIdentityAssertion(): Promise<string>;
|
|
43
|
+
getStats(_selector?: MediaStreamTrack | null): Promise<RTCStatsReport>;
|
|
44
|
+
getTransceivers(): RTCRtpTransceiver[];
|
|
45
|
+
removeTrack(_sender: RTCRtpSender): void;
|
|
46
|
+
setConfiguration(_configuration: RTCConfiguration): void;
|
|
47
|
+
setLocalDescription(_description: RTCSessionDescriptionInit): Promise<void>;
|
|
48
|
+
setRemoteDescription(_description: RTCSessionDescriptionInit): Promise<void>;
|
|
49
|
+
addEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, event_: RTCPeerConnectionEventMap[K]) => any, options?: AddEventListenerOptions | boolean): void;
|
|
50
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
|
|
51
|
+
removeEventListener<K extends keyof RTCPeerConnectionEventMap>(type: K, listener: (this: RTCPeerConnection, event_: RTCPeerConnectionEventMap[K]) => any, options?: EventListenerOptions | boolean): void;
|
|
52
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
|
|
53
|
+
dispatchEvent(_event: Event): boolean;
|
|
54
|
+
getReceivers: () => any[];
|
|
55
|
+
getSenders: () => RTCRtpSender[];
|
|
56
|
+
addTrack: (track: MediaStreamTrack) => RTCRtpSender;
|
|
57
|
+
}
|
|
58
|
+
export default RTCPeerConnectionMock;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare class RTCRtpSenderMock implements RTCRtpSender {
|
|
2
|
+
dtmf: RTCDTMFSender | null;
|
|
3
|
+
track: MediaStreamTrack | null;
|
|
4
|
+
transport: RTCDtlsTransport | null;
|
|
5
|
+
private _parameters;
|
|
6
|
+
getStats(): Promise<RTCStatsReport>;
|
|
7
|
+
replaceTrack(): Promise<void>;
|
|
8
|
+
setParameters(parameters: RTCRtpSendParameters): Promise<void>;
|
|
9
|
+
getParameters(): RTCRtpSendParameters;
|
|
10
|
+
setStreams(): void;
|
|
11
|
+
}
|
|
12
|
+
export default RTCRtpSenderMock;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IncomingRequest } from '@krivega/jssip/lib/SIPMessage';
|
|
2
|
+
type TExtraHeaders = [string, string][];
|
|
3
|
+
declare class Request extends IncomingRequest {
|
|
4
|
+
private readonly headers;
|
|
5
|
+
constructor(extraHeaders: TExtraHeaders);
|
|
6
|
+
getHeader(headerName: string): string;
|
|
7
|
+
}
|
|
8
|
+
export default Request;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import type { IncomingInfoEvent } from '@krivega/jssip';
|
|
3
|
+
import BaseSession from './BaseSession.mock';
|
|
4
|
+
export declare const FAILED_CONFERENCE_NUMBER = "777";
|
|
5
|
+
declare class Session extends BaseSession {
|
|
6
|
+
url: string;
|
|
7
|
+
status_code?: number;
|
|
8
|
+
private _isEnded;
|
|
9
|
+
constructor({ url, mediaStream, eventHandlers, originator, }: {
|
|
10
|
+
url?: string;
|
|
11
|
+
mediaStream?: any;
|
|
12
|
+
eventHandlers?: any;
|
|
13
|
+
originator: string;
|
|
14
|
+
});
|
|
15
|
+
initPeerconnection(mediaStream: any): boolean;
|
|
16
|
+
createPeerconnection(sendedStream: any): void;
|
|
17
|
+
connect(target: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* answer
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} arg1 - The argument 1
|
|
22
|
+
* @param {Object} arg1.mediaStream - The media stream
|
|
23
|
+
* @param {Array} arg1.eventHandlers - The event handlers
|
|
24
|
+
|
|
25
|
+
* @returns {undefined}
|
|
26
|
+
*/
|
|
27
|
+
answer: jest.Mock<void, [any], any>;
|
|
28
|
+
terminate({ status_code }?: {
|
|
29
|
+
status_code?: number;
|
|
30
|
+
}): this;
|
|
31
|
+
terminateRemote({ status_code }?: {
|
|
32
|
+
status_code?: number;
|
|
33
|
+
}): this;
|
|
34
|
+
_addStream(stream: Record<string, () => any[]>, action?: string): void;
|
|
35
|
+
_forEachSenders(callback: {
|
|
36
|
+
({ track }: {
|
|
37
|
+
track: any;
|
|
38
|
+
}): void;
|
|
39
|
+
({ track }: {
|
|
40
|
+
track: any;
|
|
41
|
+
}): void;
|
|
42
|
+
(argument0: any): void;
|
|
43
|
+
}): RTCRtpSender[];
|
|
44
|
+
_toggleMuteAudio(mute: boolean): void;
|
|
45
|
+
_toggleMuteVideo(mute: boolean): void;
|
|
46
|
+
mute(options: {
|
|
47
|
+
audio: any;
|
|
48
|
+
video: any;
|
|
49
|
+
}): void;
|
|
50
|
+
unmute(options: {
|
|
51
|
+
audio: any;
|
|
52
|
+
video: any;
|
|
53
|
+
}): void;
|
|
54
|
+
isMuted(): {
|
|
55
|
+
audio: boolean;
|
|
56
|
+
video: boolean;
|
|
57
|
+
};
|
|
58
|
+
replaceMediaStream(mediaStream: any): Promise<any>;
|
|
59
|
+
_onmute({ audio, video }: {
|
|
60
|
+
audio: boolean;
|
|
61
|
+
video: boolean;
|
|
62
|
+
}): void;
|
|
63
|
+
sendInfo(): Promise<void>;
|
|
64
|
+
isEnded(): boolean;
|
|
65
|
+
newInfo(data: IncomingInfoEvent): void;
|
|
66
|
+
}
|
|
67
|
+
export default Session;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import type { UA as IUA, IncomingRequest, UAConfiguration } from '@krivega/jssip';
|
|
3
|
+
import Events from 'events-constructor';
|
|
4
|
+
import type { TEventUA } from '../eventNames';
|
|
5
|
+
import { UA_EVENT_NAMES } from '../eventNames';
|
|
6
|
+
import Registrator from './Registrator.mock';
|
|
7
|
+
import Session from './Session.mock';
|
|
8
|
+
export declare const PASSWORD_CORRECT = "PASSWORD_CORRECT";
|
|
9
|
+
export declare const PASSWORD_CORRECT_2 = "PASSWORD_CORRECT_2";
|
|
10
|
+
export declare const NAME_INCORRECT = "NAME_INCORRECT";
|
|
11
|
+
declare class UA implements IUA {
|
|
12
|
+
_events: Events<typeof UA_EVENT_NAMES>;
|
|
13
|
+
_startedTimeout?: ReturnType<typeof setTimeout>;
|
|
14
|
+
_stopedTimeout?: ReturnType<typeof setTimeout>;
|
|
15
|
+
session?: Session;
|
|
16
|
+
_isRegistered?: boolean;
|
|
17
|
+
_isConnected?: boolean;
|
|
18
|
+
configuration: UAConfiguration;
|
|
19
|
+
_registrator: Registrator;
|
|
20
|
+
constructor(configuration: UAConfiguration);
|
|
21
|
+
/**
|
|
22
|
+
* start
|
|
23
|
+
*
|
|
24
|
+
* @returns {undefined}
|
|
25
|
+
*/
|
|
26
|
+
start(): void;
|
|
27
|
+
/**
|
|
28
|
+
* stop
|
|
29
|
+
*
|
|
30
|
+
* @returns {undefined}
|
|
31
|
+
*/
|
|
32
|
+
stop(): void;
|
|
33
|
+
call: jest.Mock<Session, [url: string, parameters: any], any>;
|
|
34
|
+
on(eventName: TEventUA, handler: any): this;
|
|
35
|
+
trigger(eventName: TEventUA, data?: any): void;
|
|
36
|
+
/**
|
|
37
|
+
* terminateSessions
|
|
38
|
+
*
|
|
39
|
+
* @returns {undefined}
|
|
40
|
+
*/
|
|
41
|
+
terminateSessions(): void;
|
|
42
|
+
/**
|
|
43
|
+
* set
|
|
44
|
+
*
|
|
45
|
+
* @param {string} key - key
|
|
46
|
+
* @param {string} value - value
|
|
47
|
+
*
|
|
48
|
+
* @returns {boolean} true
|
|
49
|
+
*/
|
|
50
|
+
set(key: string, value: any): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* register
|
|
53
|
+
*
|
|
54
|
+
* @returns {undefined}
|
|
55
|
+
*/
|
|
56
|
+
register(): void;
|
|
57
|
+
/**
|
|
58
|
+
* unregister
|
|
59
|
+
*
|
|
60
|
+
* @returns {undefined}
|
|
61
|
+
*/
|
|
62
|
+
unregister(): void;
|
|
63
|
+
/**
|
|
64
|
+
* isRegistered
|
|
65
|
+
*
|
|
66
|
+
* @returns {boolean} isRegistered
|
|
67
|
+
*/
|
|
68
|
+
isRegistered(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* isStarted
|
|
71
|
+
*
|
|
72
|
+
* @returns {boolean} isStarted
|
|
73
|
+
*/
|
|
74
|
+
isStarted(): boolean;
|
|
75
|
+
registrator(): Registrator;
|
|
76
|
+
newSipEvent(data: {
|
|
77
|
+
request: IncomingRequest;
|
|
78
|
+
}): void;
|
|
79
|
+
}
|
|
80
|
+
export default UA;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const user = "user";
|
|
2
|
+
export declare const displayName = "displayName";
|
|
3
|
+
export declare const SIP_SERVER_URL = "SIP_SERVER_URL";
|
|
4
|
+
export declare const SIP_WEB_SOCKET_SERVER_URL = "SIP_WEB_SOCKET_SERVER_URL";
|
|
5
|
+
export declare const dataForConnectionWithoutAuthorizationWithoutDisplayName: {
|
|
6
|
+
userAgent: string;
|
|
7
|
+
sipServerUrl: string;
|
|
8
|
+
sipWebSocketServerURL: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const dataForConnectionWithAuthorization: {
|
|
11
|
+
user: string;
|
|
12
|
+
password: string;
|
|
13
|
+
register: boolean;
|
|
14
|
+
userAgent: string;
|
|
15
|
+
sipServerUrl: string;
|
|
16
|
+
sipWebSocketServerURL: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const dataForConnectionWithAuthorizationWithDisplayName: {
|
|
19
|
+
displayName: string;
|
|
20
|
+
user: string;
|
|
21
|
+
password: string;
|
|
22
|
+
register: boolean;
|
|
23
|
+
userAgent: string;
|
|
24
|
+
sipServerUrl: string;
|
|
25
|
+
sipWebSocketServerURL: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const dataForConnectionWithoutAuthorization: {
|
|
28
|
+
displayName: string;
|
|
29
|
+
register: boolean;
|
|
30
|
+
userAgent: string;
|
|
31
|
+
sipServerUrl: string;
|
|
32
|
+
sipWebSocketServerURL: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const uaConfigurationWithAuthorization: {
|
|
35
|
+
password: string;
|
|
36
|
+
uri: string;
|
|
37
|
+
display_name: string;
|
|
38
|
+
register: boolean;
|
|
39
|
+
session_timers: boolean;
|
|
40
|
+
sockets: import("./WebSocketInterface.mock").default[];
|
|
41
|
+
user_agent: string;
|
|
42
|
+
sdp_semantics: string;
|
|
43
|
+
register_expires: number;
|
|
44
|
+
connection_recovery_max_interval: number;
|
|
45
|
+
connection_recovery_min_interval: number;
|
|
46
|
+
};
|
|
47
|
+
export declare const uaConfigurationWithAuthorizationWithDisplayName: {
|
|
48
|
+
password: string;
|
|
49
|
+
uri: string;
|
|
50
|
+
display_name: string;
|
|
51
|
+
register: boolean;
|
|
52
|
+
session_timers: boolean;
|
|
53
|
+
sockets: import("./WebSocketInterface.mock").default[];
|
|
54
|
+
user_agent: string;
|
|
55
|
+
sdp_semantics: string;
|
|
56
|
+
register_expires: number;
|
|
57
|
+
connection_recovery_max_interval: number;
|
|
58
|
+
connection_recovery_min_interval: number;
|
|
59
|
+
};
|
|
60
|
+
export declare const uaConfigurationWithoutAuthorization: {
|
|
61
|
+
display_name: string;
|
|
62
|
+
register: boolean;
|
|
63
|
+
session_timers: boolean;
|
|
64
|
+
sockets: import("./WebSocketInterface.mock").default[];
|
|
65
|
+
user_agent: string;
|
|
66
|
+
sdp_semantics: string;
|
|
67
|
+
register_expires: number;
|
|
68
|
+
connection_recovery_max_interval: number;
|
|
69
|
+
connection_recovery_min_interval: number;
|
|
70
|
+
};
|
|
71
|
+
export declare const uaConfigurationWithoutAuthorizationWithoutDisplayName: {
|
|
72
|
+
display_name: string;
|
|
73
|
+
register: boolean;
|
|
74
|
+
session_timers: boolean;
|
|
75
|
+
sockets: import("./WebSocketInterface.mock").default[];
|
|
76
|
+
user_agent: string;
|
|
77
|
+
sdp_semantics: string;
|
|
78
|
+
register_expires: number;
|
|
79
|
+
connection_recovery_max_interval: number;
|
|
80
|
+
connection_recovery_min_interval: number;
|
|
81
|
+
};
|
|
82
|
+
export declare const remoteAddress = "10.10.10.10";
|
|
83
|
+
export declare const extraHeadersRemoteAddress: string[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RTCSession, UA } from '@krivega/jssip';
|
|
2
|
+
import UAmock from './UA.mock';
|
|
3
|
+
import WebSocketInterfaceMock from './WebSocketInterface.mock';
|
|
4
|
+
declare const jssip: {
|
|
5
|
+
triggerNewInfo: (session: RTCSession, extraHeaders: [
|
|
6
|
+
string,
|
|
7
|
+
string
|
|
8
|
+
][]) => void;
|
|
9
|
+
triggerNewSipEvent: (ua: UA, extraHeaders: [
|
|
10
|
+
string,
|
|
11
|
+
string
|
|
12
|
+
][]) => void;
|
|
13
|
+
triggerIncomingSession: (ua: UAmock, { incomingNumber, displayName, host, }: {
|
|
14
|
+
incomingNumber?: string | undefined;
|
|
15
|
+
displayName: string;
|
|
16
|
+
host: string;
|
|
17
|
+
}) => void;
|
|
18
|
+
triggerFailIncomingSession: (incomingSession: unknown, options?: {
|
|
19
|
+
originator: 'local' | 'remote';
|
|
20
|
+
}) => void;
|
|
21
|
+
WebSocketInterface: typeof WebSocketInterfaceMock;
|
|
22
|
+
UA: typeof UAmock;
|
|
23
|
+
C: {
|
|
24
|
+
INVITE: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default jssip;
|
|
28
|
+
export { NAME_INCORRECT, PASSWORD_CORRECT, PASSWORD_CORRECT_2 } from './UA.mock';
|
|
29
|
+
export { FAILED_CONFERENCE_NUMBER } from './Session.mock';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const moveRequestToConferenceHeaders: [string, string][];
|
|
2
|
+
export declare const moveRequestToConferenceData: {
|
|
3
|
+
conference: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const cancelingWordRequestHeaders: [string, string][];
|
|
6
|
+
export declare const cancelingWordRequestData: {
|
|
7
|
+
conference: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const moveRequestToStreamHeaders: [string, string][];
|
|
10
|
+
export declare const moveRequestToStreamData: {
|
|
11
|
+
conference: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const removedFromListModeratorsHeaders: [string, string][];
|
|
2
|
+
export declare const removedFromListModeratorsData: {
|
|
3
|
+
conference: any;
|
|
4
|
+
};
|
|
5
|
+
export declare const addedToListModeratorsHeaders: [string, string][];
|
|
6
|
+
export declare const addedToListModeratorsData: {
|
|
7
|
+
conference: any;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getRoomFromSipUrl(sipUrl: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const webcastStartedHeaders: [string, string][];
|
|
2
|
+
export declare const webcastStartedData: {
|
|
3
|
+
conference: string;
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const webcastStoppedHeaders: [string, string][];
|
|
7
|
+
export declare const webcastStoppedData: {
|
|
8
|
+
conference: string;
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import RTCPeerConnectionMock from '../../__fixtures__/RTCPeerConnectionMock';
|
|
3
|
+
declare const data: {
|
|
4
|
+
mediaStream: import("webrtc-mock/dist/MediaStreamMock").default;
|
|
5
|
+
conference: string;
|
|
6
|
+
setOutgoingCall: jest.Mock<any, any, any>;
|
|
7
|
+
setRemoteStreams: jest.Mock<any, any, any>;
|
|
8
|
+
};
|
|
9
|
+
export default data;
|
|
10
|
+
export declare const peerConnectionFromData: RTCPeerConnectionMock;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export declare const LOCKED_SIP_WEB_SOCKET_SERVER_URL = "LOCKED_SIP_WEB_SOCKET_SERVER_URL";
|
|
2
|
+
export declare const dataForConnectionWithAuthorization: {
|
|
3
|
+
password: string;
|
|
4
|
+
name: string;
|
|
5
|
+
isRegisteredUser: boolean;
|
|
6
|
+
remoteAddress: string;
|
|
7
|
+
sipServerUrl: string;
|
|
8
|
+
sipWebSocketServerURL: string;
|
|
9
|
+
sdpSemantics: "plan-b";
|
|
10
|
+
userAgent: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const dataForConnectionWithAuthorizationWithDisplayName: {
|
|
13
|
+
displayName: string;
|
|
14
|
+
remoteAddress: string;
|
|
15
|
+
sipServerUrl: string;
|
|
16
|
+
sipWebSocketServerURL: string;
|
|
17
|
+
sdpSemantics: "plan-b";
|
|
18
|
+
userAgent: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const dataForConnectionWithoutAuthorization: {
|
|
21
|
+
displayName: string;
|
|
22
|
+
isRegisteredUser: boolean;
|
|
23
|
+
remoteAddress: string;
|
|
24
|
+
sipServerUrl: string;
|
|
25
|
+
sipWebSocketServerURL: string;
|
|
26
|
+
sdpSemantics: "plan-b";
|
|
27
|
+
userAgent: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const dataForConnectionWithoutAuthorizationWithoutDisplayName: {
|
|
30
|
+
displayName: string;
|
|
31
|
+
isRegisteredUser: boolean;
|
|
32
|
+
remoteAddress: string;
|
|
33
|
+
sipServerUrl: string;
|
|
34
|
+
sipWebSocketServerURL: string;
|
|
35
|
+
sdpSemantics: "plan-b";
|
|
36
|
+
userAgent: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const dataForConnectionWithoutAuthorizationWithSipServerUrlChanged: {
|
|
39
|
+
sipServerUrl: string;
|
|
40
|
+
displayName: string;
|
|
41
|
+
isRegisteredUser: boolean;
|
|
42
|
+
remoteAddress: string;
|
|
43
|
+
sipWebSocketServerURL: string;
|
|
44
|
+
sdpSemantics: "plan-b";
|
|
45
|
+
userAgent: string;
|
|
46
|
+
};
|
|
47
|
+
export declare const dataForConnectionWithoutAuthorizationWithSipWebSocketServerUrlChanged: {
|
|
48
|
+
sipWebSocketServerURL: string;
|
|
49
|
+
sipWebSocketServerURLChanged: boolean;
|
|
50
|
+
displayName: string;
|
|
51
|
+
isRegisteredUser: boolean;
|
|
52
|
+
remoteAddress: string;
|
|
53
|
+
sipServerUrl: string;
|
|
54
|
+
sdpSemantics: "plan-b";
|
|
55
|
+
userAgent: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const dataForConnectionWithAuthorizationIncorrectUser: {
|
|
58
|
+
name: string;
|
|
59
|
+
password: string;
|
|
60
|
+
isRegisteredUser: boolean;
|
|
61
|
+
remoteAddress: string;
|
|
62
|
+
sipServerUrl: string;
|
|
63
|
+
sipWebSocketServerURL: string;
|
|
64
|
+
sdpSemantics: "plan-b";
|
|
65
|
+
userAgent: string;
|
|
66
|
+
};
|
|
67
|
+
export declare const dataForConnectionWithAuthorizationIncorrectPassword: {
|
|
68
|
+
password: string;
|
|
69
|
+
name: string;
|
|
70
|
+
isRegisteredUser: boolean;
|
|
71
|
+
remoteAddress: string;
|
|
72
|
+
sipServerUrl: string;
|
|
73
|
+
sipWebSocketServerURL: string;
|
|
74
|
+
sdpSemantics: "plan-b";
|
|
75
|
+
userAgent: string;
|
|
76
|
+
};
|
|
77
|
+
export declare const withNameChanged: {
|
|
78
|
+
nameChanged: boolean;
|
|
79
|
+
password: string;
|
|
80
|
+
name: string;
|
|
81
|
+
isRegisteredUser: boolean;
|
|
82
|
+
remoteAddress: string;
|
|
83
|
+
sipServerUrl: string;
|
|
84
|
+
sipWebSocketServerURL: string;
|
|
85
|
+
sdpSemantics: "plan-b";
|
|
86
|
+
userAgent: string;
|
|
87
|
+
};
|
|
88
|
+
export declare const dataForConnectionWithAuthorizationPasswordChanged: {
|
|
89
|
+
password: string;
|
|
90
|
+
passwordChanged: boolean;
|
|
91
|
+
name: string;
|
|
92
|
+
isRegisteredUser: boolean;
|
|
93
|
+
remoteAddress: string;
|
|
94
|
+
sipServerUrl: string;
|
|
95
|
+
sipWebSocketServerURL: string;
|
|
96
|
+
sdpSemantics: "plan-b";
|
|
97
|
+
userAgent: string;
|
|
98
|
+
};
|
|
99
|
+
export declare const uaConfigurationWithAuthorization: {
|
|
100
|
+
password: string;
|
|
101
|
+
uri: string;
|
|
102
|
+
display_name: string;
|
|
103
|
+
register: boolean;
|
|
104
|
+
session_timers: boolean;
|
|
105
|
+
sockets: import("../../__fixtures__/WebSocketInterface.mock").default[];
|
|
106
|
+
user_agent: string;
|
|
107
|
+
sdp_semantics: string;
|
|
108
|
+
register_expires: number;
|
|
109
|
+
connection_recovery_max_interval: number;
|
|
110
|
+
connection_recovery_min_interval: number;
|
|
111
|
+
};
|
|
112
|
+
export declare const uaConfigurationWithAuthorizationPasswordChanged: {
|
|
113
|
+
password: string;
|
|
114
|
+
uri: string;
|
|
115
|
+
display_name: string;
|
|
116
|
+
register: boolean;
|
|
117
|
+
session_timers: boolean;
|
|
118
|
+
sockets: import("../../__fixtures__/WebSocketInterface.mock").default[];
|
|
119
|
+
user_agent: string;
|
|
120
|
+
sdp_semantics: string;
|
|
121
|
+
register_expires: number;
|
|
122
|
+
connection_recovery_max_interval: number;
|
|
123
|
+
connection_recovery_min_interval: number;
|
|
124
|
+
};
|
|
125
|
+
export declare const oneWord = "a";
|
|
126
|
+
export declare const twoWord = "ab";
|
|
127
|
+
export declare const thirdWord = "abc";
|
|
128
|
+
export declare const uriWithName: (name: string) => string;
|
|
129
|
+
export { uaConfigurationWithoutAuthorization, uaConfigurationWithoutAuthorizationWithoutDisplayName, } from '../../__fixtures__';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines if it has valid uri.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} uri The uri for check
|
|
5
|
+
* @param {string} url The base url
|
|
6
|
+
* @returns {boolean} True if has valid uri, False otherwise.
|
|
7
|
+
*/
|
|
8
|
+
declare const hasValidUri: (uri: string, url?: string) => boolean;
|
|
9
|
+
export default hasValidUri;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const canConnectToServer: ({ remoteAddress, sipServerUrl, sipWebSocketServerURL, name, password, isRegisteredUser, }: {
|
|
2
|
+
remoteAddress: string | undefined;
|
|
3
|
+
sipServerUrl: string | undefined;
|
|
4
|
+
sipWebSocketServerURL: string | undefined;
|
|
5
|
+
name: string;
|
|
6
|
+
password: string;
|
|
7
|
+
isRegisteredUser: boolean;
|
|
8
|
+
}) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type SipConnector from '../../SipConnector';
|
|
2
|
+
declare const resolveInitUaPromised: (sipConnector: SipConnector) => (state: {
|
|
3
|
+
remoteAddress: string | undefined;
|
|
4
|
+
sipServerUrl: string;
|
|
5
|
+
displayName: string | undefined;
|
|
6
|
+
sipWebSocketServerURL: string;
|
|
7
|
+
name: string;
|
|
8
|
+
password: string;
|
|
9
|
+
isRegisteredUser: boolean;
|
|
10
|
+
}) => Promise<unknown>;
|
|
11
|
+
export default resolveInitUaPromised;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-connector",
|
|
3
|
-
"version": "6.21.
|
|
3
|
+
"version": "6.21.6",
|
|
4
4
|
"description": "Module for connect to Vinteo server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"prepare": "husky install",
|
|
54
54
|
"prepublishOnly": "yarn build",
|
|
55
55
|
"preview": "vite preview",
|
|
56
|
-
"release": "standard-version && npm release:publish",
|
|
57
|
-
"release:major": "standard-version --release-as major && npm release:publish",
|
|
58
|
-
"release:pre": "standard-version --prerelease && npm release:publish",
|
|
56
|
+
"release": "standard-version && npm run release:publish",
|
|
57
|
+
"release:major": "standard-version --release-as major && npm run release:publish",
|
|
58
|
+
"release:pre": "standard-version --prerelease && npm run release:publish",
|
|
59
59
|
"release:publish": "git push --follow-tags origin master && npm publish --access=public",
|
|
60
60
|
"test": "jest --watch",
|
|
61
61
|
"test:ci": "cross-env CI=true jest --passWithNoTests",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"sequent-promises": "^1.0.0",
|
|
70
70
|
"stack-promises": "^1.0.1",
|
|
71
71
|
"ts-debounce": "^4.0.0",
|
|
72
|
-
"webrtc-mock": "^1.0.
|
|
72
|
+
"webrtc-mock": "^1.0.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@babel/preset-typescript": "^7.23.2",
|