Prevent CDR backends from unregistering while billing data is in flight
[asterisk/asterisk.git] / cdr / cdr_csv.c
index a6f8a4d..1cc1747 100644 (file)
@@ -315,7 +315,10 @@ static int csv_log(struct ast_cdr *cdr)
 
 static int unload_module(void)
 {
-       ast_cdr_unregister(name);
+       if (ast_cdr_unregister(name)) {
+               return -1;
+       }
+
        loaded = 0;
        return 0;
 }