[asterisk-users] Right timing for a queue call

Atis Lezdins
Thu, 03 Jan 2008 19:01:48 -0000

Andrea Spadaccini wrote:
> Hello everybody,
> I'd like to have more detailed records for calls related to queues. For
> instance, if A enters in queue X, waits for Y secs and then talks to peer Z
for
> T seconds, I'd like to have two entries in my CDR:
>
> - src: A, dst: X, duration: Y, state: ANSWERED
> - src: A, dst: Z, duration: T, state: ANSWERED
>
> This independently from how many peers the Queue app calls without success
> (peer not connected or not answering).
>
> The only way I could think of was giving an unique userfield to all the
calls
> related to the call from A to the queue X, e.g.:
>
> - A -> X usrfield: AX-uniqueid
> - call to peer B that doesn't answer, usrfield: AX-uniqueid
> - call to peer C that isn't available, usrfield: AX-uniqueid
> - call to peer Z that answers, usrfield: AX-uniqueid
>
> And then do some math based on duration and call state in order to get the
info
> I need.
>
> Do you think that it's a good idea? How can it be implemented? I see
that
> uniqueid changes for each call in the scenario that I described, so I'm
a bit
> stuck.
>
> I'm using asterisk 1.2.2x (I know that I should migrate.. This is the
last
> release of our product that uses 1.2).

You can set some inheritable variable to uniqueid of channel before
entering queue, and then in answer-macro (Dial(..,..,M()) set the CDR
userfield to that variable. This would require use of Agent or Local
channel, so you can do custom Dial for queue member. Works for me.

Regards,
Atis


--
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835