Asterisk call data records (cdr) in comma-separated text files (csv). By default, Asterisk generates CDR records in comma-separated text files in the __/var/log/asterisk/cdr-csv directory. The file Master.csv contains all records. Detail records can be partially configured on a channel basis, and some of the data for IAX and SIP can be determined on the user level. The Zap configuration for CDR records is determined by channel in zaptel.conf
For this to work you do need to have cdr_csv.so loaded. ‘show modules‘ or ‘module show‘ entered at the CLI will tell you if it has been loaded. If not: Type ‘load cdr_csv.so‘ in the CLI. You’ll also want to add that load command to /etc/asterisk/modules.conf if Asterisk didn’t automatically include this module at startup.
Fields
- accountcode: What account number to use: account, (string, 20 characters)
- src: Caller*ID number (string, 80 characters)
- dst: Destination extension (string, 80 characters)
- dcontext: Destination context (string, 80 characters)
- clid: Caller*ID with text (80 characters)
- channel: Channel used (80 characters)
- dstchannel: Destination channel if appropriate (80 characters)
- lastapp: Last application if appropriate (80 characters)
- lastdata: Last application data (arguments) (80 characters)
- start: Start of call (date/time)
- answer: Answer of call (date/time)
- end: End of call (date/time)
- duration: Total time in system, in seconds (integer)
- billsec: Total time call is up, in seconds (integer)
- disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY, FAILED
- amaflags: What flags to use: see amaflags::DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode.
- Uniqueid: Unique Channel Identifier (32 characters) (In some cases, uniqueid is appended)
Note: You can edit the source file cdr_csv.c to enable CSV_LOGUNIQUEID (it’s disabled by default). Same goes for userfield.
See also
- cdr_custom.conf
- Asterisk billing
- Asterisk CDR csv mysql import