Scott Gifford
2009-Apr-14 06:16 UTC
[asterisk-users] Ignoring time spent waiting in queue in CDR
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. 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.
Alex Balashov
2009-Apr-14 06:49 UTC
[asterisk-users] Ignoring time spent waiting in queue in CDR
I wouldn't approach this by trying to rework the CDRs at all; CDRs are fundamentally low-level call records. They correspond to calls. If you need logic to support a billing model for some specific application (i.e. time after connect to agent), I would approach that from a higher layer of abstraction that is more closely coupled to the application's own. For example, you could listen for Manager API events that indicate a queue caller's connection to an agent and flag those. There are numerous ways to skin this cat. What I would not do is try to mess with the CDRs to achieve this end; there is a reason they are called CDRs -- call detail records. Not queue detail records, not MoH detail records, not IVR detail records, but _call_ detail records. If nothing else, you may find that someday you will need the total call duration for other purposes, and have shot yourself in the foot by hacking it out this way. Plus, it's just too hard. Why jerry-rig CDRs when there are far easier and more functionally modular / extended ways to accomplish the same goal? Wrong tool for the job. Just my $.02, of course... Scott Gifford wrote:> 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. > > 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-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 Mobile : (+1) (678) 237-1775
Lenz Emilitri
2009-Apr-14 12:37 UTC
[asterisk-users] Ignoring time spent waiting in queue in CDR
My suggestion is to use a tool made specifically for this - we happen to sell one, but there are many options with different prices and licencing model. Don't reinvent the wheel and concentrate on added value. l. 2009/4/14 Scott Gifford <sgifford at suspectclass.com>> 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. > > 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 >-- Loway - home of QueueMetrics - http://queuemetrics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090414/2d04c353/attachment.htm
Jared Smith
2009-Apr-14 13:15 UTC
[asterisk-users] Ignoring time spent waiting in queue in CDR
----- "Scott Gifford" <sgifford at suspectclass.com> wrote:> 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.You're absolutely right -- the CDR information is for the entire call. Instead, look at the queue log (typically written to /var/log/asterisk/queue_log). It will tell you most (if not all) of the information you need for creating call queue reports. --- Jared Smith Training Manager Digium, Inc.
Miguel Molina
2009-Apr-14 14:31 UTC
[asterisk-users] Ignoring time spent waiting in queue in CDR
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