[asterisk-dev] [Code Review] 2599: Stasis Cache Get Guarantee + Immediate ast_endpoint_channel_add

opticron reviewboard at asterisk.org
Thu Jun 6 13:24:42 CDT 2013


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



/trunk/main/stasis_cache.c
<https://reviewboard.asterisk.org/r/2599/#comment17373>

    If this isn't going to be exposed to the world, it shouldn't have the stasis_ prefix.



/trunk/main/stasis_cache.c
<https://reviewboard.asterisk.org/r/2599/#comment17374>

    The caching guarantee should never be created without being used, so I'd add:
    ast_assert(guarantee->done == 1);


- opticron


On June 5, 2013, 4:59 p.m., Joshua Colp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2599/
> -----------------------------------------------------------
> 
> (Updated June 5, 2013, 4:59 p.m.)
> 
> 
> Review request for Asterisk Developers and David Lee.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> While implementing devicestate support for chan_pjsip I ran into a few problems which these changes solve:
> 
> 1. stasis_cache_get makes no guarantee that any queued messages have been processed before returning
> 
> This is a problem when you want to query a cache for something that may have been queued immediately prior. As it is the cache may or may not reflect it. The change attached adds the ability to require that any pending queued messages are processed by queueing its own message with a pthread condition, which is signaled when processed.
> 
> 2. ast_endpoint_add_channel does not immediately reflect added channels
> 
> As it is when ast_endpoint_add_channel returns the channel is not actually added to the endpoint, it is only done when the channel snapshot is received. The change attached adds the channel uniqueid immediately, which means that the code no longer has to check on every snapshot whether the channel is on the endpoint yet or not. It also means that anything querying the snapshot cache has a better chance of getting the actual current snapshot, when combined with the above stasis_cache_get guarantee.
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/channel.h 390610 
>   /trunk/include/asterisk/stasis.h 390610 
>   /trunk/include/asterisk/stasis_endpoints.h 390610 
>   /trunk/main/channel_internal_api.c 390610 
>   /trunk/main/endpoints.c 390610 
>   /trunk/main/stasis_cache.c 390610 
>   /trunk/main/stasis_endpoints.c 390610 
>   /trunk/res/stasis_http/resource_endpoints.c 390610 
> 
> Diff: https://reviewboard.asterisk.org/r/2599/diff/
> 
> 
> Testing
> -------
> 
> I've been using this with the new chan_pjsip devicestate support and have confirmed that it functions as expected/needed.
> 
> 
> Thanks,
> 
> Joshua Colp
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130606/861c6bfd/attachment-0001.htm>


More information about the asterisk-dev mailing list