Skip to content
CCALL

PBX API: call history, recordings, extensions

Updated:

Using the RESTful API to get CDRs and call recordings#

Besides using the JsSIP library to control calls in code, you can use this API to get call detail records (CDRs) and call recording files.

API endpoint

All requests are submitted to the base URL.

HTTP Methods

All requests are submitted with the HTTP POST method. The "Content-Type" for POST is "application/x-www-form-urlencoded" or "application/json".

Authentication

Every request requires values for the "api_key" and "api_secret" parameters. ePacific provides these values.

1. Get CDR data for a time range

Endpoint: https://api.ccall.vn/cdrs/json

request_data structure (JSON encoded):

api_key, api_secret (required): ePacific provides this key pair to the customer

param(s): date_range, hangup_cause, source, destination, cid_name, direction, page, limit

Examples:

date_range: "date_range" : { "from" : "", "to" : "" } in the format "YYYY-MM-DD HH:mm"

cid_name: "Thanh Nguyen"

source: "1001"

destination: "1005"

hangup_cause: "NORMAL_CLEARING"

direction: one of three values, "inbound", "outbound" or "local" (if the request does not include this parameter, the system queries all three)

page: 1 (current page number)

limit: 50 (rows per page)

Response data structure (JSON encoded):

Without paging

With paging

Field descriptions

"direction": call direction

"cid_name": caller name, the user name of the extension

"source": caller number (extension)

"destination": destination number (extension)

"recording": link to download the call recording file

"start": time the call started

"tta": Time to Answer, how long after the call started the destination answered (in seconds)

"duration": talk time (format hh:mm:ss)

"pdd": Post Dial Delay

"mos": Mean Opinion Score

"status": hangup cause

"paging": paging information

"txtdesc": a short description string

"page_current": the currently selected page number

"limit": maximum rows per page

"record_count": total number of rows

"page_count": total number of pages

"prev_page": previous page (true if there is a previous page, otherwise false)

"next_page": next page (true if there is a next page, otherwise false)

2. Get CDR data by "Call ID"

request_data structure (JSON encoded):

Response data structure (JSON encoded):

Get the list of registered (online) extensions:#

Endpoint: https://api.ccall.vn/ext_reg/json

request_data structure (JSON encoded):

Field descriptions

api_key, api_secret (required): ePacific provides this key pair to the customer

Response data structure (JSON encoded):

Description

For example, the system has 6 extensions, from 100 to 106. The API result shown in the image above means that 2 extensions, 100 and 101, are currently online.

Was this page helpful?