concurrency - MySQL CDR Concurrent Call Query -


i trying construct query concurrent calls of of asterisk cdr uploaded mysql.

i have tried following examples located on these threads:
mysql query - peak concurrent calls cdr data results not expected.
fetch max number of concurrent phone calls call_log , seems take forever , results not expected either.

i cant rewrite them because base not expected wouldnt know start.

what following:
1 - query peak calls system whole day

2015-06-01 | 134 

2 - query list of times of top 10 concurrent calls selected period.

 2015-06-01 9:32:21 | 50  2015-06-01 10:15:11 | 43  2015-06-01 15:45:14 | 40  ....... 

i have other complex queries me started.

eventually, want max concurrent calls of specified day src or dst equals pool of specified dids

my mysql database in format of

source  destination     calldate    endtime     duration    uniqueid  

any appreciated.

here required query find max concurrent calls on specified day.

set @start = '2015-12-03 00:00:00'; set @end = '2015-12-03 23:59:59'; set @src = ('did1','did2'); set @dst = ('did3','did4'); select date(calldate) 'date',  max((select count(*) cdr c2 (c2.source in @src or c2.destination in @dst ) , c2.calldate between @start , @end , unix_timestamp(c1.calldate) between unix_timestamp(c2.calldate) , (unix_timestamp(c2.calldate)+c2.duration))) 'channels'  cdr c1 (c1.source in @src or c1.destination in @dst ) , c1.calldate between @start , @end group 1; 

please modify @src , @dst manual addition of list of dids. or can manually add dids list on places of @src , @dst.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -