System information

${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},
${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},
${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},
${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})}
In the actual configuration file, the value in the Master.csv mapping
should be on a single line.
cdr_manager
The cdr_manager backend emits CDRs as events on the Asterisk Manager Interface
(AMI), which we discussed in detail in Chapter 20. This module is configured in
the /etc/asterisk/cdr_manager.conf file. The first section in this file is the [general] sec-
tion, which contains a single option to enable this module (the default value is no):
[general]
enabled = yes
The other section in cdr_manager.conf is the [mappings] section. This allows for adding
custom CDR variables to the manager event. The syntax is:
<CDR variable> => <Header name>
Here is an example of adding two custom CDR variables:
[mappings]
rate => Rate
carrier => Carrier
With this configuration in place, CDR records will appear as events on the manager
interface. To generate an example manager event, we will use the following dialplan
example:
exten => 110,1,Answer()
same => n,Set(CDR(rate)=0.02)
same => n,Set(CDR(carrier)=BS&S)
same => n,Hangup()
This is the command used to execute this extension and generate a sample manager
event:
*CLI> console dial 110@testing
Finally, this is an example manager event produced as a result of this test call:
Event: Cdr
Privilege: cdr,all
AccountCode:
Source:
Destination: 110
DestinationContext: testing
Call Detail Records | 533