telnyx 6.35.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/enterprises/enterprises.d.mts +2 -2
  11. package/resources/enterprises/enterprises.d.mts.map +1 -1
  12. package/resources/enterprises/enterprises.d.ts +2 -2
  13. package/resources/enterprises/enterprises.d.ts.map +1 -1
  14. package/resources/enterprises/index.d.mts +1 -1
  15. package/resources/enterprises/index.d.mts.map +1 -1
  16. package/resources/enterprises/index.d.ts +1 -1
  17. package/resources/enterprises/index.d.ts.map +1 -1
  18. package/resources/enterprises/reputation/index.d.mts +2 -2
  19. package/resources/enterprises/reputation/index.d.mts.map +1 -1
  20. package/resources/enterprises/reputation/index.d.ts +2 -2
  21. package/resources/enterprises/reputation/index.d.ts.map +1 -1
  22. package/resources/enterprises/reputation/numbers.d.mts +43 -43
  23. package/resources/enterprises/reputation/numbers.d.mts.map +1 -1
  24. package/resources/enterprises/reputation/numbers.d.ts +43 -43
  25. package/resources/enterprises/reputation/numbers.d.ts.map +1 -1
  26. package/resources/enterprises/reputation/numbers.js +31 -31
  27. package/resources/enterprises/reputation/numbers.js.map +1 -1
  28. package/resources/enterprises/reputation/numbers.mjs +31 -31
  29. package/resources/enterprises/reputation/numbers.mjs.map +1 -1
  30. package/resources/enterprises/reputation/reputation.d.mts +45 -46
  31. package/resources/enterprises/reputation/reputation.d.mts.map +1 -1
  32. package/resources/enterprises/reputation/reputation.d.ts +45 -46
  33. package/resources/enterprises/reputation/reputation.d.ts.map +1 -1
  34. package/resources/enterprises/reputation/reputation.js +43 -44
  35. package/resources/enterprises/reputation/reputation.js.map +1 -1
  36. package/resources/enterprises/reputation/reputation.mjs +43 -44
  37. package/resources/enterprises/reputation/reputation.mjs.map +1 -1
  38. package/resources/index.d.mts +1 -1
  39. package/resources/index.d.mts.map +1 -1
  40. package/resources/index.d.ts +1 -1
  41. package/resources/index.d.ts.map +1 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs +1 -1
  44. package/resources/index.mjs.map +1 -1
  45. package/resources/texml/accounts/calls/calls.d.mts +613 -201
  46. package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
  47. package/resources/texml/accounts/calls/calls.d.ts +613 -201
  48. package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
  49. package/resources/texml/accounts/calls/calls.js +1 -5
  50. package/resources/texml/accounts/calls/calls.js.map +1 -1
  51. package/resources/texml/accounts/calls/calls.mjs +1 -5
  52. package/resources/texml/accounts/calls/calls.mjs.map +1 -1
  53. package/resources/texml/index.d.mts +1 -1
  54. package/resources/texml/index.d.mts.map +1 -1
  55. package/resources/texml/index.d.ts +1 -1
  56. package/resources/texml/index.d.ts.map +1 -1
  57. package/resources/texml/index.js.map +1 -1
  58. package/resources/texml/index.mjs +1 -1
  59. package/resources/texml/index.mjs.map +1 -1
  60. package/resources/texml/texml.d.mts +219 -1
  61. package/resources/texml/texml.d.mts.map +1 -1
  62. package/resources/texml/texml.d.ts +219 -1
  63. package/resources/texml/texml.d.ts.map +1 -1
  64. package/resources/texml/texml.js +26 -0
  65. package/resources/texml/texml.js.map +1 -1
  66. package/resources/texml/texml.mjs +26 -0
  67. package/resources/texml/texml.mjs.map +1 -1
  68. package/src/client.ts +9 -1
  69. package/src/resources/enterprises/enterprises.ts +6 -6
  70. package/src/resources/enterprises/index.ts +3 -3
  71. package/src/resources/enterprises/reputation/index.ts +6 -6
  72. package/src/resources/enterprises/reputation/numbers.ts +58 -54
  73. package/src/resources/enterprises/reputation/reputation.ts +60 -61
  74. package/src/resources/index.ts +7 -1
  75. package/src/resources/texml/accounts/calls/calls.ts +705 -202
  76. package/src/resources/texml/index.ts +7 -1
  77. package/src/resources/texml/texml.ts +279 -1
  78. package/src/version.ts +1 -1
  79. package/version.d.mts +1 -1
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
  82. package/version.mjs +1 -1
@@ -83,11 +83,7 @@ export class Calls extends APIResource {
83
83
  * ```ts
84
84
  * const response = await client.texml.accounts.calls.calls(
85
85
  * 'account_sid',
86
- * {
87
- * ApplicationSid: 'example-app-sid',
88
- * From: '+13120001234',
89
- * To: '+13121230000',
90
- * },
86
+ * { Url: 'https://www.example.com/instructions.xml' },
91
87
  * );
92
88
  * ```
93
89
  */
@@ -688,248 +684,755 @@ export interface CallUpdateParams {
688
684
  Url?: string;
689
685
  }
690
686
 
691
- export interface CallCallsParams {
692
- /**
693
- * The ID of the TeXML Application.
694
- */
695
- ApplicationSid: string;
687
+ export type CallCallsParams =
688
+ | CallCallsParams.WithURL
689
+ | CallCallsParams.WithTeXml
690
+ | CallCallsParams.ApplicationDefault;
696
691
 
697
- /**
698
- * The phone number of the party that initiated the call. Phone numbers are
699
- * formatted with a `+` and country code.
700
- */
701
- From: string;
692
+ export declare namespace CallCallsParams {
693
+ export interface WithURL {
694
+ /**
695
+ * The URL from which Telnyx will retrieve the TeXML call instructions.
696
+ */
697
+ Url: string;
702
698
 
703
- /**
704
- * The phone number of the called party. Phone numbers are formatted with a `+` and
705
- * country code.
706
- */
707
- To: string;
699
+ /**
700
+ * The ID of the TeXML Application.
701
+ */
702
+ ApplicationSid?: string;
708
703
 
709
- /**
710
- * Select whether to perform answering machine detection in the background. By
711
- * default execution is blocked until Answering Machine Detection is completed.
712
- */
713
- AsyncAmd?: boolean;
704
+ /**
705
+ * Select whether to perform answering machine detection in the background. By
706
+ * default execution is blocked until Answering Machine Detection is completed.
707
+ */
708
+ AsyncAmd?: boolean;
714
709
 
715
- /**
716
- * URL destination for Telnyx to send AMD callback events to for the call.
717
- */
718
- AsyncAmdStatusCallback?: string;
710
+ /**
711
+ * URL destination for Telnyx to send AMD callback events to for the call.
712
+ */
713
+ AsyncAmdStatusCallback?: string;
719
714
 
720
- /**
721
- * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
722
- * inherited from TeXML Application setting.
723
- */
724
- AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
715
+ /**
716
+ * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
717
+ * inherited from TeXML Application setting.
718
+ */
719
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
725
720
 
726
- /**
727
- * To be used as the caller id name (SIP From Display Name) presented to the
728
- * destination (`To` number). The string should have a maximum of 128 characters,
729
- * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
730
- * ommited, the display name will be the same as the number in the `From` field.
731
- */
732
- CallerId?: string;
721
+ /**
722
+ * To be used as the caller id name (SIP From Display Name) presented to the
723
+ * destination (`To` number). The string should have a maximum of 128 characters,
724
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
725
+ * ommited, the display name will be the same as the number in the `From` field.
726
+ */
727
+ CallerId?: string;
733
728
 
734
- /**
735
- * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
736
- * `true`.
737
- */
738
- CancelPlaybackOnDetectMessageEnd?: boolean;
729
+ /**
730
+ * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
731
+ * `true`.
732
+ */
733
+ CancelPlaybackOnDetectMessageEnd?: boolean;
739
734
 
740
- /**
741
- * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
742
- */
743
- CancelPlaybackOnMachineDetection?: boolean;
735
+ /**
736
+ * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
737
+ */
738
+ CancelPlaybackOnMachineDetection?: boolean;
744
739
 
745
- /**
746
- * Custom HTTP headers to be sent with the call. Each header should be an object
747
- * with 'name' and 'value' properties.
748
- */
749
- CustomHeaders?: Array<CallCallsParams.CustomHeader>;
740
+ /**
741
+ * Custom HTTP headers to be sent with the call. Each header should be an object
742
+ * with 'name' and 'value' properties.
743
+ */
744
+ CustomHeaders?: Array<WithURL.CustomHeader>;
750
745
 
751
- /**
752
- * Allows you to chose between Premium and Standard detections.
753
- */
754
- DetectionMode?: 'Premium' | 'Regular';
746
+ /**
747
+ * Allows you to chose between Premium and Standard detections.
748
+ */
749
+ DetectionMode?: 'Premium' | 'Regular';
755
750
 
756
- /**
757
- * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
758
- * `Url` is not responding.
759
- */
760
- FallbackUrl?: string;
751
+ /**
752
+ * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
753
+ * `Url` is not responding.
754
+ */
755
+ FallbackUrl?: string;
761
756
 
762
- /**
763
- * Enables Answering Machine Detection.
764
- */
765
- MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
757
+ /**
758
+ * The phone number of the party that initiated the call. Phone numbers are
759
+ * formatted with a `+` and country code.
760
+ */
761
+ From?: string;
766
762
 
767
- /**
768
- * If initial silence duration is greater than this value, consider it a machine.
769
- * Ignored when `premium` detection is used.
770
- */
771
- MachineDetectionSilenceTimeout?: number;
763
+ /**
764
+ * Enables Answering Machine Detection.
765
+ */
766
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
772
767
 
773
- /**
774
- * Silence duration threshold after a greeting message or voice for it be
775
- * considered human. Ignored when `premium` detection is used.
776
- */
777
- MachineDetectionSpeechEndThreshold?: number;
768
+ /**
769
+ * If initial silence duration is greater than this value, consider it a machine.
770
+ * Ignored when `premium` detection is used.
771
+ */
772
+ MachineDetectionSilenceTimeout?: number;
778
773
 
779
- /**
780
- * Maximum threshold of a human greeting. If greeting longer than this value,
781
- * considered machine. Ignored when `premium` detection is used.
782
- */
783
- MachineDetectionSpeechThreshold?: number;
774
+ /**
775
+ * Silence duration threshold after a greeting message or voice for it be
776
+ * considered human. Ignored when `premium` detection is used.
777
+ */
778
+ MachineDetectionSpeechEndThreshold?: number;
784
779
 
785
- /**
786
- * Maximum timeout threshold in milliseconds for overall detection.
787
- */
788
- MachineDetectionTimeout?: number;
780
+ /**
781
+ * Maximum threshold of a human greeting. If greeting longer than this value,
782
+ * considered machine. Ignored when `premium` detection is used.
783
+ */
784
+ MachineDetectionSpeechThreshold?: number;
789
785
 
790
- /**
791
- * The list of comma-separated codecs to be offered on a call.
792
- */
793
- PreferredCodecs?: string;
786
+ /**
787
+ * Maximum timeout threshold in milliseconds for overall detection.
788
+ */
789
+ MachineDetectionTimeout?: number;
794
790
 
795
- /**
796
- * Whether to record the entire participant's call leg. Defaults to `false`.
797
- */
798
- Record?: boolean;
791
+ /**
792
+ * Defines whether media should be encrypted on the call. When set to `SRTP`, the
793
+ * call will use Secure Real-time Transport Protocol for media encryption. When set
794
+ * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
795
+ * destinations.
796
+ */
797
+ MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
799
798
 
800
- /**
801
- * The number of channels in the final recording. Defaults to `mono`.
802
- */
803
- RecordingChannels?: 'mono' | 'dual';
799
+ /**
800
+ * The list of comma-separated codecs to be offered on a call.
801
+ */
802
+ PreferredCodecs?: string;
804
803
 
805
- /**
806
- * The URL the recording callbacks will be sent to.
807
- */
808
- RecordingStatusCallback?: string;
804
+ /**
805
+ * Whether to record the entire participant's call leg. Defaults to `false`.
806
+ */
807
+ Record?: boolean;
809
808
 
810
- /**
811
- * The changes to the recording's state that should generate a call to
812
- * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
813
- * Separate multiple values with a space. Defaults to `completed`.
814
- */
815
- RecordingStatusCallbackEvent?: string;
809
+ /**
810
+ * The number of channels in the final recording. Defaults to `mono`.
811
+ */
812
+ RecordingChannels?: 'mono' | 'dual';
816
813
 
817
- /**
818
- * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
819
- */
820
- RecordingStatusCallbackMethod?: 'GET' | 'POST';
814
+ /**
815
+ * The URL the recording callbacks will be sent to.
816
+ */
817
+ RecordingStatusCallback?: string;
821
818
 
822
- /**
823
- * The number of seconds that Telnyx will wait for the recording to be stopped if
824
- * silence is detected. The timer only starts when the speech is detected. Please
825
- * note that the transcription is used to detect silence and the related charge
826
- * will be applied. The minimum value is 0. The default value is 0 (infinite)
827
- */
828
- RecordingTimeout?: number;
819
+ /**
820
+ * The changes to the recording's state that should generate a call to
821
+ * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
822
+ * Separate multiple values with a space. Defaults to `completed`.
823
+ */
824
+ RecordingStatusCallbackEvent?: string;
829
825
 
830
- /**
831
- * The audio track to record for the call. The default is `both`.
832
- */
833
- RecordingTrack?: 'inbound' | 'outbound' | 'both';
826
+ /**
827
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
828
+ */
829
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
834
830
 
835
- /**
836
- * Whether to send RecordingUrl in webhooks.
837
- */
838
- SendRecordingUrl?: boolean;
831
+ /**
832
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
833
+ * silence is detected. The timer only starts when the speech is detected. Please
834
+ * note that the transcription is used to detect silence and the related charge
835
+ * will be applied. The minimum value is 0. The default value is 0 (infinite)
836
+ */
837
+ RecordingTimeout?: number;
839
838
 
840
- /**
841
- * The password to use for SIP authentication.
842
- */
843
- SipAuthPassword?: string;
839
+ /**
840
+ * The audio track to record for the call. The default is `both`.
841
+ */
842
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
844
843
 
845
- /**
846
- * The username to use for SIP authentication.
847
- */
848
- SipAuthUsername?: string;
844
+ /**
845
+ * Whether to send RecordingUrl in webhooks.
846
+ */
847
+ SendRecordingUrl?: boolean;
849
848
 
850
- /**
851
- * Defines the SIP region to be used for the call.
852
- */
853
- SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
849
+ /**
850
+ * The password to use for SIP authentication.
851
+ */
852
+ SipAuthPassword?: string;
854
853
 
855
- /**
856
- * URL destination for Telnyx to send status callback events to for the call.
857
- */
858
- StatusCallback?: string;
854
+ /**
855
+ * The username to use for SIP authentication.
856
+ */
857
+ SipAuthUsername?: string;
859
858
 
860
- /**
861
- * The call events for which Telnyx should send a webhook. Multiple events can be
862
- * defined when separated by a space.
863
- */
864
- StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
859
+ /**
860
+ * Defines the SIP region to be used for the call.
861
+ */
862
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
865
863
 
866
- /**
867
- * HTTP request type used for `StatusCallback`.
868
- */
869
- StatusCallbackMethod?: 'GET' | 'POST';
864
+ /**
865
+ * URL destination for Telnyx to send status callback events to for the call.
866
+ */
867
+ StatusCallback?: string;
870
868
 
871
- /**
872
- * The call control ID of the existing call to supervise. When provided, the
873
- * created leg will be added to the specified call in supervising mode. Status
874
- * callbacks and action callbacks will NOT be sent for the supervising leg.
875
- */
876
- SuperviseCallSid?: string;
869
+ /**
870
+ * The call events for which Telnyx should send a webhook. Multiple events can be
871
+ * defined when separated by a space.
872
+ */
873
+ StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
877
874
 
878
- /**
879
- * The supervising role for the new leg. Determines the audio behavior: barge (hear
880
- * both sides), whisper (only hear supervisor), monitor (hear both sides but
881
- * supervisor muted). Default: barge
882
- */
883
- SupervisingRole?: 'barge' | 'whisper' | 'monitor';
875
+ /**
876
+ * HTTP request type used for `StatusCallback`.
877
+ */
878
+ StatusCallbackMethod?: 'GET' | 'POST';
884
879
 
885
- /**
886
- * TeXML to be used as instructions for the call. If provided, the call will
887
- * execute these instructions instead of fetching from the Url.
888
- */
889
- Texml?: string;
880
+ /**
881
+ * The call control ID of the existing call to supervise. When provided, the
882
+ * created leg will be added to the specified call in supervising mode. Status
883
+ * callbacks and action callbacks will NOT be sent for the supervising leg.
884
+ */
885
+ SuperviseCallSid?: string;
890
886
 
891
- /**
892
- * The maximum duration of the call in seconds. The minimum value is 30 and the
893
- * maximum value is 14400 (4 hours). Default is 14400 seconds.
894
- */
895
- TimeLimit?: number;
887
+ /**
888
+ * The supervising role for the new leg. Determines the audio behavior: barge (hear
889
+ * both sides), whisper (only hear supervisor), monitor (hear both sides but
890
+ * supervisor muted). Default: barge
891
+ */
892
+ SupervisingRole?: 'barge' | 'whisper' | 'monitor';
896
893
 
897
- /**
898
- * The number of seconds to wait for the called party to answer the call before the
899
- * call is canceled. The minimum value is 5 and the maximum value is 120. Default
900
- * is 30 seconds.
901
- */
902
- timeout_seconds?: number;
894
+ Texml?: unknown;
903
895
 
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';
896
+ /**
897
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
898
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
899
+ */
900
+ TimeLimit?: number;
909
901
 
910
- /**
911
- * The URL from which Telnyx will retrieve the TeXML call instructions.
912
- */
913
- Url?: string;
902
+ /**
903
+ * The number of seconds to wait for the called party to answer the call before the
904
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
905
+ * is 30 seconds.
906
+ */
907
+ timeout_seconds?: number;
914
908
 
915
- /**
916
- * HTTP request type used for `Url`. The default value is inherited from TeXML
917
- * Application setting.
918
- */
919
- UrlMethod?: 'GET' | 'POST';
920
- }
909
+ /**
910
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
911
+ * country code.
912
+ */
913
+ To?: string;
914
+
915
+ /**
916
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
917
+ * `trim-silence`.
918
+ */
919
+ Trim?: 'trim-silence' | 'do-not-trim';
920
+
921
+ /**
922
+ * HTTP request type used for `Url`. The default value is inherited from TeXML
923
+ * Application setting.
924
+ */
925
+ UrlMethod?: 'GET' | 'POST';
926
+ }
927
+
928
+ export namespace WithURL {
929
+ export interface CustomHeader {
930
+ /**
931
+ * The name of the custom header
932
+ */
933
+ name: string;
934
+
935
+ /**
936
+ * The value of the custom header
937
+ */
938
+ value: string;
939
+ }
940
+ }
941
+
942
+ export interface WithTeXml {
943
+ /**
944
+ * TeXML to be used as instructions for the call. If provided, the call will
945
+ * execute these instructions instead of fetching from the Url.
946
+ */
947
+ Texml: string;
948
+
949
+ /**
950
+ * The ID of the TeXML Application.
951
+ */
952
+ ApplicationSid?: string;
953
+
954
+ /**
955
+ * Select whether to perform answering machine detection in the background. By
956
+ * default execution is blocked until Answering Machine Detection is completed.
957
+ */
958
+ AsyncAmd?: boolean;
959
+
960
+ /**
961
+ * URL destination for Telnyx to send AMD callback events to for the call.
962
+ */
963
+ AsyncAmdStatusCallback?: string;
964
+
965
+ /**
966
+ * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
967
+ * inherited from TeXML Application setting.
968
+ */
969
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
970
+
971
+ /**
972
+ * To be used as the caller id name (SIP From Display Name) presented to the
973
+ * destination (`To` number). The string should have a maximum of 128 characters,
974
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
975
+ * ommited, the display name will be the same as the number in the `From` field.
976
+ */
977
+ CallerId?: string;
978
+
979
+ /**
980
+ * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
981
+ * `true`.
982
+ */
983
+ CancelPlaybackOnDetectMessageEnd?: boolean;
984
+
985
+ /**
986
+ * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
987
+ */
988
+ CancelPlaybackOnMachineDetection?: boolean;
989
+
990
+ /**
991
+ * Custom HTTP headers to be sent with the call. Each header should be an object
992
+ * with 'name' and 'value' properties.
993
+ */
994
+ CustomHeaders?: Array<WithTeXml.CustomHeader>;
995
+
996
+ /**
997
+ * Allows you to chose between Premium and Standard detections.
998
+ */
999
+ DetectionMode?: 'Premium' | 'Regular';
1000
+
1001
+ /**
1002
+ * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
1003
+ * `Url` is not responding.
1004
+ */
1005
+ FallbackUrl?: string;
921
1006
 
922
- export namespace CallCallsParams {
923
- export interface CustomHeader {
924
1007
  /**
925
- * The name of the custom header
1008
+ * The phone number of the party that initiated the call. Phone numbers are
1009
+ * formatted with a `+` and country code.
926
1010
  */
927
- name: string;
1011
+ From?: string;
928
1012
 
929
1013
  /**
930
- * The value of the custom header
1014
+ * Enables Answering Machine Detection.
931
1015
  */
932
- value: string;
1016
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
1017
+
1018
+ /**
1019
+ * If initial silence duration is greater than this value, consider it a machine.
1020
+ * Ignored when `premium` detection is used.
1021
+ */
1022
+ MachineDetectionSilenceTimeout?: number;
1023
+
1024
+ /**
1025
+ * Silence duration threshold after a greeting message or voice for it be
1026
+ * considered human. Ignored when `premium` detection is used.
1027
+ */
1028
+ MachineDetectionSpeechEndThreshold?: number;
1029
+
1030
+ /**
1031
+ * Maximum threshold of a human greeting. If greeting longer than this value,
1032
+ * considered machine. Ignored when `premium` detection is used.
1033
+ */
1034
+ MachineDetectionSpeechThreshold?: number;
1035
+
1036
+ /**
1037
+ * Maximum timeout threshold in milliseconds for overall detection.
1038
+ */
1039
+ MachineDetectionTimeout?: number;
1040
+
1041
+ /**
1042
+ * Defines whether media should be encrypted on the call. When set to `SRTP`, the
1043
+ * call will use Secure Real-time Transport Protocol for media encryption. When set
1044
+ * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
1045
+ * destinations.
1046
+ */
1047
+ MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
1048
+
1049
+ /**
1050
+ * The list of comma-separated codecs to be offered on a call.
1051
+ */
1052
+ PreferredCodecs?: string;
1053
+
1054
+ /**
1055
+ * Whether to record the entire participant's call leg. Defaults to `false`.
1056
+ */
1057
+ Record?: boolean;
1058
+
1059
+ /**
1060
+ * The number of channels in the final recording. Defaults to `mono`.
1061
+ */
1062
+ RecordingChannels?: 'mono' | 'dual';
1063
+
1064
+ /**
1065
+ * The URL the recording callbacks will be sent to.
1066
+ */
1067
+ RecordingStatusCallback?: string;
1068
+
1069
+ /**
1070
+ * The changes to the recording's state that should generate a call to
1071
+ * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
1072
+ * Separate multiple values with a space. Defaults to `completed`.
1073
+ */
1074
+ RecordingStatusCallbackEvent?: string;
1075
+
1076
+ /**
1077
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
1078
+ */
1079
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
1080
+
1081
+ /**
1082
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
1083
+ * silence is detected. The timer only starts when the speech is detected. Please
1084
+ * note that the transcription is used to detect silence and the related charge
1085
+ * will be applied. The minimum value is 0. The default value is 0 (infinite)
1086
+ */
1087
+ RecordingTimeout?: number;
1088
+
1089
+ /**
1090
+ * The audio track to record for the call. The default is `both`.
1091
+ */
1092
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
1093
+
1094
+ /**
1095
+ * Whether to send RecordingUrl in webhooks.
1096
+ */
1097
+ SendRecordingUrl?: boolean;
1098
+
1099
+ /**
1100
+ * The password to use for SIP authentication.
1101
+ */
1102
+ SipAuthPassword?: string;
1103
+
1104
+ /**
1105
+ * The username to use for SIP authentication.
1106
+ */
1107
+ SipAuthUsername?: string;
1108
+
1109
+ /**
1110
+ * Defines the SIP region to be used for the call.
1111
+ */
1112
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
1113
+
1114
+ /**
1115
+ * URL destination for Telnyx to send status callback events to for the call.
1116
+ */
1117
+ StatusCallback?: string;
1118
+
1119
+ /**
1120
+ * The call events for which Telnyx should send a webhook. Multiple events can be
1121
+ * defined when separated by a space.
1122
+ */
1123
+ StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
1124
+
1125
+ /**
1126
+ * HTTP request type used for `StatusCallback`.
1127
+ */
1128
+ StatusCallbackMethod?: 'GET' | 'POST';
1129
+
1130
+ /**
1131
+ * The call control ID of the existing call to supervise. When provided, the
1132
+ * created leg will be added to the specified call in supervising mode. Status
1133
+ * callbacks and action callbacks will NOT be sent for the supervising leg.
1134
+ */
1135
+ SuperviseCallSid?: string;
1136
+
1137
+ /**
1138
+ * The supervising role for the new leg. Determines the audio behavior: barge (hear
1139
+ * both sides), whisper (only hear supervisor), monitor (hear both sides but
1140
+ * supervisor muted). Default: barge
1141
+ */
1142
+ SupervisingRole?: 'barge' | 'whisper' | 'monitor';
1143
+
1144
+ /**
1145
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
1146
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
1147
+ */
1148
+ TimeLimit?: number;
1149
+
1150
+ /**
1151
+ * The number of seconds to wait for the called party to answer the call before the
1152
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
1153
+ * is 30 seconds.
1154
+ */
1155
+ timeout_seconds?: number;
1156
+
1157
+ /**
1158
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
1159
+ * country code.
1160
+ */
1161
+ To?: string;
1162
+
1163
+ /**
1164
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
1165
+ * `trim-silence`.
1166
+ */
1167
+ Trim?: 'trim-silence' | 'do-not-trim';
1168
+
1169
+ Url?: unknown;
1170
+
1171
+ /**
1172
+ * HTTP request type used for `Url`. The default value is inherited from TeXML
1173
+ * Application setting.
1174
+ */
1175
+ UrlMethod?: 'GET' | 'POST';
1176
+ }
1177
+
1178
+ export namespace WithTeXml {
1179
+ export interface CustomHeader {
1180
+ /**
1181
+ * The name of the custom header
1182
+ */
1183
+ name: string;
1184
+
1185
+ /**
1186
+ * The value of the custom header
1187
+ */
1188
+ value: string;
1189
+ }
1190
+ }
1191
+
1192
+ export interface ApplicationDefault {
1193
+ /**
1194
+ * The ID of the TeXML Application.
1195
+ */
1196
+ ApplicationSid?: string;
1197
+
1198
+ /**
1199
+ * Select whether to perform answering machine detection in the background. By
1200
+ * default execution is blocked until Answering Machine Detection is completed.
1201
+ */
1202
+ AsyncAmd?: boolean;
1203
+
1204
+ /**
1205
+ * URL destination for Telnyx to send AMD callback events to for the call.
1206
+ */
1207
+ AsyncAmdStatusCallback?: string;
1208
+
1209
+ /**
1210
+ * HTTP request type used for `AsyncAmdStatusCallback`. The default value is
1211
+ * inherited from TeXML Application setting.
1212
+ */
1213
+ AsyncAmdStatusCallbackMethod?: 'GET' | 'POST';
1214
+
1215
+ /**
1216
+ * To be used as the caller id name (SIP From Display Name) presented to the
1217
+ * destination (`To` number). The string should have a maximum of 128 characters,
1218
+ * containing only letters, numbers, spaces, and `-_~!.+` special characters. If
1219
+ * ommited, the display name will be the same as the number in the `From` field.
1220
+ */
1221
+ CallerId?: string;
1222
+
1223
+ /**
1224
+ * Whether to cancel ongoing playback on `greeting ended` detection. Defaults to
1225
+ * `true`.
1226
+ */
1227
+ CancelPlaybackOnDetectMessageEnd?: boolean;
1228
+
1229
+ /**
1230
+ * Whether to cancel ongoing playback on `machine` detection. Defaults to `true`.
1231
+ */
1232
+ CancelPlaybackOnMachineDetection?: boolean;
1233
+
1234
+ /**
1235
+ * Custom HTTP headers to be sent with the call. Each header should be an object
1236
+ * with 'name' and 'value' properties.
1237
+ */
1238
+ CustomHeaders?: Array<ApplicationDefault.CustomHeader>;
1239
+
1240
+ /**
1241
+ * Allows you to chose between Premium and Standard detections.
1242
+ */
1243
+ DetectionMode?: 'Premium' | 'Regular';
1244
+
1245
+ /**
1246
+ * A failover URL for which Telnyx will retrieve the TeXML call instructions if the
1247
+ * `Url` is not responding.
1248
+ */
1249
+ FallbackUrl?: string;
1250
+
1251
+ /**
1252
+ * The phone number of the party that initiated the call. Phone numbers are
1253
+ * formatted with a `+` and country code.
1254
+ */
1255
+ From?: string;
1256
+
1257
+ /**
1258
+ * Enables Answering Machine Detection.
1259
+ */
1260
+ MachineDetection?: 'Enable' | 'Disable' | 'DetectMessageEnd';
1261
+
1262
+ /**
1263
+ * If initial silence duration is greater than this value, consider it a machine.
1264
+ * Ignored when `premium` detection is used.
1265
+ */
1266
+ MachineDetectionSilenceTimeout?: number;
1267
+
1268
+ /**
1269
+ * Silence duration threshold after a greeting message or voice for it be
1270
+ * considered human. Ignored when `premium` detection is used.
1271
+ */
1272
+ MachineDetectionSpeechEndThreshold?: number;
1273
+
1274
+ /**
1275
+ * Maximum threshold of a human greeting. If greeting longer than this value,
1276
+ * considered machine. Ignored when `premium` detection is used.
1277
+ */
1278
+ MachineDetectionSpeechThreshold?: number;
1279
+
1280
+ /**
1281
+ * Maximum timeout threshold in milliseconds for overall detection.
1282
+ */
1283
+ MachineDetectionTimeout?: number;
1284
+
1285
+ /**
1286
+ * Defines whether media should be encrypted on the call. When set to `SRTP`, the
1287
+ * call will use Secure Real-time Transport Protocol for media encryption. When set
1288
+ * to `DTLS`, the call will use DTLS for media encryption. Only supported for SIP
1289
+ * destinations.
1290
+ */
1291
+ MediaEncryption?: 'disabled' | 'SRTP' | 'DTLS';
1292
+
1293
+ /**
1294
+ * The list of comma-separated codecs to be offered on a call.
1295
+ */
1296
+ PreferredCodecs?: string;
1297
+
1298
+ /**
1299
+ * Whether to record the entire participant's call leg. Defaults to `false`.
1300
+ */
1301
+ Record?: boolean;
1302
+
1303
+ /**
1304
+ * The number of channels in the final recording. Defaults to `mono`.
1305
+ */
1306
+ RecordingChannels?: 'mono' | 'dual';
1307
+
1308
+ /**
1309
+ * The URL the recording callbacks will be sent to.
1310
+ */
1311
+ RecordingStatusCallback?: string;
1312
+
1313
+ /**
1314
+ * The changes to the recording's state that should generate a call to
1315
+ * `RecoridngStatusCallback`. Can be: `in-progress`, `completed` and `absent`.
1316
+ * Separate multiple values with a space. Defaults to `completed`.
1317
+ */
1318
+ RecordingStatusCallbackEvent?: string;
1319
+
1320
+ /**
1321
+ * HTTP request type used for `RecordingStatusCallback`. Defaults to `POST`.
1322
+ */
1323
+ RecordingStatusCallbackMethod?: 'GET' | 'POST';
1324
+
1325
+ /**
1326
+ * The number of seconds that Telnyx will wait for the recording to be stopped if
1327
+ * silence is detected. The timer only starts when the speech is detected. Please
1328
+ * note that the transcription is used to detect silence and the related charge
1329
+ * will be applied. The minimum value is 0. The default value is 0 (infinite)
1330
+ */
1331
+ RecordingTimeout?: number;
1332
+
1333
+ /**
1334
+ * The audio track to record for the call. The default is `both`.
1335
+ */
1336
+ RecordingTrack?: 'inbound' | 'outbound' | 'both';
1337
+
1338
+ /**
1339
+ * Whether to send RecordingUrl in webhooks.
1340
+ */
1341
+ SendRecordingUrl?: boolean;
1342
+
1343
+ /**
1344
+ * The password to use for SIP authentication.
1345
+ */
1346
+ SipAuthPassword?: string;
1347
+
1348
+ /**
1349
+ * The username to use for SIP authentication.
1350
+ */
1351
+ SipAuthUsername?: string;
1352
+
1353
+ /**
1354
+ * Defines the SIP region to be used for the call.
1355
+ */
1356
+ SipRegion?: 'US' | 'Europe' | 'Canada' | 'Australia' | 'Middle East';
1357
+
1358
+ /**
1359
+ * URL destination for Telnyx to send status callback events to for the call.
1360
+ */
1361
+ StatusCallback?: string;
1362
+
1363
+ /**
1364
+ * The call events for which Telnyx should send a webhook. Multiple events can be
1365
+ * defined when separated by a space.
1366
+ */
1367
+ StatusCallbackEvent?: 'initiated' | 'ringing' | 'answered' | 'completed';
1368
+
1369
+ /**
1370
+ * HTTP request type used for `StatusCallback`.
1371
+ */
1372
+ StatusCallbackMethod?: 'GET' | 'POST';
1373
+
1374
+ /**
1375
+ * The call control ID of the existing call to supervise. When provided, the
1376
+ * created leg will be added to the specified call in supervising mode. Status
1377
+ * callbacks and action callbacks will NOT be sent for the supervising leg.
1378
+ */
1379
+ SuperviseCallSid?: string;
1380
+
1381
+ /**
1382
+ * The supervising role for the new leg. Determines the audio behavior: barge (hear
1383
+ * both sides), whisper (only hear supervisor), monitor (hear both sides but
1384
+ * supervisor muted). Default: barge
1385
+ */
1386
+ SupervisingRole?: 'barge' | 'whisper' | 'monitor';
1387
+
1388
+ Texml?: unknown;
1389
+
1390
+ /**
1391
+ * The maximum duration of the call in seconds. The minimum value is 30 and the
1392
+ * maximum value is 14400 (4 hours). Default is 14400 seconds.
1393
+ */
1394
+ TimeLimit?: number;
1395
+
1396
+ /**
1397
+ * The number of seconds to wait for the called party to answer the call before the
1398
+ * call is canceled. The minimum value is 5 and the maximum value is 120. Default
1399
+ * is 30 seconds.
1400
+ */
1401
+ timeout_seconds?: number;
1402
+
1403
+ /**
1404
+ * The phone number of the called party. Phone numbers are formatted with a `+` and
1405
+ * country code.
1406
+ */
1407
+ To?: string;
1408
+
1409
+ /**
1410
+ * Whether to trim any leading and trailing silence from the recording. Defaults to
1411
+ * `trim-silence`.
1412
+ */
1413
+ Trim?: 'trim-silence' | 'do-not-trim';
1414
+
1415
+ Url?: unknown;
1416
+
1417
+ /**
1418
+ * HTTP request type used for `Url`. The default value is inherited from TeXML
1419
+ * Application setting.
1420
+ */
1421
+ UrlMethod?: 'GET' | 'POST';
1422
+ }
1423
+
1424
+ export namespace ApplicationDefault {
1425
+ export interface CustomHeader {
1426
+ /**
1427
+ * The name of the custom header
1428
+ */
1429
+ name: string;
1430
+
1431
+ /**
1432
+ * The value of the custom header
1433
+ */
1434
+ value: string;
1435
+ }
933
1436
  }
934
1437
  }
935
1438