[asterisk-dev] [Code Review] If a CDR variable is set during a bridged call, make sure the values get copied over to the bridge CDR
Terry Wilson
reviewboard at asterisk.org
Tue Feb 7 18:34:40 CST 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1721/
-----------------------------------------------------------
Review request for Asterisk Developers.
Summary
-------
This completely violates my normal rule of "Don't touch CDR code, ever. No, really, I mean it. Never." So, with that said, I will be more than happy if someone tells me that this is a horrible idea and we shouldn't implement it.
Now, with *that* said, this is something that really should work. The problem is that before entering the bridge loop, we duplicate the channel cdr as the bridge cdr. When the CDR() application modifies the CDR during the bridge, it writes to the old channel cdr. This patch just copies the writable "read only" CDR variables (don't get me started) amaflags, accountcode, and userfield and other CDR variables from the channel cdr to the bridge cdr before posting the bridge cdr.
I await someone who is smarter than I am to tell me why this is a bad idea, because I know that modifying CDR code is always a bad idea.
This addresses bug ASTERISK-16990.
https://issues.asterisk.org/jira/browse/ASTERISK-16990
Diffs
-----
/branches/1.8/main/features.c 354347
Diff: https://reviewboard.asterisk.org/r/1721/diff
Testing
-------
I made a dynamic feature that calls Set(CDR(userfield)=stuff) and verified that "stuff" is actually written to the CDR userfield when it is used.
Thanks,
Terry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120208/fa43bd3f/attachment.htm>
More information about the asterisk-dev
mailing list