opensips-js-vue 0.1.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/README.md ADDED
@@ -0,0 +1,138 @@
1
+ ---
2
+ title: Getting started
3
+ description: This library is a wrapper over the opensips-js implementation.
4
+ navigation:
5
+ title: Getting Started
6
+ ---
7
+
8
+ # Getting started
9
+
10
+ ## Description
11
+ This library is a wrapper over the opensips-js implementation.
12
+ It provides a Vue 3 composable for reactive work with opensips-js functionality.
13
+ Call `useVsipProvide` on the top level of Vue components and then use `useVsipInject` in the child components to use reactive opensips-js functionality.
14
+
15
+ ## Basic Usage
16
+ *ProviderWrapper.vue*
17
+ ```vue [ProviderWrapper.vue]
18
+ <template>
19
+ <div ref="wrapper">
20
+ <VSipPhone v-if="state.isInitialized" />
21
+ <div v-else>Not initialized</div>
22
+ </div>
23
+ </template>
24
+ <script lang="ts" setup>
25
+ import { ref } from 'vue'
26
+ import { useVsipProvide } from 'opensips-js-vue'
27
+ import VSipPhone from '@/VSipPhone.vue'
28
+
29
+ const { actions, state } = useVsipProvide()
30
+ actions.init('wss07.voicenter.co', '', '')
31
+ </script>
32
+ ```
33
+ *VSipPhone.vue*
34
+ ```vue [VSipPhone.vue]
35
+ <template>
36
+ ...
37
+ </template>
38
+ <script lang="ts" setup>
39
+ import { ref } from 'vue'
40
+ import { useVsipInject } from '@/index'
41
+
42
+ const { state, actions } = useVsipInject()
43
+ const {
44
+ selectedInputDevice,
45
+ selectedOutputDevice,
46
+ muteWhenJoin,
47
+ isDND,
48
+ addCallToCurrentRoom,
49
+ microphoneInputLevel,
50
+ speakerVolume,
51
+ isMuted,
52
+ callAddingInProgress,
53
+ activeCalls,
54
+ callsInActiveRoom,
55
+ currentActiveRoomId,
56
+ activeRooms
57
+ } = state
58
+
59
+ const {
60
+ initCall,
61
+ sendDTMF,
62
+ muteCaller,
63
+ unmuteCaller,
64
+ terminateCall,
65
+ transferCall,
66
+ mergeCall,
67
+ holdCall,
68
+ unholdCall,
69
+ answerCall,
70
+ moveCall,
71
+ mute,
72
+ unmute
73
+ } = actions
74
+
75
+ /* Other code */
76
+ </script>
77
+ ```
78
+
79
+
80
+ ## Composable
81
+ ### State
82
+ | Name | Description | Type | Default |
83
+ |-----------------------|:-----------------------------------------------------------|:---------------------------------------|:----------|
84
+ | isInitialized | Defines if opensips-js is initialized | boolean | false |
85
+ | activeCalls | Active calls | { [key: string]: ICall } | {} |
86
+ | callsInActiveRoom | Calls in active room | Array\<Call> | [] |
87
+ | activeMessages | Active MSRP messages | { [key: string]: IMessage } | {} |
88
+ | addCallToCurrentRoom | Defines if new call should be added to current room | boolean | false |
89
+ | callAddingInProgress | Represents call id of progressing call if such call exists | string / undefined | undefined |
90
+ | activeRooms | Active rooms | { [key: number]: IRoom } | {} |
91
+ | msrpHistory | MSRP messages history | { [key: string]: Array\<MSRPMessage> } | {} |
92
+ | availableMediaDevices | List of available media devices | Array\<MediaDeviceInfo> | [] |
93
+ | inputMediaDeviceList | List of available input media devices | Array\<MediaDeviceInfo> | [] |
94
+ | outputMediaDeviceList | List of available output media devices | Array\<MediaDeviceInfo> | [] |
95
+ | selectedOutputDevice | ID of selected output device | string | 'default' |
96
+ | selectedInputDevice | ID of selected input device | string | 'default' |
97
+ | muteWhenJoin | Defines if agent will be muted when joining call | boolean | false |
98
+ | isDND | Defines usage agent's 'Do Not Disturb' option | boolean | false |
99
+ | originalStream | Agent's Audio Stream object | MediaStream / null | null |
100
+ | currentActiveRoomId | Defines agent's active room | number / undefined | undefined |
101
+ | callStatus | Calls' statuses | { [key: string]: ICallStatus } | {} |
102
+ | callTime | Calls' times | { [key: string]: ITimeData } | {} |
103
+ | callMetrics | Calls' metrics | { [key: string]: unknown } | {} |
104
+ | autoAnswer | Defines if auto-answer is enabled | boolean | false |
105
+ | microphoneInputLevel | Microphone sensitivity (range is from 0 to 2) | number | 2 |
106
+ | speakerVolume | Speaker volume (range is from 0 to 1) | number | 1 |
107
+
108
+
109
+ ### Methods
110
+ | Name | Interface | Description |
111
+ |--------------------------|:-----------------------------------------------------------------------------|:-----------------------------------------------------------------|
112
+ | init | (domain: string, username: string, password: string): void | Initialize opensips-js |
113
+ | initCall | (target: string, addToCurrentRoom: boolean, holdOtherCalls: boolean) => void | Make a call |
114
+ | answerCall | (callId: string) => void | Answer call |
115
+ | terminateCall | (callId: string) => void | Hangup call |
116
+ | muteCaller | (callId: string) => void | Mute caller |
117
+ | unmuteCaller | (callId: string) => void | Unmute caller |
118
+ | mute | () => void | Mute ourself |
119
+ | unmute | () => void | Unmute ourself |
120
+ | transferCall | (callId: string, target: string) => void | Transfer call |
121
+ | mergeCall | (roomId: number) => void | Merge calls in room (works only when 2 call in room) |
122
+ | mergeCallByIds | (firstCallId: string, secondCallId: string) => void | Merge calls by their ids |
123
+ | holdCall | (callId: string, automatic?: boolean) => void | Hold a call |
124
+ | unholdCall | (callId: string) => void | Unhold a call |
125
+ | moveCall | (callId: string, roomId: number) => Promise\<void> | Move call to another room |
126
+ | setMicrophone | (deviceId: string) => Promise\<void> | Set microphone which to use |
127
+ | setSpeaker | (deviceId: string) => Promise\<void> | Set speaker which to use |
128
+ | sendDTMF | (callId: string, value: string) => void | Send DTMF |
129
+ | setActiveRoom | (roomId: number / undefined) => Promise\<void> | Set current active room |
130
+ | setMicrophoneSensitivity | (value: number) => void | Set microphone sensitivity. Value should be in range from 0 to 1 |
131
+ | setSpeakerVolume | (value: number) => void | Set speaker volume. Value should be in range from 0 to 1 |
132
+ | setAutoAnswer | (value: boolean) => void | Set auto-answer |
133
+ | setDND | (state: boolean) => void | Set 'Do not Disturb' option |
134
+ | setMetricsConfig | (config: WebrtcMetricsConfigType) => void | Set the metric config (used for audio quality indicator) |
135
+ | msrpAnswer | (callId: string) => void | Answer MSRP invite |
136
+ | messageTerminate | (callId: string) => void | Terminate MSRP session |
137
+ | sendMSRP | (msrpSessionId: string, body: string) => void | Send MSRP message |
138
+ | initMSRP | (target: string, body: string, options: object) => void | Send MSRP invite |
@@ -0,0 +1,479 @@
1
+ import { AnswerOptions } from 'jssip/lib/RTCSession';
2
+ import type { ComputedRef } from 'vue';
3
+ import { EndEvent } from 'jssip/lib/RTCSession';
4
+ import { ExtraContactParams } from 'jssip/lib/Registrator';
5
+ import { ICall as ICall_2 } from '@/types/rtc';
6
+ import { ICallStatus as ICallStatus_2 } from '@/types/rtc';
7
+ import { IMessage as IMessage_2 } from '@/types/msrp';
8
+ import { IncomingAckEvent } from 'jssip/lib/RTCSession';
9
+ import { IncomingEvent } from 'jssip/lib/RTCSession';
10
+ import { IncomingMSRPSessionEvent } from '@/helpers/UA';
11
+ import { IncomingRequest } from 'jssip/lib/SIPMessage';
12
+ import { ITimeData as ITimeData_2 } from '@/types/timer';
13
+ import { MediaConstraints } from 'jssip/lib/RTCSession';
14
+ import { MODULES } from '@/enum/modules';
15
+ import MSRPMessage from '@/lib/msrp/message';
16
+ import { MSRPSession } from '@/lib/msrp/session';
17
+ import { MSRPSessionEventMap } from '@/lib/msrp/session';
18
+ import { MSRPSessionExtended as MSRPSessionExtended_2 } from '@/types/msrp';
19
+ import { OutgoingAckEvent } from 'jssip/lib/RTCSession';
20
+ import { OutgoingEvent } from 'jssip/lib/RTCSession';
21
+ import { OutgoingMSRPSessionEvent } from '@/helpers/UA';
22
+ import type { Ref } from 'vue';
23
+ import { RoomChangeEmitType as RoomChangeEmitType_2 } from '@/types/rtc';
24
+ import { RTCSession } from 'jssip/lib/RTCSession';
25
+ import { RTCSessionEventMap } from 'jssip/lib/RTCSession';
26
+ import { SessionDirection } from 'jssip/lib/RTCSession';
27
+ import { StreamMediaType as StreamMediaType_2 } from '@/types/rtc';
28
+ import { UAConfiguration } from 'jssip/lib/UA';
29
+ import { UAEventMap } from 'jssip/lib/UA';
30
+
31
+ export declare type ActiveRoomListener = (event: number | undefined) => void
32
+
33
+ export declare type addRoomListener = (value: RoomChangeEmitType_2) => void
34
+
35
+ export declare interface AnswerOptionsExtended extends AnswerOptions {
36
+ mediaConstraints?: MediaConstraints | ExactConstraints
37
+ }
38
+
39
+ export declare type AudioModuleName = typeof MODULES.AUDIO
40
+
41
+ export declare type CallAddingProgressListener = (callId: string | undefined) => void
42
+
43
+ export declare interface CallOptionsExtended extends AnswerOptionsExtended {
44
+ eventHandlers?: Partial<RTCSessionEventMap>;
45
+ anonymous?: boolean;
46
+ fromUserName?: string;
47
+ fromDisplayName?: string;
48
+ }
49
+
50
+ export declare type CallTime = Record<string, TempTimeData>
51
+
52
+ export declare type changeActiveCallsListener = (event: { [key: string]: ICall_2 }) => void
53
+
54
+ export declare type changeActiveInputMediaDeviceListener = (event: string) => void
55
+
56
+ export declare type changeActiveMessagesListener = (event: { [key: string]: IMessage_2 }) => void
57
+
58
+ export declare type changeActiveOutputMediaDeviceListener = (event: string) => void
59
+
60
+ export declare type changeActiveStreamListener = (value: MediaStream) => void
61
+
62
+ export declare type changeAudioStateListener = (state: boolean) => void
63
+
64
+ export declare type changeAvailableDeviceListListener = (event: Array<MediaDeviceInfo>) => void
65
+
66
+ export declare type changeCallMetricsListener = (event: { [key: string]: any }) => void
67
+
68
+ export declare type changeCallStatusListener = (event: { [key: string]: ICallStatus_2 }) => void
69
+
70
+ export declare type changeCallTimeListener = (event: { [key: string]: ITimeData_2 }) => void
71
+
72
+ export declare type changeCallVolumeListener = (event: ChangeVolumeEventType) => void
73
+
74
+ export declare type changeIsCallWaitingListener = (value: boolean) => void
75
+
76
+ export declare type changeIsDNDListener = (value: boolean) => void
77
+
78
+ export declare type changeIsMutedListener = (value: boolean) => void
79
+
80
+ export declare type changeMainVideoStreamListener = (event: { name: string, event: MediaStream }) => void
81
+
82
+ export declare type changeMuteWhenJoinListener = (value: boolean) => void
83
+
84
+ export declare type changeVideoStateListener = (state: boolean) => void
85
+
86
+ export declare type ChangeVolumeEventType = {
87
+ callId: string
88
+ volume: number
89
+ }
90
+
91
+ export declare type CommonLogMethodType = (...args: unknown[]) => void
92
+
93
+ export declare type conferenceEndListener = (sessionId) => void
94
+
95
+ export declare type conferenceStartListener = () => void
96
+
97
+ export declare type connectionListener = (value: boolean) => void
98
+
99
+ export declare interface CustomLoggerType {
100
+ log: CommonLogMethodType
101
+ warn: CommonLogMethodType
102
+ error: CommonLogMethodType
103
+ debug: CommonLogMethodType
104
+ }
105
+
106
+ export declare type ExactConstraints = {
107
+ audio?: {
108
+ deviceId: {exact: string}
109
+ }
110
+ video?: boolean;
111
+ }
112
+
113
+ export declare interface ICall extends RTCSessionExtended {
114
+ roomId?: number
115
+ localMuted?: boolean
116
+ localHold?: boolean
117
+ audioTag?: StreamMediaType
118
+ autoAnswer?: boolean
119
+ putOnHoldTimestamp?: number
120
+ }
121
+
122
+ export declare interface ICallStatus {
123
+ isMoving: boolean
124
+ isTransferring: boolean
125
+ isMerging: boolean
126
+ isTransferred: boolean
127
+ }
128
+
129
+ export declare interface ICallStatusUpdate {
130
+ callId: string
131
+ isMoving?: boolean
132
+ isTransferring?: boolean
133
+ isMerging?: boolean
134
+ isTransferred?: boolean
135
+ }
136
+
137
+ declare interface IMessage extends MSRPSessionExtended {
138
+ roomId?: number
139
+ localMuted?: boolean
140
+ localHold?: boolean
141
+ audioTag?: StreamMediaType_2
142
+ terminate(): void
143
+ }
144
+
145
+ export declare type IncomingMSRPSessionListener = (event: IncomingMSRPSessionEvent) => void;
146
+
147
+ declare type InitOpensipsConfiguration = Omit<IOpenSIPSConfiguration, 'uri' | 'session_timers' | 'password'>
148
+
149
+ export declare type IntervalType = ReturnType<typeof setInterval>
150
+
151
+ export declare type IOpenSIPSConfiguration = Omit<UAConfigurationExtended, 'sockets'>
152
+
153
+ export declare interface IOpenSIPSJSOptions {
154
+ configuration: IOpenSIPSConfiguration
155
+ socketInterfaces: [ string ]
156
+ sipDomain: string
157
+ sipOptions: {
158
+ session_timers: boolean
159
+ extraHeaders: [ string ]
160
+ pcConfig: RTCConfiguration_2
161
+ },
162
+ modules: Array<Modules>
163
+ pnExtraHeaders?: ExtraContactParams
164
+ }
165
+
166
+ export declare interface IRoom {
167
+ started: Date
168
+ incomingInProgress: boolean
169
+ roomId: number
170
+ }
171
+
172
+ export declare type IRoomUpdate = Omit<IRoom, 'started'> & {
173
+ started?: Date
174
+ }
175
+
176
+ export declare interface ITimeData {
177
+ callId: string
178
+ hours: number
179
+ minutes: number
180
+ seconds: number
181
+ formatted: string
182
+ }
183
+
184
+ export declare type ListenerCallbackFnType<T extends ListenersKeyType> = OpenSIPSEventMap[T]
185
+
186
+ export declare type ListenerEventType = EndEvent | IncomingEvent | OutgoingEvent | IncomingAckEvent | OutgoingAckEvent
187
+
188
+ export declare type ListenersCallbackFnType = OpenSIPSEventMap[ListenersKeyType]
189
+
190
+ export declare type ListenersKeyType = keyof OpenSIPSEventMap
191
+
192
+ declare type MediaDeviceOption = Omit<MediaDeviceInfo, 'toJSON'>
193
+
194
+ export declare interface MediaEvent extends Event {
195
+ stream: MediaStream
196
+ }
197
+
198
+ export declare type memberHangupListener = (event: object) => void
199
+
200
+ export declare type memberJoinListener = (event: object) => void
201
+
202
+ export declare type Modules = AudioModuleName | VideoModuleName | MSRPModuleName
203
+
204
+ export declare type MSRPInitializingListener = (sessionId: string | undefined) => void
205
+
206
+ export declare type MSRPMessageEventType = {
207
+ message: MSRPMessage,
208
+ session: MSRPSessionExtended_2
209
+ }
210
+
211
+ export declare type MSRPMessageListener = (event: MSRPMessageEventType) => void;
212
+
213
+ export declare type MSRPModuleName = typeof MODULES.MSRP
214
+
215
+ declare interface MSRPSessionExtended extends MSRPSession {
216
+ id: string
217
+ status: string
218
+ start_time: Date
219
+ direction: SessionDirection
220
+ _id: string
221
+ _cancel_reason: string
222
+ _contact: string
223
+ _end_time: Date
224
+ _eventsCount: number
225
+ _from_tag: string
226
+ _is_canceled: boolean
227
+ _is_confirmed: boolean
228
+ _late_sdp: string
229
+ _status: number
230
+ _remote_identity: string
231
+ target_addr: Array<string>
232
+ answer(options?: any): void
233
+ _init_incomeing(): void
234
+ sendMSRP(body: string): void
235
+ on<T extends keyof MSRPSessionEventMap>(type: T, listener: MSRPSessionEventMap[T]): this;
236
+ }
237
+
238
+ export declare type MSRPSessionListener = IncomingMSRPSessionListener | OutgoingMSRPSessionListener;
239
+
240
+ export declare type OnTransportCallback = (parsed: object, message: string) => void
241
+
242
+ export declare interface OpenSIPSEventMap extends UAEventMap {
243
+ ready: readyListener
244
+ connection: connectionListener
245
+ reconnecting: reconnectionListener
246
+ // JSSIP
247
+ changeActiveCalls: changeActiveCallsListener
248
+ changeActiveMessages: changeActiveMessagesListener
249
+ callConfirmed: TestEventListener
250
+ currentActiveRoomChanged: ActiveRoomListener
251
+ callAddingInProgressChanged: CallAddingProgressListener
252
+ isMSRPInitializingChanged: MSRPInitializingListener
253
+ roomDeleted: RoomDeletedListener
254
+ changeActiveInputMediaDevice: changeActiveInputMediaDeviceListener
255
+ changeActiveOutputMediaDevice: changeActiveOutputMediaDeviceListener
256
+ changeAvailableDeviceList: changeAvailableDeviceListListener
257
+ changeMuteWhenJoin: changeMuteWhenJoinListener
258
+ changeIsDND: changeIsDNDListener
259
+ changeIsCallWaiting: changeIsCallWaitingListener
260
+ changeIsMuted: changeIsMutedListener
261
+ changeActiveStream: changeActiveStreamListener
262
+ addRoom: addRoomListener
263
+ updateRoom: updateRoomListener
264
+ removeRoom: removeRoomListener
265
+ changeCallStatus: changeCallStatusListener
266
+ changeCallTime: changeCallTimeListener
267
+ changeCallMetrics: changeCallMetricsListener
268
+ changeCallVolume: changeCallVolumeListener
269
+ newMSRPMessage: MSRPMessageListener
270
+ newMSRPSession: MSRPSessionListener
271
+ // JANUS
272
+ conferenceStart: conferenceStartListener
273
+ conferenceEnd: conferenceEndListener
274
+ startScreenShare: startScreenShareListener
275
+ stopScreenShare: stopScreenShareListener
276
+ startBlur: startBlurListener
277
+ stopBlur: stopBlurListener
278
+ memberJoin: memberJoinListener
279
+ memberHangup: memberHangupListener
280
+ changeAudioState: changeAudioStateListener
281
+ changeVideoState: changeVideoStateListener
282
+ }
283
+
284
+ export declare type OutgoingMSRPSessionListener = (event: OutgoingMSRPSessionEvent) => void;
285
+
286
+ declare interface PNExtraHeaders {
287
+ [key: string]: string
288
+ }
289
+
290
+ export declare type readyListener = (value: boolean) => void
291
+
292
+ export declare type reconnectionListener = (value: boolean) => void
293
+
294
+ export declare interface RemoteIdentityCallType {
295
+ _display_name: string
296
+ _uri: {
297
+ _user: string
298
+ }
299
+ }
300
+
301
+ export declare type removeRoomListener = (value: RoomChangeEmitType_2) => void
302
+
303
+ export declare type RoomChangeEmitType = {
304
+ room: IRoom
305
+ roomList: { [key: number]: IRoom }
306
+ }
307
+
308
+ export declare type RoomDeletedListener = (roomId: number) => void
309
+
310
+ declare type RTCBundlePolicy_2 = 'balanced' | 'max-bundle' | 'max-compat'
311
+ export { RTCBundlePolicy_2 as RTCBundlePolicy }
312
+
313
+ declare interface RTCConfiguration_2 {
314
+ bundlePolicy?: RTCBundlePolicy_2;
315
+ certificates?: RTCCertificate[];
316
+ iceCandidatePoolSize?: number;
317
+ iceServers?: RTCIceServer_2[];
318
+ iceTransportPolicy?: RTCIceTransportPolicy_2;
319
+ rtcpMuxPolicy?: RTCRtcpMuxPolicy_2;
320
+ }
321
+ export { RTCConfiguration_2 as RTCConfiguration }
322
+
323
+ declare interface RTCIceServer_2 {
324
+ credential?: string;
325
+ urls: string | string[];
326
+ username?: string;
327
+ }
328
+ export { RTCIceServer_2 as RTCIceServer }
329
+
330
+ declare type RTCIceTransportPolicy_2 = 'all' | 'relay'
331
+ export { RTCIceTransportPolicy_2 as RTCIceTransportPolicy }
332
+
333
+ declare type RTCRtcpMuxPolicy_2 = 'require'
334
+ export { RTCRtcpMuxPolicy_2 as RTCRtcpMuxPolicy }
335
+
336
+ export declare interface RTCSessionExtended extends RTCSession {
337
+ id: string
338
+ _automaticHold: boolean
339
+ _id: string
340
+ _localHold: boolean
341
+ _audioMuted: boolean
342
+ _cancel_reason: string
343
+ _contact: string
344
+ _end_time: Date
345
+ _eventsCount: number
346
+ _from_tag: string
347
+ _is_canceled: boolean
348
+ _is_confirmed: boolean
349
+ _late_sdp: string
350
+ _videoMuted: boolean
351
+ _status: number
352
+ _remote_identity: RemoteIdentityCallType
353
+ answer(options?: AnswerOptionsExtended): void
354
+ init_icncoming(request: IncomingRequest): void
355
+ }
356
+
357
+ export declare type startBlurListener = () => void
358
+
359
+ export declare type startScreenShareListener = (event: MediaStream) => void
360
+
361
+ export declare type stopBlurListener = () => void
362
+
363
+ export declare type stopScreenShareListener = () => void
364
+
365
+ export declare interface StreamMediaType extends HTMLAudioElement {
366
+ className: string
367
+ setSinkId (id: string): Promise<void>
368
+ }
369
+
370
+ export declare type TempTimeData = Omit<ITimeData, 'callId'> & {
371
+ callId: string | undefined
372
+ }
373
+
374
+ export declare type TestEventListener = (event: { test: string }) => void
375
+
376
+ export declare interface TriggerListenerOptions {
377
+ listenerType: string
378
+ session: RTCSessionExtended
379
+ event?: ListenerEventType
380
+ }
381
+
382
+ export declare type UAConfigurationExtended = UAConfiguration & {
383
+ overrideUserAgent?: (userAgent: string) => string
384
+ onTransportCallback?: OnTransportCallback
385
+ }
386
+
387
+ export declare type updateRoomListener = (value: RoomChangeEmitType_2) => void
388
+
389
+ export declare function useVsipInject(): VsipAPI;
390
+
391
+ export declare function useVsipProvide(): VsipAPI;
392
+
393
+ export declare type VideoModuleName = typeof MODULES.VIDEO
394
+
395
+ export declare interface VsipAPI {
396
+ state: VsipAPIState
397
+ actions: VsipAPIActions
398
+ }
399
+
400
+ export declare const vsipAPI: VsipAPI;
401
+
402
+ declare interface VsipAPIActions {
403
+ init(domain: string, username: string, password: string, pnExtraHeaders?: PNExtraHeaders, opensipsConfiguration?: Partial<InitOpensipsConfiguration>): Promise<unknown>
404
+ unregister: () => void
405
+ register: () => void
406
+ disconnect: () => void
407
+ muteCaller: (callId: string) => void
408
+ unmuteCaller: (callId: string) => void
409
+ mute: () => void
410
+ unmute: () => void
411
+ setMuteWhenJoin: (state: boolean) => void
412
+ setDND: (state: boolean) => void
413
+ setCallWaiting: (state: boolean) => void
414
+ terminateCall: (callId: string) => void
415
+ transferCall: (callId: string, target: string) => void
416
+ mergeCall: (roomId: number) => void
417
+ mergeCallByIds: (firstCallId: string, secondCallId: string) => void
418
+ holdCall: (callId: string, automatic?: boolean) => void
419
+ unholdCall: (callId: string) => void
420
+ answerCall: (callId: string) => void
421
+ moveCall: (callId: string, roomId: number) => Promise<void>
422
+ msrpAnswer: (callId: string) => void
423
+ messageTerminate: (callId: string) => void
424
+ initCall: (target: string, addToCurrentRoom: boolean, holdOtherCalls = false) => void
425
+ sendMSRP: (msrpSessionId: string, body: string) => void
426
+ initMSRP: (target: string, body: string, options: object) => void
427
+ setMicrophone: (deviceId: string) => Promise<void>
428
+ setSpeaker: (deviceId: string) => Promise<void>
429
+ sendDTMF: (callId: string, value: string) => void
430
+ setActiveRoom: (roomId: number | undefined) => Promise<void>
431
+ setMicrophoneSensitivity: (value: number) => void
432
+ setSpeakerVolume: (value: number) => void
433
+ setAutoAnswer: (value: boolean) => void
434
+ setMetricsConfig: (config: WebrtcMetricsConfigType) => void
435
+ }
436
+
437
+ declare interface VsipAPIState {
438
+ isInitialized: Ref<boolean>
439
+ isOpenSIPSReady: Ref<boolean>
440
+ isOpenSIPSReconnecting: Ref<boolean>
441
+ activeCalls: Ref<{ [key: string]: ICall }>
442
+ callsInActiveRoom: ComputedRef<Array<ICall>>
443
+ activeMessages: Ref<{ [key: string]: IMessage }>
444
+ addCallToCurrentRoom: Ref<boolean>
445
+ callAddingInProgress: Ref<string | undefined>
446
+ activeRooms: Ref<{ [key: number]: IRoom }>
447
+ msrpHistory: Ref<{ [key: string]: Array<MSRPMessage> }>
448
+ availableMediaDevices: Ref<Array<MediaDeviceInfo>>
449
+ inputMediaDeviceList: Ref<Array<MediaDeviceOption>>
450
+ outputMediaDeviceList: Ref<Array<MediaDeviceOption>>
451
+ selectedOutputDevice: Ref<string>
452
+ selectedInputDevice: Ref<string>
453
+ muteWhenJoin: Ref<boolean>
454
+ isDND: Ref<boolean>
455
+ isCallWaitingEnabled: Ref<boolean>
456
+ isMuted: Ref<boolean>
457
+ originalStream: Ref<MediaStream | null>
458
+ currentActiveRoomId: Ref<number | undefined>
459
+ autoAnswer: Ref<boolean>
460
+ microphoneInputLevel: Ref<number>
461
+ speakerVolume: Ref<number>
462
+ callStatus: Ref<{ [key: string]: ICallStatus }>
463
+ callTime: Ref<{ [key: string]: ITimeData }>
464
+ callMetrics: Ref<{ [key: string]: unknown }>
465
+ }
466
+
467
+ declare interface WebrtcMetricsConfigType {
468
+ refreshEvery?: number
469
+ startAfter?: number
470
+ stopAfter?: number
471
+ verbose?: boolean
472
+ pname?: string
473
+ cid?: string
474
+ uid?: string
475
+ record?: boolean
476
+ ticket?: boolean
477
+ }
478
+
479
+ export { }