Split CDR by months

Hello to all,

Is there any way to get the CDR splitted by months? I want to have no one unique cdr, I want to have one cdr for every months.

Thank you so much

Are you saying that you have a single call that is bridged for several months?

There is no facility to split CDRs except at times when the dialplan is actively running. Any bridged segment of a call must be one CDR.

Hi

Simplest way is to use mysql storage of the CDR data and just do a report specifying the relevant month in the Query

Ian

Insert the following into your crontab file:

0 0 1 * * mv /var/log/asterisk/cdr-csv/Master.csv /var/log/asterisk/cdr-csv/Master.date +%m.csv

At one minute after midnight on the first day of each month, your Master.csv file will be renamed Master.02.csv (for February) or Master.03.csv (for March) etc. A new file named Master.csv will be created when the first call is processed in the current month. Note: the above assumes that your CDR is kept in /var/log/asterisk/cdr-csv. Edit this path as necessary for your own configuration.

Thank you to all.

I have solved the question with the crontab solution. :smile:

Thank you again