Writing CDRs

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:

  • comma separated values (.csv)
  • tabs separated values (.tsv)

Example

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.

[general]

; 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
file=/var/log/yate-cdr.csv

; comma-separated (.csv), combined=false
format=${time},”${billid}”,”${chan}”,”${address}”,”${caller}”,”${called}”,${billtime},${ringtime},${duration},”${direction}”,”${status}”,”${reason}”

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.

Example output

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

1393240867.185,”1392970078-5″,”sip/3″,”192.168.1.1:5060″,”+8564567″,”333″,0.000,0.000,0.075,”outgoing”,”outgoing”,”Offline”

1393240867.183,”1392970078-5″,”ybts/5″,”001900000000001″,”+8564567″,”333″,0.000,0.000,0.079,”incoming”,”accepted”,”noroute”

1393241254.844,”1392970078-7″,”ybts/7″,”001900000000001″,”+8564567″,”100″,13.993,0.000,14.042,”incoming”,”answered”,”normal-clearing”

1393241254.846,”1392970078-7″,”sip/5″,”192.168.1.1:5060″,”+8564567″,”100″,13.994,0.000,14.041,”outgoing”,”answered”,”normal-clearing”

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

YateUCN handles voice and data, then regarding CDRs – will handle voice and data CDRs.

Further reading

For additional information see Call detail records.
For more information about Call detail records, please check CDRs details page.

Our solutions