[asterisk-commits] juggie: branch group/NoLossCDR-Redux2 r105407 - /team/group/NoLossCDR-Redux2/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Feb 29 14:00:05 CST 2008
Author: juggie
Date: Fri Feb 29 14:00:03 2008
New Revision: 105407
URL: http://svn.digium.com/view/asterisk?view=rev&rev=105407
Log:
allow the cdr cli command to stay registered even if cdr is disabled in cdr.conf
Modified:
team/group/NoLossCDR-Redux2/main/cdr.c
Modified: team/group/NoLossCDR-Redux2/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/group/NoLossCDR-Redux2/main/cdr.c?view=diff&rev=105407&r1=105406&r2=105407
==============================================================================
--- team/group/NoLossCDR-Redux2/main/cdr.c (original)
+++ team/group/NoLossCDR-Redux2/main/cdr.c Fri Feb 29 14:00:03 2008
@@ -1248,6 +1248,7 @@
static int do_reload(int reload)
{
+ static int firstload = 1;
struct ast_config *config;
const char *enabled_value;
const char *safeshutdown_value;
@@ -1309,17 +1310,22 @@
ast_log(LOG_NOTICE, "CDR logging disabled, no data will be stored.\n");
}
-
+
if (was_enabled && !enabled) {
ast_unregister_atexit(ast_cdr_engine_term);
- ast_cli_unregister(&cli_status);
} else if (!was_enabled && enabled) {
ast_register_atexit(ast_cdr_engine_term);
- ast_cli_register(&cli_status);
- }
+ }
+
+ /* not sure if this is the best way to do this */
+ if (firstload)
+ ast_cli_register(&cli_status);
+
ast_config_destroy(config);
manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: CDR\r\nMessage: CDR subsystem reload requested\r\n");
+
+ firstload = 0;
return res;
}
More information about the asterisk-commits
mailing list