[asterisk-users] Ignoring time spent waiting in queue in CDR

Miguel Molina mmolina at millenium.com.co
Tue Apr 14 09:31:58 CDT 2009


Scott Gifford escribió:
> Hello,
>
> I'm working on an Asterisk configuration for a call center, and they
> bill based on the time spent talking to an agent, but not for any time
> spent waiting in a queue.  The CDR information contains the entire
> duration of the call as billable seconds, including time spent waiting
> in the queue.  I would like the billable seconds to only include the
> time spent actually talking to an agent.
>
> I am using Asterisk 1.4.18.
>
> The only way I have found so far is to correlate the CDRs with the
> "CONNECT" queue records, figure out the end time of the call by adding
> the CDR start time to the duration, then figure out the actual
> duration by subtracting the time of the queue "CONNECT" record.  That
> seems messy and error-prone, and I'm hoping there's a better way.
>   
Why don't you just make your billing statistics from the queue log? 
Assuming that you upload the queue log to a database, it would be very easy.

Total talk time on a queue:

- Sum of parameter 2 of COMPLETECALLER and COMPLETEAGENT events.
- Sum of parameter 4 of TRANSFER event if your calls are transferred 
somewhere else in the dialplan (which could be another queue, so you 
have the rest of the duration on the other queue call).

And you could filter per agent, queue, date, etc...

Just my two cents.

> I also looked at using the ResetCDR() or ForkCDR() dialplan functions,
> but I don't see a way to cause code to run immediatly after the agent
> answers a call from the queue.
>
> Any suggestions?  Am I missing some easy way of doing this?
>
> Thanks!
>
> ----Scott.
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>   


-- 
Ing. Miguel Molina
Grupo de Tecnología
Millenium Phone Center
PBX: (+57 1)6500800 ext. 1201
Fax: (+57 1)6500816
Móvil: (+57)3138873587 




More information about the asterisk-users mailing list