From: Joshua Colp Date: Thu, 3 Oct 2013 19:32:46 +0000 (+0000) Subject: When serializing CDR variables (like for "core show channels") don't output an error... X-Git-Tag: 13.0.0-beta1~998 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98269238055e97579225fc13a4f81e7f17085313;p=thirdparty%2Fasterisk.git When serializing CDR variables (like for "core show channels") don't output an error if CDRs aren't enabled. ........ 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 --- diff --git a/main/cdr.c b/main/cdr.c index 64520f7741..d4c2b96ab0 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -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; }