README.cdr 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Asterisk billing support - Call Detail Records
  2. ----------------------------------------------
  3. Asterisk generates Call Detail Records in a database or in a comma
  4. separated text file.
  5. * cdr_csv supports comma separated text file storage, this is the
  6. default driver
  7. * cdr_manager supports CDR information via the AMI, The Asterisk Manager
  8. interface
  9. * cdr_odbc supports UnixODBC databases, see http://www.unixodbc.org
  10. for an updated list of supported databases, from MySQL to MsSQL
  11. and text files.
  12. * cdr_tds supports FreeTDS databases (Among them MS SQL)
  13. NOTE: Please read README.tds for information on possible
  14. problems with the FreeTDS driver
  15. * cdr_sqlite supports SQlite
  16. * cdr_pgsql supports PostgreSQL
  17. In the asterisk-addons cvs archive, there's a cdr_mysql driver for
  18. MySQL.
  19. Applications
  20. ------------
  21. * SetAccount Set account code for billing
  22. * SetAMAFlags Sets AMA flags
  23. * NoCDR Make sure no CDR is saved for a specific call
  24. * ResetCDR Reset CDR
  25. * ForkCDR Save current CDR and start a new CDR for this call
  26. * Authenticate Authenticates and sets the account code
  27. * SetCDRUserField Set CDR user field
  28. * AppendCDRUserField Append data to CDR User field
  29. For more information, use the "show application" command.
  30. You can set default account codes and AMA flags for devices in
  31. channel configuration files, like sip.conf, iax.conf etc.
  32. Fields of the CDR in Asterisk
  33. -----------------------------
  34. 1. accountcode: What account number to use, (string, 20 characters)
  35. 2. src: Caller*ID number (string, 80 characters)
  36. 3. dst: Destination extension (string, 80 characters)
  37. 4. dcontext: Destination context (string, 80 characters)
  38. 5. clid: Caller*ID with text (80 characters)
  39. 6. channel: Channel used (80 characters)
  40. 7. dstchannel: Destination channel if appropriate (80 characters)
  41. 8. lastapp: Last application if appropriate (80 characters)
  42. 9. lastdata: Last application data (arguments) (80 characters)
  43. 10. start: Start of call (date/time)
  44. 11. answer: Answer of call (date/time)
  45. 12. end: End of call (date/time)
  46. 13. duration: Total time in system, in seconds (integer), from dial to hangup
  47. 14. billsec: Total time call is up, in seconds (integer), from answer to hangup
  48. 15. disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY
  49. 16. amaflags: What flags to use: DOCUMENTATION, BILL, IGNORE etc,
  50. specified on a per channel basis like accountcode.
  51. 17. user field: A user-defined field, maximum 255 characters
  52. In some cases, uniqueid is appended:
  53. * uniqueid: Unique Channel Identifier (32 characters)
  54. This needs to be enabled in the source code at compile time
  55. ONE IMPORTANT NOTE: If you are trying to collect records on IAX to IAX calls
  56. you need to be aware that by default, IAX will attempt to transfer calls
  57. in this situation (if DTMF is not required). When the transfer is completed
  58. the call is dumped from the middle machine and thus the call detail records
  59. will report a short call time. If you want detailed records you must
  60. turn off IAX transfer, but unless your servers are very close together, you
  61. will definitely get a latency hit from doing so.
  62. ____________________________________
  63. CDR Variables
  64. ------------------------------------
  65. If the channel has a cdr, that cdr record has its own set of variables which
  66. can be accessed just like channel variables. The following builtin variables
  67. are available.
  68. ${CDR(clid)} Caller ID
  69. ${CDR(src)} Source
  70. ${CDR(dst)} Destination
  71. ${CDR(dcontext)} Destination context
  72. ${CDR(channel)} Channel name
  73. ${CDR(dstchannel)} Destination channel
  74. ${CDR(lastapp)} Last app executed
  75. ${CDR(lastdata)} Last app's arguments
  76. ${CDR(start)} Time the call started.
  77. ${CDR(answer)} Time the call was answered.
  78. ${CDR(end)} Time the call ended.
  79. ${CDR(duration)} Duration of the call.
  80. ${CDR(billsec)} Duration of the call once it was answered.
  81. ${CDR(disposition)} ANSWERED, NO ANSWER, BUSY
  82. ${CDR(amaflags)} DOCUMENTATION, BILL, IGNORE etc
  83. ${CDR(accountcode)} The channel's account code.
  84. ${CDR(uniqueid)} The channel's unique id.
  85. ${CDR(userfield)} The channels uses specified field.
  86. In addition, you can set your own extra variables by using Set(CDR(name)=value).
  87. These variables can be output into a text-format CDR by using the cdr_custom
  88. CDR driver; see the cdr_custom.conf.sample file in the configs directory for
  89. an example of how to do this.