System information
To view the built-in documentation for the CDR() function, run the following command
at the Asterisk console:
*CLI> core show function CDR
In addition to the CDR() function, there are some dialplan applications that may be used
to influence CDR records. We’ll look at these next.
Dialplan Applications
There are a few dialplan applications that can be used to influence CDRs for the current
call. To get a list of the CDR applications that are loaded into the current version of
Asterisk, we can use the following CLI command:
*CLI> core show applications like CDR
-= Matching Asterisk Applications =-
ForkCDR: Forks the Call Data Record.
NoCDR: Tell Asterisk to not maintain a CDR for the current call
ResetCDR: Resets the Call Data Record.
-= 3 Applications Matching =-
Each application has documentation built into the Asterisk application, which can be
viewed using the following command:
*CLI> core show application <application name>
cdr.conf
The cdr.conf file has a [general] section that contains options that apply to the entire
CDR system. Additional optional sections may exist in this file that apply to specific
CDR logging backend modules. Table 24-3 lists the options available in the
[general] section.
Table 24-3. cdr.conf [general] section
Option Value/
Example
Notes
enable yes Enable CDR logging. The default is yes.
unanswered no Log unanswered calls. Normally, only answered calls result in a CDR. Logging all call
attempts can result in a large number of extra call records that most people do not
care about. The default value is no.
endbeforehexten no Close out CDRs before running the h extension in the Asterisk dialplan. Normally CDRs
are not closed until the dialplan is completely finished running. The default value is
no.
initiatedseconds no When calculating the billsec field, always round up. For example, if the difference
between when the call was answered and when the call ended is 1 second and
1 microsecond, billsec will be set to 2 seconds. This helps ensure that Asterisk’s
CDRs match the behavior used by telcos. The default value is no.
Call Detail Records | 529