Cdr - overwrite a field


I would like to overwrite a field of the cdr used by freepbx in reports, I couldn’t find in the extensions.conf files where to write it. For example, I would like that in the Source field it shows me accountcode.

I’m using asterisknow 1.7 wich cames with freepbx 2.7.

Thanks in advance

Ok, thanks I’ll try it as soon as I can.

Can I add or remove the fields that are showed in the reports of freepbx? How?

thanks in advance

Most CDR fields are automatically populated. I don’t recall off hand if every field is writeable or not, but depending on what you are trying to do, there are often channel variables that you could write to at the appropriate time that would result in the CDR field being changed (CID being one of them).

The best place to change CDR fields is usually the macro-hangupcall context. You will have to override the auto-generated one in the override file though.

if you are just trying to display other fields in the reports that are already in the CDR, there is a hidden but builtin in ability in FreePBX to do this by overriding a section of the reports code with a file in /etc/asterisk that it will use if present.

You’ll have to look through the CDR reports code to find the file it is looking for, and the expected format, as it’s been a long time since I have done this. It’s basically a conditional #include in the PHP code that if present, will skip what is normally used and can be tailored for the different formats of the reporting system.

Maybe I’m not being clear. I want to put for expamle

exten => s,n,Set(CDR(clid)=${CONTEXT}

so, the context of the call then is showed in the field clid in the reports of freepbx.

The problem is that i don´t know where the cdr field are written, I thougth in the extensions.conf file.


thanks for reply.

I have no cdr_custom.conf, but I have to edit something in extensions.conf I think


I would rather use the cdr_custom.conf to achieve this.

here some help…