@voicenter-team/opensips-js 1.0.122 → 1.0.124
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/index.d.ts +5 -266
- package/dist/opensips-js.cjs.js +133 -18334
- package/dist/opensips-js.es.js +14653 -77207
- package/dist/opensips-js.iife.js +136 -18337
- package/dist/opensips-js.umd.js +136 -18337
- package/package.json +2 -12
- package/src/types/listeners.d.ts +1 -10
- package/src/types/rtc.d.ts +1 -5
package/dist/index.d.ts
CHANGED
@@ -185,68 +185,12 @@ declare class AudioModule {
|
|
185
185
|
private stopVUMeter;
|
186
186
|
setupStream(): Promise<void>;
|
187
187
|
private triggerAddStream;
|
188
|
-
initCall(target: string, addToCurrentRoom: boolean): void;
|
188
|
+
initCall(target: string, addToCurrentRoom: boolean, holdOtherCalls?: boolean): void;
|
189
189
|
private processRoomChange;
|
190
190
|
}
|
191
191
|
|
192
192
|
declare type AudioModuleName = typeof MODULES.AUDIO
|
193
193
|
|
194
|
-
export declare class BaseNewStreamPlugin extends BasePlugin {
|
195
|
-
private _candidates;
|
196
|
-
private _subscribeSent;
|
197
|
-
private _configureSent;
|
198
|
-
private _lastTrickleReceived;
|
199
|
-
private _publisherSubscribeSent;
|
200
|
-
private opaqueId;
|
201
|
-
protected handleId: number;
|
202
|
-
private readonly type;
|
203
|
-
protected _connection: RTCPeerConnection;
|
204
|
-
protected jsep_offer: RTCSessionDescription | void;
|
205
|
-
protected _request: unknown;
|
206
|
-
stream: MediaStream;
|
207
|
-
constructor(name: any, type: any);
|
208
|
-
connect(options?: ConnectOptions): void;
|
209
|
-
getStream(): MediaStream;
|
210
|
-
getConnection(): RTCPeerConnection;
|
211
|
-
private _createRTCConnection;
|
212
|
-
private addTracks;
|
213
|
-
private _sendInitialRequest;
|
214
|
-
private _receiveInviteResponse;
|
215
|
-
private _sendConfigureMessage;
|
216
|
-
private _sendDetach;
|
217
|
-
protected stopMedia(): Promise<void>;
|
218
|
-
stop(): Promise<void>;
|
219
|
-
generateStream(): Promise<void>;
|
220
|
-
}
|
221
|
-
|
222
|
-
declare class BasePlugin {
|
223
|
-
opensips: any;
|
224
|
-
session: any;
|
225
|
-
name: string;
|
226
|
-
constructor(name: any);
|
227
|
-
setOpensips(opensips: any): void;
|
228
|
-
setSession(session: any): void;
|
229
|
-
kill(): void;
|
230
|
-
}
|
231
|
-
|
232
|
-
export declare class BaseProcessStreamPlugin extends BasePlugin {
|
233
|
-
stream: any;
|
234
|
-
running: boolean;
|
235
|
-
immediate: boolean;
|
236
|
-
type: string;
|
237
|
-
constructor(name: any, type: any, options?: BaseProcessStreamPluginOptions);
|
238
|
-
start(stream: any): any;
|
239
|
-
stop(): void;
|
240
|
-
process(stream: any): Promise<any>;
|
241
|
-
connect(): Promise<void>;
|
242
|
-
terminate(): void;
|
243
|
-
kill(): Promise<void>;
|
244
|
-
}
|
245
|
-
|
246
|
-
declare interface BaseProcessStreamPluginOptions {
|
247
|
-
immediate?: boolean;
|
248
|
-
}
|
249
|
-
|
250
194
|
declare type CallAddingProgressListener = (callId: string | undefined) => void
|
251
195
|
|
252
196
|
declare interface CallOptionsExtended extends AnswerOptionsExtended {
|
@@ -289,6 +233,8 @@ declare type changeIsDNDListener = (value: boolean) => void
|
|
289
233
|
|
290
234
|
declare type changeIsMutedListener = (value: boolean) => void
|
291
235
|
|
236
|
+
declare type changeMainVideoStreamListener = (event: { name: string, event: MediaStream }) => void
|
237
|
+
|
292
238
|
declare type changeMuteWhenJoinListener = (value: boolean) => void
|
293
239
|
|
294
240
|
declare type changeVideoStateListener = (state: boolean) => void
|
@@ -300,27 +246,10 @@ declare type ChangeVolumeEventType = {
|
|
300
246
|
|
301
247
|
declare type CommonLogMethodType = (...args: unknown[]) => void
|
302
248
|
|
303
|
-
declare type conferenceEndListener = (sessionId) => void
|
304
|
-
|
305
249
|
declare type conferenceStartListener = () => void
|
306
250
|
|
307
|
-
declare const CONFERENCING_MODE: {
|
308
|
-
WHITEBOARD: string;
|
309
|
-
IMAGE_WHITEBOARD: string;
|
310
|
-
};
|
311
|
-
|
312
|
-
declare type ConferencingModeType = typeof CONFERENCING_MODE[keyof typeof CONFERENCING_MODE];
|
313
|
-
|
314
251
|
declare type connectionListener = (value: boolean) => void
|
315
252
|
|
316
|
-
declare interface ConnectOptions {
|
317
|
-
extraHeaders?: Array<string>;
|
318
|
-
fromUserName?: string;
|
319
|
-
fromDisplayName?: string;
|
320
|
-
rtcConstraints?: object;
|
321
|
-
pcConfig?: object;
|
322
|
-
}
|
323
|
-
|
324
253
|
declare interface CustomLoggerType {
|
325
254
|
log: CommonLogMethodType
|
326
255
|
warn: CommonLogMethodType
|
@@ -372,7 +301,7 @@ declare interface IncomingMSRPSessionEvent {
|
|
372
301
|
|
373
302
|
declare type IncomingMSRPSessionListener = (event: IncomingMSRPSessionEvent) => void;
|
374
303
|
|
375
|
-
declare type IOpenSIPSConfiguration = Omit<
|
304
|
+
declare type IOpenSIPSConfiguration = Omit<UAConfiguration, 'sockets'>
|
376
305
|
|
377
306
|
declare interface IOpenSIPSJSOptions {
|
378
307
|
configuration: IOpenSIPSConfiguration
|
@@ -443,12 +372,6 @@ declare interface JanusSessionEventMap {
|
|
443
372
|
'peerconnection:setremotedescriptionfailed': Listener_2;
|
444
373
|
}
|
445
374
|
|
446
|
-
declare type KonvaDrawerOptions = {
|
447
|
-
strokeWidth?: number
|
448
|
-
strokeColor?: string
|
449
|
-
emptyDrawerRectColor?: string
|
450
|
-
}
|
451
|
-
|
452
375
|
declare type Listener = (event: unknown) => void
|
453
376
|
|
454
377
|
declare type Listener_2 = (event: unknown) => void
|
@@ -461,8 +384,6 @@ declare type ListenerEventType = EndEvent | IncomingEvent | OutgoingEvent | Inco
|
|
461
384
|
|
462
385
|
declare type ListenersKeyType = keyof OpenSIPSEventMap
|
463
386
|
|
464
|
-
declare type MaskEffectTypeConfigType = 'bokehEffect' | 'backgroundImageEffect';
|
465
|
-
|
466
387
|
declare type memberHangupListener = (event: object) => void
|
467
388
|
|
468
389
|
declare type memberJoinListener = (event: object) => void
|
@@ -739,11 +660,7 @@ declare interface OpenSIPSEventMap extends UAEventMap {
|
|
739
660
|
newMSRPSession: MSRPSessionListener
|
740
661
|
// JANUS
|
741
662
|
conferenceStart: conferenceStartListener
|
742
|
-
|
743
|
-
startScreenShare: startScreenShareListener
|
744
|
-
stopScreenShare: stopScreenShareListener
|
745
|
-
startBlur: startBlurListener
|
746
|
-
stopBlur: stopBlurListener
|
663
|
+
changeMainVideoStream: changeMainVideoStreamListener
|
747
664
|
memberJoin: memberJoinListener
|
748
665
|
memberHangup: memberHangupListener
|
749
666
|
changeAudioState: changeAudioStateListener
|
@@ -763,7 +680,6 @@ declare class OpenSIPSJS extends UAExtended {
|
|
763
680
|
private readonly newMSRPSessionEventName;
|
764
681
|
private isMSRPInitializingValue;
|
765
682
|
private isReconnecting;
|
766
|
-
private activeConnection;
|
767
683
|
audio: AudioModule;
|
768
684
|
msrp: MSRPModule;
|
769
685
|
video: VideoModule;
|
@@ -774,10 +690,7 @@ declare class OpenSIPSJS extends UAExtended {
|
|
774
690
|
off<T extends ListenersKeyType>(type: T, listener: ListenerCallbackFnType<T>): this;
|
775
691
|
emit(type: ListenersKeyType, args: any): boolean;
|
776
692
|
get sipDomain(): string;
|
777
|
-
use(plugin: BaseNewStreamPlugin | BaseProcessStreamPlugin): void;
|
778
|
-
getPlugin(name: string): BaseNewStreamPlugin | BaseProcessStreamPlugin;
|
779
693
|
begin(): this;
|
780
|
-
disconnect(): void;
|
781
694
|
subscribe(type: string, listener: (c: RTCSessionExtended) => void): void;
|
782
695
|
removeIListener(value: string): void;
|
783
696
|
triggerListener({ listenerType, session, event }: TriggerListenerOptions): void;
|
@@ -794,10 +707,6 @@ declare interface OutgoingMSRPSessionEvent {
|
|
794
707
|
|
795
708
|
declare type OutgoingMSRPSessionListener = (event: OutgoingMSRPSessionEvent) => void;
|
796
709
|
|
797
|
-
declare interface PluginConfig {
|
798
|
-
immediate: boolean;
|
799
|
-
}
|
800
|
-
|
801
710
|
declare type readyListener = (value: boolean) => void
|
802
711
|
|
803
712
|
declare interface RemoteIdentityCallType {
|
@@ -858,124 +767,6 @@ declare interface RTCSessionExtended extends RTCSession {
|
|
858
767
|
init_icncoming(request: IncomingRequest): void
|
859
768
|
}
|
860
769
|
|
861
|
-
export declare class ScreenSharePlugin extends BaseNewStreamPlugin {
|
862
|
-
constructor();
|
863
|
-
generateStream(): Promise<MediaStream>;
|
864
|
-
kill(): Promise<void>;
|
865
|
-
}
|
866
|
-
|
867
|
-
declare interface ScreenShareWhiteboardOptions {
|
868
|
-
selectors: ScreenShareWhiteboardSelectors;
|
869
|
-
}
|
870
|
-
|
871
|
-
export declare class ScreenShareWhiteBoardPlugin extends BaseProcessStreamPlugin {
|
872
|
-
private static video;
|
873
|
-
private static wrapperEl;
|
874
|
-
private static screenShareKonvaDrawer;
|
875
|
-
private static initialStream;
|
876
|
-
private imageSrc;
|
877
|
-
private konvaDrawer;
|
878
|
-
mode: ConferencingModeType;
|
879
|
-
private screenSharePlugin;
|
880
|
-
private selectors;
|
881
|
-
constructor(screenSharePlugin: any, options?: Partial<ScreenShareWhiteboardOptions>);
|
882
|
-
private createVideoElement;
|
883
|
-
private getAspectRatioDimensions;
|
884
|
-
/**
|
885
|
-
* Starts stream processing to add mask effect for it
|
886
|
-
* This method is useful in cases like drawing over the screen share as we
|
887
|
-
* already have a screen share stream and there is no need to create another one
|
888
|
-
* @param {MediaStream} stream
|
889
|
-
* @return {MediaStream} processed stream with mask effect
|
890
|
-
*/
|
891
|
-
start(stream: any): Promise<MediaStream>;
|
892
|
-
/**
|
893
|
-
* Stops stream processing
|
894
|
-
*/
|
895
|
-
stop(): any;
|
896
|
-
setupScreenShareDrawerOptions(options: KonvaDrawerOptions): void;
|
897
|
-
}
|
898
|
-
|
899
|
-
declare interface ScreenShareWhiteboardSelectors {
|
900
|
-
container: string;
|
901
|
-
compositeCanvasContainer: string;
|
902
|
-
compositeCanvas: string;
|
903
|
-
drawerContainer: string;
|
904
|
-
videoElement: string;
|
905
|
-
videoElementContainer: string;
|
906
|
-
document: HTMLElement;
|
907
|
-
}
|
908
|
-
|
909
|
-
declare type startBlurListener = () => void
|
910
|
-
|
911
|
-
declare type startScreenShareListener = (event: MediaStream) => void
|
912
|
-
|
913
|
-
declare type stopBlurListener = () => void
|
914
|
-
|
915
|
-
declare type stopScreenShareListener = () => void
|
916
|
-
|
917
|
-
declare interface StreamMaskOptions {
|
918
|
-
effect: MaskEffectTypeConfigType;
|
919
|
-
base64Image?: string;
|
920
|
-
visualizationConfig?: VisualizationConfigType;
|
921
|
-
}
|
922
|
-
|
923
|
-
export declare class StreamMaskPlugin extends BaseProcessStreamPlugin {
|
924
|
-
private visualizationConfig;
|
925
|
-
private maskEffectType;
|
926
|
-
private base64ImageMask;
|
927
|
-
private rafId;
|
928
|
-
private timeoutId;
|
929
|
-
private segmenter;
|
930
|
-
private camera;
|
931
|
-
private canvas;
|
932
|
-
private ctx;
|
933
|
-
private visibilityState;
|
934
|
-
constructor(options: StreamMaskOptions, pluginConfig?: PluginConfig);
|
935
|
-
/**
|
936
|
-
* Starts stream processing to add mask effect for it
|
937
|
-
* @param {MediaStream} stream
|
938
|
-
* @param {'bokehEffect' | 'backgroundImageEffect'} effect - defines the mask effect type
|
939
|
-
* @param {MediaStreamConstraints} options - media stream constraints
|
940
|
-
* @param {object} options - (optional) additional mask effect options
|
941
|
-
* @return {MediaStream} processed stream with mask effect
|
942
|
-
*/
|
943
|
-
start(stream: any): Promise<MediaStream>;
|
944
|
-
/**
|
945
|
-
* Listens to visibility change (like switching active tab)
|
946
|
-
* and switches between different kinds of requestAnimationFrame
|
947
|
-
*/
|
948
|
-
private processVisibilityChange;
|
949
|
-
/**
|
950
|
-
* Adds audio tracks to MediaStream which contains only video tracks
|
951
|
-
* @param {MediaStream} stream - stream with only video tracks
|
952
|
-
* @param {MediaStreamConstraints} options - media stream constraints
|
953
|
-
* @return {MediaStream} combined stream with both audio and video tracks
|
954
|
-
*/
|
955
|
-
private populateWithAudioTracks;
|
956
|
-
/**
|
957
|
-
* Stops stream processing
|
958
|
-
*/
|
959
|
-
stop(): void;
|
960
|
-
setupVisualizationConfig(config: VisualizationConfigType): void;
|
961
|
-
/**
|
962
|
-
* Starts rendering process by calling itself recursively.
|
963
|
-
* Uses requestAnimationFrame method for recursive invoking.
|
964
|
-
*/
|
965
|
-
private renderPrediction;
|
966
|
-
/**
|
967
|
-
* Creates Body Segmenter which is used for people segmentation and poses estimation
|
968
|
-
* @return {segmenter} segmenter instance
|
969
|
-
*/
|
970
|
-
private createSegmenter;
|
971
|
-
/**
|
972
|
-
* Render function which draws masked effect to canvas.
|
973
|
-
*/
|
974
|
-
private renderResult;
|
975
|
-
private applyBokehEffect;
|
976
|
-
private applyBackgroundImageEffect;
|
977
|
-
}
|
978
|
-
|
979
770
|
declare interface StreamMediaType extends HTMLAudioElement {
|
980
771
|
className: string
|
981
772
|
setSinkId (id: string): Promise<void>
|
@@ -989,10 +780,6 @@ declare interface TriggerListenerOptions {
|
|
989
780
|
event?: ListenerEventType
|
990
781
|
}
|
991
782
|
|
992
|
-
declare type UAConfigurationExtended = UAConfiguration & {
|
993
|
-
overrideUserAgent: (userAgent: string) => string
|
994
|
-
}
|
995
|
-
|
996
783
|
declare const UAConstructor: typeof UA;
|
997
784
|
|
998
785
|
declare class UAExtended extends UAConstructor implements UAExtendedInterface {
|
@@ -1004,21 +791,15 @@ declare class UAExtended extends UAConstructor implements UAExtendedInterface {
|
|
1004
791
|
ict: {};
|
1005
792
|
};
|
1006
793
|
_janus_sessions: any[];
|
1007
|
-
protected newStreamPlugins: Array<BaseNewStreamPlugin>;
|
1008
|
-
protected processStreamPlugins: Array<BaseProcessStreamPlugin>;
|
1009
794
|
constructor(configuration: UAConfiguration);
|
1010
795
|
call(target: string, options?: CallOptionsExtended): RTCSession;
|
1011
796
|
joinVideoCall(target: any, displayName: any, options: any): any;
|
1012
|
-
startScreenShare(): void;
|
1013
|
-
startBlur(): void;
|
1014
|
-
stopBlur(): void;
|
1015
797
|
_loadConfig(configuration: any): void;
|
1016
798
|
/**
|
1017
799
|
* new MSRPSession
|
1018
800
|
*/
|
1019
801
|
newMSRPSession(session: MSRPSession, data: object): void;
|
1020
802
|
newJanusSession(session: any, data: any): void;
|
1021
|
-
kill(): void;
|
1022
803
|
/**
|
1023
804
|
* MSRPSession destroyed.
|
1024
805
|
*/
|
@@ -1082,22 +863,10 @@ declare class VideoModule {
|
|
1082
863
|
stopAudio(): void;
|
1083
864
|
startVideo(): void;
|
1084
865
|
stopVideo(): void;
|
1085
|
-
startScreenShare(): void;
|
1086
|
-
startBlur(): void;
|
1087
|
-
stopBlur(): void;
|
1088
866
|
}
|
1089
867
|
|
1090
868
|
declare type VideoModuleName = typeof MODULES.VIDEO
|
1091
869
|
|
1092
|
-
declare type VisualizationConfigType = {
|
1093
|
-
foregroundThreshold?: number;
|
1094
|
-
maskOpacity?: number;
|
1095
|
-
maskBlur?: number;
|
1096
|
-
pixelCellWidth?: number;
|
1097
|
-
backgroundBlur?: number;
|
1098
|
-
edgeBlur?: number;
|
1099
|
-
};
|
1100
|
-
|
1101
870
|
declare interface WebrtcMetricsConfigType {
|
1102
871
|
refreshEvery?: number
|
1103
872
|
startAfter?: number
|
@@ -1110,34 +879,4 @@ declare interface WebrtcMetricsConfigType {
|
|
1110
879
|
ticket?: boolean
|
1111
880
|
}
|
1112
881
|
|
1113
|
-
declare interface WhiteboardElementSelectors {
|
1114
|
-
container: string;
|
1115
|
-
drawerContainer: string;
|
1116
|
-
konvaContainer: HTMLElement;
|
1117
|
-
document: HTMLElement;
|
1118
|
-
}
|
1119
|
-
|
1120
|
-
declare interface WhiteboardOptions {
|
1121
|
-
mode: ConferencingModeType;
|
1122
|
-
imageSrc?: string;
|
1123
|
-
selectors: Partial<WhiteboardElementSelectors>;
|
1124
|
-
}
|
1125
|
-
|
1126
|
-
export declare class WhiteBoardPlugin extends BaseNewStreamPlugin {
|
1127
|
-
private visualizationConfig;
|
1128
|
-
private rafId;
|
1129
|
-
private imageSrc;
|
1130
|
-
private konvaDrawer;
|
1131
|
-
private selectors;
|
1132
|
-
mode: ConferencingModeType;
|
1133
|
-
constructor(options: WhiteboardOptions);
|
1134
|
-
setupDrawerOptions(options: KonvaDrawerOptions): void;
|
1135
|
-
setMode(mode: ConferencingModeType, imageSrc?: string): void;
|
1136
|
-
setupDrawerImage(imageSrc: any): void;
|
1137
|
-
private drawEmptyWhiteboard;
|
1138
|
-
private drawImageWhiteboard;
|
1139
|
-
generateStream(): Promise<void>;
|
1140
|
-
kill(): Promise<void>;
|
1141
|
-
}
|
1142
|
-
|
1143
882
|
export { }
|