Update Voice OUT Trunk#
Description
Updates a Trunk.
Request#
HTTP Method: PATCH
URI Path: /v3/voice_out_trunks/{id}
URI Query Parameters:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
id |
|
Yes |
Unique ID identifier of Trunk. |
Data Attributes:
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
name |
|
No |
Yes |
The voice out trunk name. |
allowed_sip_ips |
Array of |
No |
Yes |
The allowed originating IPs. Array from 0 to 15 items: IP v4/v6 single or subnet. |
allowed_rtp_ips |
Array of |
Yes |
No |
The allowed RTP IPs. Array from 0 to 10 items: IP v4/v6 single or subnet. |
on_cli_mismatch_action |
|
No |
Yes |
Possible values are: send_original_cli - the system will pass the |
capacity_limit |
|
Yes |
No |
The capacity limit of the voice out trunk. Allowed values from 0 to 32767. |
allow_any_did_as_cli |
|
No |
No |
When set to |
status |
|
No |
No |
Can be either: active or blocked. If set to |
threshold_amount |
|
Yes |
No |
The outbound trunk 24 hour threshold limit. Can be from 0.0 to 100000.0. |
default_dst_action |
|
No |
No |
Can be either: allow_all or reject_all. |
dst_prefixes |
Array of |
Yes |
No |
The allowed destination prefixes. |
media_encryption_mode |
|
No |
No |
Media encryption mode. |
callback_url |
|
Yes |
No |
Can be null or valid HTTP(s) URL. |
force_symmetric_rtp |
|
No |
No |
When set to |
rtp_ping |
|
No |
No |
When set to |
Request Body Object Relationships:
Title |
Type |
Description |
dids |
The DID numbers if |
Examples#
http
1PATCH /v3/voice_out_trunks/457bf47d-446d-41cd-91c3-dfbda7bf0753 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": "457bf47d-446d-41cd-91c3-dfbda7bf0753",
10 "type": "voice_out_trunks",
11 "attributes": {
12 "name": "Outbound trunk 99",
13 "allowed_sip_ips": [
14 "198.51.100.1"
15 ],
16 "on_cli_mismatch_action": "send_original_cli",
17 "capacity_limit": 300,
18 "allow_any_did_as_cli": false,
19 "status": "blocked",
20 "threshold_amount": "1000.0",
21 "default_dst_action": "allow_all",
22 "dst_prefixes": [
23 "23",
24 "45"
25 ],
26 "media_encryption_mode": "disabled",
27 "allowed_rtp_ips": [
28 "198.51.100.1"
29 ],
30 "force_symmetric_rtp": true,
31 "rtp_ping": true
32 }
33 }
34}
curl
1curl -i -X PATCH https://api.didww.com/v3/voice_out_trunks/457bf47d-446d-41cd-91c3-dfbda7bf0753 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_any_did_as_cli": false, "allowed_rtp_ips": ["198.51.100.1"], "allowed_sip_ips": ["198.51.100.1"], "capacity_limit": 300, "default_dst_action": "allow_all", "dst_prefixes": ["23", "45"], "force_symmetric_rtp": true, "media_encryption_mode": "disabled", "name": "Outbound trunk 99", "on_cli_mismatch_action": "send_original_cli", "rtp_ping": true, "status": "blocked", "threshold_amount": "1000.0"}, "id": "457bf47d-446d-41cd-91c3-dfbda7bf0753", "type": "voice_out_trunks"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "457bf47d-446d-41cd-91c3-dfbda7bf0753",
7 "type": "voice_out_trunks",
8 "attributes": {
9 "allowed_sip_ips": [
10 "198.51.100.1/32"
11 ],
12 "allowed_rtp_ips": [
13 "198.51.100.1/32"
14 ],
15 "allow_any_did_as_cli": false,
16 "status": "blocked",
17 "on_cli_mismatch_action": "reject_call",
18 "name": "Outbound trunk 99",
19 "capacity_limit": 300,
20 "username": "91********",
21 "password": "zu********",
22 "created_at": "2021-12-15T18:59:28.875Z",
23 "threshold_reached": false,
24 "threshold_amount": "1000.0",
25 "media_encryption_mode": "disabled",
26 "default_dst_action": "allow_all",
27 "dst_prefixes": [
28 "23",
29 "45"
30 ],
31 "force_symmetric_rtp": true,
32 "rtp_ping": true,
33 "callback_url": null
34 },
35 "relationships": {
36 "dids": {
37 "links": {
38 "self": "https://api.didww.com/v3/voice_out_trunks/457bf47d-446d-41cd-91c3-dfbda7bf0753/relationships/dids",
39 "related": "https://api.didww.com/v3/voice_out_trunks/457bf47d-446d-41cd-91c3-dfbda7bf0753/dids"
40 }
41 }
42 },
43 "meta": {
44 "spent_amount": "0.0"
45 }
46 },
47 "meta": {
48 "api_version": "2021-12-15"
49 }
50}
http
1PATCH /v3/voice_out_trunks/291ef437-8896-4834-b0c2-eefaa0bbde98 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": "291ef437-8896-4834-b0c2-eefaa0bbde98",
10 "type": "voice_out_trunks",
11 "attributes": {
12 "name": "Outbound trunk 99",
13 "allowed_sip_ips": [
14 "198.51.100.1"
15 ],
16 "on_cli_mismatch_action": "send_original_cli",
17 "capacity_limit": 300,
18 "allow_any_did_as_cli": true,
19 "status": "blocked",
20 "threshold_amount": "1000.0",
21 "default_dst_action": "allow_all",
22 "dst_prefixes": [
23 "23",
24 "45"
25 ],
26 "media_encryption_mode": "disabled",
27 "allowed_rtp_ips": [
28 "198.51.100.1"
29 ],
30 "force_symmetric_rtp": true,
31 "callback_url": "http://example.com",
32 "rtp_ping": true
33 },
34 "relationships": {
35 "dids": {
36 "data": [
37 {
38 "type": "dids",
39 "id": "7a6c177d-a054-4c75-9b4c-b1596ed6fa25"
40 }
41 ]
42 }
43 }
44 }
45}
curl
1curl -i -X PATCH https://api.didww.com/v3/voice_out_trunks/291ef437-8896-4834-b0c2-eefaa0bbde98 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"allow_any_did_as_cli": true, "allowed_rtp_ips": ["198.51.100.1"], "allowed_sip_ips": ["198.51.100.1"], "callback_url": "http://example.com", "capacity_limit": 300, "default_dst_action": "allow_all", "dst_prefixes": ["23", "45"], "force_symmetric_rtp": true, "media_encryption_mode": "disabled", "name": "Outbound trunk 99", "on_cli_mismatch_action": "send_original_cli", "rtp_ping": true, "status": "blocked", "threshold_amount": "1000.0"}, "id": "291ef437-8896-4834-b0c2-eefaa0bbde98", "relationships": {"dids": {"data": [{"type": "dids", "id": "7a6c177d-a054-4c75-9b4c-b1596ed6fa25"}]}}, "type": "voice_out_trunks"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "291ef437-8896-4834-b0c2-eefaa0bbde98",
7 "type": "voice_out_trunks",
8 "attributes": {
9 "allowed_sip_ips": [
10 "198.51.100.1/32"
11 ],
12 "allowed_rtp_ips": [
13 "198.51.100.1/32"
14 ],
15 "allow_any_did_as_cli": false,
16 "status": "blocked",
17 "on_cli_mismatch_action": "send_original_cli",
18 "name": "Outbound trunk 99",
19 "capacity_limit": 300,
20 "username": "e1********",
21 "password": "ke********",
22 "created_at": "2022-03-03T08:21:48.322Z",
23 "threshold_reached": false,
24 "threshold_amount": "1000.0",
25 "media_encryption_mode": "disabled",
26 "default_dst_action": "allow_all",
27 "dst_prefixes": [
28 "23",
29 "45"
30 ],
31 "force_symmetric_rtp": true,
32 "rtp_ping": true,
33 "callback_url": "http://example.com"
34 },
35 "relationships": {
36 "dids": {
37 "links": {
38 "self": "https://api.didww.com/v3/voice_out_trunks/291ef437-8896-4834-b0c2-eefaa0bbde98/relationships/dids",
39 "related": "https://api.didww.com/v3/voice_out_trunks/291ef437-8896-4834-b0c2-eefaa0bbde98/dids"
40 }
41 }
42 },
43 "meta": {
44 "spent_amount": "0.0"
45 }
46 },
47 "meta": {
48 "api_version": "2021-12-15"
49 }
50}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |