Create Outbound Trunk#
Creates an outbound trunk.
Request#
HTTP Method: POST
URI Path: /v3/voice_out_trunks
Body Parameters#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
type |
|
No |
Yes |
Trunks |
attributes |
|
No |
Yes |
Trunk configuration complex object. |
Data Attributes#
Name |
Type |
Nullable |
Is Required? |
Description |
|---|---|---|---|---|
name |
|
No |
Yes |
The outbound trunk name. |
allowed_sip_ips |
Array of |
No |
Yes |
The allowed originating IPs. Array from 0 to 60 items: IP v4/v6 single or subnet. |
allowed_rtp_ips |
Array of |
Yes |
No |
The allowed RTP IPs. Array from 0 to 60 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 outbound 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
1POST /v3/voice_out_trunks 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 "type": "voice_out_trunks",
10 "attributes": {
11 "name": "Outbound trunk 11",
12 "allowed_sip_ips": ["198.51.100.1"],
13 "on_cli_mismatch_action": "send_original_cli",
14 "capacity_limit": 100,
15 "allow_any_did_as_cli": true,
16 "status": "active",
17 "threshold_amount": "9999.0",
18 "default_dst_action": "allow_all",
19 "dst_prefixes": ["23"],
20 "media_encryption_mode": "disabled",
21 "allowed_rtp_ips": ["198.51.100.1"],
22 "force_symmetric_rtp": false,
23 "rtp_ping": false
24 }
25 }
26}
curl
1curl -i -X POST https://api.didww.com/v3/voice_out_trunks -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"], "capacity_limit": 100, "default_dst_action": "allow_all", "dst_prefixes": ["23"], "force_symmetric_rtp": false, "media_encryption_mode": "disabled", "name": "Outbound trunk 11", "on_cli_mismatch_action": "send_original_cli", "rtp_ping": false, "status": "active", "threshold_amount": "9999.0"}, "type": "voice_out_trunks"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "d471975a-c6ee-4f84-80f0-fad67c5e22b1",
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": true,
16 "status": "active",
17 "on_cli_mismatch_action": "send_original_cli",
18 "name": "Outbound trunk 11",
19 "capacity_limit": 100,
20 "username": "euc******",
21 "password": "6fw******",
22 "created_at": "2021-12-02T07:17:40.125Z",
23 "threshold_reached": false,
24 "threshold_amount": "9999.0",
25 "media_encryption_mode": "disabled",
26 "default_dst_action": "allow_all",
27 "dst_prefixes": [
28 "23"
29 ],
30 "force_symmetric_rtp": false,
31 "rtp_ping": false,
32 "callback_url": null
33 },
34 "relationships": {
35 "dids": {
36 "links": {
37 "self": "https://api.didww.com/v3/voice_out_trunks/d471975a-c6ee-4f84-80f0-fad67c5e22b1/relationships/dids",
38 "related": "https://api.didww.com/v3/voice_out_trunks/d471975a-c6ee-4f84-80f0-fad67c5e22b1/dids"
39 }
40 }
41 },
42 "meta": {
43 "spent_amount": "0.0"
44 }
45 },
46 "meta": {
47 "api_version": "2022-05-10"
48 }
49}
http
1POST /v3/voice_out_trunks 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 "type": "voice_out_trunks",
10 "attributes": {
11 "name": "Outbound replace cli",
12 "allowed_sip_ips": [
13 "198.51.100.1"
14 ],
15 "on_cli_mismatch_action": "send_original_cli",
16 "capacity_limit": 300,
17 "allow_any_did_as_cli": true,
18 "status": "blocked",
19 "threshold_amount": "1000.0",
20 "default_dst_action": "allow_all",
21 "dst_prefixes": [
22 "23",
23 "45"
24 ],
25 "media_encryption_mode": "disabled",
26 "allowed_rtp_ips": [
27 "198.51.100.1"
28 ],
29 "force_symmetric_rtp": true,
30 "callback_url": "http://example.com",
31 "rtp_ping": true
32 }
33 }
34}
curl
1curl -i -X POST https://api.didww.com/v3/voice_out_trunks -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 replace cli", "on_cli_mismatch_action": "send_original_cli", "rtp_ping": true, "status": "blocked", "threshold_amount": "1000.0"}, "type": "voice_out_trunks"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "138a6765-bd54-4814-8ce7-35adc524e1fb",
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": true,
16 "status": "blocked",
17 "on_cli_mismatch_action": "send_original_cli",
18 "name": "Outbound replace cli",
19 "capacity_limit": 300,
20 "username": "p2********",
21 "password": "88********",
22 "created_at": "2022-01-12T18:13:55.417Z",
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/138a6765-bd54-4814-8ce7-35adc524e1fb/relationships/dids",
39 "related": "https://api.didww.com/v3/voice_out_trunks/138a6765-bd54-4814-8ce7-35adc524e1fb/dids"
40 }
41 }
42 },
43 "meta": {
44 "spent_amount": "0.0"
45 }
46 },
47 "meta": {
48 "api_version": "2022-05-10"
49 }
50}
http
1POST /v3/voice_out_trunks 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 "type": "voice_out_trunks",
10 "attributes": {
11 "name": "Outbound trunk 100",
12 "allowed_sip_ips": [
13 "198.51.100.1"
14 ],
15 "on_cli_mismatch_action": "reject_call",
16 "capacity_limit": 300,
17 "allow_any_did_as_cli": false,
18 "status": "active",
19 "threshold_amount": "1000.0",
20 "default_dst_action": "allow_all",
21 "dst_prefixes": [],
22 "media_encryption_mode": "disabled",
23 "allowed_rtp_ips": [
24 "198.51.100.1"
25 ],
26 "force_symmetric_rtp": false,
27 "callback_url": "http://example.com",
28 "rtp_ping": false
29 },
30 "relationships": {
31 "dids": {
32 "data": [
33 {
34 "type": "dids",
35 "id": "7a6c177d-a054-4c75-9b4c-b1596ed6fa25"
36 }
37 ]
38 }
39 }
40 }
41}
curl
1curl -i -X POST https://api.didww.com/v3/voice_out_trunks -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"], "callback_url": "http://example.com", "capacity_limit": 300, "default_dst_action": "allow_all", "dst_prefixes": [], "force_symmetric_rtp": false, "media_encryption_mode": "disabled", "name": "Outbound trunk 100", "on_cli_mismatch_action": "reject_call", "rtp_ping": false, "status": "active", "threshold_amount": "1000.0"}, "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": "2680024e-b2a1-4175-a1ec-8f40ea144e64",
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": "active",
17 "on_cli_mismatch_action": "reject_call",
18 "name": "Outbound trunk 100",
19 "capacity_limit": 300,
20 "username": "ok********",
21 "password": "m1********",
22 "created_at": "2022-03-03T09:29:20.694Z",
23 "threshold_reached": false,
24 "threshold_amount": "1000.0",
25 "media_encryption_mode": "disabled",
26 "default_dst_action": "allow_all",
27 "dst_prefixes": [],
28 "force_symmetric_rtp": false,
29 "rtp_ping": false,
30 "callback_url": "http://example.com"
31 },
32 "relationships": {
33 "dids": {
34 "links": {
35 "self": "https://api.didww.com/v3/voice_out_trunks/2680024e-b2a1-4175-a1ec-8f40ea144e64/relationships/dids",
36 "related": "https://api.didww.com/v3/voice_out_trunks/2680024e-b2a1-4175-a1ec-8f40ea144e64/dids"
37 }
38 }
39 },
40 "meta": {
41 "spent_amount": "0.0"
42 }
43 },
44 "meta": {
45 "api_version": "2022-05-10"
46 }
47}
Other Responses#
Code |
Success |
Description |
|---|---|---|
422 |
No |
|
401 |
No |