[asterisk-dev] [Code Review] 2599: Stasis Cache Get Guarantee + Immediate ast_endpoint_channel_add
Joshua Colp
reviewboard at asterisk.org
Thu Jun 6 14:08:22 CDT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2599/
-----------------------------------------------------------
(Updated June 6, 2013, 7:08 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 (updated)
-----
/trunk/include/asterisk/channel.h 390667
/trunk/include/asterisk/stasis.h 390667
/trunk/include/asterisk/stasis_endpoints.h 390667
/trunk/main/channel_internal_api.c 390667
/trunk/main/endpoints.c 390667
/trunk/main/stasis_cache.c 390667
/trunk/main/stasis_endpoints.c 390667
/trunk/res/stasis_http/resource_endpoints.c 390667
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/418dba6b/attachment-0001.htm>
More information about the asterisk-dev
mailing list