This is a simple script that will be called in and by 'cron' that will recursively search the asterisk cdr file and update call duration(s) to the highest tenth and adjust minimum duration to 18 seconds. Please use a config file to specify the database connections and adjustment values so that it might be updated by me.
1. The script will start at the first record. Determine if the duration is less than 18 seconds and if true, make the duration 18 seconds.
2. If the call duration is not a even 10th, (ie: 6,12,18,20,24 seconds and so on) adjust duration to next HIGHEST 10th.
The database is in MySQL. The database name is 'asteriskcdrdb' the table is 'cdr'. The fields of interest are 'duration' and 'billsec'
You script must be written in PHP Version 5.1.6