[asterisk-users] concurrent call tracking

Leif Madsen leif.madsen at asteriskdocs.org
Wed May 11 12:17:54 CDT 2011


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.



More information about the asterisk-users mailing list