[asterisk-bugs] [Asterisk 0015180]: [patch] No unique identifier for CDR

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 3 09:18:26 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15180 
====================================================================== 
Reported By:                Nick_Lewis
Assigned To:                mnicholson
====================================================================== 
Project:                    Asterisk
Issue ID:                   15180
Category:                   CDR/General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-05-22 08:45 CDT
Last Modified:              2009-11-03 09:18 CST
====================================================================== 
Summary:                    [patch] No unique identifier for CDR
Description: 
There is no unique identifier for a CDR. This makes it difficult to
associate other things such as call monitor recordings with a CDR. 
Each call does have a unique identifier which is stored in the CDR as
"uniqueid" but there may be multiple CDRs representing one call. For
example ResetCDR(w) saves a CDR and creates a new one for the call. Both
CDR have the same "uniqueid".
====================================================================== 

---------------------------------------------------------------------- 
 (0113044) mnicholson (administrator) - 2009-11-03 09:18
 https://issues.asterisk.org/view.php?id=15180#c113044 
---------------------------------------------------------------------- 
1. I will fix the typo there.  But the sequence field cannot be used by it
self to uniquely identify a CDR.  The sequence field is reset each time
asterisk is restarted.  It must be combined with the uniqueid or linkedid
field to uniquely identify a CDR.

2. It is true that these functions do not do very much, but I wanted to
abstract away the details of sequence number management.  This includes how
sequence numbers are generated (cdr_seq_inc) and when they are generated
(ast_cdr_init, ast_cdr_dup_*).  I don't want developers working with CDR
records to have to think about whether to increment the sequence number or
not, I think it is easier to think about whether this CDR should be unique
or not.

3. The bridge_cdr is copied from the chan->cdr.  From there several things
can happen. In most cases, bridge_cdr is written to disk, and chan->cdr is
eventually discarded (along with peer->cdr).  If a transfer occurs, the
bridge_cdr is supposed to be written and the peer->cdr or chan->cdr reset
for the next leg of the call, but I belive this code is buggy.

With the sequence number patch, the bridge_cdr gets the chan->cdr's
sequence number and chan->cdr's sequence number is incremented.  In theory,
this should cause the next leg of the call to have a new sequence number. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-03 09:18 mnicholson     Note Added: 0113044                          
======================================================================




More information about the asterisk-bugs mailing list