[asterisk-commits] tilghman: branch 1.6.0 r113876 - in /branches/1.6.0: ./ cdr/ configs/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Apr 9 14:02:27 CDT 2008
Author: tilghman
Date: Wed Apr 9 14:02:27 2008
New Revision: 113876
URL: http://svn.digium.com/view/asterisk?view=rev&rev=113876
Log:
Merged revisions 113875 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r113875 | tilghman | 2008-04-09 14:00:40 -0500 (Wed, 09 Apr 2008) | 12 lines
Merged revisions 113874 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r113874 | tilghman | 2008-04-09 13:57:33 -0500 (Wed, 09 Apr 2008) | 4 lines
If the [csv] section does not exist in cdr.conf, then an unload/load sequence
is needed to correct the problem. Track whether the load succeeded with a
variable, so we can fix this with a simple reload event, instead.
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/cdr/cdr_csv.c
branches/1.6.0/configs/cdr.conf.sample
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/cdr/cdr_csv.c?view=diff&rev=113876&r1=113875&r2=113876
==============================================================================
--- branches/1.6.0/cdr/cdr_csv.c (original)
+++ branches/1.6.0/cdr/cdr_csv.c Wed Apr 9 14:02:27 2008
@@ -50,6 +50,7 @@
static int usegmtime = 0;
static int loguniqueid = 0;
static int loguserfield = 0;
+static int loaded = 0;
static char *config = "cdr.conf";
/* #define CSV_LOGUNIQUEID 1 */
@@ -316,6 +317,7 @@
static int unload_module(void)
{
ast_cdr_unregister(name);
+ loaded = 0;
return 0;
}
@@ -326,15 +328,23 @@
if(!load_config(0))
return AST_MODULE_LOAD_DECLINE;
- if ((res = ast_cdr_register(name, ast_module_info->description, csv_log)))
+ if ((res = ast_cdr_register(name, ast_module_info->description, csv_log))) {
ast_log(LOG_ERROR, "Unable to register CSV CDR handling\n");
-
+ } else {
+ loaded = 1;
+ }
return res;
}
static int reload(void)
{
- load_config(1);
+ if (load_config(1)) {
+ loaded = 1;
+ } else {
+ loaded = 0;
+ ast_log(LOG_WARNING, "No [csv] section in cdr.conf. Unregistering backend.\n");
+ ast_cdr_unregister(name);
+ }
return 0;
}
Modified: branches/1.6.0/configs/cdr.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/configs/cdr.conf.sample?view=diff&rev=113876&r1=113875&r2=113876
==============================================================================
--- branches/1.6.0/configs/cdr.conf.sample (original)
+++ branches/1.6.0/configs/cdr.conf.sample Wed Apr 9 14:02:27 2008
@@ -136,8 +136,8 @@
[csv]
usegmtime=yes ; log date/time in GMT. Default is "no"
-loguniqueid=yes ; log uniqueid. Default is "no
-loguserfield=yes ; log user field. Default is "no
+loguniqueid=yes ; log uniqueid. Default is "no"
+loguserfield=yes ; log user field. Default is "no"
;[radius]
;usegmtime=yes ; log date/time in GMT
More information about the asterisk-commits
mailing list