SIP trunks

Update a SIP trunk

Replaces the configuration of the SIP trunk identified by id. Omitted fields revert to their defaults.

put/v1/trunks/{id}

Path parameters

idinteger required
Example:3107

The unique ID of the SIP trunk.

Request body

labelstring required

User-defined name of the SIP trunk

passwordstring required

Password set for the SIP trunk. A strong password helps keep the trunk secure.

calleridstring required

Caller ID associated with the SIP trunk. Must be an active or verified number on the account.

multiple_numbersboolean

Indicates whether any active or verified phone number on the account can be used as the Caller ID for the SIP trunk.

ip_restrictboolean required

Indicates whether SIP trunk registration is allowed from only specific public static IP addresses. When set to true, the allowed_ips parameter must be provided.

didinfo_enabledboolean required

Indicates whether inbound calls include dialed number information in the To header of SIP INVITE requests

call_restrictboolean required

Indicates whether a maximum call duration limit is enforced for the SIP trunk

call_limitinteger

Maximum call duration for the SIP trunk, in seconds. Must not exceed the maximum duration set for the account. Ignored when call_restrict is false.

cost_limitboolean required

Indicates if the max cost limit for an outbound call limit is activated for the SIP trunk.

max_call_costnumber

Maximum cost for an outbound call, in USD

channels_restrictboolean required

Indicates whether a limit on the number of concurrent outbound calls is enforced for the SIP trunk

max_channelsinteger

Maximum number of concurrent outbound calls for the SIP trunk. Must not exceed the outbound channel capacity set for the account. Ignored when channels_restrict is false.

rewrite_enabledboolean required

Indicates whether a custom dial plan is activated for the SIP trunk

rewrite_prefixstring

Digits to automatically prepend to each dialed phone number

rewrite_condstring

Number of leading digits to automatically remove from each dialed phone number

call_recording_enabledboolean

Indicates whether outbound call recording is enabled for the SIP trunk

transcription_enabledboolean required

Indicates whether automatic call transcription is enabled for the SIP trunk. Available for Flex Pro customers only.

transcription_thresholdinteger required

Transcriptions will be generated for calls that meet or exceed the specified minimal call duration threshold, in seconds. Available for Flex Pro customers only.

machine_detection_enabledboolean

Indicates whether automatic voicemail detection is enabled for the SIP trunk. Available for Flex Pro customers only.

encrypted_mediaboolean

Indicates whether SRTP media encryption is enabled for the SIP trunk.

Example request

{
  "label": "My trunk",
  "password": "4r=h;EaCB85QNtr2",
  "host_request": {
    "host": "127.0.0.1"
  },
  "callerid": "13132847320",
  "allowed_ips": [
    {
      "ip": "127.0.0.1"
    }
  ],
  "didinfo_enabled": true,
  "call_restrict": true,
  "call_limit": 3600,
  "cost_limit": true,
  "max_call_cost": 0.18,
  "max_channels": 2,
  "rewrite_enabled": true,
  "rewrite_prefix": "1",
  "call_recording_enabled": true,
  "transcription_enabled": true,
  "transcription_threshold": 10,
  "machine_detection_enabled": true,
  "encrypted_media": true
}

Response

Returns the updated SIP trunk.

idinteger required

Unique identifier of the SIP trunk on the platform

namestring required

System-generated login name of the SIP trunk

calleridstring nullable required

Caller ID configured on the SIP trunk. Contains null if no Caller ID is set, or an empty string if multiple Caller IDs are allowed.

labelstring required

User-defined name of the SIP trunk

ip_restrictboolean

Indicates whether IP restriction must be enabled on the SIP trunk

channels_restrictboolean

Indicates if the max number of concurrent outbound calls limit is activated for the SIP trunk.

max_channelsinteger nullable

A maximum number of concurrent outbound calls placed via the SIP trunk. Cannot be higher than the outbound channel capacity configured on the account.

cost_limitboolean

Indicates if the max cost limit for an outbound call limit is activated for the SIP trunk.

max_call_coststring nullable

A maximum cost of an outbound call, in USD.

call_restrictboolean nullable

Indicates if maximum call duration limit is activated for the SIP trunk.

call_limitinteger nullable

A maximum call duration for the SIP trunk, in seconds. Cannot be higher than the max call duration set for the account.

didinfo_enabledboolean

Indicates if inbound calls carry dialed number information in the 'To' header of SIP Invites

rewrite_enabledboolean

Indicates if a custom dial plan is activated for the SIP trunk.

rewrite_prefixstring

Leading digits to be added before the dialed phone numbers.

rewrite_condstring

Leading digits to be deleted from the dialed phone numbers.

call_recording_enabledboolean

Indicates if outbound call recording is enabled on the SIP trunk. Available for Flex Pro customers only.

machine_detection_enabledboolean

Indicates if automatic voicemail detection is enabled on the SIP trunk. Available for Flex Pro customers only.

transcription_enabledboolean

Indicates if automatic call transcription is enabled on the SIP trunk. Available for Flex Pro customers only.

transcription_thresholdinteger

Transcriptions will be generated for calls that meet or exceed the specified minimal call duration threshold, in seconds

created_atstring date-time required

Date and time the SIP trunk was created

hoststring

Registration host for the SIP trunk. dynamic for credential-based registration, or a public static IP address for IP authentication.

multiple_numbersboolean

Indicates whether any active or verified phone number on the account can be used as the Caller ID for the SIP trunk.

encrypted_mediaboolean

Indicates whether SRTP media encryption is enabled for the SIP trunk.

passthroughboolean

Indicates whether Caller ID passthrough is enabled.

access_tokenstring nullable

Static authentication token for the SIP trunk.

Example response

{
  "id": 293,
  "name": "67758",
  "callerid": "12345678900",
  "label": "My trunk",
  "allowed_ips": [
    {
      "id": 6712,
      "ip": "127.0.0.1"
    }
  ],
  "max_channels": 2,
  "cost_limit": true,
  "max_call_cost": "0.18",
  "call_limit": 3600,
  "didinfo_enabled": true,
  "rewrite_enabled": true,
  "rewrite_prefix": "1",
  "call_recording_enabled": true,
  "machine_detection_enabled": true,
  "transcription_threshold": 10,
  "created_at": "2023-05-16T17:13:25.000Z",
  "host": "dynamic",
  "multiple_numbers": true,
  "encrypted_media": true,
  "passthrough": true,
  "access_token": "123easwqe321132"
}

Changes

Changed in 5 of the 50 revisions of this API.38

    • added SIPTrunkResponse to the response body allOf list for the response status 200

      response-body-all-of-added

    • removed SipTrunkResponse from the response body allOf list for the response status 200

      response-body-all-of-removed

    This revision also has 42 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the endpoint scheme security bearerAuth was added to the API

      api-security-added

    This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the response property allOf[subschema #1: SipTrunkResponse]/access_token became nullable for the status 200

      response-property-became-nullable

    • the response property allOf[subschema #1: SipTrunkResponse]/callerid became nullable for the status 200

      response-property-became-nullable

    • added the optional property allOf[subschema #1: SipTrunkResponse]/passthrough to the response with the 200 status

      response-optional-property-added

  • 2e48fd9894e113See the full diff
    • the request property allowed_ips became not nullable

      request-property-became-not-nullable

    • api operation id UpdateaSIPtrunk removed and replaced with sip_trunks_update

      api-operation-id-removed

    • added SipTrunkResponse to the response body allOf list for the response status 200

      response-body-all-of-added

    • removed TrunksResponse from the response body allOf list for the response status 200

      response-body-all-of-removed

    This revision also has 163 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • endpoint added

      endpoint-added