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

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Oct 27 08:46:20 CDT 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:                     feedback
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-10-27 08:46 CDT
====================================================================== 
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".
====================================================================== 

---------------------------------------------------------------------- 
 (0112810) mnicholson (administrator) - 2009-10-27 08:46
 https://issues.asterisk.org/view.php?id=15180#c112810 
---------------------------------------------------------------------- 
The sequence number must change sometimes during duplication because
ForkCDR may call ast_cdr_dup, in which case the duplicated cdr should have
a different sequence number.  On the other hand, CDR backends call
ast_cdr_dup on records to get a copy they can work with.  Those records do
not need a different sequence number.

The sequence number generation is tied to the channel so that each
sequence number generated for that channel is unique.  If the sequence
number was simply incremented for each CDR record, you have the possibility
that a CDR record with an older sequence number will be duplicated.  That
would lead to a duplicate sequence number.

Thinking about this further, with my implementation, it is still possible
to get a duplicate sequence number if the channel used to generate the
sequence number is not the same channel referenced by the uniqueid field in
a CDR record.  One work around for this would be to fetch the channel via
its uniqueid when generating sequence numbers.  This approach would fail if
the channel has gone away when or if the channel is not yet in the channel
list when we attempt to generate a sequence number.

It may be best to go with a true uuid after all. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-10-27 08:46 mnicholson     Note Added: 0112810                          
======================================================================




More information about the asterisk-bugs mailing list