[Asterisk-code-review] ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf. (...asterisk[16])

Frederic LE FOLL asteriskteam at digium.com
Thu Sep 5 11:10:16 CDT 2019


Frederic LE FOLL has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/12848


Change subject: ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf.
......................................................................

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
---
M apps/app_chanisavail.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/48/12848/1

diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index 70325b3..446bce1 100644
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -178,6 +178,9 @@
 					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;
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12848
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1
Gerrit-Change-Number: 12848
Gerrit-PatchSet: 1
Gerrit-Owner: Frederic LE FOLL <frederic.lefoll at c-s.fr>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190905/273e1c3a/attachment.html>


More information about the asterisk-code-review mailing list