[asterisk-users] Processed Call Counter

Steve Edwards asterisk.org at sedwards.com
Thu Mar 8 10:40:03 CST 2012


On Thu, 8 Mar 2012, [Digital^Dude] ® wrote:

> 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.'

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000


More information about the asterisk-users mailing list