Incoming trunk CDRs¶
This endpoint provides the ability to retrieve Incoming Trunk CDR history.
Incoming Trunk CDRs reflect all calls that were received on the PBX via Incoming Trunks (DID providers). Internal calls between Internal Numbers (extensions) are not included.
The following HTTP method is available:
GET /incoming_trunk_cdrs - For Fetching Incoming Trunk CDRs
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 |
incoming_trunk |
incoming_trunks |
To-one |
No |
Incoming Trunk that was used to receive a particular call |
Fetching incoming trunk CDRs¶
Use the HTTP GET method to retrieve Incoming Trunk CDRs
GET
/api/rest/public/operator/incoming_trunk_cdrs
This method supports Sorting, Pagination, Sparse fieldsets and Inclusion of related resources
Supported parameters:
Parameter |
Value |
Description |
---|---|---|
filter[src_number] |
Source Number |
Used for filtering results by Source Number |
filter[dst_number] |
Destination Number |
Used for filtering results by Destination Number |
filter[time_start_gteq] |
Call time start greater than |
Used for filtering results by Call start time. Returns all results that exceed the specified time |
filter[time_start_lted] |
Call time start less than |
Used for filtering results by Call start time. Returns all results that are less than the specified time |
filter[incoming_trunk.id] |
Incoming trunk ID |
Used for filtering results by Incoming Trunk ID |
filter[success] |
“true”, “false” |
Used for filtering results by success condition of the call |
Important
The filter[time_start_gteq]=YYYY-MM-DD hh:mm:ss
parameter is mandatory and must always be specified in the request URL as shown in the example bellow
Request and Response examples:
GET /api/rest/public/operator/incoming_trunk_cdrs?filter%5Btime_start_gteq%5D=2020-09-01+00%3A00%3A00 HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
curl -i -X GET 'https://api.telecom.center/api/rest/public/operator/incoming_trunk_cdrs?filter%5Btime_start_gteq%5D=2020-09-01+00%3A00%3A00' -H "Content-Type: application/vnd.api+json" --user username:password
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": [
{
"id": "6ca40208-3d42-44f5-984e-46fd7748e701",
"type": "incoming_trunk_cdrs",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/incoming_trunk_cdrs/6ca40208-3d42-44f5-984e-46fd7748e701"
},
"attributes": {
"duration": 0,
"src_name": "1000",
"src_number": "1000",
"dst_number": "18663127656",
"did_number": "18663127656",
"lega_disconnect_code": 404,
"lega_disconnect_reason": "DID not found",
"lega_call_id": "18-18-1F3E1002-5F5884C30003E010-C214F700",
"success": false,
"time_start": "2020-09-09 07:31:15 +0000",
"time_end": "2020-09-09 07:31:15 +0000",
"time_connect": null
}
}
],
"meta": {
"record_count": 1
},
"links": {
"first": "https://api.telecom.center/api/rest/public/operator/incoming_trunk_cdrs?filter%5Btime_start_gteq%5D=2020-09-01+00%3A00%3A00&page%5Bnumber%5D=1&page%5Bsize%5D=50",
"last": "https://api.telecom.center/api/rest/public/operator/incoming_trunk_cdrs?filter%5Btime_start_gteq%5D=2020-09-01+00%3A00%3A00&page%5Bnumber%5D=1&page%5Bsize%5D=50"
}
}
The response body will contain an array of Incoming Trunk CDRs
In addition, an Incoming Trunk CDR ID may be included in the request URL to retrieve a single CDR:
GET
GET /api/rest/public/operator/termination_cdrs/{id}