Update Voice IN Trunk
Description
Updates a 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 |
After which it will be end transaction with internal disconnect code Ringing timeout if the call was not connected. |
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. |
transport_protocol_id |
|
No |
No |
Transport protocol ID. Possible values: |
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 customers 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 (1 - UDP, 2 - TCP). |
max_transfers |
|
No |
No |
Max count of the REFER requests. |
max_30x_redirects |
|
No |
No |
Max count of 301/302 redirects. |
dst |
|
No |
Yes |
Phone number’s. |
Examples
PATCH /v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "57a939dd-1600-41a6-80b1-f624e22a1f4c",
"type": "voice_in_trunks",
"attributes": {
"configuration": {
"type": "sip_configurations",
"attributes": {
"username": "new_username"
}
}
}
}
}
curl -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": {"username": "new_username"}, "type": "sip_configurations"}}, "id": "57a939dd-1600-41a6-80b1-f624e22a1f4c", "type": "voice_in_trunks"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "57a939dd-1600-41a6-80b1-f624e22a1f4c",
"type": "voice_in_trunks",
"attributes": {
"priority": 1,
"capacity_limit": 10,
"weight": 2,
"name": "Office",
"cli_format": "e164",
"cli_prefix": "+",
"description": "custom description",
"ringing_timeout": 30,
"created_at": "2017-06-25T08:21:41.795Z",
"configuration": {
"type": "sip_configurations",
"attributes": {
"username": "new_username",
"host": "example.com",
"port": 5060,
"codec_ids": [
9,
7
],
"rx_dtmf_format_id": 1,
"tx_dtmf_format_id": 1,
"resolve_ruri": true,
"auth_enabled": true,
"auth_user": "username",
"auth_password": "password",
"auth_from_user": "Office",
"auth_from_domain": "example.com",
"sst_enabled": false,
"sst_min_timer": 600,
"sst_max_timer": 900,
"sst_accept_501": true,
"sip_timer_b": 8000,
"dns_srv_failover_timer": 2000,
"rtp_ping": false,
"rtp_timeout": 30,
"force_symmetric_rtp": false,
"symmetric_rtp_ignore_rtcp": false,
"rerouting_disconnect_code_ids": [
58,
59
],
"sst_session_expires": null,
"sst_refresh_method_id": 1,
"transport_protocol_id": 2,
"max_transfers": 0,
"max_30x_redirects": 0,
"media_encryption_mode": "disabled",
"stir_shaken_mode": "disabled",
"allowed_rtp_ips": null
}
}
},
"relationships": {
"voice_in_trunk_group": {
"links": {
"self": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/voice_in_trunk_group",
"related": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/voice_in_trunk_group"
}
},
"pop": {
"links": {
"self": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/relationships/pop",
"related": "https://api.didww.com/v3/voice_in_trunks/57a939dd-1600-41a6-80b1-f624e22a1f4c/pop"
}
}
}
}
}
PATCH /v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "989d8259-9c4f-4449-97b7-a3480b1cffff",
"type": "voice_in_trunks",
"attributes": {
"configuration": {
"type": "pstn_configurations",
"attributes": {
"dst": "7xxxxxxxx"
}
}
}
}
}
curl -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"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "989d8259-9c4f-4449-97b7-a3480b1cffff",
"type": "voice_in_trunks",
"attributes": {
"priority": 1,
"capacity_limit": 5,
"weight": 65535,
"name": "Office Mobile",
"cli_format": "e164",
"cli_prefix": null,
"description": null,
"ringing_timeout": null,
"created_at": "2017-06-25T08:21:41.795Z",
"configuration": {
"type": "pstn_configurations",
"attributes": {
"dst": "7xxxxxxxx"
}
}
},
"relationships": {
"voice_in_trunk_group": {
"links": {
"self": "https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/relationships/voice_in_trunk_group",
"related": "https://api.didww.com/v3/vocie_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/voice_in_trunk_group"
}
},
"pop": {
"links": {
"self": "https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/relationships/pop",
"related": "https://api.didww.com/v3/voice_in_trunks/989d8259-9c4f-4449-97b7-a3480b1cffff/pop"
}
}
}
}
}
PATCH /v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d?include=pop HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "081ad751-d790-4e70-9c92-7c18f6b50a6d",
"type": "voice_in_trunks",
"attributes": {
"name": "New trunk"
},
"relationships": {
"pop": {
"data": {
"type": "pops",
"id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd"
}
}
}
}
}
curl -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"}}'
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "081ad751-d790-4e70-9c92-7c18f6b50a6d",
"type": "voice_in_trunks",
"attributes": {
"priority": 1,
"capacity_limit": 10,
"weight": 2,
"name": "New trunk",
"cli_format": "e164",
"cli_prefix": "+",
"description": "custom description",
"ringing_timeout": 30,
"created_at": "2017-06-25T08:21:41.795Z",
"configuration": {
"type": "sip_configurations",
"attributes": {
"username": "username",
"host": "example.com",
"port": 5060,
"codec_ids": [
9,
7
],
"rx_dtmf_format_id": 1,
"tx_dtmf_format_id": 1,
"resolve_ruri": true,
"auth_enabled": true,
"auth_user": "username",
"auth_password": "password",
"auth_from_user": "Office",
"auth_from_domain": "example.com",
"sst_enabled": false,
"sst_min_timer": 600,
"sst_max_timer": 900,
"sst_accept_501": true,
"sip_timer_b": 8000,
"dns_srv_failover_timer": 2000,
"rtp_ping": false,
"rtp_timeout": 30,
"force_symmetric_rtp": false,
"symmetric_rtp_ignore_rtcp": false,
"rerouting_disconnect_code_ids": [
58,
59
],
"sst_session_expires": null,
"sst_refresh_method_id": 1,
"transport_protocol_id": 2,
"max_transfers": 0,
"max_30x_redirects": 0,
"media_encryption_mode": "disabled",
"stir_shaken_mode": "disabled",
"allowed_rtp_ips": null
}
}
},
"relationships": {
"voice_in_trunk_group": {
"links": {
"self": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/relationships/voice_in_trunk_group",
"related": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/voice_in_trunk_group"
}
},
"pop": {
"links": {
"self": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/relationships/pop",
"related": "https://api.didww.com/v3/voice_in_trunks/081ad751-d790-4e70-9c92-7c18f6b50a6d/pop"
},
"data": {
"type": "pops",
"id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd"
}
}
}
},
"included": [
{
"id": "cb5ea690-e3a3-4781-a4f3-3bd0123284dd",
"type": "pops",
"attributes": {
"name": "US, NY"
}
}
]
}
Other Responses
Code |
Success |
Description |
---|---|---|
404 |
No |
|
401 |
No |