[asterisk-bugs] [Asterisk 0010666]: not optimal CDR lock flag check

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Sep 7 09:20:13 CDT 2007


The following issue has been UPDATED. 
====================================================================== 
http://bugs.digium.com/view.php?id=10666 
====================================================================== 
Reported By:                arkadia
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10666
Category:                   CDR/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-07-2007 05:22 CDT
Last Modified:              09-07-2007 09:20 CDT
====================================================================== 
Summary:                    not optimal CDR lock flag check
Description: 
In cdr.c in functions where we check AST_CDR_FLAG_LOCKED flag
it should be done as a first thing.

Here in common patterns from the code:

for (; cdr; cdr = cdr->next) {
  if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
  .....
  }
}

OR

while (cdr) {
  if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
  .....
  }
  cdr = cdr->next;
}

Function ast_cdr_failed, ast_cdr_noanswer, ast_cdr_setdestchan should be
changed to match this idea, course they do some other stuff prior checking
AST_CDR_FLAG_LOCKED which may be not required at all.
I've prepared patch for this change.
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-07-07 09:20  Corydon76      Asterisk Version         1.4.11  =>  SVN     
09-07-07 09:20  Corydon76      SVN Branch (only for SVN checkou 1.4  =>  trunk  
  
======================================================================




More information about the asterisk-bugs mailing list