Get calls by extension from Cdr table

Hello everyone, I’m building call statistics based on extensions(each extension is related to an operator), so I need to now for ‘dcontext’ => ‘ext-group’

For not a simple call does the dstchannel indicates the operator for ext-group?

dstchannel => PJSIP/204-000072c5 I’ve several row with same uniqueid but the number 204 is repeating, in ext-queues case I’ve different numbers for uniqueid.
lastdata => PJSIP/203&PJSIP/204&PJSIP/207&PJSIP/210&PJSIP/217&...

I’m aware for example for ’dcontext' => 'ext-queues' I have in ‘dstchannel’ => 'Local/325@from-queue-00007c44;1' the number 325 indicates an operator and for each row with the same uniqueid the numbers are different.

Your question is full of terms that are not meaningful in raw Asterisk. You seem to be referring to contexts in a dialplan provided as part of some other package.

In Asterisk terms, 325 represents an extension in the from-queue context. Asterisk doesn’t define a from-queue context, so you will have to consult the documentation for the dialplan you are using to know the exact semantics of an extension in that context, but in Asterisk terms, it could be a local phone (what FreePBX calls an extension), a PSTN number, or an internal service.

dstchannel represents the channel on B side of the bridge, which could be a real hardware channel, or the special case Local channel, which connects to another part of the dialplan (and will result in CDRs from that dialplan).

Thanks for your reply, I’m not an asterisk administrator, just have access to database.
I’m just interesting it’s possibly or not to count for example incoming calls or missed calls for chosen operator?
If I have data like this from one uniqueid there is 4 rows(No Answer), (I think one person called to 4 operator).

1) 'dstchannel' => 'PJSIP/204-000072c2',
'lastdata' => 'PJSIP/203&PJSIP/204&PJSIP/207&PJSIP/210&PJSIP/217&PJSIP/241&PJSIP/243&PJSIP/306',
2)
'dstchannel' => 'PJSIP/204-000072c3',
'lastdata' => 'PJSIP/203&PJSIP/204&PJSIP/207&PJSIP/210&PJSIP/217&PJSIP/241&PJSIP/243&PJSIP/306',
3)
'dstchannel' => 'PJSIP/204-000072c4',
'lastdata' => 'PJSIP/203&PJSIP/204&PJSIP/207&PJSIP/210&PJSIP/217&PJSIP/241&PJSIP/243&PJSIP/306',
4)
'dstchannel' => 'PJSIP/204-000072c5',
'lastdata' => 'PJSIP/203&PJSIP/204&PJSIP/207&PJSIP/210&PJSIP/217&PJSIP/241&PJSIP/243&PJSIP/306',

About 8 numbers are being called simultaneously. The queue application loops on select available agents, then call them for a certain amount of time. You will get CDRs every time round the loop, and because you are using the ring all strategy, there will be CDRs for all 8 called agents for each circuit of the loop.

Analysing CDRs for such cases really needs you to understand what FreePBX is doing and how Asterisk handles queues, as it is not straightforward.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.