[svn-commits] mmichelson: branch mmichelson/queue_bugbug r396945 - /team/mmichelson/queue_b...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 19 18:55:23 CDT 2013


Author: mmichelson
Date: Mon Aug 19 18:55:22 2013
New Revision: 396945

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396945
Log:
Forward messages from the queue topic to the manager topic.

This makes AgentComplete manager events show up correctly.


Modified:
    team/mmichelson/queue_bugbug/apps/app_queue.c

Modified: team/mmichelson/queue_bugbug/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/queue_bugbug/apps/app_queue.c?view=diff&rev=396945&r1=396944&r2=396945
==============================================================================
--- team/mmichelson/queue_bugbug/apps/app_queue.c (original)
+++ team/mmichelson/queue_bugbug/apps/app_queue.c Mon Aug 19 18:55:22 2013
@@ -10311,6 +10311,7 @@
 };
 
 static struct stasis_message_router *agent_router;
+static struct stasis_subscription *topic_forwarder;
 
 static int unload_module(void)
 {
@@ -10338,6 +10339,7 @@
 		stasis_message_router_remove(message_router, queue_agent_ringnoanswer_type());
 	}
 	stasis_message_router_unsubscribe_and_join(agent_router);
+	topic_forwarder = stasis_unsubscribe(topic_forwarder);
 
 	STASIS_MESSAGE_TYPE_CLEANUP(queue_caller_join_type);
 	STASIS_MESSAGE_TYPE_CLEANUP(queue_caller_leave_type);
@@ -10416,6 +10418,8 @@
 	struct ast_flags mask = {AST_FLAGS_ALL, };
 	struct ast_config *member_config;
 	struct stasis_message_router *manager_router;
+	struct stasis_topic *queue_topic;
+	struct stasis_topic *manager_topic;
 
 	queues = ao2_container_alloc(MAX_QUEUE_BUCKETS, queue_hash_cb, queue_cmp_cb);
 
@@ -10486,8 +10490,20 @@
 		res = -1;
 	}
 
+	manager_topic = ast_manager_get_topic();
+	if (!manager_topic) {
+		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;
+	}
+	topic_forwarder = stasis_forward_all(queue_topic, manager_topic);
+	if (!topic_forwarder) {
 		return AST_MODULE_LOAD_DECLINE;
 	}
 




More information about the svn-commits mailing list