[Home]

Summary:ASTERISK-12890: [patch] Unanswered Queue() calls don't have CDR
Reporter:Daniel Ferrer (dferrer)Labels:
Date Opened:2008-10-14 11:15:44Date Closed:2009-05-18 14:02:53
Priority:MinorRegression?No
Status:Closed/CompleteComponents:CDR/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 13691.patch
( 1) asterisk-1.4.22-unanswered_queue.diff
( 2) asterisk-trunk-unanswered_queue.diff
( 3) cdr-queue-unanswered1.diff
( 4) cdr-queue-unanswered2.diff
Description:When a call goes to Queue app without an Answer in its path, and call doesn't get answered, there is no CDR for this call. The first impression is that this appears to be a correct behaviour, because I've option "unanswered=no" in cdr.conf.
However this 'unanswered' is a bit incoherent, because if I dial B using Dial app, and B doesn't answer, CDR is posted in this case (field 'channel' and 'dstchannel' have source and destination channels in this case, so CDR is posted). For the Queue case, 'dstchannel' is empty, so CDR post is disabled, as you can see in post_cdr logic to skip unanswered calls.

I'm happy with current behaviour, but I wanted to change it for Queue calls: I wanted a CDR posted in case of a missed Queue call. I'm attaching a patch for 1.4.22 and trunk for app_queue for that, I mark CDR as AST_CDR_FLAG_DONT_TOUCH and in post_cdr it will be "untouched" if cdr is marked with this flag. Another solution was to put Queue's final destination channel in 'dstchannel', but this is not elegant when I'm in 'ringall' strategy.
Comments:By: Leif Madsen (lmadsen) 2008-10-14 11:18:20

Heya murf!

Another CDR issue... would you mind checking this out and determine how to move this forward?

Thanks!

By: RobertB (bahjons) 2009-01-15 06:13:34.000-0600

When testing the patch, and compiling, I get the following error:

