Last active
September 23, 2016 06:49
-
-
Save kevin39/b93b793c6bae0958d773ef5869ede9e3 to your computer and use it in GitHub Desktop.
Asterisk - Agent outgoing call summary per hour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Heure, ROUND(AVG(nbAppels),2) nbAppelsMoyen | |
FROM | |
( | |
SELECT DATE_PART('day',eventtime) Jour, DATE_PART('hour',eventtime) Heure, count(DISTINCT cid_name) nbAppels | |
FROM cel | |
WHERE eventtime >= '2016-02-01 00:00:00' | |
AND eventtime < '2016-03-01 00:00:00' | |
AND eventtype = 'CHAN_START' | |
AND context = 'from-extern' | |
GROUP BY DATE_PART('day',eventtime), DATE_PART('hour',eventtime) | |
ORDER BY 1,2 | |
) t1 | |
GROUP BY Heure | |
ORDER BY 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment