Call Detail Records (CDR)
A Call Detail Record (CDR) is a structured log of a phone call that includes metadata such as:
- Call direction (inbound/outbound)
- Start and end timestamps
- Call status (answered, missed, failed, etc.)
- Caller and callee numbers
- Duration (billed and total)
- Billing info
- Hangup cause and source
This data is essential for reporting, analytics, billing, tracking, and debugging.
🔍 Accessing CDRs
There are multiple ways to access CDRs depending on your use case and integration style.
🛠️ Inside Callr Actions Scenarios
✅ For Inbound Calls
When a call reaches your inbound-call branch, the CDR is automatically available via the call.cdr object.
- action: log@v1
params:
message: CDR=${{ JSON.stringify(call.cdr) }}You can push the CDR to your backend using
fetch@v2, typically from thehangupbranch.
✅ For Outbound Calls (using dial@v1)
- action: dial@v1
params:
targets:
- number: "+33639980042"
timeout: 60
result: $dial
- action: log@v1
params:
message: CDR=${{ JSON.stringify($dial.cdr) }}The typical use case is to push the CDR to your platform (more examples here: Push Data to Your Platform).
- action: fetch@v2
params:
url: https://...
method: POST
headers:
content-type: application/json
body: |
{
"cdr": ${{ JSON.stringify(call.cdr) }}
}🌐 Webhooks (v2.call.*)
If you're using Callr Webhooks, the CDR is included in the payload of the following event types:
v2.call.inbound.startedv2.call.inbound.endedv2.call.outbound.startedv2.call.outbound.ended
You’ll receive the same CDR structure as available in Callr Actions — including full call metadata and billing info.
Tip💡 Make sure your webhook server is ready to handle POST requests and validate incoming data.
📦 CDR Export API
For historical data or bulk exports, use the CDR export endpoint.
curl --request POST \
--url 'https://api.callr.com/v2.0/calls/export?direction=<direction>&from=<from>&to=<to>' \
--header 'accept: application/json' \
--header 'x-api-key: <your-callr-api-key>'This allows you to download CDRs in bulk (CSV format) over a specified time range.
🧾 CDR Fields Overview
| Field | Type | Description |
|---|---|---|
billingCredit | string | The credit amount applied, expressed in cents. |
billingDebit | string | The debit amount applied, expressed in cents. |
billingDestinationLabel | string | The geographic label representing the billing destination. |
billingPaymentType | string | The payment type used for billing, either prepaid or postpaid. |
callee | string | The phone number of the callee. |
callerName | string | The name of the caller. |
callerNumber | string | The phone number of the caller (empty if caller ID is restricted). |
callerRestricted | bool | Indicates whether the caller's identity is restricted (i.e., CLIR). |
callid | int64 | The unique identifier for the call. |
direction | string | The call direction, which can be inbound or outbound. |
durationAnswered | int | The duration in seconds that the call was actively answered. |
durationBilled | int | The duration in seconds used for billing purposes. |
durationTotal | int | The total duration in seconds of the call. |
started | string | The ISO8601 timestamp when the call started. |
answered | string | The ISO8601 timestamp when the call was answered. |
ended | string | The ISO8601 timestamp when the call ended. |
hangupCause | int | The hangup cause code as defined by Q.850 ISDN standards. |
hangupSource | string | The source of the hangup event (caller, callee, or system). |
hangupTech | string | A technology specific identifier for the hangup cause. |
scenarioName | string | The name of the scenario associated with the call. |
scenarioSid | string | The unique identifier of the call scenario. |
scenarioTypeName | string | The type name of the scenario (e.g., Actions). |
scenarioTypeVersion | string | The version of the scenario type. |
status | string | The current status of the call (dialing, ringing,answered, failed, unallocated, busy, or canceled). |
Updated 7 months ago
