Update Trunk#
Description
Updates a Trunk.
Request#
HTTP Method: PATCH
URI Path: /v3/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. |
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. |
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. |
media_encryption_mode |
|
No |
No |
Media encryption mode. |
stir_shaken_mode |
|
No |
No |
Stir/Shaken mode. |
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_refresh_method_id |
|
No |
No |
SIP method which will be used for session update. |
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. |
allowed_rtp_ips |
Array of |
No |
No |
The allowed RTP IPs. Array from 0 to 10 items: IPv4 or IPv6, single or subnet. |
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_session_expires |
|
No |
No |
Session-Expires header value. Optional, should be in range with sst_min_timer and sst_max_timer. |
port |
|
No |
No |
Port part of R-URI in INVITE request (is not mandatory). |
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. |
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. |
sst_enabled |
|
No |
No |
Enable SIP Session timers customization. |
sst_accept_501 |
|
No |
No |
Do not drop the call after receiving SIP 501 response for non-critical messages. |
auth_enabled |
|
No |
No |
Enable authorization for the SIP server. |
resolve_ruri |
|
No |
No |
Replace host part of the R-URI by resolved IP address. |
rerouting_disconnect_code_ids |
|
No |
No |
|
codec_ids |
|
No |
No |
|
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. |
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
dst |
|
No |
Yes |
Phone number’s. |
Examples#
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 "username": "new_username"
16 }
17 }
18 }
19 }
20}
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": {"username": "new_username"}, "type": "sip_configurations"}}, "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c", "type": "trunks"}}'
response
1HTTP/1.1 201 Created
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 "configuration": {
19 "type": "sip_configurations",
20 "attributes": {
21 "username": "new_username",
22 "host": "example.com",
23 "port": 5060,
24 "codec_ids": [
25 9,
26 7
27 ],
28 "rx_dtmf_format_id": 1,
29 "tx_dtmf_format_id": 1,
30 "resolve_ruri": true,
31 "auth_enabled": true,
32 "auth_user": "username",
33 "auth_password": "password",
34 "auth_from_user": "Office",
35 "auth_from_domain": "example.com",
36 "sst_enabled": false,
37 "sst_min_timer": 600,
38 "sst_max_timer": 900,
39 "sst_accept_501": true,
40 "sip_timer_b": 8000,
41 "dns_srv_failover_timer": 2000,
42 "rtp_ping": false,
43 "rtp_timeout": 30,
44 "force_symmetric_rtp": false,
45 "symmetric_rtp_ignore_rtcp": false,
46 "rerouting_disconnect_code_ids": [
47 58,
48 59
49 ],
50 "sst_session_expires": null,
51 "sst_refresh_method_id": 1,
52 "transport_protocol_id": 2,
53 "max_transfers": 0,
54 "max_30x_redirects": 0
55 }
56 }
57 },
58 "relationships": {
59 "trunk_group": {
60 "links": {
61 "self": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/trunk_group",
62 "related": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/trunk_group"
63 }
64 },
65 "pop": {
66 "links": {
67 "self": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/pop",
68 "related": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/pop"
69 }
70 }
71 }
72 }
73}
http
1PATCH /v3/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": "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/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": "trunks"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "989d8259-9c4f-4449-97b7-a3480b1cffff",
7 "type": "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 "configuration": {
19 "type": "pstn_configurations",
20 "attributes": {
21 "dst": "7xxxxxxxx"
22 }
23 }
24 },
25 "relationships": {
26 "trunk_group": {
27 "links": {
28 "self": "https://api.didww.com/v3/trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/relationships/trunk_group",
29 "related": "https://api.didww.com/v3/trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/trunk_group"
30 }
31 },
32 "pop": {
33 "links": {
34 "self": "https://api.didww.com/v3/trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/relationships/pop",
35 "related": "https://api.didww.com/v3/trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/pop"
36 }
37 }
38 }
39 }
40}
http
1PATCH /v3/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": "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/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": "trunks"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "081ad751-d790-4e70-9c92-7c18f6b50a6d",
7 "type": "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 "configuration": {
19 "type": "sip_configurations",
20 "attributes": {
21 "username": "username",
22 "host": "example.com",
23 "port": 5060,
24 "codec_ids": [
25 9,
26 7
27 ],
28 "rx_dtmf_format_id": 1,
29 "tx_dtmf_format_id": 1,
30 "resolve_ruri": true,
31 "auth_enabled": true,
32 "auth_user": "username",
33 "auth_password": "password",
34 "auth_from_user": "Office",
35 "auth_from_domain": "example.com",
36 "sst_enabled": false,
37 "sst_min_timer": 600,
38 "sst_max_timer": 900,
39 "sst_accept_501": true,
40 "sip_timer_b": 8000,
41 "dns_srv_failover_timer": 2000,
42 "rtp_ping": false,
43 "rtp_timeout": 30,
44 "force_symmetric_rtp": false,
45 "symmetric_rtp_ignore_rtcp": false,
46 "rerouting_disconnect_code_ids": [
47 58,
48 59
49 ],
50 "sst_session_expires": null,
51 "sst_refresh_method_id": 1,
52 "transport_protocol_id": 2,
53 "max_transfers": 0,
54 "max_30x_redirects": 0
55 }
56 }
57 },
58 "relationships": {
59 "trunk_group": {
60 "links": {
61 "self": "https://api.didww.com/v3/trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/relationships/trunk_group",
62 "related": "https://api.didww.com/v3/trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/trunk_group"
63 }
64 },
65 "pop": {
66 "links": {
67 "self": "https://api.didww.com/v3/trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/relationships/pop",
68 "related": "https://api.didww.com/v3/trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/pop"
69 },
70 "data": {
71 "type": "pops",
72 "id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd"
73 }
74 }
75 }
76 },
77 "included": [
78 {
79 "id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd",
80 "type": "pops",
81 "attributes": {
82 "name": "US, NY"
83 }
84 }
85 ]
86}
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 201 Created
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 "configuration": {
19 "type": "sip_configurations",
20 "attributes": {
21 "username": "new_username",
22 "host": "example.com",
23 "port": 5060,
24 "codec_ids": [
25 9,
26 7
27 ],
28 "rx_dtmf_format_id": 1,
29 "tx_dtmf_format_id": 1,
30 "resolve_ruri": true,
31 "auth_enabled": true,
32 "auth_user": "username",
33 "auth_password": "password",
34 "auth_from_user": "Office",
35 "auth_from_domain": "example.com",
36 "sst_enabled": false,
37 "sst_min_timer": 600,
38 "sst_max_timer": 900,
39 "sst_accept_501": true,
40 "sip_timer_b": 8000,
41 "dns_srv_failover_timer": 2000,
42 "rtp_ping": false,
43 "rtp_timeout": 30,
44 "force_symmetric_rtp": false,
45 "symmetric_rtp_ignore_rtcp": false,
46 "rerouting_disconnect_code_ids": [
47 56,
48 57,
49 58,
50 59,
51 60,
52 64,
53 65,
54 66,
55 67,
56 68,
57 69,
58 70,
59 71,
60 72,
61 73,
62 74,
63 75,
64 76,
65 77,
66 78,
67 79,
68 80,
69 81,
70 82,
71 83,
72 84,
73 86,
74 87,
75 88,
76 89,
77 90,
78 91,
79 92,
80 96,
81 97,
82 98,
83 99,
84 100,
85 101,
86 102,
87 103,
88 104,
89 105,
90 106,
91 107,
92 108,
93 1505
94 ],
95 "sst_session_expires": null,
96 "sst_refresh_method_id": 1,
97 "transport_protocol_id": 2,
98 "max_transfers": 0,
99 "max_30x_redirects": 0
100 }
101 }
102 },
103 "relationships": {
104 "trunk_group": {
105 "links": {
106 "self": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/trunk_group",
107 "related": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/trunk_group"
108 }
109 },
110 "pop": {
111 "links": {
112 "self": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/pop",
113 "related": "https://api.didww.com/v3/trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/pop"
114 }
115 }
116 }
117 },
118 "meta": {
119 "api_version": "2021-04-19"
120 }
121}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |