[asterisk-users] Peak number of calls?

Gordon Henderson gordon+asterisk at drogon.net
Thu Jan 24 02:04:39 CST 2008


On Wed, 23 Jan 2008, Tilghman Lesher wrote:

> On Wednesday 23 January 2008 23:23:23 Anthony Francis wrote:
>> Tilghman Lesher wrote:
>>> On Wednesday 23 January 2008 12:23:24 Gordon Henderson wrote:
>>>> Is there any way to find-out the peak number of calls that an asterisk
>>>> system has had? Not the total number of calls, but the maximum number of
>>>> simultaneous calls.
>>>>
>>>> I know I can porobably go through the CDR logs and look for calls which
>>>> have overlapped in time, but I'm wondering if there's some counter
>>>> somewhere I could access...
>>>
>>> No, the CDRs would be where that information is stored, if anywhere.
>>
>> This is actually sort of easy. You simply have every call pass through a
>> context in which you assign the call to a group, then either do a NoOp
>> echoing the group count or a user event doing the same, then either
>> programatically or grep search your logs for the output or have a script
>> monitoring the AMI watch for the user event and write the number in a
>> data base.
>>
>> Of these two I personally do the second option because then I can just
>> do a max() function on that database field to get the maximum calls for
>> any time range I specify.
>>
>> Oh and just a note, never just say no because you don't know, in this
>> instance you would say, "I think your best bet is the CDR's". Just a tip.
>
> The key phrase in the original post was "has had", indicating past behavior,
> not future behavior.  Yes, you can do all sorts of things in the dialplan to
> get that information into a logfile, but you cannot retroactively do those
> things.  The only place that information can be had are the CDRs, so I will
> stick with my original assessment.

Yes, nice to know what happened in the past, but also nice to know what 
happens in the future, so I'm not overly hung up about how. (And the CDRs 
aren't in a database either - just flat file on my devices)

I did actually think of adding in some diaplan stuff to keep counts, but 
I've now got a skeleton and a good idea if something that'll keep me 
happy. Basically 2 parts - one which polls the system via the manager 
inteface every few seconds to count calls, and another which interfaces to 
mrtg. I didn't really think of this initially as for a long time my units 
did have perl, (which mrtg needs) but I've managed to squeeze in enough 
perl to run other things now, so off I go.

Thanks,

Gordon



More information about the asterisk-users mailing list