Prevent CDR backends from unregistering while billing data is in flight
[asterisk/asterisk.git] / cdr / cdr_adaptive_odbc.c
index 0a9cfdb..4078b79 100644 (file)
@@ -767,7 +767,10 @@ early_release:
 
 static int unload_module(void)
 {
-       ast_cdr_unregister(name);
+       if (ast_cdr_unregister(name)) {
+               return -1;
+       }
+
        if (AST_RWLIST_WRLOCK(&odbc_tables)) {
                ast_cdr_register(name, ast_module_info->description, odbc_log);
                ast_log(LOG_ERROR, "Unable to lock column list.  Unload failed.\n");