[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

Mark Michelson reviewboard at asterisk.org
Thu Feb 9 13:13:05 CST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1721/#review5470
-----------------------------------------------------------

Ship it!


What you've got here makes sense to me, and the code is not unsafe (from a crash/deadlock perspective). I give a "ship it!" on code soundness, but I also invite those who realize this may be a bad idea to comment on the implementation.


- Mark


On Feb. 7, 2012, 6:34 p.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1721/
> -----------------------------------------------------------
> 
> (Updated Feb. 7, 2012, 6:34 p.m.)
> 
> 
> 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/20120209/60a7f498/attachment.htm>


More information about the asterisk-dev mailing list