Summary:ASTERISK-13097: On a configuration reload, cdr_csv ignores options if cdr.conf was unchanged
Reporter:David Woolley (davidw)Labels:
Date Opened:2008-11-20 12:59:46.000-0600Date Closed:2008-11-21 11:08:19.000-0600
Versions:Frequency of
Environment:Attachments:( 0) cdr_diff.txt
Description:If you do a global reload (we didn't try a specific module reload), the loguniqueid and loguserfield options get turned off unconditionally.


The problem would seem to be that cdr/cdr_csv.c resets these flags before it decides it is going to do nothing because the file is unchanged.

I can't easily check for trunk and 1.6.1 as svn.digium.com, for HTTP, currently thinks it is bugs.digium.com.  cdr/cdr_radius.c has completely different code.

I didn't get an internal report of losing the UTC time option, but I suspect that happened as well.

Prime suspect code is:

    99         usegmtime = 0;
   100         loguniqueid = 0;
   101         loguserfield = 0;
   103         if (!(cfg = ast_config_load(config, config_flags))) {
   104                 ast_log(LOG_WARNING, "unable to load config: %s\n", config);
   105                 return 0;
   106         } else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
   107                 return 1;
Comments:By: Terry Wilson (twilson) 2008-11-20 16:00:36.000-0600

davidw: Does the attached patch fix this for you?

By: David Woolley (davidw) 2008-11-21 09:14:59.000-0600

Works for us (and what I would have tried).

By: Digium Subversion (svnbot) 2008-11-21 11:08:19.000-0600

Repository: asterisk
Revision: 158374

U   trunk/cdr/cdr_csv.c

r158374 | twilson | 2008-11-21 11:08:18 -0600 (Fri, 21 Nov 2008) | 8 lines

Reloading the config and having no changes still initialized some settings to 0. Initialize settings after doing all of the cfg checks.

(closes issue ASTERISK-13097)
Reported by: davidw
     cdr_diff.txt uploaded by otherwiseguy (license 396)
Tested by: davidw