Wrong agent login time in call center statistics
The AgentCallbackLogoff event column data2 bigger or smaller than it's normal value by a difference of the timezone offset, causing the agent login time in the call center statistics to be wrong.
If my server is configured in GMT+2
If I login, wait 5 seconds and logoff.
Then the generated login time will be 2 hours and 5 seconds.
The problem is that postgresql <=9.1 used to have a default timezone of localtime and the timezone line was commented in the postgresql.conf file.
In postgresql 9.4 the default timezone is GMT but the postgresql.conf contains the line "timezone = localtime" on a fresh install.
Since upgraded servers contains the old file with the commented timezone Postgresql is in GMT.
#3 Updated by Etienne Lessard about 2 years ago
- Category set to Call center
- In versions changed from >15.20 to 15.20 - 16.06
- Status changed from In progress to Code review
For XiVOs that were affected by the bug, i.e. for XiVOs that have been upgraded from version 15.19 or earlier to version between 15.20 and 16.06 AND that are using the "call center statistics" feature, a manual action is required if you want your call center statistics to be fixed for the period of time you were in version between 15.20 and 16.06. If you don't use or don't care about your call center statistics for that period of time, you don't need to take any action.
To apply the fix, you first need to figure out when your agent login time statistics started to be incorrect, i.e. when you have upgraded to XiVO 15.20-16.06. You can check in /var/log/xivo-upgrade.log to try to pinpoint the moment you've upgraded to the buggy version. You also need to figure out when you upgraded to a fixed version, i.e. to XiVO 16.07 or later. Let's say for example that you figured out that you upgraded from XiVO 15.18 to XiVO 16.02 on 2016-03-02 at 15:30:00 (local time) and that you have upgraded to 16.07 on 2016-06-20 at 11:00:00. You then need to copy the following script on your XiVO, and run it like (replacing the first argument by the first date your figured out, and the second argument with the second date your figured out):
./rebuild-cc-stats-bug6213 '2016-03-02 15:30:00' '2016-06-20 11:00:00'Before running the script, note that:
- after fixing the login time in the queue_log table, the script runs the "xivo-stat clean_db" and "xivo-stat fill_db" commands. This will regenerate the complete call center statistics. On large call center installation, it's probably wise to run the script out of the "high-load" hours.
- don't run the script twice