[Freeswitch-users] custom call counter

Michael Jerris mike at jerris.com
Fri Nov 27 23:01:47 PST 2009


It depends on the timing of when your increment and decrement are vs when the sql calls to push the events into the tables that are used for show calls are.  Also, the sql calls are batched and queued causing a little delay (less than a second).  If your doing a lot of short lived calls there is sure to be timing discrepancy.  I am sure there is even more discrepancy if you look at the output of status which shows the current number of sessions (those are individual call legs) as that information is a little more real time.

Mike

On Nov 28, 2009, at 12:48 AM, Juan Backson wrote:

> Hi,
> 
> Instead of using "show calls count" to obtain the current call count stat, I am writing some C code to increment a counter during on_answer_hook and decrement the counter during on_hangup_hook.
> 
> It looks like my counter result is very closed to "show calls count" when the traffic is low, like 50 -60.  But when traffic is high, like 1000 calls, my counter is showing 30% less.
> 
> When all calls are finished, my counter becomes 0 again, and that proves that it does not increment/decrement more than it should.
> 
> Is this normal?  Does anyone have any idea why there is such discrepancy?
> 
> thanks,
> jb
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org





More information about the FreeSWITCH-users mailing list