[asterisk-commits] mmichelson: branch mmichelson/transfer_stasis r391454 - in /team/mmichelson/t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 11 17:24:41 CDT 2013


Author: mmichelson
Date: Tue Jun 11 17:24:39 2013
New Revision: 391454

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391454
Log:
Switch transfer link message to use a channel snapshot for the local channels.


Modified:
    team/mmichelson/transfer_stasis/include/asterisk/stasis_bridging.h
    team/mmichelson/transfer_stasis/main/stasis_bridging.c

Modified: team/mmichelson/transfer_stasis/include/asterisk/stasis_bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer_stasis/include/asterisk/stasis_bridging.h?view=diff&rev=391454&r1=391453&r2=391454
==============================================================================
--- team/mmichelson/transfer_stasis/include/asterisk/stasis_bridging.h (original)
+++ team/mmichelson/transfer_stasis/include/asterisk/stasis_bridging.h Tue Jun 11 17:24:39 2013
@@ -293,8 +293,8 @@
 		char app[AST_MAX_APP];
 		/*! Pair of local channels and the bridge to which they belong. Applicable for AST_ATTENDED_TRANSFER_DEST_LINK */
 		struct {
-			/*! Local channel unique ID */
-			const char *channel;
+			/*! Local channel snapshot */
+			struct ast_channel_snapshot *local_channel;
 			/*! Bridge unique ID to which the local channel belongs */
 			char bridge[AST_UUID_STR_LEN];
 		} links[2];

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=391454&r1=391453&r2=391454
==============================================================================
--- team/mmichelson/transfer_stasis/main/stasis_bridging.c (original)
+++ team/mmichelson/transfer_stasis/main/stasis_bridging.c Tue Jun 11 17:24:39 2013
@@ -414,7 +414,7 @@
 	}
 
 	for (i = 0; i < ARRAY_LEN(msg->dest.links); ++i) {
-		ast_free((char *) msg->dest.links[i].channel);
+		ao2_cleanup(msg->dest.links[i].local_channel);
 	}
 }
 
@@ -523,8 +523,8 @@
 
 	transfer_msg->dest_type = AST_ATTENDED_TRANSFER_DEST_LINK;
 	for (i = 0; i < 2; ++i) {
-		transfer_msg->dest.links[i].channel = ast_strdup(ast_channel_uniqueid(locals[i]->channel));
-		if (!transfer_msg->dest.links[i].channel) {
+		transfer_msg->dest.links[i].local_channel = ast_channel_snapshot_create(locals[i]->channel);
+		if (!transfer_msg->dest.links[i].local_channel) {
 			return;
 		}
 		ast_copy_string(transfer_msg->dest.links[i].bridge, locals[i]->bridge->uniqueid,
@@ -643,9 +643,9 @@
 		ast_log(LOG_NOTICE, "Transfer to application %s\n", xfer_msg->dest.app);
 		break;
 	case AST_ATTENDED_TRANSFER_DEST_LINK:
-		ast_log(LOG_NOTICE, "Transfer linking two bridges.\n\t\tFirst bridge and chan: %s and %s.\n\t\tSecond bridge and chan: %s and %s\n",
-				xfer_msg->dest.links[0].channel, xfer_msg->dest.links[0].bridge,
-				xfer_msg->dest.links[1].channel, xfer_msg->dest.links[1].bridge);
+		ast_log(LOG_NOTICE, "Transfer linking two bridges.\n\t\tFirst chan and bridge: %s and %s.\n\t\tSecond chan and bridge: %s and %s\n",
+				xfer_msg->dest.links[0].local_channel->name, xfer_msg->dest.links[0].bridge,
+				xfer_msg->dest.links[1].local_channel->name, xfer_msg->dest.links[1].bridge);
 		break;
 	}
 }




More information about the asterisk-commits mailing list