Add a SIP Trunk
Endpoint
POST /api/v0.0.1/siptrunk/add?token={token}&type={type}
Request Parameters
Name | Importance | Type | Description |
trunkname | Required | String | SIP trunk name. |
trunktype | Required | String | SIP trunk type.
|
Register Trunk | |||
host | Required | String | The domain or IP address of the ITSP. |
port | Required | String | The SIP trunk port. |
username | Required | String | The SIP account that is provided by the ITSP. |
authname | Required | String | The SIP account that is provided by the ITSP. |
fromuser | Optional | 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 doesn’t require this setting, leave fromuser blank. |
password | Required | String | The password of the SIP account. |
Peer Trunk | |||
host | Required | String | The domain or IP address of the ITSP. |
port | Required | String | SIP trunk port. |
Account Trunk | |||
username | Required | String | The user name of the Account Trunk. |
authname | Required | String | The authentication name of the Account Trunk. |
password | Required | String | The password of the Account Trunk. |
Examples
Request Example
POST /api/v0.0.1/siptrunk/add?token=813b621cfe8eecf445a2ce1f4a079ffe&type=json HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.150
{
“trunkname”: “to-108-16-test”,
“trunktype”: “register”,
“host”: “172.16.108.16”,
“port”: “5060”,
“username”:”6100″,
“authname”:”6100″,
“password”:”Rqzswb55″
}
POST /api/v0.0.1/siptrunk/add?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>to-108-16-test</trunkname>
<trunktype>register</trunktype>
<host>172.16.108.16</host>
<port>5060</port>
<domain>172.16.108.16</domain>
<username>6100</username>
<authname>6100</authname>
<password>Rqzswb55</password>
</xml>
Response Example
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
“status”: “Success”
}
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>
</xml>