[asterisk-commits] dlee: branch group/performance r399910 - /team/group/performance/apps/

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


Author: dlee
Date: Fri Sep 27 08:42:16 2013
New Revision: 399910

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399910
Log:
Fix app_queue for the now optional manager_router

Modified:
    team/group/performance/apps/app_queue.c

Modified: team/group/performance/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/apps/app_queue.c?view=diff&rev=399910&r1=399909&r2=399910
==============================================================================
--- team/group/performance/apps/app_queue.c (original)
+++ team/group/performance/apps/app_queue.c Fri Sep 27 08:42:16 2013
@@ -10337,24 +10337,24 @@
 	struct ao2_iterator q_iter;
 	struct call_queue *q = NULL;
 
-	struct stasis_message_router *message_router;
-
-	message_router = ast_manager_get_message_router();
-	if (message_router) {
-		stasis_message_router_remove(message_router, queue_caller_join_type());
-		stasis_message_router_remove(message_router, queue_caller_leave_type());
-		stasis_message_router_remove(message_router, queue_caller_abandon_type());
-		stasis_message_router_remove(message_router, queue_member_status_type());
-		stasis_message_router_remove(message_router, queue_member_added_type());
-		stasis_message_router_remove(message_router, queue_member_removed_type());
-		stasis_message_router_remove(message_router, queue_member_pause_type());
-		stasis_message_router_remove(message_router, queue_member_penalty_type());
-		stasis_message_router_remove(message_router, queue_member_ringinuse_type());
-		stasis_message_router_remove(message_router, queue_agent_called_type());
-		stasis_message_router_remove(message_router, queue_agent_connect_type());
-		stasis_message_router_remove(message_router, queue_agent_complete_type());
-		stasis_message_router_remove(message_router, queue_agent_dump_type());
-		stasis_message_router_remove(message_router, queue_agent_ringnoanswer_type());
+	struct stasis_message_router *manager_router;
+
+	manager_router = ast_manager_get_message_router();
+	if (manager_router) {
+		stasis_message_router_remove(manager_router, queue_caller_join_type());
+		stasis_message_router_remove(manager_router, queue_caller_leave_type());
+		stasis_message_router_remove(manager_router, queue_caller_abandon_type());
+		stasis_message_router_remove(manager_router, queue_member_status_type());
+		stasis_message_router_remove(manager_router, queue_member_added_type());
+		stasis_message_router_remove(manager_router, queue_member_removed_type());
+		stasis_message_router_remove(manager_router, queue_member_pause_type());
+		stasis_message_router_remove(manager_router, queue_member_penalty_type());
+		stasis_message_router_remove(manager_router, queue_member_ringinuse_type());
+		stasis_message_router_remove(manager_router, queue_agent_called_type());
+		stasis_message_router_remove(manager_router, queue_agent_connect_type());
+		stasis_message_router_remove(manager_router, queue_agent_complete_type());
+		stasis_message_router_remove(manager_router, queue_agent_dump_type());
+		stasis_message_router_remove(manager_router, queue_agent_ringnoanswer_type());
 	}
 	stasis_message_router_unsubscribe_and_join(agent_router);
 	topic_forwarder = stasis_forward_cancel(topic_forwarder);
@@ -10513,9 +10513,6 @@
 		return AST_MODULE_LOAD_DECLINE;
 	}
 	manager_router = ast_manager_get_message_router();
