Create Voice OUT Trunk
POST https://{{host}}/v3/voice_out_trunks
Creates a voice out trunk.
Request Body Scheme
{
data (object, required)
{
type (string, required): voiceouttrunks
Trunksattributes (object, required)
{
Trunk configuration complex object.name (string, required, NOT nullable)
The voice out trunk name.allowedsipips (array[string], required, NOT nullable)
The allowed originating IPs. Array from 0 to 15 items: IP v4/v6 single or subnet.allowedrtpips (array[string], NOT required, nullable)
The allowed RTP IPs. Array from 0 to 10 items: IP v4/v6 single or subnet.onclimismatch_action (enumerate[string], required, NOT nullable): sendoriginalcli, reject_call
Possible values are: sendoriginalcli - the system will pass theFROM
header value to the termination gateway. reject_call - the system will reject the call if theFROM
header value does not match any of the allowed DIDs.capacity_limit (integer, NOT required, nullable): The capacity limit of the voice out trunk. Allowed values from 0 to 32767.
allowanydidascli (boolean, NOT required, NOT nullable): When set to
True
, passed than DIDs relationship can not be set to explicit DIDs. if DIDs relationship is omitted in payload already linked DIDs will be automatically unassigned. Default value isfalse
.status (enumerate[string], NOT required, NOT nullable): active, blocked Can be either: active or blocked. Default value is
active
.threshold_amount (string, NOT required, NOT nullable): The outbound trunk 24 hour threshold limit. Can be from 0.0 to 100000.0.
defaultdstaction (enumerate[string], NOT required, NOT nullable): allow_all, reject_all Can be either: allow_all or reject_all. Default value is
allow_all
.dst_prefixes (array[string], NOT required, nullable) The allowed destination prefixes.
mediaencryptionmode (enumerate[string], NOT required, NOT nullable): disabled, srtp_sdes, srtp_dtls, zrtp Media encryption mode. See RFC4568 about SRTP SDES, RFC5764 about SRTP DTLS, and RFC6189 about ZRTP for more details. Possible values: disabled - Disabled srtp_sdes - SRTP SDES srtp_dtls - SRTP DTLS zrtp - ZRTP
callback_url (string, NOT required, nullable) Can be null or valid HTTP(s) URL.
forcesymmetricrtp (boolean, NOT required, NOT nullable) Forced to work in Symmetric RTP / COMEDIA mode. Default value is
false
.rtp_ping (boolean, NOT required, NOT nullable) Use RTP PING when connecting a call. After establishing the call, DIDWW will send empty RTP packet RTP PING. It is necessary if both parties operate in Symmetric RTP / Comedia mode and expect the other party to start sending RTP first. Default value is
false
.
}
relationships (object, optional)
{
dids (object, optional): to-many
Linkage for included DID Object The DID numbers ifallow_any_did_as_cli
is set tofalse
.
}
}
}
Request Body Example:
Voice OUT trunk
{
"data": {
"type": "voice_out_trunks",
"attributes": {
"name": "Outbound trunk 11",
"allowed_sip_ips": ["192.168.1.1"],
"on_cli_mismatch_action": "send_original_cli",
"capacity_limit": 100,
"allow_any_did_as_cli": true,
"status": "active",
"threshold_amount": "9999.0",
"default_dst_action": "allow_all",
"dst_prefixes": ["23"],
"media_encryption_mode": "disabled",
"allowed_rtp_ips": ["192.168.1.1"],
"force_symmetric_rtp": false,
"rtp_ping": false
}
}
}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string | ||
Content-Type | string | ||
Api-Key | string |
RESPONSES
status: Created
{"data":{"id":"2680024e-b2a1-4175-a1ec-8f40ea144e64","type":"voice_out_trunks","attributes":{"allowed_sip_ips":["192.168.1.1/32"],"allowed_rtp_ips":["192.168.1.1/32"],"allow_any_did_as_cli":false,"status":"active","on_cli_mismatch_action":"send_original_cli","name":"Outbound trunk 100","capacity_limit":300,"username":"ok********","password":"m1********","created_at":"2022-03-03T09:29:20.694Z","threshold_reached":false,"threshold_amount":"1000.0","media_encryption_mode":"disabled","default_dst_action":"allow_all","dst_prefixes":[],"force_symmetric_rtp":false,"rtp_ping":false,"callback_url":"http://10.201.10.1/test.php"},"relationships":{"dids":{"links":{"self":"https://api.didww.com/v3/voice_out_trunks/2680024e-b2a1-4175-a1ec-8f40ea144e64/relationships/dids","related":"https://api.didww.com/v3/voice_out_trunks/2680024e-b2a1-4175-a1ec-8f40ea144e64/dids"}}},"meta":{"spent_amount":"0.0"}},"meta":{"api_version":"2022-05-10"}}