From: Frederic LE FOLL Date: Thu, 5 Sep 2019 16:09:28 +0000 (+0200) Subject: ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf. X-Git-Tag: 13.29.0-rc1~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9462722b17c96ad8e2ed6dc04e5d95d36911a694;p=thirdparty%2Fasterisk.git ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf. ChanIsAvail() creates a temporary channel with ast_request() to test resource availability. It should not generate a CDR when it hangs up this temporary channel. This patch disables CDR generation for the temporary channel with ast_cdr_set_property(). ASTERISK-28527 Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1 --- diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index 0b5f89e03e..539a530e6c 100644 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -180,6 +180,9 @@ static int chanavail_exec(struct ast_channel *chan, const char *data) snprintf(tmp, sizeof(tmp), "%d", status); ast_str_append(&tmp_availcause, 0, "%s%s", ast_str_strlen(tmp_availcause) ? "&" : "", tmp); + /* Disable CDR for this temporary channel. */ + ast_cdr_set_property(ast_channel_name(tempchan), AST_CDR_FLAG_DISABLE_ALL); + ast_hangup(tempchan); tempchan = NULL;