mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Prevent CDR backends from unregistering while billing data is in flight
This patch makes it so that CDR backends cannot be unregistered while active CDR records exist. This helps to prevent billing data from being lost during restarts and shutdowns. Review: https://reviewboard.asterisk.org/r/2880/ ........ Merged revisions 402081 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -384,9 +384,11 @@ static int my_unload_module(int reload)
|
||||
}
|
||||
|
||||
dbport = 0;
|
||||
ast_cdr_unregister(name);
|
||||
|
||||
return 0;
|
||||
if (reload) {
|
||||
return ast_cdr_backend_suspend(name);
|
||||
} else {
|
||||
return ast_cdr_unregister(name);
|
||||
}
|
||||
}
|
||||
|
||||
static int my_load_config_string(struct ast_config *cfg, const char *category, const char *variable, struct ast_str **field, const char *def)
|
||||
@@ -660,7 +662,11 @@ static int my_load_module(int reload)
|
||||
return AST_MODULE_LOAD_FAILURE;
|
||||
}
|
||||
|
||||
res = ast_cdr_register(name, desc, mysql_log);
|
||||
if (!reload) {
|
||||
res = ast_cdr_register(name, desc, mysql_log);
|
||||
} else {
|
||||
res = ast_cdr_backend_unsuspend(name);
|
||||
}
|
||||
if (res) {
|
||||
ast_log(LOG_ERROR, "Unable to register MySQL CDR handling\n");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user