Search Specific Trunks
Search specific trunks from the trunk list.
Request URL
GET {base_url}/{api_path}/trunk/search?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| page | No | Integer | Define which page is displayed. |
| page_size | No | Integer | Define how many records per page. |
| sort_by | No | String | Define the sorting field. Valid value:
|
| order_by | No | String | Define the display order. Valid value:
|
| search_value | No | String | Search keyword. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
|
| errmsg | String | Returned message.
|
| total_number | Integer | The total of the searched trunk. |
| data | Array <Trunk_Info> | The information of the trunk. |
Trunk_Info
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Trunk ID. |
| status | Integer | Trunk status. |
| name | String | Trunk name. |
| type | String | Trunk type.
|
| host_port | String | Hostname and port. |
| def_outbound_cid | String | Trunk outbound caller ID. |
| username | String | Username. Note:This field is only available when the trunk type is register or account. |
Trunk status
| Status | Description |
|---|---|
| 0 | Unknown status. |
| 1 | The trunk is idle. |
| 2 | The trunk is busy. |
| 3 | The SIP trunk is idle and unmonitored. |
| 4 | The SIP trunk is registering. |
| 41 | SIP register trunk registration failed. |
| 42 | SIP trunk is unreachable. |
| 43 | SIP account trunk is unavailable. |
| 44 | SIP trunk is disabled. |
Examples
Request example
Search peer trunk from the trunk list.
GET /openapi/v1.0/trunk/search?search_value=peer&access_token=apz5vsX2UjbOYq1XN9jhFbc4V20mSVuq HTTP/1.1 Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"total_number": 1,
"data": [
{
"id": 27,
"status": 1,
"name": "peer-to-41",
"type": "peer",
"host_port": "112.48.19.180:18000",
"def_outbound_cid": "13200000092"
}
]
}