[Home]

Summary:ASTERISK-13822: ForkCDR creates 3 CDR's
Reporter:deepesh (deepesh)Labels:
Date Opened:2009-03-25 05:37:18Date Closed:2009-05-21 11:19:31
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_forkcdr
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Hello,

After upgrading to asterisk 1.4.23.2 from asterisk 1.4.19.1, I am facing problems with ForkCDR. While using ForkCDR I am getting three cdr's instead of two. My dialplan is as follows.

[dialexten]
exten => 763,1,SetCDRUserField(764)
exten => 763,n,ForkCDR()
exten => 763,n,SetCDRUserField(763)
exten => 763,n,Dial(SIP/763)
exten => 763,n,Hangup

After exten 763 is answered it creates three cdrs.
The first cdr has userfield 763 and ANSWERED
Second cdr has userfield 764 and ANSWERED
Third cdr has userfield 763 and NO ANSWER

In the earlier version (1.4.19.1) only the first two cdrs used to be created.

Thanks in advance.
Comments:By: Damian Adamski (sh0t) 2009-03-25 10:03:40

hello

This is probably related to issue ASTERISK-1369797
You can try patch provided there.

Are your billsec values OK? after update to 1.4.23.2 ?

Damian

By: deepesh (deepesh) 2009-03-25 11:50:58

This patch solved the problem of three cdr's. But now the billsec are same for both cdr's. I have posted the cdrs below.

cdr format:-   ${CDR(start)}|${CDR(answer)}|${CDR(end)}|${CDR(duration)}|${CDR(billsec)}|${CDR(disposition)}|${CDR(uniqueid)}|${CDR(userfield)}|1

Before patch
2009-03-25 22:17:33|2009-03-25 22:17:35|2009-03-25 22:17:40|7|5|ANSWERED|1237999653.0|"763"|1
2009-03-25 22:17:33|2009-03-25 22:17:33|2009-03-25 22:17:40|7|7|ANSWERED|1237999653.0|"764"|1
2009-03-25 22:17:40||2009-03-25 22:17:40|0|0|NO ANSWER|1237999653.0|"763"|1

After patch
2009-03-25 22:16:56|2009-03-25 22:17:03|2009-03-25 22:17:05|9|2|ANSWERED|1237999616.4|"764"|1
2009-03-25 22:16:56|2009-03-25 22:17:03|2009-03-25 22:17:05|9|2|ANSWERED|1237999616.4|"763"|1

By: Damian Adamski (sh0t) 2009-03-25 15:44:04

I can confirm that..
The last version with ForkCDR working as it should be was 1.4.21

regards

By: deepesh (deepesh) 2009-03-25 21:04:13

How can I fix this problem. Are there any patches available for this?

By: Damian Adamski (sh0t) 2009-03-26 01:48:05

No, I don't think so.

The only way I know is just using older version.
I'm waiting for that fix too..

regards.

By: deepesh (deepesh) 2009-03-26 12:20:47

I could see that there are a lot more options in ForkCDR in the new versions. Is there any option which restores the old behaviour of ForkCDR? Was the old functionality removed?

By: Damian Adamski (sh0t) 2009-03-26 12:26:55

I've tried all of them in various combinations, and nothing didn't found the old behaviour. It could be a bug, but we have wait for murf or someone finding some time to have look at it.

By: deepesh (deepesh) 2009-03-27 01:27:01

I went through the changelog of 1.4.22 and found that they had made some changes in the way cdr's are handled during bridging of call (changes in res_features.c), this is probably what stopped the old behaviour. Don't know whether this is a bug.

By: deepesh (deepesh) 2009-03-28 04:20:24

I have upgraded to asterisk-1.4.24 and the problem persists.

I tried by changing the function ast_bridge_call in res_features.c to an older version (copied from asterisk 1.4.21.1) and it worked (it created 2 cdrs with proper billsecs). Is it advisable to use this?



By: keeky (keeky) 2009-03-28 21:19:13

I have the same issue and waiting for a fix
I've applied the 13797 patch to my Asterisk 1.4.23 and it was working fine.
Now I upgrade to 1.4.24.
I also applied the 13797 patch to 1.4.24 and it's fine now.
But I'm waiting for a correct fix.

