CDR reporting

walterwerner's picture

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.


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

email CDR

samyantoun's picture

Hi,

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" reciepient_email@mail.com -- -f sender_email@mail.com

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 "reciepient_email@mail.com"

Hope that helps

Hi, I am having the same

Disaster's picture

Hi,

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.

Thanks.