cdr: submit: fix logic of test for batch mode
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 2 Jan 2018 13:36:04 +0000 (15:36 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Tue, 2 Jan 2018 13:36:04 +0000 (15:36 +0200)
ASTERISK-27539 #close

Change-Id: I33cdf329d2bb4486dcae975c450f6aae94c515f7

main/cdr.c

index 0ec6ada..8acae60 100644 (file)
@@ -4211,7 +4211,7 @@ static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_
 
        if (!ast_test_flag(&mod_cfg->general->settings, CDR_ENABLED)) {
                ast_cli(a->fd, "Cannot submit CDR batch: CDR engine disabled.\n");
 
        if (!ast_test_flag(&mod_cfg->general->settings, CDR_ENABLED)) {
                ast_cli(a->fd, "Cannot submit CDR batch: CDR engine disabled.\n");
-       } else if (ast_test_flag(&mod_cfg->general->settings, CDR_BATCHMODE)) {
+       } else if (!ast_test_flag(&mod_cfg->general->settings, CDR_BATCHMODE)) {
                ast_cli(a->fd, "Cannot submit CDR batch: batch mode not enabled.\n");
        } else {
                submit_unscheduled_batch();
                ast_cli(a->fd, "Cannot submit CDR batch: batch mode not enabled.\n");
        } else {
                submit_unscheduled_batch();