Add a SIP Trunk

Add and configure a SIP trunk.

Endpoint

POST /api/v1.1.0/siptrunk/add?token={token}

Request Parameters

Name Importance Type Description
trunkname Required String SIP trunk name.
trunktype Required String SIP trunk type.
  • register: SIP Register Trunk
  • peer: SIP Peer Trunk
  • account: SIP Account Trunk
Register Trunk
host Required String The domain or IP address of the ITSP.
port Required String The SIP trunk port.
domain Required String The domain or IP address of the ITSP.
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.
domain Required String The domain or IP address of the ITSP.
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.
DOD Number
extensionsdod Optional String

The DOD number that is bound with an extension.

Format: {dod_number}-{dod_name}-{extension_number}

Example: "extensionsdod":"5503301-yeastar-1000"
extensionsgroupdod Optional String The DOD number that is bound with an extension group.

Format: {dod_number}-{dod_name}-{extension_group_name}

Example: "extensionsdod":"5503301-yeastar-sales"

Examples

Request Example

POST /api/v1.1.0/siptrunk/add?token=277ac400357b509b4a587ff2157f7ad5 HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 192.168.5.150
{
    "trunkname": "siptrunk1",
    "trunktype": "register",
    "host": "192.168.12.161",
    "port": "5060",
    "domain": "192.168.12.161",
    "username": "1001",
    "authname": "1001",
    "fromuser": "",
    "password": "Pajsjx9183",
    "extensionsdod": "",
    "extensionsgroupdod": ""
}

Response Example

HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
    "status": "Success"
}