CDR reporting

I’ve been trying to find the ability to do 2 things with the CDR data…

  1. allow users to have access to view selected extension data.
    what I did is created a user and a group with that user a member of it.
    I granted that group access to reporting, and the user can view the CDR data
    but only for himself… He’s a manager, and I want him to view data for
    a list of extnsions… if that’s not possible than all data.

  2. it’s been requested to generate call log reports and email them to managers.
    so, is there a tool to generate call reports through cron and email them…
    obviously, the cron part and emailing isn’t a big deal, it’s the utility
    that can run as a system task (ie. not though the web interface). If not,
    is there any documentation on the format of the CDR capturing, what fields
    are so I can edit the /etc/asterisk/cdr…conf files
    I’ve looked at /var/log/asterisk/cdr-csr/Master.csv and some of it isn’t
    completely clear.

Any help would be appreciated.


I can answer part 2 only, bellow is a sample command

(echo “Body”; mysql -uroot -pPASSWORD asteriskcdrdb -B -e “SELECT * FROM cdr WHERE DATE(calldate) = DATE_ADD(CURDATE(), INTERVAL -1 DAY)” | sed ‘s/"/""/g;s/^/"/g;s/\t/","/g;s/$/"/g;s/$/\r/’ | gzip | uuencode cdr.csv.gz) | mail -s “Subject” [email protected] – -f [email protected]

The command does the following:

  1. Generate a CDR report in a CSV (sed part) format with Yesterday (INTERVAL -1 DAY) calls

  2. Zip the file (gzip)

  3. uuencode (In Centos, you need to install sharutils “yum install sharutils”)

  4. Attached the report and email it to "[email protected]"

Hope that helps


I am having the same issue, Was wondering if you found a solution. As I want my users to see or CDR reports as there are two mangers who want to see all calls.


When I use the code above the recieved e-mails look like this:

begin 644 cdr.csv.gz

I tried several e-mail account but to no avail.

there are a number of packages available for cdr reporting. why don’t you try one of them rather than reinventing the wheel. I think there is even an open source package - look at it is not the only one, though. there are a lot of them.

Hi There

We also have these exact same requirements with addition to the managers wanting to be able to pull their agents’ call recordings as well. I have looked for all means I know of to try and make the reporting access granular or restrictive, but have been unsuccessful. Does anyone know of any 3rd party software that will meet all of these requirements even? All the others I have looked at don’t offer all the requirements I have. I am basically looking for a “NICE” for asterisk/freepbx.

It would be a great enhancement to the commercial call recordings module.

If you talked to Schmooze perhaps they would be willing to do a flat rate to code that in as it would probably help sales of the module.