Update Inbound Trunk#
Updates an inbound trunk.
Request#
HTTP Method: PATCH
URI Path: /v3/voice_in_trunks/
URI Query Parameters#
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
id |
|
Yes |
Unique ID identifier of Trunk. |
Data Attributes#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
priority |
|
No |
Yes |
The priority of this target host. |
weight |
|
No |
Yes |
A trunk selection mechanism. |
capacity_limit |
|
No |
No |
Maximum number of simultaneous calls for the trunk. |
ringing_timeout |
|
No |
No |
Ring time in seconds. Supported values are integers from 1 to 32. If |
name |
|
No |
Yes |
Friendly name of the trunk. |
external_reference_id |
|
Yes |
No |
Optional identifier for the inbound trunk in the customer’s external system. Maximum length is 100 characters. |
cli_format |
|
No |
No |
RAW - Do not alter CLI (default). |
cli_prefix |
|
No |
No |
You may prefix the CLI with an optional |
description |
|
No |
No |
Optional description of the trunk. |
configuration |
N/A |
Yes |
Trunk configuration complex object. |
Object Relationships#
Value |
Description |
|---|---|
voice_in_trunk_group |
|
pop |
Attributes Configuration#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
type |
|
No |
Yes |
SIP configuration complex object. |
attributes |
No |
Yes |
SIP configuration attributes object. |
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
type |
|
No |
Yes |
PSTN configuration complex object. |
attributes |
No |
Yes |
PSTN configuration attributes object. |
Configuration Attributes#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
username |
|
No |
Yes |
User part of R-URI in INVITE request. |
host |
|
No |
Yes |
Host part of R-URI in INVITE request. |
port |
|
No |
No |
Port part of R-URI in INVITE request (is not mandatory). |
codec_ids |
|
No |
No |
|
rx_dtmf_format_id |
|
No |
No |
The method id for receiving DTMF signals from customers equipment. |
tx_dtmf_format_id |
|
No |
No |
The method of sending DTMF signals to the customer’s equipment. |
resolve_ruri |
|
No |
No |
Replace host part of the R-URI by resolved IP address. |
auth_enabled |
|
No |
No |
Enable authorization for the SIP server. |
auth_user |
|
No |
No |
Optional authorization user for the SIP server. |
auth_password |
|
No |
No |
Optional authorization password for the SIP server. |
auth_from_user |
|
No |
No |
Specify user in a from field instead of CallerID (overrides CallerID). |
auth_from_domain |
|
No |
No |
Sets default from domain in SIP messages. Some equipment may require specific From Domain. |
sst_enabled |
|
No |
No |
Enable SIP Session timers customization. |
sst_min_timer |
|
No |
No |
Minimal SIP Session timer value (Default 600 seconds). |
sst_max_timer |
|
No |
No |
Maximal SIP Session timer value (Default 900 seconds). |
sst_accept_501 |
|
No |
No |
Do not drop the call after receiving SIP 501 response for non-critical messages. |
sip_timer_b |
|
No |
No |
INVITE transaction timeout (Default 8000ms). |
dns_srv_failover_timer |
|
No |
No |
Invite transaction timeout for each of gateways with DNS SRV rerouting (Default 2000ms). |
rtp_ping |
|
No |
No |
Use RTP PING when connecting a call. |
rtp_timeout |
|
No |
No |
Disconnect the call if the RTP packets do not arrive within the specified time. |
force_symmetric_rtp |
|
No |
No |
Forced to work in Symmetric RTP / COMEDIA mode. |
symmetric_rtp_ignore_rtcp |
|
No |
No |
Avoid switching RTP session based on RTCP packet while working in Symmetric RTP / COMEDIA. |
rerouting_disconnect_code_ids |
|
No |
No |
|
sst_session_expires |
|
No |
No |
Session-Expires header value. Optional, should be in range with sst_min_timer and sst_max_timer. |
sst_refresh_method_id |
|
No |
No |
SIP method which will be used for session update. |
transport_protocol_id |
|
No |
No |
The transport layer that will be responsible for the actual transmission of SIP requests and responses: |
max_transfers |
|
No |
No |
Max count of the REFER requests. |
max_30x_redirects |
|
No |
No |
Max count of 301/302 redirects. |
media_encryption_mode |
|
No |
No |
Media encryption mode. |
stir_shaken_mode |
|
No |
No |
Stir/Shaken mode. |
allowed_rtp_ips |
Array of |
No |
No |
The allowed RTP IPs. Array from 0 to 10 items: IPv4 or IPv6, single or subnet. |
network_protocol_priority |
|
No |
No |
Network protocol priority for SIP routing. |
enabled_sip_registration |
|
No |
No |
Enables SIP registration for the trunk. |
use_did_in_ruri |
|
No |
No |
Uses the called DID in the R-URI. This attribute works only when |
diversion_relay_policy |
|
No |
No |
Controls how Diversion information is relayed. |
diversion_inject_mode |
|
No |
No |
Controls how Diversion information is injected. |
cnam_lookup |
|
No |
No |
Enables inbound CNAM lookup. |
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
dst |
|
No |
Yes |
Phone number’s. |
Examples#
http
1PATCH /v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c",
10 "type": "voice_in_trunks",
11 "attributes": {
12 "configuration": {
13 "type": "sip_configurations",
14 "attributes": {
15 "username": "new_username",
16 "host": "example.com",
17 "port": 5060,
18 "codec_ids": [
19 9,
20 7
21 ],
22 "rx_dtmf_format_id": 1,
23 "tx_dtmf_format_id": 1,
24 "resolve_ruri": true,
25 "auth_enabled": true,
26 "auth_user": "username",
27 "auth_password": "password",
28 "auth_from_user": "Office",
29 "auth_from_domain": "example.com",
30 "sst_enabled": false,
31 "sst_min_timer": 600,
32 "sst_max_timer": 900,
33 "sst_accept_501": true,
34 "sip_timer_b": 8000,
35 "dns_srv_failover_timer": 2000,
36 "rtp_ping": false,
37 "rtp_timeout": 30,
38 "force_symmetric_rtp": false,
39 "symmetric_rtp_ignore_rtcp": false,
40 "rerouting_disconnect_code_ids": [
41 58,
42 59
43 ],
44 "sst_session_expires": null,
45 "sst_refresh_method_id": 1,
46 "transport_protocol_id": 2,
47 "max_transfers": 0,
48 "max_30x_redirects": 0,
49 "media_encryption_mode": "disabled",
50 "stir_shaken_mode": "disabled",
51 "allowed_rtp_ips": null,
52 "network_protocol_priority": "prefer_ipv6",
53 "enabled_sip_registration": true,
54 "use_did_in_ruri": true,
55 "diversion_relay_policy": "tel",
56 "diversion_inject_mode": "did_number",
57 "cnam_lookup": true
58 }
59 }
60 }
61 }
62}
curl
1curl -i -X PATCH https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"configuration": {"attributes": {"allowed_rtp_ips": null, "auth_enabled": true, "auth_from_domain": "example.com", "auth_from_user": "Office", "auth_password": "password", "auth_user": "username", "cnam_lookup": true, "codec_ids": [9, 7], "diversion_inject_mode": "did_number", "diversion_relay_policy": "tel", "dns_srv_failover_timer": 2000, "enabled_sip_registration": true, "force_symmetric_rtp": false, "host": "example.com", "max_30x_redirects": 0, "max_transfers": 0, "media_encryption_mode": "disabled", "network_protocol_priority": "prefer_ipv6", "port": 5060, "rerouting_disconnect_code_ids": [58, 59], "resolve_ruri": true, "rtp_ping": false, "rtp_timeout": 30, "rx_dtmf_format_id": 1, "sip_timer_b": 8000, "sst_accept_501": true, "sst_enabled": false, "sst_max_timer": 900, "sst_min_timer": 600, "sst_refresh_method_id": 1, "sst_session_expires": null, "stir_shaken_mode": "disabled", "symmetric_rtp_ignore_rtcp": false, "transport_protocol_id": 2, "tx_dtmf_format_id": 1, "use_did_in_ruri": true, "username": "new_username"}, "type": "sip_configurations"}}, "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c", "type": "voice_in_trunks"}}'
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c",
7 "type": "voice_in_trunks",
8 "attributes": {
9 "priority": 1,
10 "capacity_limit": 10,
11 "weight": 2,
12 "name": "Office",
13 "cli_format": "e164",
14 "cli_prefix": "+",
15 "description": "custom description",
16 "ringing_timeout": 30,
17 "created_at": "2017-06-25T08:21:41.795Z",
18 "external_reference_id": null,
19 "configuration": {
20 "type": "sip_configurations",
21 "attributes": {
22 "username": "new_username",
23 "host": "example.com",
24 "port": 5060,
25 "codec_ids": [
26 9,
27 7
28 ],
29 "rx_dtmf_format_id": 1,
30 "tx_dtmf_format_id": 1,
31 "resolve_ruri": true,
32 "auth_enabled": true,
33 "auth_user": "username",
34 "auth_password": "password",
35 "auth_from_user": "Office",
36 "auth_from_domain": "example.com",
37 "sst_enabled": false,
38 "sst_min_timer": 600,
39 "sst_max_timer": 900,
40 "sst_accept_501": true,
41 "sip_timer_b": 8000,
42 "dns_srv_failover_timer": 2000,
43 "rtp_ping": false,
44 "rtp_timeout": 30,
45 "force_symmetric_rtp": false,
46 "symmetric_rtp_ignore_rtcp": false,
47 "rerouting_disconnect_code_ids": [
48 58,
49 59
50 ],
51 "sst_session_expires": null,
52 "sst_refresh_method_id": 1,
53 "transport_protocol_id": 2,
54 "max_transfers": 0,
55 "max_30x_redirects": 0,
56 "media_encryption_mode": "disabled",
57 "stir_shaken_mode": "disabled",
58 "allowed_rtp_ips": null,
59 "network_protocol_priority": "prefer_ipv6",
60 "enabled_sip_registration": true,
61 "use_did_in_ruri": true,
62 "diversion_relay_policy": "tel",
63 "diversion_inject_mode": "did_number",
64 "cnam_lookup": true
65 }
66 }
67 },
68 "relationships": {
69 "voice_in_trunk_group": {
70 "links": {
71 "self": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/voice_in_trunk_group",
72 "related": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/voice_in_trunk_group"
73 }
74 },
75 "pop": {
76 "links": {
77 "self": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/pop",
78 "related": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/pop"
79 }
80 }
81 }
82 }
83}
http
1PATCH /v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "id": "989d8259-9c4f-4449-97b7-a3480b1cffff",
10 "type": "voice_in_trunks",
11 "attributes": {
12 "configuration": {
13 "type": "pstn_configurations",
14 "attributes": {
15 "dst": "7xxxxxxxx"
16 }
17 }
18 }
19 }
20}
curl
1curl -i -X PATCH https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"configuration": {"attributes": {"dst": "7xxxxxxxx"}, "type": "pstn_configurations"}}, "id": "989d8259-9c4f-4449-97b7-a3480b1cffff", "type": "voice_in_trunks"}}'
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "989d8259-9c4f-4449-97b7-a3480b1cffff",
7 "type": "voice_in_trunks",
8 "attributes": {
9 "priority": 1,
10 "capacity_limit": 5,
11 "weight": 65535,
12 "name": "Office Mobile",
13 "cli_format": "e164",
14 "cli_prefix": null,
15 "description": null,
16 "ringing_timeout": null,
17 "created_at": "2017-06-25T08:21:41.795Z",
18 "external_reference_id": null,
19 "configuration": {
20 "type": "pstn_configurations",
21 "attributes": {
22 "dst": "7xxxxxxxx"
23 }
24 }
25 },
26 "relationships": {
27 "voice_in_trunk_group": {
28 "links": {
29 "self": "https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/relationships/voice_in_trunk_group",
30 "related": "https://api.didww.com/v3/vocie_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/voice_in_trunk_group"
31 }
32 },
33 "pop": {
34 "links": {
35 "self": "https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/relationships/pop",
36 "related": "https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/pop"
37 }
38 }
39 }
40 }
41}
http
1PATCH /v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d?include=pop HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "id": "081ad751-d790-4e70-9c92-7c18f6b50a6d",
10 "type": "voice_in_trunks",
11 "attributes": {
12 "name": "New trunk"
13 },
14 "relationships": {
15 "pop": {
16 "data": {
17 "type": "pops",
18 "id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd"
19 }
20 }
21 }
22 }
23}
curl
1curl -i -X PATCH 'https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d?include=pop' -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"name": "New trunk"}, "id": "081ad751-d790-4e70-9c92-7c18f6b50a6d", "relationships": {"pop": {"data": {"id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd", "type": "pops"}}}, "type": "voice_in_trunks"}}'
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "081ad751-d790-4e70-9c92-7c18f6b50a6d",
7 "type": "voice_in_trunks",
8 "attributes": {
9 "priority": 1,
10 "capacity_limit": 10,
11 "weight": 2,
12 "name": "New trunk",
13 "cli_format": "e164",
14 "cli_prefix": "+",
15 "description": "custom description",
16 "ringing_timeout": 30,
17 "created_at": "2017-06-25T08:21:41.795Z",
18 "external_reference_id": null,
19 "configuration": {
20 "type": "sip_configurations",
21 "attributes": {
22 "username": "username",
23 "host": "example.com",
24 "port": 5060,
25 "codec_ids": [
26 9,
27 7
28 ],
29 "rx_dtmf_format_id": 1,
30 "tx_dtmf_format_id": 1,
31 "resolve_ruri": true,
32 "auth_enabled": true,
33 "auth_user": "username",
34 "auth_password": "password",
35 "auth_from_user": "Office",
36 "auth_from_domain": "example.com",
37 "sst_enabled": false,
38 "sst_min_timer": 600,
39 "sst_max_timer": 900,
40 "sst_accept_501": true,
41 "sip_timer_b": 8000,
42 "dns_srv_failover_timer": 2000,
43 "rtp_ping": false,
44 "rtp_timeout": 30,
45 "force_symmetric_rtp": false,
46 "symmetric_rtp_ignore_rtcp": false,
47 "rerouting_disconnect_code_ids": [
48 58,
49 59
50 ],
51 "sst_session_expires": null,
52 "sst_refresh_method_id": 1,
53 "transport_protocol_id": 2,
54 "max_transfers": 0,
55 "max_30x_redirects": 0,
56 "media_encryption_mode": "disabled",
57 "stir_shaken_mode": "disabled",
58 "allowed_rtp_ips": null
59 }
60 }
61 },
62 "relationships": {
63 "voice_in_trunk_group": {
64 "links": {
65 "self": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/relationships/voice_in_trunk_group",
66 "related": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/voice_in_trunk_group"
67 }
68 },
69 "pop": {
70 "links": {
71 "self": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/relationships/pop",
72 "related": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/pop"
73 },
74 "data": {
75 "type": "pops",
76 "id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd"
77 }
78 }
79 }
80 },
81 "included": [
82 {
83 "id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd",
84 "type": "pops",
85 "attributes": {
86 "name": "US, NY"
87 }
88 }
89 ]
90}
http
1PATCH /v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7{
8 "data": {
9 "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c",
10 "type": "trunks",
11 "attributes": {
12 "configuration": {
13 "type": "sip_configurations",
14 "attributes": {
15 "rerouting_disconnect_code_ids": [
16 56,
17 57,
18 58,
19 59,
20 60,
21 64,
22 65,
23 66,
24 67,
25 68,
26 69,
27 70,
28 71,
29 72,
30 73,
31 74,
32 75,
33 76,
34 77,
35 78,
36 79,
37 80,
38 81,
39 82,
40 83,
41 84,
42 86,
43 87,
44 88,
45 89,
46 90,
47 91,
48 92,
49 96,
50 97,
51 98,
52 99,
53 100,
54 101,
55 102,
56 103,
57 104,
58 105,
59 106,
60 107,
61 108,
62 1505
63 ]
64 }
65 }
66 }
67 }
68}
curl
1curl -i -X PATCH https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"configuration": {"attributes": {"rerouting_disconnect_code_ids": [56, 57, 58, 59, 60, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 91, 92, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 1505]}, "type": "sip_configurations"}}, "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c", "type": "trunks"}}'
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c",
7 "type": "trunks",
8 "attributes": {
9 "priority": 1,
10 "capacity_limit": 10,
11 "weight": 2,
12 "name": "Office",
13 "cli_format": "e164",
14 "cli_prefix": "+",
15 "description": "custom description",
16 "ringing_timeout": 30,
17 "created_at": "2017-06-25T08:21:41.795Z",
18 "external_reference_id": null,
19 "configuration": {
20 "type": "sip_configurations",
21 "attributes": {
22 "username": "new_username",
23 "host": "example.com",
24 "port": 5060,
25 "codec_ids": [
26 9,
27 7
28 ],
29 "rx_dtmf_format_id": 1,
30 "tx_dtmf_format_id": 1,
31 "resolve_ruri": true,
32 "auth_enabled": true,
33 "auth_user": "username",
34 "auth_password": "password",
35 "auth_from_user": "Office",
36 "auth_from_domain": "example.com",
37 "sst_enabled": false,
38 "sst_min_timer": 600,
39 "sst_max_timer": 900,
40 "sst_accept_501": true,
41 "sip_timer_b": 8000,
42 "dns_srv_failover_timer": 2000,
43 "rtp_ping": false,
44 "rtp_timeout": 30,
45 "force_symmetric_rtp": false,
46 "symmetric_rtp_ignore_rtcp": false,
47 "rerouting_disconnect_code_ids": [
48 56,
49 57,
50 58,
51 59,
52 60,
53 64,
54 65,
55 66,
56 67,
57 68,
58 69,
59 70,
60 71,
61 72,
62 73,
63 74,
64 75,
65 76,
66 77,
67 78,
68 79,
69 80,
70 81,
71 82,
72 83,
73 84,
74 86,
75 87,
76 88,
77 89,
78 90,
79 91,
80 92,
81 96,
82 97,
83 98,
84 99,
85 100,
86 101,
87 102,
88 103,
89 104,
90 105,
91 106,
92 107,
93 108,
94 1505
95 ],
96 "sst_session_expires": null,
97 "sst_refresh_method_id": 1,
98 "transport_protocol_id": 2,
99 "max_transfers": 0,
100 "max_30x_redirects": 0
101 }
102 }
103 },
104 "relationships": {
105 "trunk_group": {
106 "links": {
107 "self": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/trunk_group",
108 "related": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/trunk_group"
109 }
110 },
111 "pop": {
112 "links": {
113 "self": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/pop",
114 "related": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/pop"
115 }
116 }
117 }
118 },
119 "meta": {
120 "api_version": "2026-04-16"
121 }
122}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |