[asterisk-commits] twilson: branch 10 r356964 - in /branches/10: ./ main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 27 10:05:31 CST 2012


Author: twilson
Date: Mon Feb 27 10:05:24 2012
New Revision: 356964

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=356964
Log:
Copy CDR variables when set during a bridge

This patch makes sure amaflags, accountcode, and userfield get copied
to the bridge CDR when set during a bridge (like via a custom feature).

(closes issue ASTERISK-16990)
Review: https://reviewboard.asterisk.org/r/1721/
........

Merged revisions 356963 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/features.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/features.c?view=diff&rev=356964&r1=356963&r2=356964
==============================================================================
--- branches/10/main/features.c (original)
+++ branches/10/main/features.c Mon Feb 27 10:05:24 2012
@@ -4390,8 +4390,16 @@
 	
 	/* 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 (bridge_cdr && new_chan_cdr && ast_test_flag(new_chan_cdr, AST_CDR_FLAG_POST_DISABLED))
-		ast_set_flag(bridge_cdr, AST_CDR_FLAG_POST_DISABLED);
+	/* If the channel CDR has been modified during the call, record the changes in the bridge cdr */
+	if (new_chan_cdr && bridge_cdr) {
+		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;
+		ast_copy_string(bridge_cdr->accountcode, new_chan_cdr->accountcode, sizeof(bridge_cdr->accountcode));
+		if (ast_test_flag(new_chan_cdr, AST_CDR_FLAG_POST_DISABLED)) {
+			ast_set_flag(bridge_cdr, AST_CDR_FLAG_POST_DISABLED);
+		}
+	}
 
 	/* we can post the bridge CDR at this point */
 	if (bridge_cdr) {




More information about the asterisk-commits mailing list