-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
3569 lines (3066 loc) · 93.9 KB
/
types.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
export type Meta = {
/**
* Pagination object
* @example { "total_pages": 1, "total_results": 1, "page_number": 1, "page_size": 20 }
*/
/**
* Total number of pages
* @example 1
*/
total_pages: number;
/**
* Total number of results
* @example 1
*/
total_results: number;
/**
* Current page number
* @example 1
*/
page_number: number;
/**
* Number of results per page
* @example 20
*/
page_size: number;
};
export type UnexpectedError = {
/**
* Error code
* @example 10007
*/
code: string;
/**
* Error title
* @example "Unexpected error"
*/
title: string;
/**
* Error detail
* @example "An unexpected error occurred."
*/
detail: string;
/**
* Meta object containing additional information
*/
meta: {
/**
* URL containing more information about the error
*/
url: string;
};
};
export type CommandResult = {
result: "ok";
};
export type DialogflowConfig = {
/**
* Enables sentiment analysis for Dialogflow.
* @default false
* @example true
*/
analyze_sentiment?: boolean;
/**
* Enables partial automated agent replies for Dialogflow.
* @default false
* @example true
*/
partial_automated_agent_reply?: boolean;
};
export type AnsweringMachineDetectionConfig = {
/**
* Maximum timeout threshold for overall detection.
* @default 3500
* @example 5000
*/
total_analysis_time_millis?: number;
/**
* Silence duration threshold after a greeting message or voice for it be considered human.
* @default 800
* @example 1000
*/
after_greeting_silence_millis?: number;
/**
* Maximum threshold for silence between words.
* @default 50
* @example 100
*/
between_words_silence_millis?: number;
/**
* Maximum threshold of a human greeting. If greeting longer than this value, considered machine.
* @default 3500
* @example 1500
*/
greeting_duration_millis?: number;
/**
* If initial silence duration is greater than this value, consider it a machine.
* @default 3500
* @example 1800
*/
initial_silence_millis?: number;
/**
* If number of detected words is greater than this value, consder it a machine.
* @default 5
* @example 3
*/
maximum_number_of_words?: number;
/**
* If a single word lasts longer than this threshold, consider it a machine.
* @default 3500
* @example 2000
*/
maximum_word_length_millis?: number;
/**
* Minimum noise threshold for any analysis.
* @default 256
* @example 512
*/
silence_threshold?: number;
/**
* If machine already detected, maximum timeout threshold to determine the end of the machine greeting.
* @default 5000
* @example 7500
*/
greeting_total_analysis_time_millis?: number;
/**
* If machine already detected, maximum threshold for silence between words. If exceeded, the greeting is considered ended.
* @default 1500
* @example 2000
*/
greeting_silence_duration_millis?: number;
};
export type DialRequest = {
/**
* The DID or SIP URI to dial out to. Multiple DID or SIP URIs can be provided using an array of strings
* @example "+18005550100 or sip:[email protected]"
* @example ["+18005550100", "sip:[email protected]"]
*/
to: string | string[];
/**
* The `from` number to be used as the caller id presented to the destination (`to` number). The number should be in +E164 format.
* @example "+18005550101"
*/
from: string;
/**
* The `from_display_name` string to be used as the caller id name (SIP From Display Name) presented to the destination (`to` number). The string should have a maximum of 128 characters, containing only letters, numbers, spaces, and -_~!.+ special characters. If ommited, the display name will be the same as the number in the `from` field.
* @example "Company Name"
*/
from_display_name?: string;
/**
* The ID of the Call Control App (formerly ID of the connection) to be used when dialing the destination.
*/
connection_id: string;
/**
* The URL of a file to be played back to the callee when the call is answered. The URL can point to either a WAV or MP3 file. media_name and audio_url cannot be used together in one request.
* @example "http://example.com/message.wav"
*/
audio_url?: string;
/**
* The media_name of a file to be played back to the callee when the call is answered. The media_name must point to a file previously uploaded to api.voxo.com/v2/media by the same user/organization. The file must either be a WAV or MP3 file.
* @example "my_media_uploaded_to_media_storage_api"
*/
media_name?: string;
/**
* The list of comma-separated codecs in a preferred order for the forked media to be received.
* @example "G722,PCMU,PCMA,G729,OPUS,VP8,H264"
*/
preferred_codecs?: string;
/**
* The number of seconds that VOXO will wait for the call to be answered by the destination to which it is being called. If the timeout is reached before an answer is received, the call will hangup and a `call.hangup` webhook with a `hangup_cause` of `timeout` will be sent. Minimum value is 5 seconds. Maximum value is 120 seconds.
* @default 30
* @example 60
*/
timeout_secs?: number;
/**
* Sets the maximum duration of a Call Control Leg in seconds. If the time limit is reached, the call will hangup and a `call.hangup` webhook with a `hangup_cause` of `time_limit` will be sent. For example, by setting a time limit of 120 seconds, a Call Leg will be automatically terminated two minutes after being answered. The default time limit is 14400 seconds or 4 hours and this is also the maximum allowed call length.
* @default 14400
* @example 600
*/
time_limit_secs?: number;
/**
* Enables Answering Machine Detection. VOXO offers Premium and Standard detections. With Premium detection, when a call is answered, VOXO runs real-time detection and sends a `call.machine.premium.detection.ended` webhook with one of the following results: `human_residence`, `human_business`, `machine`, `silence` or `fax_detected`. If we detect a beep, we also send a `call.machine.premium.greeting.ended` webhook with the result of `beep_detected`. If we detect a beep before `call.machine.premium.detection.ended` we only send `call.machine.premium.greeting.ended`, and if we detect a beep after `call.machine.premium.detection.ended`, we send both webhooks. With Standard detection, when a call is answered, VOXO runs real-time detection to determine if it was picked up by a human or a machine and sends an `call.machine.detection.ended` webhook with the analysis result. If `greeting_end` or `detect_words` is used and a `machine` is detected, you will receive another `call.machine.greeting.ended` webhook when the answering machine greeting ends with a beep or silence. If `detect_beep` is used, you will only receive `call.machine.greeting.ended` if a beep is detected.
* @default "disabled"
*/
answering_machine_detection?:
| "premium"
| "detect"
| "detect_beep"
| "detect_words"
| "greeting_end"
| "disabled";
/**
* Optional configuration parameters to modify 'answering_machine_detection' performance.
*/
answering_machine_detection_config?: AnsweringMachineDetectionConfig;
/**
* Custom headers to be added to the SIP INVITE.
* @example [
* {
* "name": "head_1",
* "value": "val_1"
* },
* {
* "name": "head_2",
* "value": "val_2"
* }
* ]
*/
custom_headers?: Array<{
name: string;
value: string;
}>;
/**
* Use this field to set the Billing Group ID for the call. Must be a valid and existing Billing Group ID.
* @example "f5586561-8ff0-4291-a0ac-84fe544797bd"
*/
billing_group_id?: string;
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
* @example "aGF2ZSBhIG5pY2UgZGF5ID1d"
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore others Dial commands with the same `command_id`.
* @example "891510ac-f3e4-11e8-af5b-de00688a4901"
*/
command_id?: string;
/**
* Use another call's control id for sharing the same call session id
* @example "ilditnZK_eVysupV21KzmzN_sM29ygfauQojpm4BgFtfX5hXAcjotg=="
*/
link_to?: string;
/**
* SIP Authentication username used for SIP challenges.
*/
sip_auth_username?: string;
/**
* SIP Authentication password used for SIP challenges.
*/
sip_auth_password?: string;
/**
* SIP headers to be added to the SIP INVITE request. Currently only User-to-User header is supported.
* @example [
* {
* "name": "User-to-User",
* "value": "12345"
* }
* ]
*/
sip_headers?: Array<{
name: string;
value: string;
}>;
/**
* Sound modifications object
*/
sound_modifications?: SoundModifications;
/**
* The destination WebSocket address where the stream is going to be delivered.
* @example "wss://www.example.com/websocket"
*/
stream_url?: string;
/**
* Specifies which track should be streamed.
* @default "inbound_track"
* @example "both_tracks"
*/
stream_track?: "inbound_track" | "outbound_track" | "both_tracks";
/**
* Generate silence RTP packets when no transmission available.
* @default false
* @example true
*/
send_silence_when_idle?: boolean;
/**
* Use this field to override the URL for which VOXO will send subsequent webhooks to for this call.
* @example "https://www.example.com/server-b/"
*/
webhook_url?: string;
/**
* HTTP request export type used for `webhook_url`.
* @default "POST"
* @example "GET"
*/
webhook_url_method?: "POST" | "GET";
/**
* Start recording automatically after an event. Disabled by default.
* @example "record-from-answer"
*/
record?: "record-from-answer";
/**
* Defines which channel should be recorded ('single' or 'dual') when `record` is specified.
* @default "dual"
* @example "single"
*/
record_channels?: "single" | "dual";
/**
* Defines the format of the recording ('wav' or 'mp3') when `record` is specified.
* @default "mp3"
* example "wav"
*/
record_format?: "wav" | "mp3";
/**
* Defines the maximum length for the recording in seconds when `record` is specified. The minimum value is 0. The maximum value is 43200. The default value is 0 (infinite).
* @default 0
* @example 1000
*/
record_max_length?: number;
/**
* The number of seconds that VOXO will wait for the recording to be stopped if silence is detected when `record` is specified. The timer only starts when the speech is detected. The minimum value is 0. The default value is 0 (infinite).
* @default 0
* @example 100
*/
record_timeout_secs?: number;
/**
* Enables Dialogflow for the current call. The default value is false.
* @default false
* @example true
*/
enable_dialogflow?: boolean;
/**
* Dialogflow configuration object
*/
dialogflow_config?: DialogflowConfig;
};
export interface DialResponse extends Call {
/**
* Indicates whether the call is alive or not. For Dial command it will always be `false` (dialing is asynchronous).
* @example true
*/
is_alive: boolean;
}
export type CustomSipHeader = {
name: string;
value: string;
};
export type SipHeader = {
name: string;
value: string;
};
export type SoundModifications = {
/**
* Set the pitch directly, value should be > 0, default 1 (lower = lower tone)
*/
pitch?: number;
/**
* Adjust the pitch in semitones, values should be between -14 and 14, default 0
*/
semitone?: number;
/**
* Adjust the pitch in octaves, values should be between -1 and 1, default 0
*/
octaves?: number;
/**
* The track to which the sound modifications will be applied. Accepted values are `inbound` or `outbound`
*/
track?: string;
};
export type AnswerRequest = {
/**
* Use this field to set the Billing Group ID for the call. Must be a valid and existing Billing Group ID.
* @example "f5586561-8ff0-4291-a0ac-84fe544797bd"
*/
billing_group_id?: string;
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
* @example "aGF2ZSBhIG5pY2UgZGF5ID1d"
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same `command_id` for the same `call_control_id`.
* @example "891510ac-f3e4-11e8-af5b-de00688a4901"
*/
command_id?: string;
/**
* Custom headers to be added to the SIP INVITE response.
* @example [ { name: "head_1", value: "val_1" }, { name: "head_2", value: "val_2" }]
*/
custom_headers?: CustomSipHeader[];
/**
* SIP headers to be added to the SIP INVITE response. Currently only User-to-User header is supported.
* @example [ { name: "User-to-User", value: "value" }]
*/
sip_headers?: SipHeader[];
/**
* Sound modifications for the answer request.
*/
sound_modifications?: SoundModifications;
/**
* The destination WebSocket address where the stream is going to be delivered.
* @example "wss://www.example.com/websocket"
*/
stream_url?: string;
/**
* Specifies which track should be streamed.
* @default "inbound_track"
* @example "both_tracks"
*/
stream_track?: "inbound_track" | "outbound_track" | "both_tracks";
/**
* Generate silence RTP packets when no transmission available.
* @default false
* @example true
*/
send_silence_when_idle?: boolean;
/**
* Use this field to override the URL for which VOXO will send subsequent webhooks to for this call.
* @example "https://www.example.com/server-b/"
*/
webhook_url?: string;
/**
* HTTP request export type used for `webhook_url`.
* @default "POST"
* @example "GET"
*/
webhook_url_method?: "POST" | "GET";
};
export type CommandResponse = {
result: "ok";
};
export type BridgeRequest = {
/**
* The Call Control ID of the call you want to bridge with.
*/
call_control_id: string;
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same `command_id` for the same `call_control_id`.
*/
command_id?: string;
/**
* Specifies behavior after the bridge ends (i.e. the opposite leg either hangs up or is transferred). If supplied with the value self, the current leg will be parked after unbridge. If not set, the default behavior is to hang up the leg.
*/
park_after_unbridge?: string;
/**
* The name of the queue you want to bridge with, can't be used together with call_control_id parameter. Bridging with a queue means bridging with the first call in the queue. The call will always be removed from the queue regardless of whether bridging succeeds. Returns an error when the queue is empty.
*/
queue?: string;
};
export type EnqueueRequest = {
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
/**
* The maximum number of calls allowed in the queue at a given time. Can't be modified for an existing queue.
* @default 100
*/
max_size?: number;
/**
* The number of seconds after which the call will be removed from the queue.
*/
max_wait_time_secs?: number;
/**
* The name of the queue the call should be put in. If a queue with a given name doesn't exist yet it will be created.
*/
queue_name: string;
};
export type ForkingStartRequest = {
/**
* A valid Base-64 encoded string to add state to every subsequent webhook.
* @example "c2FtcGxlIHN0YXRl"
*/
client_state?: string;
/**
* A unique identifier to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
* @example "unique-command-id"
*/
command_id?: string;
/**
* The network target, udp:ip_address:port, where the call's incoming RTP media packets should be forwarded.
* @example "udp:192.168.1.1:1234"
*/
rx: string;
/**
* Optionally specify a media export type to stream. If decrypted selected, VOXO will decrypt incoming SIP media before forking to the target.
* rx and tx are required fields if decrypted selected.
* @default "raw"
* @enum "raw" "decrypted"
* @example "raw"
*/
stream_type?: "raw" | "decrypted";
/**
* The network target, udp:ip_address:port, where the call's RTP media packets should be forwarded.
* Both incoming and outgoing media packets will be delivered to the specified target, and information about the stream will be included in the encapsulation protocol header, including the direction (0 = inbound; 1 = outbound), leg (0 = A-leg; 1 = B-leg), and call_leg_id.
* @example "udp:192.168.1.1:2345"
*/
target: string;
/**
* The network target, udp:ip_address:port, where the call's outgoing RTP media packets should be forwarded.
* @example "udp:192.168.1.1:3456"
*/
tx: string;
};
export type ForkingStopRequest = {
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
/**
* Optionally specify a stream_type. This should match the stream_export type that was used in fork_start command to properly stop the fork.
* @default "raw"
* @enum "raw" | "decrypted"
*/
stream_type?: "raw" | "decrypted";
};
export type GatherRequest = {
/**
* A Base-64 encoded string to add state to every subsequent webhook.
*/
client_state?: string;
/**
* A unique identifier for the command to avoid duplicate commands.
* VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
/**
* The number of milliseconds to wait for the first DTMF.
* @default 5000
*/
initial_timeout_millis?: number;
/**
* The number of milliseconds to wait for input between digits.
* @default 5000
*/
inter_digit_timeout_millis?: number;
/**
* The maximum number of digits to fetch.
* This parameter has a maximum value of 128.
* @default 128
*/
maximum_digits?: number;
/**
* The minimum number of digits to fetch.
* This parameter has a minimum value of 1.
* @default 1
*/
minimum_digits?: number;
/**
* The digit used to terminate input if fewer than maximum_digits digits have been gathered.
* @default "#"
*/
terminating_digit?: string;
/**
* The number of milliseconds to wait to complete the request.
* @default 60000
*/
timeout_millis?: number;
/**
* A list of all digits accepted as valid.
* @default "0123456789#*"
*/
valid_digits?: string;
};
export type GatherStopRequest = {
/**
* A valid Base-64 encoded string used to add state to every subsequent webhook.
* @example "U3RhdGUgRXhhbXBsZQ=="
*/
client_state?: string;
/**
* A unique identifier to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
* @example "cmd_12345"
*/
command_id?: string;
};
export type GatherUsingAudioRequest = {
/**
* The URL of a file to be played back at the beginning of each prompt. The URL can point to either a WAV or MP3 file. media_name and audio_url cannot be used together in one request.
*/
audio_url?: string;
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
/**
* The number of milliseconds to wait for input between digits.
* @default 5000
*/
inter_digit_timeout_millis?: number;
/**
* The URL of a file to play when digits don't match the valid_digits parameter or the number of digits is not between min and max. The URL can point to either a WAV or MP3 file. invalid_media_name and invalid_audio_url cannot be used together in one request.
*/
invalid_audio_url?: string;
/**
* The media_name of a file to be played back when digits don't match the valid_digits parameter or the number of digits is not between min and max. The media_name must point to a file previously uploaded to api.VOXO.com/v2/media by the same user/organization. The file must either be a WAV or MP3 file.
*/
invalid_media_name?: string;
/**
* The maximum number of digits to fetch. This parameter has a maximum value of 128.
* @default 128
*/
maximum_digits?: number;
/**
* The maximum number of times the file should be played if there is no input from the user on the call.
* @default 3
*/
maximum_tries?: number;
/**
* The media_name of a file to be played back at the beginning of each prompt. The media_name must point to a file previously uploaded to api.VOXO.com/v2/media by the same user/organization. The file must either be a WAV or MP3 file.
*/
media_name?: string;
/**
* The minimum number of digits to fetch. This parameter has a minimum value of 1.
* @default 1
*/
minimum_digits?: number;
/**
* The digit used to terminate input if fewer than maximum_digits digits have been gathered.
* @default "#"
*/
terminating_digit?: string;
/**
* The number of milliseconds to wait for a DTMF response after file playback ends before a replaying the sound file.
* @default 60000
*/
timeout_millis?: number;
/**
* A list of all digits accepted as valid.
* @default "0123456789#*"
*/
valid_digits?: string;
};
export type GatherUsingSpeakRequest = {
/**
* A valid Base-64 encoded string to add state to every subsequent webhook.
*/
client_state?: string;
/**
* A string to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
/**
* @default 5000
* The number of milliseconds to wait for input between digits.
*/
inter_digit_timeout_millis?: number;
/**
* The text or SSML to be converted into speech when digits don't match the valid_digits parameter or the number of digits is not between min and max. There is a 3,000 character limit.
*/
invalid_payload?: string;
/**
* @required
* @enum "arb" "cmn-CN" "cy-GB" "da-DK" "de-DE" "en-AU" "en-GB" "en-GB-WLS" "en-IN" "en-US" "es-ES" "es-MX" "es-US" "fr-CA" "fr-FR" "hi-IN" "is-IS" "it-IT" "ja-JP" "ko-KR" "nb-NO" "nl-NL" "pl-PL" "pt-BR" "pt-PT" "ro-RO" "ru-RU" "sv-SE" "tr-TR"
* The language you want spoken.
*/
language: string;
/**
* @default 128
* The maximum number of digits to fetch. This parameter has a maximum value of 128.
*/
maximum_digits?: number;
/**
* @default 3
* The maximum number of times that a file should be played back if there is no input from the user on the call.
*/
maximum_tries?: number;
/**
* @default 1
* The minimum number of digits to fetch. This parameter has a minimum value of 1.
*/
minimum_digits?: number;
/**
* @required
* The text or SSML to be converted into speech. There is a 3,000 character limit.
*/
payload: string;
/**
* @default "text"
* @enum "text" "ssml"
* The export type of the provided payload. The payload can either be plain text, or Speech Synthesis Markup Language (SSML).
*/
payload_type?: string;
/**
* @default "premium"
* @enum "basic" "premium"
* This parameter impacts speech quality, language options and payload types. When using basic, only the en-US language and payload export type text are allowed.
*/
service_level?: string;
/**
* @default "#"
* The digit used to terminate input if fewer than maximum_digits digits have been gathered.
*/
terminating_digit?: string;
/**
* @default 60000
* The number of milliseconds to wait for a DTMF response after speak ends before a replaying the sound file.
*/
timeout_millis?: number;
/**
* @default "0123456789#*"
* A list of all digits accepted as valid.
*/
valid_digits?: string;
/**
* @required
* @enum "male" "female"
* The gender of the voice used to speak back the text.
*/
voice: string;
};
export type HangupRequest = {
/**
* Use this field to add state to every subsequent webhook.
* It must be a valid Base-64 encoded string.
* @example "Y2xpZW50X3N0YXRlX2V4YW1wbGU="
*/
client_state: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any
* command with the same command_id for the same call_control_id.
* @example "command-1234"
*/
command_id: string;
};
export type RemoveFromQueueRequest = {
/**
* The unique identifier for the call.
*/
call_control_id: string;
/**
* Removes the call from the queue, the call currently is enqueued in.
* @default ""
*/
client_state?: string;
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
* @example "c2FtcGxlX3N0YXRl"
*/
command_id?: string;
};
export type PlayAudioRequest = {
/**
* The URL of a file to be played back on the call. The URL can point to either a WAV or MP3 file.
* media_name and audio_url cannot be used together in one request.
* @example "https://example.com/audio-file.mp3"
*/
audio_url?: string;
/**
* Caches the audio file. Useful when playing the same audio file multiple times during the call.
* @default true
*/
cache_audio?: boolean;
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
* @example "client_state_example"
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
* @example "command_id_example"
*/
command_id?: string;
/**
* Specifies the number of times the audio file should be played.
* @example 3
*/
loop?: string | number;
/**
* The media_name of a file to be played back on the call. The media_name must point to a file previously uploaded to api.VOXO.com/v2/media by the same user/organization.
* The file must either be a WAV or MP3 file.
* @example "media_name_example"
*/
media_name?: string;
/**
* When enabled, audio will be mixed on top of any other audio that is actively being played back.
* Note that overlay: true will only work if there is another audio file already being played on the call.
* @default false
*/
overlay?: boolean;
/**
* Allows a user to provide base64 encoded mp3.
* Note: when using this parameter, media_url and media_name in the playback_started and playback_ended webhooks will be empty.
* @example "base64_encoded_mp3"
*/
playback_content?: string;
/**
* When specified, it stops the current audio being played.
* @enum "current" - Stop the current audio being played, and play the next file in the queue.
* @enum "all" - Stop the current audio file being played and clear all audio files from the queue.
* @example "current"
*/
stop?: "current" | "all";
/**
* Specifies the leg or legs on which audio will be played.
* @default "self"
* @enum "self" - Play audio on the current leg.
* @enum "opposite" - Play audio on the opposite leg.
* @enum "both" - Play audio on both legs.
* @example "self"
*/
target_legs?: "self" | "opposite" | "both";
};
export type StopAudioRequest = {
/**
* Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.
*/
client_state?: string;
/**
* Use this field to avoid duplicate commands. VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
/**
* When enabled, it stops the audio being played in the overlay queue.
* @default false
*/
overlay?: boolean;
/**
* Use current to stop the current audio being played. Use all to stop the current audio file being played and clear all audio files from the queue.
* @default "all"
* @enum "current" | "all"
*/
stop?: "current" | "all";
};
export type PauseRecordingRequest = {
/**
* client_state is used to add state to every subsequent webhook.
* It must be a valid Base-64 encoded string.
*/
client_state?: string;
/**
* command_id is used to avoid duplicate commands.
* VOXO will ignore any command with the same command_id for the same call_control_id.
*/
command_id?: string;
};
export type ResumeRecordingRequest = {
/**
* @description The client state that should be added to every subsequent webhook.
* @example "c2FtcGxlX3N0YXRl"
*/
client_state?: string;
/**
* @description The command ID used to avoid duplicate commands.
* @example "command_123"
*/