[CC] app_queue.c -> app_queue.o
app_queue.c: In function ‘try_calling’:
app_queue.c:2914: error: ‘queue_debug’ undeclared (first use in this function)
app_queue.c:2914: error: (Each undeclared identifier is reported only once
app_queue.c:2914: error: for each function it appears in.)
make[1]: *** [app_queue.o] Error 1
make[1]: Leaving directory `/usr/src/asterisk-1.4.22/apps'
make: *** [apps] Error 2

By: Steve Murphy (murf) 2009-01-21 15:48:28.000-0600

OK, I've just uploaded 13691.patch. I'm working right now on resolving
complaints about brain-dead CDR's when unanswered=yes; I have another bug patch
that is introducing a similar patch to the Dial() world.(13892)

This new patch will output a CDR for each attempted dial, and should include
the disposition of the unconnected call. It is ONLY output if the "unanswered=yes" is specified in cdr.conf.

I've looked at your patch, and don't think it especially bad; I'd probably alter it in these ways, though:
 1. Don't try to re-use an existing CDR flag field for this purpose. DONT_TOUCH is for another situation, and who knows, maybe the 'original' purpose for which it is intended might collide with this new purpose. (which is to overrride the single-channel CDR filtering code to force the CDR to be posted anyway). I think it would be clearer to define a CDR flag like "POST_ANYWAY" and use that instead.
 2. I think it would be better if this code were wrapped with
if (!ast_cdr_isset_unanswered()) {...}, because if you do specify 'unanswered = yes', then you'll get a CDR for all attempts, and another for the total effort. *murf shrugs* ... perhaps, tho, that's what you want.....  tell me what you think is best here.

By: Steve Murphy (murf) 2009-01-21 15:51:09.000-0600

I'm going to put this into "Ready for testing" mode... more as a reminder to me that I have code here to merge.


By: RobertB (bahjons) 2009-03-04 12:45:20.000-0600

13691.patch doesn't log abandoned Queue calls still. But it does log each unanswered attempt at calling agents.

By: Leif Madsen (lmadsen) 2009-03-04 19:07:49.000-0600

Changing status back to confirmed as there is a reporter who has discovered an issue.

By: Matthew Nicholson (mnicholson) 2009-04-17 17:06:17

Please test the patch I just uploaded and see if it fixes cdrs for abandoned calls.

By: Matthew Nicholson (mnicholson) 2009-04-29 15:46:01

That patch does not fix the abandoned issue.  I am working on a fix.

By: Matthew Nicholson (mnicholson) 2009-04-30 17:15:13

Ok.  Test the patch I just uploaded and see if it fixes the abandoned issues.  I don't particularly like the way this fix is implemented, but it should work.

By: Digium Subversion (svnbot) 2009-05-12 17:15:50

Repository: asterisk
Revision: 194028

U   branches/1.4/apps/app_queue.c

------------------------------------------------------------------------
r194028 | mnicholson | 2009-05-12 17:15:50 -0500 (Tue, 12 May 2009) | 16 lines

This change modifies app_queue to properly generate CDR records in failure
situations.

This involves setting a proper cdr disposition coresponding to the given
failure condition and ensuring the proper information is stored in the cdr
record.

(closes issue ASTERISK-12890)
Reported by: dferrer
Tested by: mnicholson

(closes issue ASTERISK-12839)
Reported by: atis
Tested by: atis


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194028

By: Digium Subversion (svnbot) 2009-05-12 17:32:18

Repository: asterisk
Revision: 194057

_U  trunk/
U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r194057 | mnicholson | 2009-05-12 17:32:18 -0500 (Tue, 12 May 2009) | 22 lines

Merged revisions 194028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r194028 | mnicholson | 2009-05-12 17:15:45 -0500 (Tue, 12 May 2009) | 16 lines
 
 This change modifies app_queue to properly generate CDR records in failure
 situations.
 
 This involves setting a proper cdr disposition coresponding to the given
 failure condition and ensuring the proper information is stored in the cdr
 record.
 
 (closes issue ASTERISK-12890)
 Reported by: dferrer
 Tested by: mnicholson
 
 (closes issue ASTERISK-12839)
 Reported by: atis
 Tested by: atis
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194057

By: Digium Subversion (svnbot) 2009-05-12 17:48:19

Repository: asterisk
Revision: 194059

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_queue.c

------------------------------------------------------------------------
r194059 | mnicholson | 2009-05-12 17:48:19 -0500 (Tue, 12 May 2009) | 29 lines

Merged revisions 194057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r194057 | mnicholson | 2009-05-12 17:32:13 -0500 (Tue, 12 May 2009) | 22 lines
 
 Merged revisions 194028 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r194028 | mnicholson | 2009-05-12 17:15:45 -0500 (Tue, 12 May 2009) | 16 lines
   
   This change modifies app_queue to properly generate CDR records in failure
   situations.
   
   This involves setting a proper cdr disposition coresponding to the given
   failure condition and ensuring the proper information is stored in the cdr
   record.
   
   (closes issue ASTERISK-12890)
   Reported by: dferrer
   Tested by: mnicholson
   
   (closes issue ASTERISK-12839)
   Reported by: atis
   Tested by: atis
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194059

By: Digium Subversion (svnbot) 2009-05-12 18:01:54

Repository: asterisk
Revision: 194062

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_queue.c

------------------------------------------------------------------------
r194062 | mnicholson | 2009-05-12 18:01:54 -0500 (Tue, 12 May 2009) | 29 lines

Merged revisions 194057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r194057 | mnicholson | 2009-05-12 17:32:13 -0500 (Tue, 12 May 2009) | 22 lines
 
 Merged revisions 194028 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r194028 | mnicholson | 2009-05-12 17:15:45 -0500 (Tue, 12 May 2009) | 16 lines
   
   This change modifies app_queue to properly generate CDR records in failure
   situations.
   
   This involves setting a proper cdr disposition coresponding to the given
   failure condition and ensuring the proper information is stored in the cdr
   record.
   
   (closes issue ASTERISK-12890)
   Reported by: dferrer
   Tested by: mnicholson
   
   (closes issue ASTERISK-12839)
   Reported by: atis
   Tested by: atis
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194062

By: Digium Subversion (svnbot) 2009-05-12 18:04:02

Repository: asterisk
Revision: 194063

_U  branches/1.6.0/
U   branches/1.6.0/apps/app_queue.c

------------------------------------------------------------------------
r194063 | mnicholson | 2009-05-12 18:04:02 -0500 (Tue, 12 May 2009) | 29 lines

Merged revisions 194057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r194057 | mnicholson | 2009-05-12 17:32:13 -0500 (Tue, 12 May 2009) | 22 lines
 
 Merged revisions 194028 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r194028 | mnicholson | 2009-05-12 17:15:45 -0500 (Tue, 12 May 2009) | 16 lines
   
   This change modifies app_queue to properly generate CDR records in failure
   situations.
   
   This involves setting a proper cdr disposition coresponding to the given
   failure condition and ensuring the proper information is stored in the cdr
   record.
   
   (closes issue ASTERISK-12890)
   Reported by: dferrer
   Tested by: mnicholson
   
   (closes issue ASTERISK-12839)
   Reported by: atis
   Tested by: atis
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194063