[solved] Count calls in individual statistic

i would like to count calls that have not been asnwered.
now i have different call flows for different inbound routes. i would like to have a special target vfor counting these calls (in genesys it was called “virtual queue”, just to count calls entering this statistic point).

is there any way to realize this? would a custom destination fit my need?


Yes, many different ways. You could write a custom context that does the counting for you, or you can pull the call logs from the CDR and query what you need. You could have it go to a “blank” announcement (before continuing on the treatment) and count those.

ah, cool idea. will try that. thx!

i had some thoughts on this. this works fine for “simple” calls, but not for special conditions.
especially i would like to know how many calls haven’t been answered although there were free lines.
the callflow is quite simple:
incoming call → ext 1, after ringing timeout → ext 2, after ringing timeout disconnect.
if ext1 is busy, incoming calls are directly routed to ext2 (ext1 busy dest → ext2).

any thoughts about counting these calls?


If it doesn’t have to be real-time I would just write a SQL query the CDR database table.

Another GUI option is another “blank” announcement. have extension 1 fail to the announcement, which then passes to extension 2. Count the extension 2 announcement.

realtime is not necessary. the only thing that doesn’t my requirement is the failover from extension1 to extensio2 in case it is busy - if extension2 won’t answer the call it would failover to announcement2 as well - but the counter wouldn’t reflect the numbers i like to get (calls not being answered on ext1 AND ext2).
any chance to use a variable that will count the RONAs? then i just need to get that variable into the database.

Of course, you can set any variable within any dial plan you build.
Asterisk cmd Set - VoIP-Info

There is a free field in the database known at UserField, you could store your variable there.
SetCDRUserField() — Sets the Call Detail Record user field - Asterisk: The Future of Telephony, 2nd Edition [Book] (oreilly.com)

Although you might be able to use what happens already on the CDR to query a count for you. Looking at the DID and where the call goes from there, or where it answers.