-	if (!manager_router) {
-		return AST_MODULE_LOAD_DECLINE;
-	}
 	queue_topic = ast_queue_topic_all();
 	if (!queue_topic) {
 		return AST_MODULE_LOAD_DECLINE;
@@ -10547,75 +10544,77 @@
 	STASIS_MESSAGE_TYPE_INIT(queue_agent_dump_type);
 	STASIS_MESSAGE_TYPE_INIT(queue_agent_ringnoanswer_type);
 
-	stasis_message_router_add(manager_router,
-				  queue_caller_join_type(),
-				  queue_channel_manager_event,
-				  "QueueCallerJoin");
-
-	stasis_message_router_add(manager_router,
-				  queue_caller_leave_type(),
-				  queue_channel_manager_event,
-				  "QueueCallerLeave");
-
-	stasis_message_router_add(manager_router,
-				  queue_caller_abandon_type(),
-				  queue_channel_manager_event,
-				  "QueueCallerAbandon");
-
-	stasis_message_router_add(manager_router,
-				  queue_member_status_type(),
-				  queue_member_manager_event,
-				  "QueueMemberStatus");
-
-	stasis_message_router_add(manager_router,
-				  queue_member_added_type(),
-				  queue_member_manager_event,
-				  "QueueMemberAdded");
-
-	stasis_message_router_add(manager_router,
-				  queue_member_removed_type(),
-				  queue_member_manager_event,
-				  "QueueMemberRemoved");
-
-	stasis_message_router_add(manager_router,
-				  queue_member_pause_type(),
-				  queue_member_manager_event,
-				  "QueueMemberPause");
-
-	stasis_message_router_add(manager_router,
-				  queue_member_penalty_type(),
-				  queue_member_manager_event,
-				  "QueueMemberPenalty");
-
-	stasis_message_router_add(manager_router,
-				  queue_member_ringinuse_type(),
-				  queue_member_manager_event,
-				  "QueueMemberRinginuse");
-
-	stasis_message_router_add(manager_router,
-				  queue_agent_called_type(),
-				  queue_multi_channel_manager_event,
-				  "AgentCalled");
-
-	stasis_message_router_add(manager_router,
-				  queue_agent_connect_type(),
-				  queue_multi_channel_manager_event,
-				  "AgentConnect");
-
-	stasis_message_router_add(manager_router,
-				  queue_agent_complete_type(),
-				  queue_multi_channel_manager_event,
-				  "AgentComplete");
-
-	stasis_message_router_add(manager_router,
-				  queue_agent_dump_type(),
-				  queue_multi_channel_manager_event,
-				  "AgentDump");
-
-	stasis_message_router_add(manager_router,
-				  queue_agent_ringnoanswer_type(),
-				  queue_multi_channel_manager_event,
-				  "AgentRingNoAnswer");
+	if (manager_router) {
+		stasis_message_router_add(manager_router,
+			queue_caller_join_type(),
+			queue_channel_manager_event,
+			"QueueCallerJoin");
+
+		stasis_message_router_add(manager_router,
+			queue_caller_leave_type(),
+			queue_channel_manager_event,
+			"QueueCallerLeave");
+
+		stasis_message_router_add(manager_router,
+			queue_caller_abandon_type(),
+			queue_channel_manager_event,
+			"QueueCallerAbandon");
+
+		stasis_message_router_add(manager_router,
+			queue_member_status_type(),
+			queue_member_manager_event,
+			"QueueMemberStatus");
+
+		stasis_message_router_add(manager_router,
+			queue_member_added_type(),
+			queue_member_manager_event,
+			"QueueMemberAdded");
+
+		stasis_message_router_add(manager_router,
+			queue_member_removed_type(),
+			queue_member_manager_event,
+			"QueueMemberRemoved");
+
+		stasis_message_router_add(manager_router,
+			queue_member_pause_type(),
+			queue_member_manager_event,
+			"QueueMemberPause");
+
+		stasis_message_router_add(manager_router,
+			queue_member_penalty_type(),
+			queue_member_manager_event,
+			"QueueMemberPenalty");
+
+		stasis_message_router_add(manager_router,
+			queue_member_ringinuse_type(),
+			queue_member_manager_event,
+			"QueueMemberRinginuse");
+
+		stasis_message_router_add(manager_router,
+			queue_agent_called_type(),
+			queue_multi_channel_manager_event,
+			"AgentCalled");
+
+		stasis_message_router_add(manager_router,
+			queue_agent_connect_type(),
+			queue_multi_channel_manager_event,
+			"AgentConnect");
+
+		stasis_message_router_add(manager_router,
+			queue_agent_complete_type(),
+			queue_multi_channel_manager_event,
+			"AgentComplete");
+
+		stasis_message_router_add(manager_router,
+			queue_agent_dump_type(),
+			queue_multi_channel_manager_event,
+			"AgentDump");
+
+		stasis_message_router_add(manager_router,
+			queue_agent_ringnoanswer_type(),
+			queue_multi_channel_manager_event,
+			"AgentRingNoAnswer");
+	}
 
 	stasis_message_router_add(agent_router,
 			ast_channel_agent_login_type(),




More information about the asterisk-commits mailing list