Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 1

Displaying posts with tag: Voice / Voice over IP (reset)

Two Random Asterisk-Related SQL Queries
+0 Vote Up -0Vote Down

I hate losing useful SQL queries, so I tend to save them. Ever so often, I stumble across a file of queries from some work I was doing months ago. The following two queries are just such a case. I was analyzing some call data for a call center that uses Asterisk. I set up a temporary database for this, so I can't even run them again. Still, it's nice to save them away for a rainy day.

Call Center Call Volume by Day of Week and Hour

SET @tz = 'EST5EDT';
select 
  DAYNAME(CONVERT_TZ(start, 'GMT', @tz)) AS "Weekday",
  HOUR(CONVERT_TZ(start, 'GMT', @tz)) AS "Hour",
  COUNT(id), 
  SUM(duration), 
  SUM(billsec), 
  AVG(duration), AVG(billsec) 
  FROM cdr 
    WHERE dcontext IN ('Queue1', 'Queue2', 'Queue3', 'Queue4')
      AND duration > 60
    GROUP BY Weekday, Hour
    ORDER BY
  [Read more...]
Showing entries 1 to 1

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.