About
Use this request to create a new SIP trunk associated with a property.
Resource URI
POST
/v2/Properties/{PropertySid}/SipTrunk
Request
URI Parameters
Parameter | Type | Description |
---|---|---|
PropertySid | string | The secure identification to create a SIP trunk. |
Resource Parameters
Parameter | Type | Description |
---|---|---|
Name (Required) | string | Name to add to a sip trunk. |
DefaultCallerId (Required) (E.164 Format including +) |
string | Must be a non-shared-rate, non-tollfree AU number in +E.164 format. |
Type (Required) | short | Sip Trunk type. 0 – IP to IP, 1 – Authenticated. |
SipTrunkIpAddresses (Required when Type = 0) | array | * IpAddress (string): Subnet must be IPv4 CIDR (/24 or smaller). Use /32 for a single IP. Only public IP addresses are allowed. |
SipTrunkCredentials (Required when Type = 1) | object | * Realm (string): Realm for SIP authentication. * Password (string): Password for SIP authentication. At least 10 characters including the following 4 types of characters: a lower-case letter, an upper-case letter, a number, a special character (such as !@#$%^&*). Not more than 2 identical characters in a row (for example, 111 is not allowed). |
SipTrunkAllowedCountries (Optional) | array | * CountryCode (string): Allowed country codes. Example: AU, NZ. Default value is AU if none selected. |
ChannelLimit (Optional) | integer | The number of channels allowed for the SIP trunk. Default value is 1 if none selected. |
CustomerReference (Optional) | string | Custom reference for a sip trunk. |
Example: Creating a new Sip Trunk with Type = 0.
{
"Name": "SipTrunkName",
"DefaultCallerId": "+61799999999",
"Type": 0,
"SipTrunkIpAddresses": [
{
"IpAddress": "1.2.3.4/32"
}
],
"SipTrunkAllowedCountries": [{
"CountryCode": "NZ"
}, {
"CountryCode": "AU"
}]
}
Example: Creating a new Sip Trunk with Type = 1.
{
"Name": "SipTrunkName",
"DefaultCallerId": "+61799999999",
"Type": 1,
"SipTrunkCredentials": {
"Realm": "realm",
"Password": "password"
},
"SipTrunkAllowedCountries": [{
"CountryCode": "NZ"
}, {
"CountryCode": "AU"
}]
}
Response
200 – OK
The server will respond with JSON containing the SIP trunk identifier.
Response Parameters
Parameter | Type | Description |
---|---|---|
SipTrunkSid | string | The secure identifier which uniquely identifies this SIP trunk. |
Example: An example response.
{
"SipTrunkSid": AG5T3HFR5ASD54FS5GB3SDAFJAKSH6DS
}
400 – Error
For error codes and messages, please refer to the REST API Error Codes page.