telnyx 6.36.0 → 6.37.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.
@@ -51,11 +51,7 @@ export declare class Calls extends APIResource {
51
51
  * ```ts
52
52
  * const response = await client.texml.accounts.calls.calls(
53
53
  * 'account_sid',
54
- * {
55
- * ApplicationSid: 'example-app-sid',
56
- * From: '+13120001234',
57
- * To: '+13121230000',
58
- * },
54
+ * { Url: 'https://www.example.com/instructions.xml' },
59
55
  * );
60
56
  * ```
61
57
  */
@@ -514,214 +510,623 @@ export interface CallUpdateParams {
514
510
  */
515
511
  Url?: string;
516
512
  }
517
- export interface CallCallsParams {
518
- /**
519
- * The ID of the TeXML Application.
520
- */
521
- ApplicationSid: string;
522
- /**
523
- * The phone number of the party that initiated the call. Phone numbers are
524
- * formatted with a `+` and country code.
525
- */
526
- From: string;
527
- /**
528
- * The phone number of the called party. Phone numbers are formatted with a `+` and
529
- * country code.
530
- */
531
- To: string;
532
- /**
533
- * Select whether to perform answering machine detection in the background. By
534
- * default execution is blocked until Answering Machine Detection is completed.
535
- */
536
- AsyncAmd?: boolean;
537
- /**
538
- * URL destination for Telnyx to send AMD callback events to for the call.
539
- */
540
- AsyncAmdStatusCallback?: string;
541
- /**
542
- * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
543
- * inherited from TeXML Application setting.
544
- */
545
- AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
546
- /**
547
- * To be used as the caller id name (SIP From Display Name) presented to the
548
- * destination (`To` number). The string should have a maximum of 128 characters,
549
- * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
550
- * ommited, the display name will be the same as the number in the `From` field.
551
- */
552
- CallerId?: string;
553
- /**
554
- * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
555
- * `true`.
556
- */
557
- CancelPlaybackOnDetectMessageEnd?: boolean;
558
- /**
559
- * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
560
- */
561
- CancelPlaybackOnMachineDetection?: boolean;
562
- /**
563
- * Custom HTTP headers to be sent with the call. Each header should be an object
564
- * with 'name' and 'value' properties.
565
- */
566
- CustomHeaders?: Array<CallCallsParams.CustomHeader>;
567
- /**
568
- * Allows you to chose between Premium and Standard detections.
569
- */
570
- DetectionMode?: 'Premium' | 'Regular';
571
- /**
572
- * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
573
- * `Url` is not responding.
574
- */
575
- FallbackUrl?: string;
576
- /**
577
- * Enables Answering Machine Detection.
578
- */
579
- MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
580
- /**
581
- * If initial silence duration is greater than this value, consider it a machine.
582
- * Ignored when `premium` detection is used.
583
- */
584
- MachineDetectionSilenceTimeout?: number;
585
- /**
586
- * Silence duration threshold after a greeting message or voice for it be
587
- * considered human. Ignored when `premium` detection is used.
588
- */
589
- MachineDetectionSpeechEndThreshold?: number;
590
- /**
591
- * Maximum threshold of a human greeting. If greeting longer than this value,
592
- * considered machine. Ignored when `premium` detection is used.
593
- */
594
- MachineDetectionSpeechThreshold?: number;
595
- /**
596
- * Maximum timeout threshold in milliseconds for overall detection.
597
- */
598
- MachineDetectionTimeout?: number;
599
- /**
600
- * Defines whether media should be encrypted on the call. When set to `SRTP`, the
601
- * call will use Secure Real-time Transport Protocol for media encryption. When set
602
- * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
603
- * destinations.
604
- */
605
- MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
606
- /**
607
- * The list of comma-separated codecs to be offered on a call.
608
- */
609
- PreferredCodecs?: string;
610
- /**
611
- * Whether to record the entire participant's call leg. Defaults to `false`.
612
- */
613
- Record?: boolean;
614
- /**
615
- * The number of channels in the final recording. Defaults to `mono`.
616
- */
617
- RecordingChannels?: 'mono' | 'dual';
618
- /**
619
- * The URL the recording callbacks will be sent to.
620
- */
621
- RecordingStatusCallback?: string;
622
- /**
623
- * The changes to the recording's state that should generate a call to
624
- * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
625
- * Separate multiple values with a space. Defaults to `completed`.
626
- */
627
- RecordingStatusCallbackEvent?: string;
628
- /**
629
- * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
630
- */
631
- RecordingStatusCallbackMethod?: 'GET' | 'POST';
632
- /**
633
- * The number of seconds that Telnyx will wait for the recording to be stopped if
634
- * silence is detected. The timer only starts when the speech is detected. Please
635
- * note that the transcription is used to detect silence and the related charge
636
- * will be applied. The minimum value is 0. The default value is 0 (infinite)
637
- */
638
- RecordingTimeout?: number;
639
- /**
640
- * The audio track to record for the call. The default is `both`.
641
- */
642
- RecordingTrack?: 'inbound' | 'outbound' | 'both';
643
- /**
644
- * Whether to send RecordingUrl in webhooks.
645
- */
646
- SendRecordingUrl?: boolean;
647
- /**
648
- * The password to use for SIP authentication.
649
- */
650
- SipAuthPassword?: string;
651
- /**
652
- * The username to use for SIP authentication.
653
- */
654
- SipAuthUsername?: string;
655
- /**
656
- * Defines the SIP region to be used for the call.
657
- */
658
- SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
659
- /**
660
- * URL destination for Telnyx to send status callback events to for the call.
661
- */
662
- StatusCallback?: string;
663
- /**
664
- * The call events for which Telnyx should send a webhook. Multiple events can be
665
- * defined when separated by a space.
666
- */
667
- StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
668
- /**
669
- * HTTP request type used for `StatusCallback`.
670
- */
671
- StatusCallbackMethod?: 'GET' | 'POST';
672
- /**
673
- * The call control ID of the existing call to supervise. When provided, the
674
- * created leg will be added to the specified call in supervising mode. Status
675
- * callbacks and action callbacks will NOT be sent for the supervising leg.
676
- */
677
- SuperviseCallSid?: string;
678
- /**
679
- * The supervising role for the new leg. Determines the audio behavior: barge (hear
680
- * both sides), whisper (only hear supervisor), monitor (hear both sides but
681
- * supervisor muted). Default: barge
682
- */
683
- SupervisingRole?: 'barge' | 'whisper' | 'monitor';
684
- /**
685
- * TeXML to be used as instructions for the call. If provided, the call will
686
- * execute these instructions instead of fetching from the Url.
687
- */
688
- Texml?: string;
689
- /**
690
- * The maximum duration of the call in seconds. The minimum value is 30 and the
691
- * maximum value is 14400 (4 hours). Default is 14400 seconds.
692
- */
693
- TimeLimit?: number;
694
- /**
695
- * The number of seconds to wait for the called party to answer the call before the
696
- * call is canceled. The minimum value is 5 and the maximum value is 120. Default
697
- * is 30 seconds.
698
- */
699
- timeout_seconds?: number;
700
- /**
701
- * Whether to trim any leading and trailing silence from the recording. Defaults to
702
- * `trim-silence`.
703
- */
704
- Trim?: 'trim-silence' | 'do-not-trim';
705
- /**
706
- * The URL from which Telnyx will retrieve the TeXML call instructions.
707
- */
708
- Url?: string;
709
- /**
710
- * HTTP request type used for `Url`. The default value is inherited from TeXML
711
- * Application setting.
712
- */
713
- UrlMethod?: 'GET' | 'POST';
714
- }
513
+ export type CallCallsParams = CallCallsParams.WithURL | CallCallsParams.WithTeXml | CallCallsParams.ApplicationDefault;
715
514
  export declare namespace CallCallsParams {
716
- interface CustomHeader {
515
+ interface WithURL {
516
+ /**
517
+ * The URL from which Telnyx will retrieve the TeXML call instructions.
518
+ */
519
+ Url: string;
520
+ /**
521
+ * The ID of the TeXML Application.
522
+ */
523
+ ApplicationSid?: string;
524
+ /**
525
+ * Select whether to perform answering machine detection in the background. By
526
+ * default execution is blocked until Answering Machine Detection is completed.
527
+ */
528
+ AsyncAmd?: boolean;
529
+ /**
530
+ * URL destination for Telnyx to send AMD callback events to for the call.
531
+ */
532
+ AsyncAmdStatusCallback?: string;
533
+ /**
534
+ * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
535
+ * inherited from TeXML Application setting.
536
+ */
537
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
538
+ /**
539
+ * To be used as the caller id name (SIP From Display Name) presented to the
540
+ * destination (`To` number). The string should have a maximum of 128 characters,
541
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
542
+ * ommited, the display name will be the same as the number in the `From` field.
543
+ */
544
+ CallerId?: string;
545
+ /**
546
+ * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
547
+ * `true`.
548
+ */
549
+ CancelPlaybackOnDetectMessageEnd?: boolean;
550
+ /**
551
+ * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
552
+ */
553
+ CancelPlaybackOnMachineDetection?: boolean;
554
+ /**
555
+ * Custom HTTP headers to be sent with the call. Each header should be an object
556
+ * with 'name' and 'value' properties.
557
+ */
558
+ CustomHeaders?: Array<WithURL.CustomHeader>;
559
+ /**
560
+ * Allows you to chose between Premium and Standard detections.
561
+ */
562
+ DetectionMode?: 'Premium' | 'Regular';
563
+ /**
564
+ * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
565
+ * `Url` is not responding.
566
+ */
567
+ FallbackUrl?: string;
568
+ /**
569
+ * The phone number of the party that initiated the call. Phone numbers are
570
+ * formatted with a `+` and country code.
571
+ */
572
+ From?: string;
573
+ /**
574
+ * Enables Answering Machine Detection.
575
+ */
576
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
577
+ /**
578
+ * If initial silence duration is greater than this value, consider it a machine.
579
+ * Ignored when `premium` detection is used.
580
+ */
581
+ MachineDetectionSilenceTimeout?: number;
582
+ /**
583
+ * Silence duration threshold after a greeting message or voice for it be
584
+ * considered human. Ignored when `premium` detection is used.
585
+ */
586
+ MachineDetectionSpeechEndThreshold?: number;
587
+ /**
588
+ * Maximum threshold of a human greeting. If greeting longer than this value,
589
+ * considered machine. Ignored when `premium` detection is used.
590
+ */
591
+ MachineDetectionSpeechThreshold?: number;
592
+ /**
593
+ * Maximum timeout threshold in milliseconds for overall detection.
594
+ */
595
+ MachineDetectionTimeout?: number;
596
+ /**
597
+ * Defines whether media should be encrypted on the call. When set to `SRTP`, the
598
+ * call will use Secure Real-time Transport Protocol for media encryption. When set
599
+ * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
600
+ * destinations.
601
+ */
602
+ MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
603
+ /**
604
+ * The list of comma-separated codecs to be offered on a call.
605
+ */
606
+ PreferredCodecs?: string;
607
+ /**
608
+ * Whether to record the entire participant's call leg. Defaults to `false`.
609
+ */
610
+ Record?: boolean;
611
+ /**
612
+ * The number of channels in the final recording. Defaults to `mono`.
613
+ */
614
+ RecordingChannels?: 'mono' | 'dual';
615
+ /**
616
+ * The URL the recording callbacks will be sent to.
617
+ */
618
+ RecordingStatusCallback?: string;
619
+ /**
620
+ * The changes to the recording's state that should generate a call to
621
+ * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
622
+ * Separate multiple values with a space. Defaults to `completed`.
623
+ */
624
+ RecordingStatusCallbackEvent?: string;
625
+ /**
626
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
627
+ */
628
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
629
+ /**
630
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
631
+ * silence is detected. The timer only starts when the speech is detected. Please
632
+ * note that the transcription is used to detect silence and the related charge
633
+ * will be applied. The minimum value is 0. The default value is 0 (infinite)
634
+ */
635
+ RecordingTimeout?: number;
636
+ /**
637
+ * The audio track to record for the call. The default is `both`.
638
+ */
639
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
640
+ /**
641
+ * Whether to send RecordingUrl in webhooks.
642
+ */
643
+ SendRecordingUrl?: boolean;
644
+ /**
645
+ * The password to use for SIP authentication.
646
+ */
647
+ SipAuthPassword?: string;
648
+ /**
649
+ * The username to use for SIP authentication.
650
+ */
651
+ SipAuthUsername?: string;
652
+ /**
653
+ * Defines the SIP region to be used for the call.
654
+ */
655
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
656
+ /**
657
+ * URL destination for Telnyx to send status callback events to for the call.
658
+ */
659
+ StatusCallback?: string;
660
+ /**
661
+ * The call events for which Telnyx should send a webhook. Multiple events can be
662
+ * defined when separated by a space.
663
+ */
664
+ StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
665
+ /**
666
+ * HTTP request type used for `StatusCallback`.
667
+ */
668
+ StatusCallbackMethod?: 'GET' | 'POST';
669
+ /**
670
+ * The call control ID of the existing call to supervise. When provided, the
671
+ * created leg will be added to the specified call in supervising mode. Status
672
+ * callbacks and action callbacks will NOT be sent for the supervising leg.
673
+ */
674
+ SuperviseCallSid?: string;
675
+ /**
676
+ * The supervising role for the new leg. Determines the audio behavior: barge (hear
677
+ * both sides), whisper (only hear supervisor), monitor (hear both sides but
678
+ * supervisor muted). Default: barge
679
+ */
680
+ SupervisingRole?: 'barge' | 'whisper' | 'monitor';
681
+ Texml?: unknown;
682
+ /**
683
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
684
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
685
+ */
686
+ TimeLimit?: number;
687
+ /**
688
+ * The number of seconds to wait for the called party to answer the call before the
689
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
690
+ * is 30 seconds.
691
+ */
692
+ timeout_seconds?: number;
717
693
  /**
718
- * The name of the custom header
694
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
695
+ * country code.
719
696
  */
720
- name: string;
697
+ To?: string;
721
698
  /**
722
- * The value of the custom header
699
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
700
+ * `trim-silence`.
723
701
  */
724
- value: string;
702
+ Trim?: 'trim-silence' | 'do-not-trim';
703
+ /**
704
+ * HTTP request type used for `Url`. The default value is inherited from TeXML
705
+ * Application setting.
706
+ */
707
+ UrlMethod?: 'GET' | 'POST';
708
+ }
709
+ namespace WithURL {
710
+ interface CustomHeader {
711
+ /**
712
+ * The name of the custom header
713
+ */
714
+ name: string;
715
+ /**
716
+ * The value of the custom header
717
+ */
718
+ value: string;
719
+ }
720
+ }
721
+ interface WithTeXml {
722
+ /**
723
+ * TeXML to be used as instructions for the call. If provided, the call will
724
+ * execute these instructions instead of fetching from the Url.
725
+ */
726
+ Texml: string;
727
+ /**
728
+ * The ID of the TeXML Application.
729
+ */
730
+ ApplicationSid?: string;
731
+ /**
732
+ * Select whether to perform answering machine detection in the background. By
733
+ * default execution is blocked until Answering Machine Detection is completed.
734
+ */
735
+ AsyncAmd?: boolean;
736
+ /**
737
+ * URL destination for Telnyx to send AMD callback events to for the call.
738
+ */
739
+ AsyncAmdStatusCallback?: string;
740
+ /**
741
+ * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
742
+ * inherited from TeXML Application setting.
743
+ */
744
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
745
+ /**
746
+ * To be used as the caller id name (SIP From Display Name) presented to the
747
+ * destination (`To` number). The string should have a maximum of 128 characters,
748
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
749
+ * ommited, the display name will be the same as the number in the `From` field.
750
+ */
751
+ CallerId?: string;
752
+ /**
753
+ * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
754
+ * `true`.
755
+ */
756
+ CancelPlaybackOnDetectMessageEnd?: boolean;
757
+ /**
758
+ * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
759
+ */
760
+ CancelPlaybackOnMachineDetection?: boolean;
761
+ /**
762
+ * Custom HTTP headers to be sent with the call. Each header should be an object
763
+ * with 'name' and 'value' properties.
764
+ */
765
+ CustomHeaders?: Array<WithTeXml.CustomHeader>;
766
+ /**
767
+ * Allows you to chose between Premium and Standard detections.
768
+ */
769
+ DetectionMode?: 'Premium' | 'Regular';
770
+ /**
771
+ * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
772
+ * `Url` is not responding.
773
+ */
774
+ FallbackUrl?: string;
775
+ /**
776
+ * The phone number of the party that initiated the call. Phone numbers are
777
+ * formatted with a `+` and country code.
778
+ */
779
+ From?: string;
780
+ /**
781
+ * Enables Answering Machine Detection.
782
+ */
783
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
784
+ /**
785
+ * If initial silence duration is greater than this value, consider it a machine.
786
+ * Ignored when `premium` detection is used.
787
+ */
788
+ MachineDetectionSilenceTimeout?: number;
789
+ /**
790
+ * Silence duration threshold after a greeting message or voice for it be
791
+ * considered human. Ignored when `premium` detection is used.
792
+ */
793
+ MachineDetectionSpeechEndThreshold?: number;
794
+ /**
795
+ * Maximum threshold of a human greeting. If greeting longer than this value,
796
+ * considered machine. Ignored when `premium` detection is used.
797
+ */
798
+ MachineDetectionSpeechThreshold?: number;
799
+ /**
800
+ * Maximum timeout threshold in milliseconds for overall detection.
801
+ */
802
+ MachineDetectionTimeout?: number;
803
+ /**
804
+ * Defines whether media should be encrypted on the call. When set to `SRTP`, the
805
+ * call will use Secure Real-time Transport Protocol for media encryption. When set
806
+ * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
807
+ * destinations.
808
+ */
809
+ MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
810
+ /**
811
+ * The list of comma-separated codecs to be offered on a call.
812
+ */
813
+ PreferredCodecs?: string;
814
+ /**
815
+ * Whether to record the entire participant's call leg. Defaults to `false`.
816
+ */
817
+ Record?: boolean;
818
+ /**
819
+ * The number of channels in the final recording. Defaults to `mono`.
820
+ */
821
+ RecordingChannels?: 'mono' | 'dual';
822
+ /**
823
+ * The URL the recording callbacks will be sent to.
824
+ */
825
+ RecordingStatusCallback?: string;
826
+ /**
827
+ * The changes to the recording's state that should generate a call to
828
+ * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
829
+ * Separate multiple values with a space. Defaults to `completed`.
830
+ */
831
+ RecordingStatusCallbackEvent?: string;
832
+ /**
833
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
834
+ */
835
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
836
+ /**
837
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
838
+ * silence is detected. The timer only starts when the speech is detected. Please
839
+ * note that the transcription is used to detect silence and the related charge
840
+ * will be applied. The minimum value is 0. The default value is 0 (infinite)
841
+ */
842
+ RecordingTimeout?: number;
843
+ /**
844
+ * The audio track to record for the call. The default is `both`.
845
+ */
846
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
847
+ /**
848
+ * Whether to send RecordingUrl in webhooks.
849
+ */
850
+ SendRecordingUrl?: boolean;
851
+ /**
852
+ * The password to use for SIP authentication.
853
+ */
854
+ SipAuthPassword?: string;
855
+ /**
856
+ * The username to use for SIP authentication.
857
+ */
858
+ SipAuthUsername?: string;
859
+ /**
860
+ * Defines the SIP region to be used for the call.
861
+ */
862
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
863
+ /**
864
+ * URL destination for Telnyx to send status callback events to for the call.
865
+ */
866
+ StatusCallback?: string;
867
+ /**
868
+ * The call events for which Telnyx should send a webhook. Multiple events can be
869
+ * defined when separated by a space.
870
+ */
871
+ StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
872
+ /**
873
+ * HTTP request type used for `StatusCallback`.
874
+ */
875
+ StatusCallbackMethod?: 'GET' | 'POST';
876
+ /**
877
+ * The call control ID of the existing call to supervise. When provided, the
878
+ * created leg will be added to the specified call in supervising mode. Status
879
+ * callbacks and action callbacks will NOT be sent for the supervising leg.
880
+ */
881
+ SuperviseCallSid?: string;
882
+ /**
883
+ * The supervising role for the new leg. Determines the audio behavior: barge (hear
884
+ * both sides), whisper (only hear supervisor), monitor (hear both sides but
885
+ * supervisor muted). Default: barge
886
+ */
887
+ SupervisingRole?: 'barge' | 'whisper' | 'monitor';
888
+ /**
889
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
890
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
891
+ */
892
+ TimeLimit?: number;
893
+ /**
894
+ * The number of seconds to wait for the called party to answer the call before the
895
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
896
+ * is 30 seconds.
897
+ */
898
+ timeout_seconds?: number;
899
+ /**
900
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
901
+ * country code.
902
+ */
903
+ To?: string;
904
+ /**
905
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
906
+ * `trim-silence`.
907
+ */
908
+ Trim?: 'trim-silence' | 'do-not-trim';
909
+ Url?: unknown;
910
+ /**
911
+ * HTTP request type used for `Url`. The default value is inherited from TeXML
912
+ * Application setting.
913
+ */
914
+ UrlMethod?: 'GET' | 'POST';
915
+ }
916
+ namespace WithTeXml {
917
+ interface CustomHeader {
918
+ /**
919
+ * The name of the custom header
920
+ */
921
+ name: string;
922
+ /**
923
+ * The value of the custom header
924
+ */
925
+ value: string;
926
+ }
927
+ }
928
+ interface ApplicationDefault {
929
+ /**
930
+ * The ID of the TeXML Application.
931
+ */
932
+ ApplicationSid?: string;
933
+ /**
934
+ * Select whether to perform answering machine detection in the background. By
935
+ * default execution is blocked until Answering Machine Detection is completed.
936
+ */
937
+ AsyncAmd?: boolean;
938
+ /**
939
+ * URL destination for Telnyx to send AMD callback events to for the call.
940
+ */
941
+ AsyncAmdStatusCallback?: string;
942
+ /**
943
+ * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
944
+ * inherited from TeXML Application setting.
945
+ */
946
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
947
+ /**
948
+ * To be used as the caller id name (SIP From Display Name) presented to the
949
+ * destination (`To` number). The string should have a maximum of 128 characters,
950
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
951
+ * ommited, the display name will be the same as the number in the `From` field.
952
+ */
953
+ CallerId?: string;
954
+ /**
955
+ * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
956
+ * `true`.
957
+ */
958
+ CancelPlaybackOnDetectMessageEnd?: boolean;
959
+ /**
960
+ * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
961
+ */
962
+ CancelPlaybackOnMachineDetection?: boolean;
963
+ /**
964
+ * Custom HTTP headers to be sent with the call. Each header should be an object
965
+ * with 'name' and 'value' properties.
966
+ */
967
+ CustomHeaders?: Array<ApplicationDefault.CustomHeader>;
968
+ /**
969
+ * Allows you to chose between Premium and Standard detections.
970
+ */
971
+ DetectionMode?: 'Premium' | 'Regular';
972
+ /**
973
+ * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
974
+ * `Url` is not responding.
975
+ */
976
+ FallbackUrl?: string;
977
+ /**
978
+ * The phone number of the party that initiated the call. Phone numbers are
979
+ * formatted with a `+` and country code.
980
+ */
981
+ From?: string;
982
+ /**
983
+ * Enables Answering Machine Detection.
984
+ */
985
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
986
+ /**
987
+ * If initial silence duration is greater than this value, consider it a machine.
988
+ * Ignored when `premium` detection is used.
989
+ */
990
+ MachineDetectionSilenceTimeout?: number;
991
+ /**
992
+ * Silence duration threshold after a greeting message or voice for it be
993
+ * considered human. Ignored when `premium` detection is used.
994
+ */
995
+ MachineDetectionSpeechEndThreshold?: number;
996
+ /**
997
+ * Maximum threshold of a human greeting. If greeting longer than this value,
998
+ * considered machine. Ignored when `premium` detection is used.
999
+ */
1000
+ MachineDetectionSpeechThreshold?: number;
1001
+ /**
1002
+ * Maximum timeout threshold in milliseconds for overall detection.
1003
+ */
1004
+ MachineDetectionTimeout?: number;
1005
+ /**
1006
+ * Defines whether media should be encrypted on the call. When set to `SRTP`, the
1007
+ * call will use Secure Real-time Transport Protocol for media encryption. When set
1008
+ * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
1009
+ * destinations.
1010
+ */
1011
+ MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
1012
+ /**
1013
+ * The list of comma-separated codecs to be offered on a call.
1014
+ */
1015
+ PreferredCodecs?: string;
1016
+ /**
1017
+ * Whether to record the entire participant's call leg. Defaults to `false`.
1018
+ */
1019
+ Record?: boolean;
1020
+ /**
1021
+ * The number of channels in the final recording. Defaults to `mono`.
1022
+ */
1023
+ RecordingChannels?: 'mono' | 'dual';
1024
+ /**
1025
+ * The URL the recording callbacks will be sent to.
1026
+ */
1027
+ RecordingStatusCallback?: string;
1028
+ /**
1029
+ * The changes to the recording's state that should generate a call to
1030
+ * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
1031
+ * Separate multiple values with a space. Defaults to `completed`.
1032
+ */
1033
+ RecordingStatusCallbackEvent?: string;
1034
+ /**
1035
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
1036
+ */
1037
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
1038
+ /**
1039
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
1040
+ * silence is detected. The timer only starts when the speech is detected. Please
1041
+ * note that the transcription is used to detect silence and the related charge
1042
+ * will be applied. The minimum value is 0. The default value is 0 (infinite)
1043
+ */
1044
+ RecordingTimeout?: number;
1045
+ /**
1046
+ * The audio track to record for the call. The default is `both`.
1047
+ */
1048
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
1049
+ /**
1050
+ * Whether to send RecordingUrl in webhooks.
1051
+ */
1052
+ SendRecordingUrl?: boolean;
1053
+ /**
1054
+ * The password to use for SIP authentication.
1055
+ */
1056
+ SipAuthPassword?: string;
1057
+ /**
1058
+ * The username to use for SIP authentication.
1059
+ */
1060
+ SipAuthUsername?: string;
1061
+ /**
1062
+ * Defines the SIP region to be used for the call.
1063
+ */
1064
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
1065
+ /**
1066
+ * URL destination for Telnyx to send status callback events to for the call.
1067
+ */
1068
+ StatusCallback?: string;
1069
+ /**
1070
+ * The call events for which Telnyx should send a webhook. Multiple events can be
1071
+ * defined when separated by a space.
1072
+ */
1073
+ StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
1074
+ /**
1075
+ * HTTP request type used for `StatusCallback`.
1076
+ */
1077
+ StatusCallbackMethod?: 'GET' | 'POST';
1078
+ /**
1079
+ * The call control ID of the existing call to supervise. When provided, the
1080
+ * created leg will be added to the specified call in supervising mode. Status
1081
+ * callbacks and action callbacks will NOT be sent for the supervising leg.
1082
+ */
1083
+ SuperviseCallSid?: string;
1084
+ /**
1085
+ * The supervising role for the new leg. Determines the audio behavior: barge (hear
1086
+ * both sides), whisper (only hear supervisor), monitor (hear both sides but
1087
+ * supervisor muted). Default: barge
1088
+ */
1089
+ SupervisingRole?: 'barge' | 'whisper' | 'monitor';
1090
+ Texml?: unknown;
1091
+ /**
1092
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
1093
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
1094
+ */
1095
+ TimeLimit?: number;
1096
+ /**
1097
+ * The number of seconds to wait for the called party to answer the call before the
1098
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
1099
+ * is 30 seconds.
1100
+ */
1101
+ timeout_seconds?: number;
1102
+ /**
1103
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
1104
+ * country code.
1105
+ */
1106
+ To?: string;
1107
+ /**
1108
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
1109
+ * `trim-silence`.
1110
+ */
1111
+ Trim?: 'trim-silence' | 'do-not-trim';
1112
+ Url?: unknown;
1113
+ /**
1114
+ * HTTP request type used for `Url`. The default value is inherited from TeXML
1115
+ * Application setting.
1116
+ */
1117
+ UrlMethod?: 'GET' | 'POST';
1118
+ }
1119
+ namespace ApplicationDefault {
1120
+ interface CustomHeader {
1121
+ /**
1122
+ * The name of the custom header
1123
+ */
1124
+ name: string;
1125
+ /**
1126
+ * The value of the custom header
1127
+ */
1128
+ value: string;
1129
+ }
725
1130
  }
726
1131
  }
727
1132
  export interface CallRetrieveCallsParams {