Writing CDRs

From YateBTS
Jump to: navigation, search

Call detailed records (CDRs) are logs containing detailed information related to phone calls, such as: the time they were initiated, their origin and the destination addresses, the call duration etc.

To write the call detailed records (CDRs) you can use one of Yate's predefined options: write to a file or to a database.

Writing the CDRs to a file

To enable writing the CDRs to a file edit cdrfile.conf and set:

  • file - name of the file where to write the CDRs to
  • format - specifies the format for writing, the parameters to write and their order. You have two formats:
    • comma separated values (.csv)
    • tabs separated values (.tsv)
  • you can choose to use the combined format to write a single entry for each call instead of one for each call leg(the default)


The file where CRDs are written is /var/log/yate-cdr.csv. If you want to change the .csv predefined format, you can uncomment it in cdrfile.conf.

; file: string: Name of the file to write the CDR to
; You should check that this file is log rotated - see /etc/logrotate.d/yate
; Example: file=/var/log/yate-cdr.tsv

; comma-separated (.csv), combined=false

Example output

In /var/log/yate-cdr.csv you'll see something similar to the log below:


Note: In the messages above we see the call logs for 2 calls (we have only 2 billids: 1392970078-5 and 1392970078-7)

  • first call: from +8564567 to 333. +8564567 is the GSM phone with IMSI 001900000000001. The call was routed outside the network using a SIP account (server YateBTS routed the call to which answered that 333 is Offline.
  • second call: from +8564567 to 100. Call was answered and billtime is 13.994 seconds.

Further reading

For additional information see Call detail records.