text
stringlengths
0
152
amaflags
DOCUMENTATION
userfield
PerMinuteCharge:0.02
uniqueid
1288112400.1
Notes
An indication of what happened to the call. This may be NO ANSWER,
FAILED, BUSY, ANSWERED, or UNKNOWN.
The Automatic Message Accounting (AMA) flag associated with this
call. This may be one of the following: OMIT, BILLING,
DOCUMENTATION, or Unknown.
A general-purpose user field. This field is empty by default and can be
set to a user-defined string.a
The unique ID for the src channel. This field is set automatically and is
read-only.
a The userfield is not as relevant now as it used to be. Custom CDR variables are a more flexible way to get custom data
into CDRs.
You can access all fields of the CDR record in the Asterisk dialplan by using the CDR()
function. The CDR() function is also used to set the fields of the CDR that are user-
defined:
exten => 115,1,Verbose(Call start time: ${CDR(start)})
same => n,Set(CDR(userfield)=zombie pancakes)
In addition to the fields that are always included in a CDR, it is possible to add cus‐
tom fields. You do this in the dialplan by using the Set() application with the CDR()
function:
exten => 115,1,NoOp()
same => n,Set(CDR(mycustomfield)=coffee)
same => n,Verbose(I need some more ${CDR(mycustomfield)})
If you choose to use custom CDR variables, make sure that the
CDR backend that you choose is capable of logging them.
To view the built-in documentation for the CDR() function, run the following com‐
mand at the Asterisk console:
*CLI> core show function CDR
In addition to the CDR() function, some dialplan applications may be used to influ‐
ence CDR records. We’ll look at these next.
Dialplan Applications
A few dialplan applications 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:
Call Detail Records
|
357
*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 21-3 lists the options available in the
[general] section.
Table 21-3. cdr.conf [general] section
Option
enable
Value/example Notes
yes
unanswered
no
end before
hexten
initiated
seconds
batch