[asterisk-users] Need queue name in CDR

Warren Selby wcselby at selbytech.com
Fri Jun 15 15:37:10 CDT 2012


On Tue, Jun 12, 2012 at 10:38 PM, Pratik Shrestha <pratikdbl at gmail.com>wrote:

> Dear All,
>
> I am making asterisk report using CDR values given by asterisk.
>
> I have queues which consist of multiple members (extension). Also, an
> extension may be in multiple queues. So, I want CDR to record the
> name/number of queue from which the call was originated.
>
> E.g.
> *Channel*                                         * DestinationChannel*
>                                   * Src*                           * Destination
>    *
> SIP/KOT-0000000c                           Local/102 at from-queue-6a84;1
>                       0856511524                9999               (first
> line in CDR)
> Local/102 at from-queue-6a84;2           SIP/102-0000000e
>                        0856511524                 102
>  (second line in CDR)
>
>
> In above example, 9999 is a queue and 102 is an extension which is member
> to that queue. So call comes from 0856511524 and goes to queue 9999 first
> and queue routes call to 102 extension. So what I need is when the queue is
> routed to extension 102 (in the seconds line), I want to show the queue
> (9999) also. I know that I can track the queue by comparing Destination
> Channel of queue(first line) with Channel of extension (second line). But
> this will make my query very long and hard.
>
> Please help me. I am still new to asterisk.
>
>

While I agree with Lenz about using one of the existing tools out there to
analyze queue logs (his Queuemetrics is a very good tool, I would
definitely recommend it!), if all you really want is queue name in the CDR
fields, you can do that with a simple Set command in your local channel
that dials your agents using func CDR:

exten => agentcall,1,Set(CDR(queue)=${queuenum})

This will create a new field in your CDR called "queue" and will populate
it with the result of the channel variable ${queuenum}, which you should
set before you enter the queue.  If you're using MySQL for your CDR
storage, I believe you have to create the column first for the new field.


-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com <http://www.selbytech.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120615/a482cba1/attachment.htm>


More information about the asterisk-users mailing list