login | register
Fri 03 of Jul, 2009 [21:45 UTC]

voip-info.org

History

Asterisk cdr csv

Created by: oej,Last modification on Sat 03 of Jan, 2009 [15:34 UTC] by rafikberzi

Asterisk call data records in comma-separated text files

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

  1. accountcode: What account number to use: Asterisk billing account, (string, 20 characters)
  2. src: Caller*ID number (string, 80 characters)
  3. dst: Destination extension (string, 80 characters)
  4. dcontext: Destination context (string, 80 characters)
  5. clid: Caller*ID with text (80 characters)
  6. channel: Channel used (80 characters)
  7. dstchannel: Destination channel if appropriate (80 characters)
  8. lastapp: Last application if appropriate (80 characters)
  9. lastdata: Last application data (arguments) (80 characters)
  10. start: Start of call (date/time)
  11. answer: Answer of call (date/time)
  12. end: End of call (date/time)
  13. duration: Total time in system, in seconds (integer)
  14. billsec: Total time call is up, in seconds (integer)
  15. disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY, FAILED
  16. amaflags: What flags to use: see amaflags::DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode.


In some cases, uniqueid is appended:
  • uniqueid: Unique Channel Identifier (32 characters)
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



Comments

Comments Filter
222

333Update for 5.0

by oej, Thursday 27 of November, 2003 [07:15:49 UTC]
Page updated /Oej
222

333update for 0.5.0?

by , Wednesday 19 of November, 2003 [21:12:15 UTC]
I'm not sure, but I think this needs to be updated as of Asterisk 0.5.0 cdr format. E.g., looks like now the account code is indicated as the first field in the cdr.