[asterisk-commits] twilson: branch 1.8 r358978 - /branches/1.8/main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 13 15:31:28 CDT 2012


Author: twilson
Date: Tue Mar 13 15:31:23 2012
New Revision: 358978

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=358978
Log:
Fix setting CDR variables in the hangup extension

A previous CDR fix for setting CDR variables during a bridge via
custom dialplan features broke setting CDR variables in the
hangup extension. This patch fixes the issue.

Review: https://reviewboard.asterisk.org/r/1794/

Modified:
    branches/1.8/main/features.c

Modified: branches/1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/features.c?view=diff&rev=358978&r1=358977&r2=358978
==============================================================================
--- branches/1.8/main/features.c (original)
+++ branches/1.8/main/features.c Tue Mar 13 15:31:23 2012
@@ -4375,8 +4375,10 @@
 	
 	/* obey the NoCDR() wishes. -- move the DISABLED flag to the bridge CDR if it was set on the channel during the bridge... */
 	new_chan_cdr = pick_unlocked_cdr(chan->cdr); /* the proper chan cdr, if there are forked cdrs */
-	/* If the channel CDR has been modified during the call, record the changes in the bridge cdr */
-	if (new_chan_cdr && bridge_cdr) {
+	/* If the channel CDR has been modified during the call, record the changes in the bridge cdr,
+	 * BUT, if we've gone through the h extension block above, the CDR got swapped so don't overwrite
+	 * what was done in the h extension. What a mess. This is why you never touch CDR code. */
+	if (new_chan_cdr && bridge_cdr && !h_context) {
 		ast_cdr_copy_vars(bridge_cdr, new_chan_cdr);
 		ast_copy_string(bridge_cdr->userfield, new_chan_cdr->userfield, sizeof(bridge_cdr->userfield));
 		bridge_cdr->amaflags = new_chan_cdr->amaflags;




More information about the asterisk-commits mailing list