[asterisk-commits] dlee: branch group/performance r399911 - /team/group/performance/res/res_agi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 27 08:45:15 CDT 2013


Author: dlee
Date: Fri Sep 27 08:45:14 2013
New Revision: 399911

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399911
Log:
Now fix res_agi when there's no manager_router

Modified:
    team/group/performance/res/res_agi.c

Modified: team/group/performance/res/res_agi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/res/res_agi.c?view=diff&rev=399911&r1=399910&r2=399911
==============================================================================
--- team/group/performance/res/res_agi.c (original)
+++ team/group/performance/res/res_agi.c Fri Sep 27 08:45:14 2013
@@ -4290,9 +4290,6 @@
 	struct stasis_message_router *message_router;
 
 	message_router = ast_manager_get_message_router();
-	if (!message_router) {
-		return AST_MODULE_LOAD_DECLINE;
-	}
 
 	STASIS_MESSAGE_TYPE_INIT(agi_exec_start_type);
 	STASIS_MESSAGE_TYPE_INIT(agi_exec_end_type);
@@ -4300,30 +4297,32 @@
 	STASIS_MESSAGE_TYPE_INIT(agi_async_exec_type);
 	STASIS_MESSAGE_TYPE_INIT(agi_async_end_type);
 
-	stasis_message_router_add(message_router,
-				  agi_exec_start_type(),
-				  agi_channel_manager_event,
-				  "AGIExecStart");
-
-	stasis_message_router_add(message_router,
-				  agi_exec_end_type(),
-				  agi_channel_manager_event,
-				  "AGIExecEnd");
-
-	stasis_message_router_add(message_router,
-				  agi_async_start_type(),
-				  agi_channel_manager_event,
-				  "AsyncAGIStart");
-
-	stasis_message_router_add(message_router,
-				  agi_async_exec_type(),
-				  agi_channel_manager_event,
-				  "AsyncAGIExec");
-
-	stasis_message_router_add(message_router,
-				  agi_async_end_type(),
-				  agi_channel_manager_event,
-				  "AsyncAGIEnd");
+	if (message_router) {
+		stasis_message_router_add(message_router,
+			agi_exec_start_type(),
+			agi_channel_manager_event,
+			"AGIExecStart");
+
+		stasis_message_router_add(message_router,
+			agi_exec_end_type(),
+			agi_channel_manager_event,
+			"AGIExecEnd");
+
+		stasis_message_router_add(message_router,
+			agi_async_start_type(),
+			agi_channel_manager_event,
+			"AsyncAGIStart");
+
+		stasis_message_router_add(message_router,
+			agi_async_exec_type(),
+			agi_channel_manager_event,
+			"AsyncAGIExec");
+
+		stasis_message_router_add(message_router,
+			agi_async_end_type(),
+			agi_channel_manager_event,
+			"AsyncAGIEnd");
+	}
 
 	ast_cli_register_multiple(cli_agi, ARRAY_LEN(cli_agi));
 	/* we can safely ignore the result of ast_agi_register_multiple() here, since it cannot fail, as




More information about the asterisk-commits mailing list