[asterisk-commits] kmoore: branch kmoore/stasis-bridge_events r385830 - in /team/kmoore/stasis-b...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 16 08:00:07 CDT 2013


Author: kmoore
Date: Tue Apr 16 08:00:04 2013
New Revision: 385830

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385830
Log:
Multiple revisions 385815,385828

........
  r385815 | kmoore | 2013-04-15 14:50:31 -0500 (Mon, 15 Apr 2013) | 1 line
  
  Make sure the module fails to load if init fails
........
  r385828 | kmoore | 2013-04-16 07:56:01 -0500 (Tue, 16 Apr 2013) | 1 line
  
  variable naming tweak
........

Merged revisions 385815,385828 from http://svn.asterisk.org/svn/asterisk/team/kmoore/stasis-bridging-channel_events

Modified:
    team/kmoore/stasis-bridge_events/   (props changed)
    team/kmoore/stasis-bridge_events/res/res_stasis.c

Propchange: team/kmoore/stasis-bridge_events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr 16 08:00:04 2013
@@ -1,1 +1,1 @@
-/team/kmoore/stasis-bridging-channel_events:1-385813
+/team/kmoore/stasis-bridging-channel_events:1-385829

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=385830&r1=385829&r2=385830
==============================================================================
--- team/kmoore/stasis-bridge_events/res/res_stasis.c (original)
+++ team/kmoore/stasis-bridge_events/res/res_stasis.c Tue Apr 16 08:00:04 2013
@@ -82,7 +82,7 @@
 struct ao2_container *blob_handlers;
 
 /*! \brief Message router for the channel caching topic */
-struct stasis_message_router *app_channel_router;
+struct stasis_message_router *channel_router;
 
 struct stasis_message_router *bridge_router;
 
@@ -1278,19 +1278,25 @@
 	}
 
 	blob_handlers = ao2_container_alloc(BLOB_HANDLER_BUCKETS, blob_handler_hash, blob_handler_cmp);
+	if (!blob_handlers) {
+		return AST_MODULE_LOAD_FAILURE;
+	}
 
 	register_blob_handler("userevent", handle_blob_generic);
 	register_blob_handler("hangup_request", handle_blob_generic);
 	register_blob_handler("varset", handle_blob_generic);
 	register_blob_handler("dtmf_end", handle_blob_dtmf);
 
-	app_channel_router = stasis_message_router_create(stasis_caching_get_topic(ast_channel_topic_all_cached()));
-	if (!app_channel_router) {
+	channel_router = stasis_message_router_create(stasis_caching_get_topic(ast_channel_topic_all_cached()));
+	if (!channel_router) {
 		return AST_MODULE_LOAD_FAILURE;
 	}
 
 	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);
+	if (ret) {
+		return AST_MODULE_LOAD_FAILURE;
+	}
 
 	app_bridges = ao2_container_alloc(APP_BRIDGES_BUCKETS, bridge_info_hash, bridge_info_cmp);
 	if (!app_bridges) {
@@ -1318,8 +1324,8 @@
 {
 	int r = 0;
 
-	stasis_message_router_unsubscribe(app_channel_router);
-	app_channel_router = NULL;
+	stasis_message_router_unsubscribe(channel_router);
+	channel_router = NULL;
 
 	ao2_cleanup(blob_handlers);
 	blob_handlers = NULL;




More information about the asterisk-commits mailing list