'Script for checking operator activity on line in MySQL Wokbench asterisk cdrdb database
I have a task: in the cdrdb table from asterisk in which need to calculate the time of the operator (agent) on the line in one column (time) excluding his breaks (PAUSE-UNPAUSE) between authorizations (ADDMEMBER-REMOVEMEMBER) in seconds or minutes.
SELECT time, agent, event FROM asteriskcdrdb.queuelog
| time | agent | event |
| YYYY-MM-DD hh:mm:ss | Smith | ADDMEMBER |
| YYYY-MM-DD hh:mm:ss | Smith | PAUSE |
| YYYY-MM-DD hh:mm:ss | Smith | UNPAUSE |
| YYYY-MM-DD hh:mm:ss | Smith | REMOVEMEMBER |
How to sum the time between ADDMEMBER and REMOVEMEMBER excluding the time between all breaks PAUSE and UNPAUSE in one column (time)?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
