[asterisk-commits] kmoore: branch kmoore/stasis-bridge_events r385829 - /team/kmoore/stasis-brid...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 16 07:58:02 CDT 2013
Author: kmoore
Date: Tue Apr 16 07:57:58 2013
New Revision: 385829
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385829
Log:
Tweaks and cleanup
Modified:
team/kmoore/stasis-bridge_events/res/res_stasis.c
Modified: team/kmoore/stasis-bridge_events/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridge_events/res/res_stasis.c?view=diff&rev=385829&r1=385828&r2=385829
==============================================================================
--- team/kmoore/stasis-bridge_events/res/res_stasis.c (original)
+++ team/kmoore/stasis-bridge_events/res/res_stasis.c Tue Apr 16 07:57:58 2013
@@ -84,7 +84,7 @@
/*! \brief Message router for the channel caching topic */
struct stasis_message_router *app_channel_router;
-struct stasis_message_router *app_bridge_router;
+struct stasis_message_router *bridge_router;
struct ao2_container *app_bridges;
@@ -995,7 +995,7 @@
bridge_channel_diff,
};
-static void sub_bridge_handler(void *data,
+static void bridge_state_cb(void *data,
struct stasis_subscription *sub,
struct stasis_topic *topic,
struct stasis_message *message)
@@ -1263,7 +1263,7 @@
static int load_module(void)
{
- int r = 0;
+ int ret = 0;
__apps_registry =
ao2_container_alloc(APPS_NUM_BUCKETS, app_hash, app_compare);
@@ -1289,21 +1289,25 @@
return AST_MODULE_LOAD_FAILURE;
}
- r |= stasis_message_router_add(app_channel_router, stasis_cache_update_type(), sub_snapshot_handler, NULL);
- r |= stasis_message_router_add(app_channel_router, ast_channel_blob_type(), sub_blob_handler, NULL);
+ ret |= stasis_message_router_add(app_channel_router, stasis_cache_update_type(), sub_snapshot_handler, NULL);
+ ret |= stasis_message_router_add(app_channel_router, ast_channel_blob_type(), sub_blob_handler, NULL);
app_bridges = ao2_container_alloc(APP_BRIDGES_BUCKETS, bridge_info_hash, bridge_info_cmp);
if (!app_bridges) {
return AST_MODULE_LOAD_FAILURE;
}
- app_bridge_router = stasis_message_router_create(stasis_caching_get_topic(ast_bridge_topic_all_cached()));
- if (!app_bridge_router) {
+ bridge_router = stasis_message_router_create(stasis_caching_get_topic(ast_bridge_topic_all_cached()));
+ if (!bridge_router) {
return AST_MODULE_LOAD_FAILURE;
}
- r |= stasis_message_router_add(app_bridge_router, stasis_cache_update_type(), sub_bridge_handler, NULL);
- if (r) {
+ ret |= stasis_message_router_add(
+ bridge_router,
+ stasis_cache_update_type(),
+ bridge_state_cb,
+ NULL);
+ if (ret) {
return AST_MODULE_LOAD_FAILURE;
}
@@ -1320,8 +1324,8 @@
ao2_cleanup(blob_handlers);
blob_handlers = NULL;
- stasis_message_router_unsubscribe(app_bridge_router);
- app_bridge_router = NULL;
+ stasis_message_router_unsubscribe(bridge_router);
+ bridge_router = NULL;
ao2_cleanup(__apps_registry);
__apps_registry = NULL;
More information about the asterisk-commits
mailing list