[asterisk-bugs] [Asterisk 0013797]: [patch] forkcdr() doesn't fork when call disposition is ANSWERED

Asterisk Bug Tracker noreply at bugs.digium.com
Thu May 21 11:19:23 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=13797 
====================================================================== 
Reported By:                sh0t
Assigned To:                mnicholson
====================================================================== 
Project:                    Asterisk
Issue ID:                   13797
Category:                   Applications/app_forkcdr
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.22 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-10-29 08:59 CDT
Last Modified:              2009-05-21 11:19 CDT
====================================================================== 
Summary:                    [patch] forkcdr() doesn't fork when call disposition
is ANSWERED
Description: 
Hello, I have problem with forkcdr app. (sip-sip calls)
First look at this sample dialplan

exten => s,1,answer
exten => s,n,Set(CDR(accountcode)=1001)
exten => s,n,Set(CDR(userfield)=MAIN)
exten => s,n,wait(2)
exten => s,n,ForkCDR()
exten => s,n,ResetCDR()
exten => s,n,Set(CDR(userfield)=OUTpggw1)
exten => s,n,Dial(SIP/pggw1,20)
exten => s,n,hangup

Everything works ok when that Dial result is NO ANSWER or for example
FAILED
but if I answer that call. I will see only one CDR record (that with
userfield MAIN)

(the failure scenario (with answered call))
bellow two examples of the cdr records (stored in pgsql database)
2008-10-29
14:17:58,32,32,11,pg-gw,SIP/pggw2-c8073fd0,,Dial,SIP/pggw1|20,14,6,ANSWERED,3,1001,1225286278.17290,MAIN

(the expected one, only when call disposition is NO ANSWER or billsec=0)
2008-10-29
14:19:03,32,32,11,pg-gw,SIP/pggw2-c807dd30,,ForkCDR,,10,10,ANSWERED,3,1001,1225286343.17309,MAIN
2008-10-29
14:19:05,32,32,s,test1,SIP/pggw2-c807dd30,SIP/pggw1-01139f40,Dial,SIP/pggw1|20,8,0,NO
ANSWER,3,1001,1225286343.17309,OUTpggw1

I'm using forkcdr because I need to have two cdr records. One for
incomiing call and one for that dial.

It worked for a long time with earlier versions of asterisk (for example
1.4.11)

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0014744 ForkCDR creates 3 CDR's
related to          0013881 [patch] AGI command "answer" ...
====================================================================== 

---------------------------------------------------------------------- 
 (0105230) svnbot (reporter) - 2009-05-21 11:19
 https://issues.asterisk.org/view.php?id=13797#c105230 
---------------------------------------------------------------------- 
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 https://issues.asterisk.org/view.php?id=13797)
    Reported by: sh0t
    Tested by: sh0t
    
    (closes issue https://issues.asterisk.org/view.php?id=14744)
    Reported by: deepesh
  ........
................

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-21 11:19 svnbot         Checkin                                      
2009-05-21 11:19 svnbot         Note Added: 0105230                          
======================================================================




More information about the asterisk-bugs mailing list