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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2013-10-27 19:40:43 +00:00
parent 23be89dfff
commit 5740a2bda6
15 changed files with 155 additions and 36 deletions

View File

@@ -443,6 +443,10 @@ failed:
static int tds_unload_module(void)
{
if (ast_cdr_unregister(name)) {
return -1;
}
if (settings) {
ast_mutex_lock(&tds_lock);
mssql_disconnect();
@@ -452,8 +456,6 @@ static int tds_unload_module(void)
ast_free(settings);
}
ast_cdr_unregister(name);
dbexit();
return 0;