CDR - Call Data Records

Introduction

3CX Phone System has an inbuilt CDR Service that is able to log phone calls including a record that can be saved to a file, or pushed to another application instantly via TCP.

The record contains various call details such as time, date, duration, source and destination numbers as well as the cost. 3CX goes a step further adding much more information such as call-types, call information, From and To names and final display names crucial when call transfers occur.

CDR Settings in 3CX

Configuring Output Format

You can generate CDR in 4 different formats:

  1. Single file for all calls
  2. Separate files for each call
  3. 3CX CDR service is server / Passive Socket
  4. 3CX CDR service is client / Active Socket

Enable CDR

To enable CDR, access the 3CX Management console. Go to Reporting > CDR, choose Generate CDR.  Select the desired output. When you output to a file, the file will be stored in the 3CX Logs folder and named cdr.log. Example location: C:\ProgramData\3CX\Instance1\Data\Logs\CDRLogs

Configuring CDR to output to a socket in passive mode requires you to configure a port which is free on the 3CX Phone System Server. In this mode, 3CX CDR Service will act as a Server and will expect a CDR Client to connect to the IP:Port configured. This implies that you must allow data traffic to pass from your firewall in TCP Mode.

3CX CDR can send call data records to a CDR Central server. In this mode, 3CX CDR Service will act as a client and you need to provide the IP Address and TCP Port of the CDR Server that is handling your CDR Requirements.

Configuring the CDR fields

One of the biggest CDR challenges apart from the output and the data is the STRUCTURE and the position where the data is before it is sent to the file or to the socket.

The 3CX CDR Service allows the administrator to control what is sent and how the record will look and this is very important when dealing with legacy CDR Servers, hotel PMS Systems and 3rd party CDR applications which are normally extremely sensitive to format.

In the CDR Settings section click Add CDR under the Configure CDR Output fields section.

Select CDR Output fields to add on the 3CX Management console

You can enable or disable any of the output fields which you are not interested in. You can also change the position of the field by clicking on the Move Up or Move Down button. This will move the field either to the left of the line, or to the right.

A sample CDR File by default looks like this:

CDR Logs

CDR Records Documentation

The following are the supported output fields and what they mean:

  • historyid - This is the call number - each call has a number, internal to 3CX. Useful for call tracking.
  • callid - This is the Call ID - the unique identifier of the call.
  • duration - Call Duration time.
  • time-start - Call Start time.
  • time-answered - Answered time.
  • time-end - Call terminated time.
  • reason-terminated - Why the call was terminated.
  • from-no - Source caller number.
  • to-no - Destination To Number.
  • from-dn - Distinguished name of caller - this is 3CX Specific Can be omitted by 3rd party developers.
  • to-dn - Distinguished name of To - Destination - this is 3CX Specific Can be omitted by 3rd party developers.
  • dial-no - Dialled number.
  • reason-changed - The Reason why a change occurred in a call - example in a transfer you will see "ReplacedDst" which means that the destination was replaced with something else.
  • final-number - Final Number - the final number which was replaced (In a transfer this will be the final connected number).
  • final-dn - The Distinguished name of the final number entity - this is 3CX Specific and can be omitted by 3rd party dev.
  • bill-code - Billing code dialed after the destination (for example: **Sales).
  • bill-rate  - The billing rate that matched the prefix of the rate. This is used to apply a cost calculation variance.
  • bill-cost - The Cost of the call calculated with simple proportion / minute.
  • bill-name - The rate name of the billing variance.
  • chain - All endpoints which were involved in the call.
  • from-type - Source type.
  • to-type - Destination type.
  • final-type - Final destination type.
  • from-dispname - Source Display Name.
  • to-dispname - Destination Display Name.
  • final-dispname - Final destination Display Name.
  • missed-queue-calls - A list of queue agents that were polled during a queue call that didn’t answer the call.

Last Updated

This document was last updated on 11 June 2023

https://www.3cx.com/docs/cdr-call-data-records/