Your function changing does the trick ? I compared the version and there is a lot of difference. I assume it will break something else :(



By: deepesh (deepesh) 2009-03-28 22:13:54

keeky-
The 13797 patch solves the problem of 3 cdrs (even in 1.4.24) but it introduced the new problem of billsecs being the same. Are you sure you billsecs are correct?

By: keeky (keeky) 2009-03-28 22:42:37

Yes mine are correct. I check them twice when I read your post.

By: deepesh (deepesh) 2009-03-28 23:54:05

keeky-
Did you use any options with ForkCDR or Dial? I have tried various combination's in my dialplan, but nothing seems to work. Am I missing something in my dialplan.

By: keeky (keeky) 2009-03-29 00:44:46

I use Forkcdr(v)

By: deepesh (deepesh) 2009-03-29 03:07:33

I tried ForkCDR(v), it did not help.

I still get two cdrs with same billsecs.

By: keeky (keeky) 2009-03-29 04:36:42

I think that in your case it's normal that they have same billsecs.
There is no difference between your extension action.

I'm using forkcdr for a purpose
1. Incoming call in a context
2. Transfer is active I need to foward the call to my cell
3. ForkCDR
4. Dial to my cell
So now I have 2 CDR one for the incoming call with correct duration, billsec and disposition and one for the dial to my cell.

By: deepesh (deepesh) 2009-03-29 07:26:33

I too use it for a similar application.
1. Incoming call comes to a context.
2. The call is answered (billsecs should start now).
3. ForkCDR
4. Dial another extension (billsecs should start when this extension answers)

Thus I should be having 2 cdrs with different bill secs. But what I get is 2 cdrs with same billsecs. Billsecs for both cdrs start when the extension answers. If the extension takes a few seconds to answer then I lose that seconds in the first cdr (incoming call).



By: Matthew Nicholson (mnicholson) 2009-05-15 16:31:49

Please test with the latest patch on issue ASTERISK-12977 (cdr-setanswer1.diff).  If  you do not want the billsec and answer time values to be the same, use ForkCDR(A).

By: Digium Subversion (svnbot) 2009-05-21 10:25:53

Repository: asterisk
Revision: 195881

U   branches/1.4/include/asterisk/cdr.h
U   branches/1.4/main/cdr.c
U   branches/1.4/res/res_features.c

------------------------------------------------------------------------
r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines

This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.

This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.

This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.

(closes issue ASTERISK-12977)
Reported by: sh0t
Tested by: sh0t

(closes issue ASTERISK-13822)
Reported by: deepesh

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

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

By: Digium Subversion (svnbot) 2009-05-21 10:33:57

Repository: asterisk
Revision: 195882

_U  trunk/
U   trunk/include/asterisk/cdr.h
U   trunk/main/cdr.c

------------------------------------------------------------------------
r195882 | mnicholson | 2009-05-21 10:33:56 -0500 (Thu, 21 May 2009) | 20 lines

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

........
 r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines
 
 This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.
 
 This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.
 
 This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.
 
 (closes issue ASTERISK-12977)
 Reported by: sh0t
 Tested by: sh0t
 
 (closes issue ASTERISK-13822)
 Reported by: deepesh
........

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

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

By: Digium Subversion (svnbot) 2009-05-21 10:57:02

Repository: asterisk
Revision: 195883

_U  branches/1.6.2/
U   branches/1.6.2/include/asterisk/cdr.h
U   branches/1.6.2/main/cdr.c

------------------------------------------------------------------------
r195883 | mnicholson | 2009-05-21 10:57:01 -0500 (Thu, 21 May 2009) | 27 lines

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

................
 r195882 | mnicholson | 2009-05-21 10:33:55 -0500 (Thu, 21 May 2009) | 20 lines
 
 Merged revisions 195881 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines
   
   This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.
   
   This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.
   
   This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.
   
   (closes issue ASTERISK-12977)
   Reported by: sh0t
   Tested by: sh0t
   
   (closes issue ASTERISK-13822)
   Reported by: deepesh
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-05-21 11:19:24

Repository: asterisk
Revision: 195892

_U  branches/1.6.1/
U   branches/1.6.1/include/asterisk/cdr.h
U   branches/1.6.1/main/cdr.c

------------------------------------------------------------------------
r195892 | mnicholson | 2009-05-21 11:19:20 -0500 (Thu, 21 May 2009) | 27 lines

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

................
 r195882 | mnicholson | 2009-05-21 10:33:55 -0500 (Thu, 21 May 2009) | 20 lines
 
 Merged revisions 195881 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines
   
   This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.
   
   This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.
   
   This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.
   
   (closes issue ASTERISK-12977)
   Reported by: sh0t
   Tested by: sh0t
   
   (closes issue ASTERISK-13822)
   Reported by: deepesh
 ........
................

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

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

By: Digium Subversion (svnbot) 2009-05-21 11:19:30

Repository: asterisk
Revision: 195894

_U  branches/1.6.0/
U   branches/1.6.0/include/asterisk/cdr.h
U   branches/1.6.0/main/cdr.c

------------------------------------------------------------------------
r195894 | mnicholson | 2009-05-21 11:19:29 -0500 (Thu, 21 May 2009) | 27 lines

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

................
 r195882 | mnicholson | 2009-05-21 10:33:55 -0500 (Thu, 21 May 2009) | 20 lines
 
 Merged revisions 195881 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines
   
   This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.
   
   This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.
   
   This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.
   
   (closes issue ASTERISK-12977)
   Reported by: sh0t
   Tested by: sh0t
   
   (closes issue ASTERISK-13822)
   Reported by: deepesh
 ........
................

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

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