[asterisk-dev] [Code Review] [18801] - features reload does not clear old configuration and always include 700 on parkedcalls : patch

David Vossel reviewboard at asterisk.org
Wed Apr 6 13:56:15 CDT 2011


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


You could approach this by marking all parkinglots for destruction at the beginning on the reload, and as each one gets added back in the config un-mark it for destruction. At the end destroy all the parked calls that are still marked for destruction.  We perform something similar to this in  channels/chan_iax.c's reload_config function.  The callno_limits container has all the elements marked for destruction, the config is then read, after the config all the elements still marked for destruction are unlinked and destroyed using an ao2_callback.

If you want to learn more about general usage of ao2 containers, take a look at astobj2.h and the tests/test_astobj2.c for sample usage.


/trunk/main/features.c
<https://reviewboard.asterisk.org/r/1161/#comment6870>

    parkinglot_destroy never needs to be called explicitly.  The destruction is performed automatically when the parkinglot's ref count reaches 0.
    
    Unlinking the parkinglot will release the ref held by the ao2 container.  Once you call  ao2_unref(p, -1) after the unlink the ref count given to the iterator will be decremented.  This should destroy the object.
    
    
    
    
    



/trunk/main/features.c
<https://reviewboard.asterisk.org/r/1161/#comment6873>

    The context doesn't have to be "parkedcalls"


- David


On 2011-04-06 10:50:38, jrose wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1161/
> -----------------------------------------------------------
> 
> (Updated 2011-04-06 10:50:38)
> 
> 
> Review request for Asterisk Developers, David Vossel and rbyrant.
> 
> 
> Summary
> -------
> 
> This fix follows a completely different approach from the other one, so I created a new review request.
> This fix involves wiping all the parking lots in the parkinglots ao2_container while purging their extensions so that they have to be rebuilt when features reload is performed.
> 
> I have a bit more confidence in this one.  It's much more additive and much less destructive than the last one.
> 
> 
> This addresses bug 18801.
>     https://issues.asterisk.org/view.php?id=18801
> 
> 
> Diffs
> -----
> 
>   /trunk/main/features.c 312991 
> 
> Diff: https://reviewboard.asterisk.org/r/1161/diff
> 
> 
> Testing
> -------
> 
> Tested with multiple parking lots, changing multiple parking lots, with and without [general], with general and then without general and then with general again (which showed a need for an additional change), and mixes of all the above.
> 
> 
> Thanks,
> 
> jrose
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110406/78a89e47/attachment.htm>


More information about the asterisk-dev mailing list