Auto Email or way to Access CDR reports for end user?

I need to give a customer access to CDR reports without using UCP or Gui because we don’t want them to know what PBX we use. Someone mentioned you can do this in excel

There’s a commercial module that might also do something like this, IIRC. Check there first (I suppose) then try mysqldump to a CSV file, then, if you have the resources, you could easily write a simple PERL or PHP script that pulls the data out of the CDR mysql table then reformats it into Excel XML (for an ‘xmlx’ file) spreadsheet. The program wouldn’t need to be more than a few dozen lines and could run from a cron job early in the morning.

yeah I wouldn’t know how to write that. Someone surely has done this before?

If you have /var/log/asterisk/cdr-csv/Master* files (Distro dependent but relatively easy to add if they are not there), then you can set the rotation to 1 day and email the /var/log/asterisk/cdr-csvMaster.csv.1 every morning at 6 am.

I do have them but it would have to be formatted for the customer

Import them into a libreoffice/Excel, template
Which you have cut pasted and dragged and dropped over for as long as it takes to get 'the customer’s what she wants.

In /etc/logrotate.d/asterisk

Change monthly to daily and rotate to 365 for the cdr-csv stanza , add a crontab for 6am that run the Master.csv.1 through headless libreoffice (soffice) and pipe the output, perhaps as a PDF through your mta.

Let’s not forget that a single call can generate multiple CDR records as the call traverses the dialplan. So are you going to give the customer 10 CDR records for the same call or are you going to trim it down so it can show one record for the entire call?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.