Query SIP Trunk Settings
Endpoint
POST /api/v1.1.0/siptrunk/query?token={token}&type={type}
Request Parameters
Name | Importance | Type | Description |
trunkname | Required | String | SIP trunk name.
Example: “trunkname”:”SIP”
Example: “trunkname”: “SIP1,SIP2”
|
Response Parameters
Name | Type | Description |
trunks | Object | Object parameter. |
id | Int | Trunk ID. |
trunkname | String | Trunk name. |
trunktype | String | SIP trunk type.
|
Register Trunk | ||
host | String | The domain or IP address of the ITSP. |
port | String | The SIP trunk port. |
domain | String | The domain or IP address of the ITSP. |
username | String | The SIP account that is provided by the ITSP. |
authname | String | The SIP account that is provided by the ITSP. |
fromuser | String | If fromuser is set, all outgoing calls from this SIP trunk will use the fromuser value as From Header of the SIP INVITE packets.
Note: If the ITSP does not support it, leave it blank. |
password | String | The password of the SIP account. |
Peer Trunk | ||
host | String | The domain or IP address of the ITSP. |
port | String | SIP trunk port. |
domain | String | The domain or IP address of the ITSP. |
Account Trunk | ||
username | String | The user name of the Account Trunk. |
authname | String | The authentication name of the Account Trunk. |
password | String | The password of the Account Trunk. |
Examples
Request Example
POST /api/v0.0.1/siptrunk/query?token=813b621cfe8eecf445a2ce1f4a079ffe&type=json HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.150
{
“trunkname”: “all”
}
POST /api/v0.0.1/siptrunk/query?token=813b621cfe8eecf445a2ce1f4a079ffe&type=xml HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.150
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<xml>
<trunkname>all</trunkname>
</xml>
Response Example
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
“status”: “Success”,
“trunks”: [
{
“id”: “1”,
“trunkname”: “to-108-16”,
“tech”: “pjsip”,
“trunktype”: “register”,
“host”: “172.16.108.16”,
“port”: “5060”,
“domain”: “172.16.108.16”,
“username”: “6100”,
“authname”: “6100”,
“fromuser”: “”,
“password”: “@123456wW”
},
{
“id”: “2”,
“trunkname”: “to-18-16-2”,
“tech”: “pjsip”,
“trunktype”: “peer”,
“host”: “172.16.108.16”,
“port”: “5060”,
“domain”: “172.16.108.16”
}
]
}
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
<?xml version=”1.0″ encoding=”utf-8″?>
<xml>
<status>Success</status>
<trunks>
<item id=”0″>
<id>2</id>
<trunkname>to-18-16-2</trunkname>
<tech>pjsip</tech>
<trunktype>peer</trunktype>
<host>172.16.108.16</host>
<port>5060</port>
<domain>172.16.108.16</domain>
</item>
</trunks>
</xml>