When serializing CDR variables (like for "core show channels") don't output an error...
authorJoshua Colp <jcolp@digium.com>
Thu, 3 Oct 2013 19:32:46 +0000 (19:32 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 3 Oct 2013 19:32:46 +0000 (19:32 +0000)
........

Merged revisions 400442 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400443 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/cdr.c

index 64520f7..d4c2b96 100644 (file)
@@ -3002,7 +3002,13 @@ int ast_cdr_serialize_variables(const char *channel_name, struct ast_str **buf,
        }
 
        if (!cdr) {
-               ast_log(AST_LOG_ERROR, "Unable to find CDR for channel %s\n", channel_name);
+               RAII_VAR(struct module_config *, mod_cfg,
+                        ao2_global_obj_ref(module_configs), ao2_cleanup);
+
+               if (ast_test_flag(&mod_cfg->general->settings, CDR_ENABLED)) {
+                       ast_log(AST_LOG_ERROR, "Unable to find CDR for channel %s\n", channel_name);
+               }
+
                return 0;
        }