I need a simple script that can be called using Asterisk AGI Function from a dialplan that will count the calls and add the duration for the current month for a selected DID number (extension).
Asterisk will provide the extension number in the call to the script as a variable. The script will search the asteriskcdrdb database using table 'cdr' for matching records; first for the current month range; then by 'dst' that equals the extension; then count those calls and add up the 'duration' field for total seconds; convert seconds to whole minutes; and finally return to asterisk these values by setting variables 'count' and 'duration'
Please write this in PHP - Please state "I know Asterisk" in your bid so I know you are NOT a robot bidder. If you have questions, Please ask.
Thanks Bart