Comparison between asterisk CDR logs and Master Billing CDRs generated after the Master Crash

Created on 111110 by André Guimarães, Switzernet

 

This document analyses the CDRs that were generated in Master Billing by the Astrad’s script /etc/astrad/ast-resend-lost.pl. This script reads from the table radius_packets_Failed which is filled by the script /etc/astrad/ast-rad-acc.pl when there is no connection between an Astrad and the Billing Server’s radius.

 

We’ve found differences between the two that affect the customer’s balance. We’ll correct this differences during the next days.

 

 

 

In the calls marked in green everything is fine. There is only a 19, 20 second difference between the time in asterisk log and the CDR in Billing.

Two of the calls marked in red are duplicated. The customer was double billed. This must be corrected.

On the other call marked in red the billed time differs 3 seconds between CDRs. This should be verified and corrected.

On the second customer the call marked in red was tripled billed and the costs don’t match.

The third customer was billed 4 times for some calls. Also the total billed does not match the total in CDRs.

 

Notes:

The first call from the Billing Master list was done after the filter in asterisk.logs. Due to that it doesn’t appear on the image on the right.

Appeals not answered (0 duration) where filtered out when creating calls.txt.

The first, second and fifth call are incoming calls so the were not billied to the customer.

To obtain the calls.txt on the image on the right the following command was run:

 

for m in {3..19};

do

echo -e "Now parsing Astrad$m...\n"

sshpass -p XXXX ssh root@astrad$m.switzernet.com 'cat /var/log/asterisk/cdr-csv/*.csv|grep "2011-11-09"|grep -E "ANSWERED"' >> calls.txt

done