diff options
author | Terry Wilson <twilson@digium.com> | 2012-02-27 16:08:28 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2012-02-27 16:08:28 +0000 |
commit | a9f4d13b02a1877353e8198b34ef9f030aec221d (patch) | |
tree | 89207670fb497686f908f0f2dd88d09747b3ee19 | |
parent | 8d258e00f61aa7c29439027e1fdfc66289bb7f85 (diff) |
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
........
Merged revisions 356964 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/features.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/features.c b/main/features.c index b329c6acc..9f257f7a0 100644 --- a/main/features.c +++ b/main/features.c @@ -4403,8 +4403,16 @@ before_you_go: /* 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(ast_channel_cdr(chan)); /* 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) { |