forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoximplant-websdk.d.ts
1215 lines (1154 loc) · 27.9 KB
/
voximplant-websdk.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for VoxImplant Web SDK 3.0.x
// Project: http://voximplant.com/
// Definitions by: Alexey Aylarov <https://github.com/aylarov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare namespace VoxImplant {
/**
* VoxImplant.Client general events
*/
enum Events {
AuthResult,
ConnectionClosed,
ConnectionEstablished,
ConnectionFailed,
IMError,
IncomingCall,
MicAccessResult,
NetStatsReceived,
PlaybackFinished,
SDKReady,
SourcesInfoUpdated
}
/**
* VoxImplant.Client Instant Messaging and Presence events
*/
enum IMEvents {
ChatStateUpdate,
MessageReceived,
MessageStatus,
PresenceUpdate,
RosterItemChange,
RosterPresenceUpdate,
RosterReceived,
SubscriptionRequest
}
/**
* VoxImplant.Call events
*/
enum CallEvents {
Connected,
Disconnected,
Failed,
InfoReceived,
MessageReceived,
ProgressToneStart,
ProgressToneStop,
TransferComplete,
TransferFailed
}
module Events {
/**
* Event dispatched after login , loginWithOneTimeKey, requestOneTimeLoginKey or loginWithCode function call
*/
interface AuthResult {
/**
* Auth error code, possible values are: 301 - code for 'code' auth type was sent, 302 - key for 'onetimekey' auth type received, 401 - invalid password, 404 - invalid username, 403 - user account is frozen, 500 - internal error
*/
code? : number;
/**
* Authorized user's display name
*/
displayName?: string;
/**
* This parameter is used to calculate hash parameter for loginWithOneTimeKey method. AuthResult with the key dispatched after requestOneTimeLoginKey method was called
*/
key?: string;
/**
* Application options
*/
options?: Object;
/**
* True in case of successful authorization, false - otherwise
*/
result: boolean;
}
/**
* Event dispatched if connection to VoxImplant Cloud was closed because of network problems. See connect function
*/
interface ConnectionClosed {}
/**
* Event dispatched after connection to VoxImplant Cloud was established successfully. See connect function
*/
interface ConnectionEstablished {}
/**
* Event dispatched if connection to VoxImplant Cloud couldn't be established. See connect function
*/
interface ConnectionFailed {
/**
* Failure reason description
*/
message: string;
}
/**
* Event dispatched in case of instant messaging subsystem error
*/
interface IMError {
/**
* Error data object, contains the error details
*/
errorData: Object;
/**
* Error type
*/
errorType: IMErrorType;
}
/**
* Event dispatched when there is a new incoming call to current user
*/
interface IncomingCall {
/**
* Incoming call instance. See VoxImplant.Call for details
*/
call: Call;
/**
* Optional SIP headers received with the message
*/
headers?: Object;
}
/**
* Event dispatched after user interaction with the mic access dialog.
*/
interface MicAccessResult {
/**
* True is access was allowed, false - otherwise
*/
result: boolean;
}
/**
* Event dispatched when packet loss data received from VoxImplant servers
*/
interface NetStatsReceived {
/**
* Network info object
*/
stats: NetworkInfo;
}
/**
* Event dispatched after sound playback was stopped. See playToneScript and stopPlayback functions
*/
interface PlaybackFinished {}
/**
* Event dispatched after SDK was successfully initialized after init function call
*/
interface SDKReady {
/**
* SDK version
*/
version: string;
}
/**
* Event dispatched when audio and video sources information was updated. See audioSources and videoSources for details
*/
interface SourcesInfoUpdated {}
}
module CallEvents {
/**
* Event dispatched after call was connected
*/
interface Connected {
/**
* Call that dispatched the event
*/
call: Call;
/**
* Optional SIP headers received with the message
*/
headers?: Object;
}
/**
* Event dispatched after call was disconnected
*/
interface Disconnected {
/**
* Call that dispatched the event
*/
call: Call;
/**
* Optional SIP headers received with the message
*/
headers?: Object;
}
/**
* Event dispatched after if call failed
*/
interface Failed {
/**
* Call that dispatched the event
*/
call: Call;
/**
* Status code of the call (i.e. 486)
*/
code: number;
/**
* Optional SIP headers received with the message
*/
headers?: Object;
/**
* Status message of call failure (i.e. Busy Here)
*/
reason: string;
}
/**
* Event dispatched when INFO message is received
*/
interface InfoReceived {
/**
* Content of the message
*/
body: string;
/**
* Call that dispatched the event
*/
call: Call;
/**
* Optional SIP headers received with the message
*/
headers?: Object;
/**
* MIME type of INFO message
*/
mimeType: string;
}
/**
* Event dispatched when text message is received
*/
interface MessageReceived {
/**
* Call that dispatched the event
*/
call: Call;
/**
* Content of the message
*/
text: string;
}
/**
* Event dispatched when progress tone playback starts
*/
interface ProgressToneStart {
/**
* Call that dispatched the event
*/
call: Call;
}
/**
* Event dispatched when progress tone playback stops
*/
interface ProgressToneStop {
/**
* Call that dispatched the event
*/
call: Call;
}
/**
* Event dispatched when call has been transferred successfully
*/
interface TransferComplete {
/**
* Call that dispatched the event
*/
call: Call;
}
/**
* Event dispatched when call transfer failed
*/
interface TransferFailed {
/**
* Call that dispatched the event
*/
call: Call;
}
}
module IMEvents {
/**
* Event dispatched when chat session state updated
*/
interface ChatStateUpdate {
/**
* User id
*/
id: string,
/**
* Resource name
*/
resource?: string,
/**
* Current chat session state. See VoxImplant.ChatStateType enum
*/
state: ChatStateType
}
/**
* Event dispatched when instant message received
*/
interface MessageReceived {
/**
* Message content
*/
content: string,
/**
* User id
*/
id: string,
/**
* Message id
*/
message_id: string,
/**
* Resource name
*/
resource?: string
}
/**
* Event dispatched when sent message status changed
*/
interface MessageStatus {
/**
* User id
*/
id: string,
/**
* Message id
*/
message_id: string,
/**
* Resource name
*/
resource?: string,
/**
* Message event type. See VoxImplant.MessageEventType enum
*/
type: MessageEventType
}
/**
* Event dispatched when self presence updated
*/
interface PresenceUpdate {
/**
* User id
*/
id: string,
/**
* Status message
*/
message: string,
/**
* Current presence status
*/
presence: UserStatuses,
/**
* Resource name
*/
resource?: string
}
/**
* Event dispatched when roster item changed
*/
interface RosterItemChange {
/**
* User display name
*/
displayName: string,
/**
* User id
*/
id: string,
/**
* Resource name
*/
resource?: string,
/**
* Roster item event type. See VoxImplant.RosterItemEvent enum
*/
type: RosterItemEvent
}
/**
* Event dispatched when roster item presence update happened
*/
interface RosterPresenceUpdate {
/**
* User id
*/
id: string,
/**
* Status message
*/
message?: string,
/**
* Current presence status
*/
presence: UserStatuses,
/**
* Resource name
*/
resource?: string
}
/**
* Event dispatched when roster data received
*/
interface RosterReceived {
/**
* User id
*/
id: string,
/**
* Array contains VoxImplant.RosterItem elements
*/
roster: RosterItem[]
}
/**
* Event dispatched when some user tries to add current user into his roster. Current user can confirm or reject the subscription, then VoxImplant.IMEvents.RosterItemChange will be dispatched on for user that made the request
*/
interface SubscriptionRequest {
/**
* User id
*/
id: string,
/**
* Optional message
*/
message?: string,
/**
* Resource name
*/
resource?: string,
/**
* Message event type. See VoxImplant.SubscriptionRequestType enum
*/
type: SubscriptionRequestType
}
}
type VoxImplantEvent = Events.AuthResult | Events.ConnectionClosed | Events.ConnectionEstablished |
Events.ConnectionFailed | Events.IMError | Events.IncomingCall | Events.MicAccessResult |
Events.NetStatsReceived | Events.PlaybackFinished | Events.SDKReady | Events.SourcesInfoUpdated;
type VoxImplantCallEvent = CallEvents.Connected | CallEvents.Disconnected | CallEvents.Failed |
CallEvents.InfoReceived | CallEvents.MessageReceived | CallEvents.ProgressToneStart |
CallEvents.ProgressToneStop | CallEvents.TransferComplete | CallEvents.TransferFailed;
type VoxImplantIMEvent = IMEvents.ChatStateUpdate | IMEvents.MessageReceived | IMEvents.MessageStatus |
IMEvents.PresenceUpdate | IMEvents.RosterItemChange | IMEvents.RosterPresenceUpdate |
IMEvents.RosterReceived | IMEvents.SubscriptionRequest;
/**
* VoxImplant SDK Configuration
*/
interface Config {
/**
* XSS protection for inbound instant messages that can contain HTML content
*/
imXSSprotection?: boolean;
/**
* If set to true microphone access dialog will be shown and all functions will become available only after user allowed access
*/
micRequired?: boolean;
/**
* Automatically plays progress tone by means of SDK according to specified progressToneCountry
*/
progressTone?: boolean;
/**
* Country code for progress tone generated automatically if progressTone set to true
*/
progressToneCountry?: string;
/**
* Show debug info in console
*/
showDebugInfo?: boolean;
/**
* Show Flash Settings panel instead of standard Allow/Deny dialog (in Flash mode)
*/
showFlashSettings?: boolean;
/**
* Id of HTMLElement that will be used as container for Flash component of SDK (Mic/cam access dialog will appear in the container). If micRequired set to true element should have size not less than 215x138 (px) for access dialog to be shown
*/
swfContainer?: string;
/**
* Force VoxImplant to use Flash (WebRTC is used if available by default)
*/
useFlashOnly?: boolean;
/**
* Force VoxImplant to use WebRTC (WebRTC is used if available by default). Error will be thrown if WebRTC in unavailable
*/
useRTCOnly?: boolean;
/**
* Default constraints that will be applied while the next attachRecordingDevice function call or if micRequired set to true
*/
videoConstraints?: VideoSettings;
/**
* Video support
*/
videoSupport?: boolean;
}
/**
* VoxImplant login options
*/
interface LoginOptions {
/**
* If set to false Web SDK can be used only for ACD status management
*/
receiveCalls?: boolean;
/**
* If set to true user presence will be changed automatically while a call
*/
serverPresenceControl?: boolean;
}
/**
* Audio recording device info
*/
interface AudioSourceInfo {
/**
* Device id that can be used to choose audio recording device
*/
id: number | string;
/**
* Device name , in WebRTC mode populated with real data only when app has been opened using HTTPS protocol
*/
name: string;
}
/**
* Video recording device info
*/
interface VideoSourceInfo {
/**
* Device id that can be used to choose video recording device
*/
id: number | string;
/**
* Device name , in WebRTC mode populated with real data only when app has been opened using HTTPS protocol
*/
name: string;
}
enum ChatStateType {
/**
* User is actively participating in the chat session
*/
Active,
/**
* User is composing a message
*/
Composing,
/**
* User has effectively ended their participation in the chat session
*/
Gone,
/**
* User has not been actively participating in the chat session
*/
Inactive,
/**
* Invalid type
*/
Invalid,
/**
* User had been composing but now has stopped
*/
Paused
}
enum IMErrorType {
RemoteFunctionError,
Error,
RosterError
}
enum MessageEventType {
/**
* Cancels the 'Composing' event
*/
Cancel,
/**
* Indicates that a reply is being composed
*/
Composing,
/**
* Indicates that the message has been delivered to the recipient
*/
Delivered,
/**
* Indicates that the message has been displayed
*/
Displayed,
/**
* Invalid type
*/
Invalid,
/**
* Indicates that the message has been stored offline by the intended recipient's server
*/
Offline
}
enum OperatorACDStatuses {
AfterService,
DND,
InService,
Offline,
Online,
Ready,
Timeout
}
enum RosterItemEvent {
/**
* Roster item added
*/
Added,
/**
* Roster item removed
*/
Removed,
/**
* User subscribed on your status updates (authorized the request)
*/
Subscribed,
/**
* User unsubscribed from your status updates (didn't authorize the request)
*/
Unsubscribed,
/**
* Roster item updated
*/
Updated
}
enum SubscriptionRequestType {
/**
* User is asking for permission to add you into his roster
*/
Subscribe,
/**
* User removed you from his roster
*/
Unsubscribe
}
enum UserStatuses {
/**
* User is away
*/
Away,
/**
* User is available for chat
*/
Chat,
/**
* User is in DND state (Do Not Disturbed)
*/
DND,
/**
* User is offline
*/
Offline,
/**
* User is online
*/
Online,
/**
* User is in XA state (eXtended Away)
*/
XA
}
/**
* Client class used to control platform functions. Can't be instantiatied directly (singleton), please use VoxImplant.getInstance to get the class instance
*/
interface Client {
/**
* Register handler for specified event
*
* @param eventName Event name
* @param eventHandler Handler function. A single parameter is passed - object with the event information
*/
addEventListener(eventName: VoxImplant.Events | VoxImplant.IMEvents, eventHandler: (eventObject: VoxImplantEvent | VoxImplantIMEvent) => any): void;
/**
* Add roster item (IM)
*
* @param user_id User id
* @param name Display name
* @param group User group
*/
addRosterItem(user_id: string, name: string, group?: string): void;
/**
* Add roster item group (IM)
*
* @param user_id User id
* @param group Group name
*/
addRosterItemGroup(user_id: string, group: string): void;
/**
* Enable microphone/camera if micRequired in VoxImplant.Config was set to false (WebRTC mode only)
*
* @param successCallback A function called in case of successful audio recording device change
* @param failedCallback A function called in case of problems while changing audio recording device
*/
attachRecordingDevice(successCallback?: () => any, failedCallback?: () => any): void;
/**
* Get a list of all currently available audio sources / microphones
*/
audioSources(): AudioSourceInfo[];
/**
* Create call
*
* @param number The number to call
* @param useVideo Tells if video should be supported for the call
* @param customData Custom string associated with the call session. It can be later obtained from Call History using HTTP API
* @param extraHeaders Optional custom parameters (SIP headers) that should be passed with call (INVITE) message. Parameter names must start with "X-" to be processed by application. IMPORTANT: Headers size limit is 200 bytes
*/
call(number: string, useVideo?: boolean, customData?: string, extraHeaders?: Object): Call;
/**
* Get current config
*/
config(): Config;
/**
* Connect to VoxImplant Cloud
*/
connect(): void;
/**
* Check if connected to VoxImplant Cloud
*/
connected(): boolean;
/**
* Disable microphone/camera if micRequired in VoxImplant.Config was set to false (WebRTC mode only)
*/
detachRecordingDevice(): void;
/**
* Disconnect from VoxImplant Cloud
*/
disconnect(): void;
/**
* Initialize SDK. SDKReady event will be dispatched after succesful SDK initialization. SDK can't be used until it's initialized
*
* @param config Client configuration options
*/
init(config?: Config): void;
/**
* Check if WebRTC support is available
*/
isRTCsupported(): boolean;
/**
* Login into application
*
* @param username
* @param password
* @param options Login options
*/
login(username: string, password: string, options?: LoginOptions): void;
/**
* Login into application using 'code' auth method
*
* @param username
* @param code
* @param options Login options
*/
loginWithCode(username: string, code: string, options?: LoginOptions): void;
/**
* Login into application using 'onetimekey' auth method
*
* @param username
* @param hash
* @param options Login options
*/
loginWithOneTimeKey(username: string, hash: string, options?: LoginOptions): void;
/**
* Move roster item group (IM)
*
* @param user_id User id
* @param groupSrc Group name (source)
* @param groupDst Group name (destination)
*/
moveRosterItemGroup(user_id: string, groupSrc: string, groupDst: string): void;
/**
* Play ToneScript using WebAudio API
*
* @param script Tonescript string
* @param loop Loop playback if true
*/
playToneScript(script: string, loop?: boolean): void;
/**
* Remove handler for specified event
*
* @param eventName Event name
* @param eventHandler Handler function
*/
removeEventListener(eventName: VoxImplant.Events | VoxImplant.IMEvents, eventHandler: () => any): void;
/**
* Remove roster item (IM)
*
* @param user_id User id
*/
removeRosterItem(user_id: string): void;
/**
* Remove roster item group (IM)
*
* @param user_id User id
* @param group Group name
*/
remoteRosterItemGroup(user_id: string, group: string): void;
/**
* Rename roster item (IM)
*
* @param user_id User id
* @param name New display name
*/
renameRosterItem(user_id: string, name: string): void;
/**
* Request a key for 'onetimekey' auth method. Server will send the key in AuthResult event with code 302
*
* @param username
*/
requestOneTimeLoginKey(username: string): void;
/**
* Send message to user (IM)
*
* @param user_id User id
* @param content Message content
*/
sendInstantMessage(user_id: string, content: string): string;
/**
* Start/stop sending local video to remote party/parties
*
* @param flag Start/stop - true/false
*/
sendVideo(flag: boolean): void;
/**
* Set active call
*
* @param call VoxImplant call instance
* @param active If true make call active, otherwise make call inactive
*/
setCallActive(call: Call, active: boolean): void;
/**
* Set chat session state info
*
* @param user_id User id
* @param status Chat session status. See VoxImplant.ChatStateType enum
*/
setChatState(user_id: string, status: ChatStateType): void;
/**
* Set local video position
*
* @param x Horizontal position (px)
* @param y Vertical position (px)
*/
setLocalVideoPosition(x: number, y: number): void;
/**
* Set local video size
*
* @param width Width in pixels
* @param height Height in pixels
*/
setLocalVideoSize(width: number, height: number): void;
/**
* Set local video size
*
* @param user_id User id
* @param type Message event type: VoxImplant.MessageEventType.Delivered or VoxImplant.MessageEventType.Displayed. See VoxImplant.MessageEventType enum
* @param message_id Message id(s)
*/
setMessageStatus(user_id: string, type: MessageEventType, message_id: string[]): void;
/**
* Set ACD status
*
* @param status Presence status string, see VoxImplant.OperatorACDStatuses
*/
setOperatorACDStatus(status: OperatorACDStatuses): void;
/**
* Set presence
*
* @param status Presence status from VoxImplant.UserStatuses
* @param msg Presence text message
*/
setPresenceStatus(status: UserStatuses, msg: string): void;
/**
* Set background color of flash app (only for Flash mode)
*
* @param color Color in web format (i.e. #000000 for black)
*/
setSwfColor(color: string): void;
/**
* Set bandwidth limit for video calls. Currently supported by Chrome/Chromium. The limit will be applied for the next call. (WebRTC mode only)
*
* @param bandwidth Bandwidth limit in kilobits per second (kbps)
*/
setVideoBandwidth(bandwidth: number): void;
/**
* Set video settings globally. This settings will be used for the next call.
*
* @param settings Video settings
* @param successCallback Success callback function
* @param failedCallback Failed callback function
*/
setVideoSettings(settings: VideoSettings | FlashVideoSettings, successCallback?: () => any, failedCallback?: () => any): void;
/**
* Show flash settings panel
*
* @param panel Settings type - default/microphone/camera/etc as described in SecurityPanel class
*/
showFlashSettingsPanel(panel?: string): void;
/**
* Show/hide local video
*
* @param flag Show/hide - true/false
*/
showLocalVideo(flag: boolean): void;
/**
* Stop playing ToneScript using WebAudio API
*/
stopPlayback(): void;
/**
* Transfer call, depending on the result VoxImplant.CallEvents.TransferComplete or VoxImplant.CallEvents.TransferFailed event will be dispatched
*
* @param call1 Call which will be transferred
* @param call2 Call where call1 will be transferred
*/
transferCall(call1: Call, call2: Call): void;
/**
* Use specified audio source , use audioSources to get the list of available audio sources
*
* @param id Id of the audio source
* @param successCallback Called in WebRTC mode if audio source changed successfully
* @param failedCallback Called in WebRTC mode if audio source couldn't be changed successfully
*/
useAudioSource(id: number | string, successCallback?: () => any, failedCallback?: () => any): void;
/**
* Use specified audio source , use audioSources to get the list of available audio sources
*
* @param id Id of the video source
* @param successCallback Called in WebRTC mode if video source changed successfully
* @param failedCallback Called in WebRTC mode if video source couldn't be changed successfully
*/
useVideoSource(id: number | string, successCallback?: () => any, failedCallback?: () => any): void;
/**
* Get a list of all currently available video sources / cameras
*/
videoSources(): VideoSourceInfo[];
}
interface Call {
/**
* Returns information about the call's media state (active/inactive)
*/
active(): boolean;
/**
* Register handler for specified event
*
* @param eventName Event name
* @param eventHandler Handler function. A single parameter is passed - object with the event information
*/
addEventListener(eventName: VoxImplant.CallEvents, eventHandler: (eventObject: VoxImplantCallEvent) => any): void;
/**
* Answer on incoming call
*
* @param customData Set custom string associated with call session. It can be later obtained from Call History using HTTP API
* @param extraHeaders Optional custom parameters (SIP headers) that should be sent after accepting incoming call. Parameter names must start with "X-" to be processed by application
*/
answer(customData?: string, extraHeaders?: Object): void;
/**
* Reject incoming call