Processed Call Counter

Home » Asterisk Users » Processed Call Counter
Asterisk Users 5 Comments

Hi there

How can I reset the value of asterisk’ “calls processed” without restarting
asterisk? Where does it save/access the value of all processed calls since
last restart from?

5 thoughts on - Processed Call Counter

  • AFAIK, this is a “shell count” (The count is kept in shell memory for the
    running asterisk process). You handicap potential answer by not stating
    your Asterisk version or your technology (SIP/DAHDI/T1/etc). If you are
    just using SIP trunks, SIP RELOAD might do it.

    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of [Digital^Dude]
    R
    Sent: Thursday, March 08, 2012 2:41 AM

    Hi there

    How can I reset the value of asterisk’ “calls processed” without restarting
    asterisk? Where does it save/access the value of all processed calls since
    last restart from?

  • (I’m just a 1.2 Luddite, so my input may be a bit dated.)

    Where are you seeing ‘calls processed?’

    There is a ‘channels created’ counter. That’s the bit after the ‘.’ in
    ${UNIQUEID}.

    Resetting this is probably a bad idea, but if you’re really determined you
    could write a small Asterisk application (app_reset_call_counter()?) that
    would lock the appropriate data structure, reset it, and unlock the data
    structure.

    Probably a better idea would be for you to maintain a counter in a global
    variable. Then you are free to do with it as you please without having to
    consider the implications of changing something internal to Asterisk.

    If you stored your counter in a database, it could persist beyond that
    instance of Asterisk in case of an unlikely crash. If you go this route, 2
    AGIs (increment-call-counter and reset-call-counter) would help keep your
    dialplan ‘clean.’

  • 1.4:
    pbx> core show channels
    [snip]
    167 active channels
    84 active calls

    1.8:
    pbx> core show channels
    [snip]
    23 active channels
    12 active calls
    9567 calls processed

  • Danny,

    I use 1.6.x and 1.8.x asterisk versions. I would think asterisk call
    counters won’t be changed in each version… hence I thought the asterisk
    version wouldn’t be relevant. Reload of a particular application doesn’t
    reset the counters. I have noticed that calls done with AMI Originate,
    don’t get added in the asterisk counters…. (neither as active call, nor
    processed calls).