Query Information of a Trunk
Query detailed information of a SIP trunk.
Request URL
GET {base_url}/{api_path}/trunk/get?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | Integer | The unique ID of a trunk.Note:You can query trunk's ID using Search Specific Trunks. |
Response parameters
Register Trunk
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| data | Array <Trunk_Info> | The detailed information of the trunk. |
Trunk_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Trunk ID. |
| name | String | Trunk name. |
| enable | Integer | Whether the trunk is enabled.
|
| country | String | The country of the ITSP. |
| itsp | String | ITSP. |
| type | String | Trunk type.
|
| transport | String | Transport protocol. |
| hostname | String | The domain or IP address of the ITSP. |
| port | Integer | The registration port of the SIP trunk. |
| domain | String | The domain or IP address of the ITSP. |
| username | String | The username of the SIP account that is provided by the ITSP. |
| password | String | The password of the SIP account. |
| auth_name | String | The authentication name that is provided by the ITSP. |
| enb_outbound_proxy | Integer | Whether an outbound proxy is enabled.
|
| outbound_proxy_server | String | The domain name or IP address of the outbound proxy server. |
| outbound_proxy_port | Integer | The port of the outbound proxy server. |
| codec_sel | String | Codec settings of the trunk. |
| def_outbound_cid | String | Default outbound caller ID. |
| def_outbound_cid_name | String | Default outbound caller ID name. |
| outbound_cid_list | Array <OutCaller_Info> | The information of customized outbound caller ID for specific extensions. |
| did_list | Array <DID_List> | DID information associated with the trunk. |
| transparent_trans_180_msg | Integer | Whether the 180 message is forwarded following the peer's SDP presence. |
| setting_of_sip_and_sdp_ip | String | Whether the default or a custom IP address is used in 'Contact'(SIP) and 'Connection'(SIP) fields. |
| sip_and_sdp_ip_addr | String | The custom IP address used in 'Contact'(SIP) and 'Connection'(SIP) fields. |
| ignore_100_response | Integer | Whether the PBX will ignore the 100 Trying response.
|
| force_dod_from | Integer | Whether PBX will ignore the trunk's From User Part setting and forcibly use the extension's selected DOD number in the From header when the extension selects a specific DOD to make an outbound call.
|
| force_sip_uri_scheme | Integer | Whether PBX will forcibly use sip: URI scheme instead of sips: in registration requests to change SIP transport from encrypted to unencrypted.
|
| enb_send_302_on_cf_external | Integer | Whether PBX will return a "302 Moved Temporarily" response to the caller when forwarding an inbound call to an external number.
|
| refer_to_support | Integer | Whether the PBX can process the SIP REFER requests received via the trunk.
|
| refer_to_mode_list | Array<String> | The allowed destination types for blind transfers triggered by REFER requests.
|
| refer_to_prefix | String | The prefix of the outbound route for blind transfers triggered by REFER requests. |
| outbound_failover_sip_code | String | Specify which SIP response codes trigger automatic failover to the next trunk within the same outbound route and re-initiation of the call.
|
| sip_codes | String | Custom SIP response codes that trigger automatic failover to the next trunk within the same outbound route and re-initiation of the call. |
OutCaller_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of an outbound caller ID entry. |
| outbound_cid_option | String | The type of outbound caller ID.
|
| outbound_cid | String | The outbound caller ID. |
| outbound_cid_name | String | The outbound caller ID name. |
| outbound_cid_to_ext_range | String | The extension range corresponding to the outbound caller ID range.Note:This parameter is displayed only when outbound_cid_option is set to range. |
| ext_list | Array <Extension_Info> | The information of the associated extensions.Note:This parameter is displayed only when outbound_cid_option is set to shared. |
| outbound_cid_label | String | The default label of outbound caller ID. |
| outbound_cid_short_code | String | The short code of outbound caller ID. |
Extension_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of an extension or an extension group. |
| type | String | An extension or an extension group.
|
| ext_number | String | The number of an extension or the name of an extension group. |
| ext_name | String | The name of an extension or an extension group. |
DID_List
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of a DID entry. |
| did | String | The DID number associated with the trunk. |
| did_name | String | The DID name associated with the trunk. |
Peer Trunk
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| data | Array <Trunk_Info> | The detailed information of the trunk. |
Trunk_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Trunk ID. |
| name | String | Trunk name. |
| enable | Integer | Whether the trunk is enabled.
|
| country | String | The country of the ITSP. |
| itsp | String | ITSP. |
| type | String | Trunk type.
|
| transport | String | Transport protocol. |
| hostname | String | The domain or IP address of the ITSP. |
| port | Integer | The registration port of the SIP trunk. |
| domain | String | The domain or IP address of the ITSP. |
| codec_sel | String | Codec settings of the trunk. |
| def_outbound_cid | String | Default outbound caller ID. |
| def_outbound_cid_name | String | Default outbound caller ID name. |
| outbound_cid_list | Array <OutCaller_Info> | The information of customized outbound caller ID for specific extensions. |
| did_list | Array <DID_List> | DID information associated with the trunk. |
| transparent_trans_180_msg | Integer | Whether the 180 message is forwarded following the peer's SDP presence. |
| setting_of_sip_and_sdp_ip | String | Whether the default or a custom IP address is used in 'Contact'(SIP) and 'Connection'(SIP) fields. |
| sip_and_sdp_ip_addr | String | The custom IP address used in 'Contact'(SIP) and 'Connection'(SIP) fields. |
| force_dod_from | Integer | Whether PBX will ignore the trunk's From User Part setting and forcibly use the extension's selected DOD number in the From header when the extension selects a specific DOD to make an outbound call.
|
| enb_send_302_on_cf_external | Integer | Whether PBX will return a "302 Moved Temporarily" response to the caller when forwarding an inbound call to an external number.
|
| refer_to_support | Integer | Whether the PBX can process the SIP REFER requests received via the trunk.
|
| refer_to_mode_list | Array<String> | The allowed destination types for blind transfers triggered by REFER requests.
|
| refer_to_prefix | String | The prefix of the outbound route for blind transfers triggered by REFER requests. |
| outbound_failover_sip_code | String | Specify which SIP response codes trigger automatic failover to the next trunk within the same outbound route and re-initiation of the call.
|
| sip_codes | String | Custom SIP response codes that trigger automatic failover to the next trunk within the same outbound route and re-initiation of the call. |
OutCaller_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of an outbound Caller ID entry. |
| outbound_cid_option | String | The type of outbound Caller ID.
|
| outbound_cid | String | The outbound caller ID. |
| outbound_cid_name | String | The outbound caller ID name. |
| outbound_cid_to_ext_range | String | The extension range corresponding to the outbound caller ID range. Note: This parameter is displayed only when outbound_cid_option is set to range. |
| ext_list | Array <Extension_Info> | The information of the associated extensions. Note: This parameter is displayed only when outbound_cid_option is set to shared. |
| outbound_cid_label | String | The default label of outbound caller ID. |
| outbound_cid_short_code | String | The short code of outbound caller ID. |
Extension_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of an extension or an extension group. |
| type | String | Whether this is an extension or an extension group.
|
| ext_number | String | The number of an extension or the name of an extension group. |
| ext_name | String | The name of an extension or an extension group. |
DID_List
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of a DID entry. |
| did | String | The DID number associated with the trunk. |
| did_name | String | The DID name associated with the trunk. |
Account Trunk
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| data | Array <Trunk_Info> | The detailed information of the trunk. |
Trunk_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Trunk ID. |
| name | String | Trunk name. |
| enable | Integer | Whether the trunk is enabled.
|
| country | String | The country of the ITSP. |
| itsp | String | ITSP. |
| type | String | Trunk type.
|
| transport | String | Transport protocol. |
| username | String | The user name of the SIP account trunk. |
| password | String | The password associated with the username. |
| auth_name | String | The authentication name for a third-party device to register with. |
| codec_sel | String | Codec settings of the trunk. |
| def_outbound_cid | String | Default outbound caller ID. |
| def_outbound_cid_name | String | Default outbound caller ID name. |
| transparent_trans_180_msg | Integer | Whether the 180 message is forwarded following the peer's SDP presence. |
| outbound_cid_list | Array <OutCaller_Info> | The information of customized outbound caller ID for specific extensions. |
| ignore_100_response | Integer | Whether the PBX will ignore the 100 Trying response.
|
| force_dod_from | Integer | Whether PBX will ignore the trunk's From User Part setting and forcibly use the extension's selected DOD number in the From header when the extension selects a specific DOD to make an outbound call.
|
| enb_send_302_on_cf_external | Integer | Whether PBX will return a "302 Moved Temporarily" response to the caller when forwarding an inbound call to an external number.
|
| refer_to_support | Integer | Whether the PBX can process the SIP REFER requests received via the trunk.
|
| refer_to_mode_list | Array<String> | The allowed destination types for blind transfers triggered by REFER requests.
|
| refer_to_prefix | String | The prefix of the outbound route for blind transfers triggered by REFER requests. |
| outbound_failover_sip_code | String | Specify which SIP response codes trigger automatic failover to the next trunk within the same outbound route and re-initiation of the call.
|
| sip_codes | String | Custom SIP response codes that trigger automatic failover to the next trunk within the same outbound route and re-initiation of the call. |
OutCaller_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of an outbound caller ID entry. |
| outbound_cid_option | String | The type of outbound caller ID.
|
| outbound_cid | String | The outbound caller ID. |
| outbound_cid_name | String | The outbound caller ID name. |
| outbound_cid_to_ext_range | String | The extension range corresponding to the outbound caller ID range. Note: This parameter is displayed only when outbound_cid_option is set to range. |
| ext_list | Array <Extension_Info> | The information of the associated extensions. Note: This parameter is displayed only when outbound_cid_option is set to shared. |
| outbound_cid_label | String | The default label of outbound caller ID. |
| outbound_cid_short_code | String | The short code of outbound caller ID. |
Extension_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | The unique ID of an extension or an extension group. |
| type | String | Whether this is an extension or an extension group.
|
| ext_number | String | The number of an extension or the name of an extension group. |
| ext_name | String | The name of an extension or extension group. |
Examples
Request example
Query the information of a trunk (ID: "8").
GET /openapi/v1.0/trunk/get?id=8&access_token=lLWhMzGKmWFQ4gNztelxaRq9voCj9PaU& HTTP/1.1 Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"data": {
"id": 8,
"name": "Local_Calls",
"enable": 1,
"country": "general",
"type": "register",
"transport": "udp",
"hostname": "abc.provider.com",
"port": 5060,
"domain": "abc.provider.com",
"username": "6701",
"password": "0T9crrZ0gx",
"auth_name": "mubJwYEWs9",
"enb_outbound_proxy": 0,
"outbound_proxy_server": "",
"outbound_proxy_port": 0,
"codec_sel": "ulaw,alaw,g729",
"def_outbound_cid": "",
"def_outbound_cid_name": "",
"outbound_cid_list": [
{
"id": 11,
"outbound_cid_option": "shared",
"outbound_cid": "5503302",
"outbound_cid_name": "Sales",
"ext_list": [
{
"ext_number": "Sales",
"ext_name": "Sales",
"type": "ext_group",
"id": 7
}
],
"outbound_cid_label": "Yeastar Sales",
"outbound_cid_short_code": "123"
}
],
"did_list": [
{
"id": 8,
"did": "5503300",
"did_name": "Sales"
}
],
"transparent_trans_180_msg": 0,
"setting_of_sip_and_sdp_ip": "default",
"sip_and_sdp_ip_addr": "",
"ignore_100_response": 0,
"force_dod_from": 1,
"enb_send_302_on_cf_external": 0,
"refer_to_support": 1,
"refer_to_mode_list": [
"external_number",
"internal_number"
],
"refer_to_prefix": "55",
"outbound_failover_sip_code": "custom",
"sip_codes": "408;480;500;502;503;513;555;580"
}
}