Skip to main content

Update a phone number with voice settings

PATCH 
/phone_numbers/:id/voice

Update a phone number with voice settings

Request

Path Parameters

    id int64required

    Identifies the resource.

Body

required

Updated voice settings for the phone number.

    tech_prefix_enabled boolean

    Controls whether a tech prefix is enabled for this phone number.

    translated_number string

    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.

    caller_id_name_enabled boolean

    Controls whether the caller ID name is enabled for this phone number.

    call_forwarding

    object

    The call forwarding settings for a phone number.

    call_forwarding_enabled boolean

    Default value: true

    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.

    forwards_to string

    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.

    forwarding_type string

    Possible values: [always, on_failure]

    Call forwarding type. 'forwards_to' must be set for this to have an effect.

    The call forwarding settings for a phone number.

    cnam_listing

    object

    The CNAM listing settings for a phone number.

    cnam_listing_enabled boolean

    Enables CNAM listings for this number. Requires cnam_listing_details to also be set.

    cnam_listing_details string

    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.

    The CNAM listing settings for a phone number.

    usage_payment_method string

    Possible values: [pay-per-minute, channel]

    Default value: pay-per-minute

    Controls whether a number is billed per minute or uses your concurrent channels.

    media_features

    object

    The media features settings for a phone number.

    rtp_auto_adjust_enabled boolean

    Default value: true

    When RTP Auto-Adjust is enabled, the destination RTP address port will be automatically changed to match the source of the incoming RTP packets.

    accept_any_rtp_packets_enabled boolean

    When enabled, Telnyx will accept RTP packets from any customer-side IP address and port, not just those to which Telnyx is sending RTP.

    t38_fax_gateway_enabled boolean

    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.

    The media features settings for a phone number.

    call_recording

    object

    The call recording settings for a phone number.

    inbound_call_recording_enabled boolean

    When enabled, any inbound call to this number will be recorded.

    inbound_call_recording_format string

    Possible values: [wav, mp3]

    Default value: wav

    The audio file format for calls being recorded.

    inbound_call_recording_channels string

    Possible values: [single, dual]

    Default value: single

    When using 'dual' channels, final audio file will be stereo recorded with the first leg on channel A, and the rest on channel B.

    The call recording settings for a phone number.

    inbound_call_screening string

    Possible values: [disabled, reject_calls, flag_calls]

    Default value: disabled

    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.

Responses

200: Successful response with details about a phone number including voice settings.

default: Unexpected error

Request samples


curl -L -X PATCH 'https://api.telnyx.com/v2/phone_numbers/:id/voice' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"tech_prefix_enabled": true,
"translated_number": "+13035559999",
"caller_id_name_enabled": true,
"call_forwarding": {
"call_forwarding_enabled": true,
"forwards_to": "+13035559123",
"forwarding_type": "always"
},
"cnam_listing": {
"cnam_listing_enabled": true,
"cnam_listing_details": "example"
},
"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"
}'

Response samples


{
"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"
},
"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"
}
}