[asterisk-dev] [Code Review]: Two new CEL-related fixes

Terry Wilson reviewboard at asterisk.org
Mon May 21 19:27:49 CDT 2012



> On May 21, 2012, 7:16 p.m., rmudgett wrote:
> > /trunk/main/channel.c, line 2189
> > <https://reviewboard.asterisk.org/r/1900/diff/3/?file=28211#file28211line2189>
> >
> >     This should be at the end of the destructor.

Ok.


> On May 21, 2012, 7:16 p.m., rmudgett wrote:
> > /trunk/main/channel.c, line 6362
> > <https://reviewboard.asterisk.org/r/1900/diff/3/?file=28211#file28211line6362>
> >
> >     This should be:
> >     if (ast_channel_linkedid(chan) && !strcmp(...)) {
> >     }

ok.


> On May 21, 2012, 7:16 p.m., rmudgett wrote:
> > /trunk/main/channel_internal_api.c, line 452
> > <https://reviewboard.asterisk.org/r/1900/diff/3/?file=28212#file28212line452>
> >
> >     This test is not needed.  String field sets are tolerant of NULL values.  They are treated as empty strings.

Stringfields are tolerant of NULLs, but linkedid specifically should *never* be set to an empty string.


> On May 21, 2012, 7:16 p.m., rmudgett wrote:
> > /trunk/include/asterisk/channel.h, lines 2107-2111
> > <https://reviewboard.asterisk.org/r/1900/diff/3/?file=28208#file28208line2107>
> >
> >     With these calls, we could complain about a potential channel reference leak if they are different on shutdown!

Yes! And someone should totally do that in another patch sometime. :-)


- Terry


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


On May 21, 2012, 5:57 p.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1900/
> -----------------------------------------------------------
> 
> (Updated May 21, 2012, 5:57 p.m.)
> 
> 
> Review request for Asterisk Developers, Mark Michelson and rmudgett.
> 
> 
> Summary
> -------
> 
> This patch fixes to situations that could cause the CEL LINKEDID_END event to be missed.
> 
> 1) During a core stop gracefully, modules are unloaded when ast_active_channels == 0. The LINKDEDID_END event fires during the channel destructor. This means that occasionally, the cel_* module will be unloaded before the channel is destroyed. It seemed generally useful to wait until the refcount of all channel == 0 before unloading, so I added a channel counter and used it in the shutdown code.
> 
> 2) During a masquerade, ast_channel_change_linkedid is called. It calls ast_cel_check_retire_linkedid which unrefs the linkedid in the linkedids container in cel.c. It didn't ref the new linkedid. Now it does. I also changed the logic a little, since it used to call ast_channel_linkedid_set() even when it hadn't changed (or was blank, which should be verboten).
> 
> (this patch is against trunk, but it will go in 1.8+)
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/cel.h 367201 
>   /trunk/include/asterisk/channel.h 367201 
>   /trunk/main/asterisk.c 367201 
>   /trunk/main/cel.c 367201 
>   /trunk/main/channel.c 367201 
>   /trunk/main/channel_internal_api.c 367201 
> 
> Diff: https://reviewboard.asterisk.org/r/1900/diff
> 
> 
> Testing
> -------
> 
> My CEL test passed 100 times or so and transferred calls no longer show an error.
> 
> 
> Thanks,
> 
> Terry
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120522/708cc8b0/attachment.htm>


More information about the asterisk-dev mailing list