Hi all, I would like to track/store concurrent call usage per user by day/week/month and get server totals by day/week/month. Google comes up with mostly info regarding concurrent call limits, though my goal is to calculate actual concurrent channel usage and add it into reporting. I'm using * 1.6.2 + mysql - realtime (no gui). Any suggestions / open-source / AGI on where to start looking into implementing something like this? TIA, Skyler -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110511/814b2eca/attachment.htm>
On 11-05-11 12:57 PM, Skyler wrote:> I would like to track/store concurrent call usage per user by > day/week/month and get server totals by day/week/month. Google comes up with > mostly info regarding concurrent call limits, though my goal is to calculate > actual concurrent channel usage and add it into reporting. I'm using * 1.6.2 > + mysql - realtime (no gui). Any suggestions / open-source / AGI on where to > start looking into implementing something like this?Just use SNMP to get the channel usage. If you don't want to use SNMP, then just use something like GROUP(), GROUP_COUNT() and func_odbc to write channel usage to the database. Something like.... [Outgoing] exten => _NXXNXXXXXX,1,NoOp() same => n,GoSub(subTotalCallCounter,start,1(outgoing)) [subTotalCallCounter] exten => start,1,NoOp() same => n,Set(GROUP(totalcalls)=${ARG1}) same => n,Set(ODBC_TOTAL_CALLS(${ARG1})=${GROUP_COUNT(${ARG1}@totalcalls)}) same => n,Return() [Incoming] exten => 4165551212,1,NoOp() same => n,GoSub(subTotalCallCounter,start,1(incoming)) [LocalSets] exten => _1XX,1,NoOp() same => n,GoSub(subTotalCallCounter,start,1(internal)) func_odbc --------- [TOTAL_CALLS] dsn=myDatabase writesql=INSERT INTO totalCalls ('type','callcount') VALUES ('${VAL1}','${ARG1}') Something like that. Totally untested and only written in this email :) Leif.
You can use the manager api (interface) and "poll" that info and then store it in a MYSQL table etc. You can do this outside asterisk,even from a different machine using your preferred dev language as there are manager libraries/bindings for most major dev languages 'Actual' is the key word though. To get the actual concurrent channels you should poll the system, at least every second, and that means 3600 records per hour or 86.400 per day. That would end up taking a alot of time to average using mysql queries. Alternatively you could do N minutes averages and store them in the db i.e read every second but save the average of 60 reads which is 1 minute etc Stelios On Wed, 2011-05-11 at 09:57 -0700, Skyler wrote:> Hi all, > > > > I would like to track/store concurrent call usage per user by > day/week/month and get server totals by day/week/month. Google comes > up with mostly info regarding concurrent call limits, though my goal > is to calculate actual concurrent channel usage and add it into > reporting. I?m using * 1.6.2 + mysql ? realtime (no gui). Any > suggestions / open-source / AGI on where to start looking into > implementing something like this? > > > > TIA, > > > > Skyler > > > > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
What I do is when ever a call comes in I update a table in MySQL to active = (active +1). On hang up I do active = (active -1). I have a cron that checks once a minute to see how many active and stores it along with epoch in db. I then have a graph that shows channel usage. If you want the code let me know. ----- Original Message ----- From: Skyler To: asterisk-users at lists.digium.com Sent: Wednesday, May 11, 2011 19:57 Subject: [asterisk-users] concurrent call tracking Hi all, I would like to track/store concurrent call usage per user by day/week/month and get server totals by day/week/month. Google comes up with mostly info regarding concurrent call limits, though my goal is to calculate actual concurrent channel usage and add it into reporting. I'm using * 1.6.2 + mysql - realtime (no gui). Any suggestions / open-source / AGI on where to start looking into implementing something like this? TIA, Skyler ------------------------------------------------------------------------------ -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110512/11cc859a/attachment.htm>
Hi, this is my first post to mailing list, so sorry in case i'm doing something wrong. when i want to count concurent calls from particular user, i dont use any cron jobs or counters in dialplan, run query on cdr, something like: SEELCT dst, calldate, IF(action = 'substract', @count := @count - 1, @count := @count + 1) FROM (SELECT dst, calldate, 'substract' AS 'action' FROM cdr WHERE calldate between '2011.05.12' AND '2011.05.13' AND src = "500" UNION SELECT dst, DATE_ADD(calldate, INTERVAL duration SECOND), 'add' FROM cdr WHERE calldate between '2011.05.12' AND '2011.05.13' AND src = "500") JOIN (SELECT @count := 0) ORDER BY calldate; ----- Original Message ----- From: Skyler To: asterisk-users at lists.digium.com Sent: Wednesday, May 11, 2011 19:57 Subject: [asterisk-users] concurrent call tracking Hi all, I would like to track/store concurrent call usage per user by day/week/month and get server totals by day/week/month. Google comes up with mostly info regarding concurrent call limits, though my goal is to calculate actual concurrent channel usage and add it into reporting. I'm using * 1.6.2 + mysql - realtime (no gui). Any suggestions / open-source / AGI on where to start looking into implementing something like this? TIA, Skyler -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110512/dbadd932/attachment.htm>