import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const voice = await client.phoneNumbers.voice.update('1293384261075731499');
console.log(voice.data);{
"data": {
"id": "1293384261075731499",
"record_type": "voice_settings",
"connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
"customer_reference": "customer-reference",
"tech_prefix_enabled": false,
"translated_number": "+13035559999",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
},
"emergency": {
"emergency_enabled": true,
"emergency_address_id": "1315261609962112019",
"emergency_status": "active"
},
"usage_payment_method": "pay-per-minute",
"media_features": {
"rtp_auto_adjust_enabled": true,
"accept_any_rtp_packets_enabled": true,
"t38_fax_gateway_enabled": true
},
"call_recording": {
"inbound_call_recording_enabled": true,
"inbound_call_recording_format": "wav",
"inbound_call_recording_channels": "single"
},
"inbound_call_screening": "disabled"
}
}import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const voice = await client.phoneNumbers.voice.update('1293384261075731499');
console.log(voice.data);{
"data": {
"id": "1293384261075731499",
"record_type": "voice_settings",
"connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
"customer_reference": "customer-reference",
"tech_prefix_enabled": false,
"translated_number": "+13035559999",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
},
"emergency": {
"emergency_enabled": true,
"emergency_address_id": "1315261609962112019",
"emergency_status": "active"
},
"usage_payment_method": "pay-per-minute",
"media_features": {
"rtp_auto_adjust_enabled": true,
"accept_any_rtp_packets_enabled": true,
"t38_fax_gateway_enabled": true
},
"call_recording": {
"inbound_call_recording_enabled": true,
"inbound_call_recording_format": "wav",
"inbound_call_recording_channels": "single"
},
"inbound_call_screening": "disabled"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Identifies the resource.
"1293384261075731499"
Updated voice settings for the phone number.
Controls whether a tech prefix is enabled for this phone number.
This field allows you to rewrite the destination number of an inbound call before the call is routed to you. The value of this field may be any alphanumeric value, and the value will replace the number originally dialed.
Controls whether the caller ID name is enabled for this phone number.
The call forwarding settings for a phone number.
Show child attributes
Indicates if call forwarding will be enabled for this number if forwards_to and forwarding_type are filled in. Defaults to true for backwards compatibility with APIV1 use of numbers endpoints.
true
The phone number to which inbound calls to this number are forwarded. Inbound calls will not be forwarded if this field is left blank. If set, must be a +E.164-formatted phone number.
Call forwarding type. 'forwards_to' must be set for this to have an effect.
always, on-failure "always"
{
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
}The CNAM listing settings for a phone number.
Show child attributes
Enables CNAM listings for this number. Requires cnam_listing_details to also be set.
The CNAM listing details for this number. Must be alphanumeric characters or spaces with a maximum length of 15. Requires cnam_listing_enabled to also be set to true.
{
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
}Controls whether a number is billed per minute or uses your concurrent channels.
pay-per-minute, channel The media features settings for a phone number.
Show child attributes
When RTP Auto-Adjust is enabled, the destination RTP address port will be automatically changed to match the source of the incoming RTP packets.
When enabled, Telnyx will accept RTP packets from any customer-side IP address and port, not just those to which Telnyx is sending RTP.
Controls whether Telnyx will accept a T.38 re-INVITE for this phone number. Note that Telnyx will not send a T.38 re-INVITE; this option only controls whether one will be accepted.
{
"rtp_auto_adjust_enabled": true,
"accept_any_rtp_packets_enabled": true,
"t38_fax_gateway_enabled": true
}The call recording settings for a phone number.
Show child attributes
When enabled, any inbound call to this number will be recorded.
The audio file format for calls being recorded.
wav, mp3 When using 'dual' channels, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.
single, dual {
"inbound_call_recording_enabled": true,
"inbound_call_recording_format": "wav",
"inbound_call_recording_channels": "single"
}The inbound_call_screening setting is a phone number configuration option variable that allows users to configure their settings to block or flag fraudulent calls. It can be set to disabled, reject_calls, or flag_calls. This feature has an additional per-number monthly cost associated with it.
disabled, reject_calls, flag_calls Successful response with details about a phone number including voice settings.
Show child attributes
Identifies the type of resource.
"1293384261075731499"
Identifies the type of the resource.
"voice_settings"
The phone number in +E164 format.
"+13035551234"
Identifies the connection associated with this phone number.
"1d0e6cb8-8668-462e-94c6-49ae0f0ed48b"
A customer reference string for customer look ups.
"MY REF 001"
Controls whether a tech prefix is enabled for this phone number.
false
This field allows you to rewrite the destination number of an inbound call before the call is routed to you. The value of this field may be any alphanumeric value, and the value will replace the number originally dialed.
"+13035559999"
The call forwarding settings for a phone number.
Show child attributes
Indicates if call forwarding will be enabled for this number if forwards_to and forwarding_type are filled in. Defaults to true for backwards compatibility with APIV1 use of numbers endpoints.
true
The phone number to which inbound calls to this number are forwarded. Inbound calls will not be forwarded if this field is left blank. If set, must be a +E.164-formatted phone number.
Call forwarding type. 'forwards_to' must be set for this to have an effect.
always, on-failure "always"
{
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
}The CNAM listing settings for a phone number.
Show child attributes
Enables CNAM listings for this number. Requires cnam_listing_details to also be set.
The CNAM listing details for this number. Must be alphanumeric characters or spaces with a maximum length of 15. Requires cnam_listing_enabled to also be set to true.
{
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
}The emergency services settings for a phone number.
Show child attributes
Allows you to enable or disable emergency services on the phone number. In order to enable emergency services, you must also set an emergency_address_id.
Identifies the address to be used with emergency services.
Represents the state of the number regarding emergency activation.
disabled, active, provisioning, deprovisioning, provisioning-failed {
"emergency_enabled": true,
"emergency_address_id": "1315261609962112019",
"emergency_status": "active"
}Controls whether a number is billed per minute or uses your concurrent channels.
pay-per-minute, channel "pay-per-minute"
The media features settings for a phone number.
Show child attributes
When RTP Auto-Adjust is enabled, the destination RTP address port will be automatically changed to match the source of the incoming RTP packets.
When enabled, Telnyx will accept RTP packets from any customer-side IP address and port, not just those to which Telnyx is sending RTP.
Controls whether Telnyx will accept a T.38 re-INVITE for this phone number. Note that Telnyx will not send a T.38 re-INVITE; this option only controls whether one will be accepted.
{
"rtp_auto_adjust_enabled": true,
"accept_any_rtp_packets_enabled": true,
"t38_fax_gateway_enabled": true
}The call recording settings for a phone number.
Show child attributes
When enabled, any inbound call to this number will be recorded.
The audio file format for calls being recorded.
wav, mp3 When using 'dual' channels, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.
single, dual {
"inbound_call_recording_enabled": true,
"inbound_call_recording_format": "wav",
"inbound_call_recording_channels": "single"
}The inbound_call_screening setting is a phone number configuration option variable that allows users to configure their settings to block or flag fraudulent calls. It can be set to disabled, reject_calls, or flag_calls. This feature has an additional per-number monthly cost associated with it.
disabled, reject_calls, flag_calls {
"id": "1293384261075731499",
"record_type": "voice_settings",
"connection_id": "1d0e6cb8-8668-462e-94c6-49ae0f0ed48b",
"customer_reference": "customer-reference",
"tech_prefix_enabled": false,
"translated_number": "+13035559999",
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
},
"emergency": {
"emergency_enabled": true,
"emergency_address_id": "1315261609962112019",
"emergency_status": "active"
},
"usage_payment_method": "pay-per-minute",
"media_features": {
"rtp_auto_adjust_enabled": true,
"accept_any_rtp_packets_enabled": true,
"t38_fax_gateway_enabled": true
},
"call_recording": {
"inbound_call_recording_enabled": true,
"inbound_call_recording_format": "wav",
"inbound_call_recording_channels": "single"
},
"inbound_call_screening": "disabled"
}Was this page helpful?