Prevent CDR backends from unregistering while billing data is in flight
[asterisk/asterisk.git] / cdr / cdr_sqlite3_custom.c
index 6012346..83dac6a 100644 (file)
@@ -289,7 +289,9 @@ static int write_cdr(struct ast_cdr *cdr)
 
 static int unload_module(void)
 {
-       ast_cdr_unregister(name);
+       if (ast_cdr_unregister(name)) {
+               return -1;
+       }
 
        free_config(0);