Hi, I’m really a newbie on asterisk and programming. The only that I have created for my system is ome monitoring scripts. I would like to if somebody could share me some scripts on computating calculating, all calls(successful and unsucessfull) based on the cdr records of asterisk. Will I’ll be concatenating the csv file?WHat would be the best programming language to use?I hope somebody could help me on this one. It would be very grateful if someone can share this scripts. Thank you very much in advance.
Thanks for the help. One last thing, I wanted to compute for the calls in an hour?Is this possible? And does any one have the documentation on the cvs file.I dont know what is the use or what does it mean/represent some column on the cvs file. Thank you very much
#!/bin/bash
date=$1
time=$2
seconds=0
summary=0
minutes=0
time1=0
for a in `cat /var/log/asterisk/cdr-csv/Master.csv | grep $date | grep $time: | grep -v :$time | cut -d"," -f13`
do
summary=$(($summary+$a))
done
minutes=$(($summary/60))
time1=$(($minutes*60))
seconds=$(($summary-$time1))
echo "we talk $minutes minutes $seconds seconds in $date between $time - $(($time+1))"
this will add whole CDR(billsec) values for one day and one specified hour ($1 parameter for example 2006-08-30 $2 parameter for example 12)
script isn’t very accurate becous when call is starded at 11:59 and ends 12:01 it will be counted for 11 and 12 as $2. But it’s not so hard to repair that bug (a task for You) http://www.voip-info.org/wiki/view/Asterisk+cdr+csv