SIP accounts¶
This endpoint provides the ability to manage SIP Accounts on your customer accounts.
The customer can create, delete and modify the configuration manually. However, depending on your pricing model, the number of allowed SIP Accounts may be limited when using the Customers endpoint.
When the SIP Account limitation is reached, the ability to “create” a new SIP Account will be locked on the UI, while existing SIP Accounts will remain functional.
The following HTTP method(s) are available on this endpoint:
GET /sip_device_routes - For Fetching SIP accounts
PATCH /sip_device_routes/{id} - For Updating a SIP account
Relationship to other resources:
Name |
Resource Type |
Relationship Type |
Updatable |
Description |
---|---|---|---|---|
customer |
customers |
To-one |
No |
Parent customer’s ID that will include this incoming trunk |
Important
Relationships can be used with include
and fields
parameters if the method supports it.
Fetching SIP accounts¶
Use the HTTP GET method to retrieve a list of SIP Accounts
GET
/api/rest/public/operator/sip_device_routes
This method supports Sorting, Pagination, Sparse fieldsets and Inclusion of related resources
Other supported parameters:
Parameter |
Value |
Description |
---|---|---|
filter[id] |
SIP Account ID |
Used for filtering results by resource ID |
filter[customer.id] |
Customer ID |
Used for filtering results by Customer ID |
filter[username] |
string |
Used for filtering results by SIP Account username |
filter[caller_id_name] |
string |
Used for filtering results by Caller ID name |
filter[allow_external_calls] |
“true”,”false” |
Used for filtering results by allowed outbound calls |
filter[internal_caller_id] |
integer |
Used for filtering results by Internal Caller ID |
filter[external_caller_id] |
integer |
Used for filtering results by External Caller ID |
Request and Response examples:
http
GET /api/rest/public/operator/sip_device_routes HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
curl
curl -i https://api.telecom.center/api/rest/public/operator/sip_device_routes -H 'Content-Type: application/vnd.api+json' --user username:password
response
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": [
{
"id": "c1c798dc-ee42-462e-8fca-0fa96d6fe3c0",
"type": "sip_device_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/sip_device_routes/c1c798dc-ee42-462e-8fca-0fa96d6fe3c0"
},
"attributes": {
"username": "z4wnypvker",
"password": "08hxobdp5z",
"incoming_internal": false,
"incoming_external": false,
"outgoing_internal": false,
"outgoing_external": false,
"on_demand": false,
"caller_id_name": "Helo bye",
"internal_caller_id": null,
"external_caller_id": null,
"allow_external_calls": false,
"is_online": false,
"user_agent": null,
"use_allowed_ips": true,
"allowed_ips": "127.0.0.1/32"
}
}
],
"meta": {
"record_count": 1
},
"links": {
"first": "https://api.telecom.center/api/rest/public/operator/sip_device_routes?page%5Bnumber%5D=1&page%5Bsize%5D=50",
"last": "https://api.telecom.center/api/rest/public/operator/sip_device_routes?page%5Bnumber%5D=1&page%5Bsize%5D=50"
}
}
Additionally, a SIP Account ID may be included in the request URL to retrieve a specific SIP Account:
GET
/api/rest/public/operator/sip_device_routes/{id}
Updating a SIP account¶
Use the HTTP POST method to update an existing SIP Account:
PATCH
/api/rest/public/operator/sip_device_routes/{id}
This method supports Sparse fieldsets and Inclusion of related resources
Supported attributes:
Attribute |
Value |
Description |
Optional |
Controlled via UI |
---|---|---|---|---|
use_allowed_ips |
“true”,”false” |
Used to enable IP-based verification for SIP Account registration |
Yes |
Yes |
allowed_ips |
string |
Used to specify allowed IP addresses for SIP Account registration |
Yes |
Yes |
Request and Response examples:
http
PATCH /api/rest/public/operator/sip_device_routes/c1c798dc-ee42-462e-8fca-0fa96d6fe3c0 HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
{
"data": {
"id": "c1c798dc-ee42-462e-8fca-0fa96d6fe3c0",
"type": "sip_device_routes",
"attributes": {
"use_allowed_ips": "true",
"allowed_ips": "127.0.0.1"
}
}
}
curl
curl -i -X PATCH https://api.telecom.center/api/rest/public/operator/sip_device_routes/c1c798dc-ee42-462e-8fca-0fa96d6fe3c0 -H 'Content-Type: application/vnd.api+json' --data-raw '{"data": {"attributes": {"allowed_ips": "127.0.0.1", "use_allowed_ips": "true"}, "id": "c1c798dc-ee42-462e-8fca-0fa96d6fe3c0", "type": "sip_device_routes"}}' --user username:password
response
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "c1c798dc-ee42-462e-8fca-0fa96d6fe3c0",
"type": "sip_device_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/sip_device_routes/c1c798dc-ee42-462e-8fca-0fa96d6fe3c0"
},
"attributes": {
"username": "z4wnypvker",
"password": "08hxobdp5z",
"incoming_internal": false,
"incoming_external": false,
"outgoing_internal": false,
"outgoing_external": false,
"on_demand": false,
"caller_id_name": "Helo bye",
"internal_caller_id": null,
"external_caller_id": null,
"allow_external_calls": false,
"is_online": false,
"user_agent": null,
"use_allowed_ips": true,
"allowed_ips": "127.0.0.1/32"
}
}
}