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

Friendly Automation asteriskteam at digium.com
Wed Sep 11 09:02:12 CDT 2019


Friendly Automation has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/12860 )

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(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c
index 0b5f89e..539a530 100644
--- a/apps/app_chanisavail.c
+++ b/apps/app_chanisavail.c
@@ -180,6 +180,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/+/12860
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1
Gerrit-Change-Number: 12860
Gerrit-PatchSet: 1
Gerrit-Owner: Frederic LE FOLL <frederic.lefoll at c-s.fr>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190911/affc9033/attachment-0001.html>


More information about the asterisk-code-review mailing list