Custom CDR csv for each account code

Hello. Can somebody tell me if it is possible to make custom CDR csv files for each account code?

In cdr.conf there is line:
accountlogs=yes ; create separate log file for each account code. Default is “yes”

It uses standard cdr template as in Master.csv.

But is it possible to use templates from cdr_custom.conf to apply with log files created for different account codes?

Thank you.

The accountlogs setting only applies to the cdr_csv backend. It isn’t processed at all by the cdr_custom backend.

If you need a separate template per accountcode, you will have to generate that manually in cdr_custom.conf.

Thank you for the answer.
But could you tell me how can I do that?
In cdr_custom.conf I have

tryme.csv => ${CSV_QUOTE(${CDR(clid)})} …

But this very file logs everything just like master.csv and not just events for “tryme” accountcode.
How to make tryme.csv to log only “tryme” accountcode events?
Thank you.

What you’re trying to do isn’t something supported natively by Asterisk; as such, you really can’t do what you want to do without a lot of post-processing.

The only thing I can think of would be to define a template per accountcode, then use a script to manually go back through and remove entries that don’t have the accountcode that matches the template.

OK, I see.
Thank you.