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

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 3 04:24:50 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 04:24 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".
====================================================================== 

---------------------------------------------------------------------- 
 (0113029) Nick_Lewis (reporter) - 2009-11-03 04:24
 https://issues.asterisk.org/view.php?id=15180#c113029 
---------------------------------------------------------------------- 
Thanks

It looks good. I will give it a go once I have a system with trunk
software up and running

Review
1. Regarding
+ * A 'sequence' field has been added to CDRs which can be combined with
+   linkedid or uniqueid and used as a unique identifier with for a CDR.

(i) There is a typo "with for" 

(ii) Since the sequence is now global should this comment instead become
+ * A 'sequence' field has been added to CDRs which can be 
+   used as a unique identifier for a CDR.


2. Regarding ast_cdr_dup_unique and ast_cdr_dup_unique2 functions:
These functions do not seem to add anything over exposing cdr_seq_inc and
seem to make the code less easy to understand.

Suggest
-	if (!(newcdr = ast_cdr_dup(cdr)))
+	if (!(newcdr = ast_cdr_dup_unique(cdr)))
 		return;
Become
-	if (!(newcdr = ast_cdr_dup(cdr)))
+	if (!(newcdr = ast_cdr_dup(cdr))) {
+		cdr_seq_inc(newcdr);
 		return;
+	}

Suggest
-	if ((duplicate = ast_cdr_dup(cdr))) {
+	if ((duplicate = ast_cdr_dup_unique2(cdr))) {
Become
	if ((duplicate = ast_cdr_dup(cdr))) {
+		cdr_seq_inc(cdr);

Suggest
-	bridge_cdr = ast_cdr_dup(chan_cdr);
+	bridge_cdr = ast_cdr_dup_unique2(chan_cdr);
Become
	bridge_cdr = ast_cdr_dup(chan_cdr);
+	cdr_seq_inc(chan_cdr);

Suggest deleting ast_cdr_dup_unique and ast_cdr_dup_unique2 functions

3. Regarding features.c
What happens to the old chan_cdr once the bridge_cdr is created. Is it
posted? If so should it instead have the original sequence number and
bridge_cdr have the new one? 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-11-03 04:24 Nick_Lewis     Note Added: 0113029                          
======================================================================




More information about the asterisk-bugs mailing list