[asterisk-commits] mmichelson: branch mmichelson/transfer_stasis r391272 - /team/mmichelson/tran...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jun 10 11:16:19 CDT 2013


Author: mmichelson
Date: Mon Jun 10 11:16:18 2013
New Revision: 391272

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391272
Log:
Put in a temporary debug function for transfer stasis messages.

Oh, and btw, it appears that blind transfer stasis messages are working
A-OK.


Modified:
    team/mmichelson/transfer_stasis/main/stasis_bridging.c

Modified: team/mmichelson/transfer_stasis/main/stasis_bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/main/stasis_bridging.c?view=diff&rev=391272&r1=391271&r2=391272
==============================================================================
--- team/mmichelson/transfer_stasis/main/stasis_bridging.c (original)
+++ team/mmichelson/transfer_stasis/main/stasis_bridging.c Mon Jun 10 11:16:18 2013
@@ -399,6 +399,28 @@
 	return snapshot->uniqueid;
 }
 
+static void transfer_cb(void *userdata, struct stasis_subscription *sub,
+		struct stasis_topic *topic, struct stasis_message *msg)
+{
+	struct ast_blind_transfer_message *xfer_msg;
+
+	if (ast_blind_transfer_type() != stasis_message_type(msg)) {
+		/* Don't care about other types of messages for now */
+		return;
+	}
+
+	xfer_msg = stasis_message_data(msg);
+
+	ast_log(LOG_NOTICE, "Blind transfer to %s@%s by %s\n", xfer_msg->exten,
+			xfer_msg->context, xfer_msg->transferer->name);
+	if (xfer_msg->result == AST_TRANSFER_SUCCESS) {
+		ast_log(LOG_NOTICE, "Transfer from bridge %s was successful\n",
+				xfer_msg->original_bridge->uniqueid);
+	} else {
+		ast_log(LOG_NOTICE, "Transfer was unsuccessful\n");
+	}
+}
+
 int ast_stasis_bridging_init(void)
 {
 	ast_register_cleanup(stasis_bridging_cleanup);
@@ -411,6 +433,10 @@
 	bridge_topic_all = stasis_topic_create("ast_bridge_topic_all");
 	bridge_topic_all_cached = stasis_caching_topic_create(bridge_topic_all, bridge_snapshot_get_id);
 	bridge_topic_pool = stasis_topic_pool_create(bridge_topic_all);
+
+	/* XXX Temporary stasis subscriptions for debugging/testing */
+	stasis_subscribe(ast_bridge_topic_all(), transfer_cb, NULL);
+
 	return !bridge_topic_all
 		|| !bridge_topic_all_cached
 		|| !bridge_topic_pool ? -1 : 0;




More information about the asterisk-commits mailing list