Fix bridge/channel AMI event ordering issues
authorDavid M. Lee <dlee@digium.com>
Tue, 23 Jul 2013 13:39:50 +0000 (13:39 +0000)
committerDavid M. Lee <dlee@digium.com>
Tue, 23 Jul 2013 13:39:50 +0000 (13:39 +0000)
commitfec667646fb63fb0d55d26cf76ade739dc62bcfe
treeddc5248bd5b7ed97a1939961592c9394621d81ff
parent5f56004b1dbfb67dd9cbc58a110ddec8089b10af
Fix bridge/channel AMI event ordering issues

The stasis_cache_update messages are somewhat cumbersome to handle
with the stasis_message_router. Since all updates have the same
message type, they are normally handled with the same route.

Since caching itself is a first class component of stasis-core, it
makes sense for the router to handle the cache update messages itself.
This patch adds stasis_message_router_add_cache_update() and
stasis_message_router_remove_cache_update() to handle the routing of
stasis_cache_update messages.

This patch also corrects an issue with manager_{bridging,channels}.c,
where events might be reordered. The reordering occurs because the
components use different message routers, which they needed because
they both needed to route cache update messages. They now both use
manager's router, and add cache routes for just the cache updates they
are interested in.

(closes issue ASTERISK-22038)
Review: https://reviewboard.asterisk.org/r/2677/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/stasis_message_router.h
main/cdr.c
main/manager_bridging.c
main/manager_channels.c
main/stasis_message_router.c
tests/test_stasis.c