Käynnissä

Simple Script to update call counts and duration totals

This script will be run in cron and should be write in php. Its purpose is to count the total calls and duration for the current months range and update the owner’s table ‘dnislookup’. The databases involved are MySQL.

The call records are located in the database ‘asteriskcdrdb’ and the table is ‘cdr’.

The database to update is ‘dax’ and the table ‘dnislookup’.

The procedure is as follows:

1. Open ‘dnislookup’ and obtain the contents of the field ‘dnis’ (first record).

2. Using contents on ‘dnis’, open database ‘asteriskcdrdb’ & ‘cdr’ table, attempt to locate all records in the table that match the ‘dnis’ field using the ‘dst’ field.

3. Set a filter on ‘calldate’ for the current month’s range.

4. Next count the records that match ‘dst’ and add the ‘duration’ field amounts.

5. Once you have total records count and total duration in seconds, reopen ‘dnislookup’ and update the fields ‘goodcalls’ and ‘duration’.

6. Then move to next record in ‘dnislookup’ and repeat until all records have been updated.

Taidot: PHP

Näytä lisää: script records update duration, dnislookup, update mysql, run and update, record call, PHP simple, on-call, dax, cron script, cdr, call, call record, c update, script update database mysql, php add record mysql table, table month php, write simple php database, filter amp, cdr call, mysql update field, update database mysql, mysql update database, call cdr, open cdr, match records

Tietoa työnantajasta:
( 39 arvostelua ) Buena Park, United States

Projektin tunnus: #495990