CDRs API
Call detail records (CDRs) provide a summary view of a call leg. Use the CDR API to manage call history records.
API calls
Click on each call to view the endpoint, method, and request example.
- Get a summary of CDRs
- Get a list of CDRs by time range
- Get CDRs as CSV
- Get details of a CDR
- Get interaction summary
- Get all legs related to an interaction
Parameters
The table shows the possible parameters available for CDR requests.
Note
Some CDR attributes or CDR fields are for internal or billing purposes only. You can't access them using our API but they might appear in the CDR. For a description of these fields, contact IP Telecom support.
Key | Description | Type | Options/Min/Max/Default |
---|---|---|---|
call_id |
Required. Unique identifier of the call leg. | string | |
app_name |
The application that issued the CDR. | string | |
app_version |
The internal version number of the application that issued the CDR. | string | |
billing_seconds |
The number of seconds the call leg can be billed for (typically from when the call leg is answered). | string | |
call_direction |
The direction of the call, relative to the media switch. If inbound , the leg came into the media switch (typically the A-leg). If outbound , the leg started on the media switch (typically the B-leg). |
string | inbound , outbound |
callee_id_name |
The indicated name of the callee. | string | |
callee_id_number |
The indicated number of the callee. | string | |
caller_id_name |
The indicated name of the caller. | string | |
caller_id_number |
The indicated number of the caller. | string | |
custom_channel_vars |
Specific key/value pairs set on the channel. | object | |
custom_sip_headers |
A property list of SIP headers beginning with the prefix X- . |
object | |
digits_dialed |
All the DTMF tones detected on this leg of the call. | string | |
disposition |
Specifies who sent the SIP BYE message. | string | |
duration_seconds |
The duration of the call leg, in seconds. | integer | |
fax_bad_rows |
The number of rows that failed to transfer (fax request only) . | string | |
fax_ecm_used |
Specifies if error correction mode (ECM) was used on the fax (fax request only). | string | |
fax_result_code |
The result code of the transmission (fax request only). | string | |
fax_result_text |
The error string, if any, or 'OK' if successful (fax request only). | string | |
fax_success |
Indicates if the fax was considered a success (fax request only). | boolean | |
fax_total_pages |
The total number of pages (fax request only). | string | |
fax_transfer_rate |
The baud of the fax transfer (fax request only). | string | |
fax_transferred_pages |
The number of pages transferred (fax request only). | string | |
from |
Depending on direction, represents the "from" user. | string | |
from_uri |
The "from" SIP URI. | string | |
hangup_cause |
The reason for the call leg's termination. See FreeSWITCH Hangup Causes for descriptions. | string | |
hangup_code |
The SIP hangup code, if available. | string | |
local_sdp |
The session description protocol (SDP) negotiated by the local agent. | string | |
media_server |
The hostname of the media server that processed the call. | string | |
node |
Indicates which node (ecallmgr) issued the CDR. | string | |
other_leg_call_id |
If this leg is bridged, this value indicates the call-id of the opposite leg. | string | |
other_leg_caller_id_name |
The caller ID name of the bridged leg. | string | |
other_leg_caller_id_number |
The caller ID number of the bridged leg. | string | |
other_leg_destination_number |
The dialed number of the other leg. | string | |
other_leg_direction |
The direction of the other leg, relative to the media server. | string | |
presence_id |
The ID used in NOTIFY SIP messages. |
string | |
remote_sdp |
The SDP negotiated by the remote agent. | string | |
request |
The processed request URI. | string | |
ringing_seconds |
Indicates the number of seconds that the leg was ringing for before it was answered. | integer | |
timestamp |
UTC timestamp, in gregorian seconds, of when the CDR was generated. | integer | |
to |
Depending on direction, represents the "to" user. If "outbound", it uses either the presence-id or the SIP Request address. If "inbound" is uses the SIP To header. |
string | |
to_uri |
The "to" SIP URI. | string | |
user_agent |
User-agent header from SIP packet. | string |
Get a summary of CDRs
Returns a list of CDRs.
Method and endpoint
GET /v2/accounts/{ACCOUNT_ID}/cdrs
Request
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/cdrs
Get a list of CDRs by time range
Returns a list of CDRs for a specific time range.
Request
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/cdrs?created_from={FROM_TIMESTAMP}&created_to={TO_TIMESTAMP}
Note
To offset from UTC time, use seconds as shown
curl -v -X GET \ -H "X-Auth-Token: {AUTH_TOKEN}" \ http://{SERVER}:8443/v2/accounts/{ACCOUNT_ID}/cdrs?created_from={FROM_TIMESTAMP}&created_to={TO_TIMESTAMP}&utc_offset={SECONDS_OFFSET}
Get CDRs as CSV
Returns the CDRs as a .csv
file.
Request
curl -v -X GET \
-H "Accept: text/csv" \
-H "X-Auth-Token: {AUTH_TOKEN}" \
https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/cdrs
Get details of a CDR
Returns the detailed representation of the CDR.
Method and endpoint
GET /v2/accounts/{ACCOUNT_ID}/cdrs/{CDR_ID}
Request
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/cdrs/{CDR_ID}
Get interaction summary
Returns a summary list of all CDRs that interacted with each other.
Method and endpoint
GET /v2/accounts/{ACCOUNT_ID}/cdrs/interaction
Request
curl -v -X GET \
-H "X-Auth-Token: {AUTH_TOKEN}" \
https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/cdrs/interaction
Get all legs related to an interaction
Returns details of specific call legs from CDRs that interacted with each other.
Method and endpoint
GET /v2/accounts/{ACCOUNT_ID}/cdrs/legs/{INTERACTION_ID}
Request
Note
Select CDRs/interactions for a specific user by adding them to the URI:
curl -v -X GET \ -H "X-Auth-Token: {AUTH_TOKEN}" \ https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/cdrs/legs/{INTERACTION_ID}
GET /v2/accounts/{ACCOUNT_ID}/users/{USER_ID}/cdrs