Termination CDRs

This endpoint provides the ability to retrieve Termination CDR history.

Termination CDRs reflect all calls that originated from the PBX to Termination Gateways (PSTN), and these records include outbound calls as well as call forwarding to PSTN. In general, these calls are billed by the termination provider.

The following HTTP method is available for this endpoint:

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

termination_route

termination_routes

To-one

No

Route that was used to terminate a particular call

termination_gateway

termination_gateway

To-one

No

Gateway that was used to terminate a particular call

Important

Relationships can be used with include and fields parameters if the method supports it.

Fetching termination CDRs

Use the HTTP GET method to retrieve Termination CDRs

GET

/api/rest/public/operator/termination_cdrs

This method supports Sorting, Pagination, Sparse fieldsets and Inclusion of related resources

Other supported parameters:

Parameter

Value

Description

filter[id]

Used for filtering results by Termination CDR ID

filter[aleg_code]

Leg A disconnect code

Used for filtering results by Leg A disconnect code

filter[aleg_reason]

Leg A disconnect reason

Used for filtering results by Leg A disconnect reason

filter[src_name_in]

Source Name

Used for filtering results by Source Name

filter[src_number_in]

Source Number

Used for filtering results by Source Number

filter[dst_number_in]

Destination Number

Used for filtering results by Destination Number

filter[orig_call_id]

Originating call ID

Used for filtering results by Originating call ID

filter[local_tag]

Local tag

Used for filtering results by Local tag

filter[global_tag]

Global tag

Used for filtering results by Global tag

filter[time_start]

Call time start

Used for filtering results by Call time start

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[customer.id]

Customer ID

Used for filtering results by Customer ID

filter[termination_gateway.id]

Termination Gateway ID

Used for filtering results by Termination Gateway ID

filter[termination_route.id]

Termination Route ID

Used for filtering results by Termination Route ID

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:

http

GET /api/rest/public/operator/termination_cdrs?filter%5Btime_start_gteq%5D=2020-06-01+00%3A00%3A00 HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

curl

curl -i -X GET 'https://api.telecom.center/api/rest/public/operator/termination_cdrs?filter%5Btime_start_gteq%5D=2020-06-01+00%3A00%3A00' -H "Content-Type: application/vnd.api+json" --user username:password

response

HTTP/2 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "ec0775b4-3bd0-4dd1-8fa3-cf2f0accbd8b",
      "type": "termination_cdrs",
      "links": {
        "self": "https://api.telecom.center/api/rest/public/operator/termination_cdrs/ec0775b4-3bd0-4dd1-8fa3-cf2f0accbd8b"
      },
      "attributes": {
        "duration": 0,
        "aleg_code": 408,
        "aleg_reason": "Timeout",
        "src_name_in": "Test call",
        "src_number_in": "1000",
        "dst_number_in": "12222110000",
        "orig_call_id": "WF-m1iHXm0ghHUBugLXIDg..",
        "local_tag": "2-30B740A2-5F56150F000098E7-C8947700",
        "global_tag": "srid-16-5f15adf9-65a7-fc1",
        "time_start": "2020-09-07 11:10:07 +0000",
        "time_connect": null,
        "time_end": "2020-09-07 11:10:39 +0000"
      }
    }
  ],
  "meta": {
    "record_count": 1
  },
  "links": {
    "first": "https://api.telecom.center/api/rest/public/operator/termination_cdrs?filter%5Btime_start_gteq%5D=2020-06-01+00%3A00%3A00&page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.telecom.center/api/rest/public/operator/termination_cdrs?filter%5Btime_start_gteq%5D=2020-06-01+00%3A00%3A00&page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

The response body will contain an array of Termination CDRs

In addition, a Termination CDR ID may be included in the request URL to retrieve a single CDR:

GET

/api/rest/public/operator/termination_cdrs/{id}