[asterisk-commits] mmichelson: branch mmichelson/transfer r386428 - /team/mmichelson/transfer/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 24 13:13:41 CDT 2013


Author: mmichelson
Date: Wed Apr 24 13:13:37 2013
New Revision: 386428

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386428
Log:
With this set of changes, blind transfers now work!

I can now successfully blind transfer either party in a two-party bridge.

There are a few loose ends to tie up:
1) The blind transfer function needs to avoid locking the bridge multiple times
2) The blind transfer function will need to behave differently if transferring to a parking exten
3) I'm unsure if the manager action should be hanging up the channel or simply removing it from the bridge.

Oh, and this removes the BUGBUG comment in ast_async_goto() about checking for a bridge.


Modified:
    team/mmichelson/transfer/main/bridging.c
    team/mmichelson/transfer/main/manager.c
    team/mmichelson/transfer/main/pbx.c

Modified: team/mmichelson/transfer/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/main/bridging.c?view=diff&rev=386428&r1=386427&r2=386428
==============================================================================
--- team/mmichelson/transfer/main/bridging.c (original)
+++ team/mmichelson/transfer/main/bridging.c Wed Apr 24 13:13:37 2013
@@ -1953,7 +1953,7 @@
 		struct blind_transfer_data *blind_data)
 {
 	if (!strncmp(ast_channel_name(bridge_channel->chan), blind_data->transferee_name, sizeof(blind_data->transferee_name))) {
-		ast_explicit_goto(bridge_channel->chan, blind_data->context, blind_data->exten, 1);
+		ast_async_goto(bridge_channel->chan, blind_data->context, blind_data->exten, 1);
 		ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_HANGUP);
 	}
 }

Modified: team/mmichelson/transfer/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/main/manager.c?view=diff&rev=386428&r1=386427&r2=386428
==============================================================================
--- team/mmichelson/transfer/main/manager.c (original)
+++ team/mmichelson/transfer/main/manager.c Wed Apr 24 13:13:37 2013
@@ -3931,6 +3931,7 @@
 		break;
 	case AST_BRIDGE_TRANSFER_SUCCESS:
 		astman_send_ack(s, m, "Transfer succeeded");
+		ast_softhangup(chan, AST_SOFTHANGUP_EXPLICIT);
 		break;
 	}
 	

Modified: team/mmichelson/transfer/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/transfer/main/pbx.c?view=diff&rev=386428&r1=386427&r2=386428
==============================================================================
--- team/mmichelson/transfer/main/pbx.c (original)
+++ team/mmichelson/transfer/main/pbx.c Wed Apr 24 13:13:37 2013
@@ -9393,10 +9393,12 @@
 		struct ast_format writeformat;
 	} tmpvars = { 0, };
 
-/* BUGBUG need to add bridge check code to also do an ast_explicit_goto() as a blind transfer. */
 	ast_channel_lock(chan);
-	if (ast_channel_pbx(chan)) { /* This channel is currently in the PBX */
-		ast_explicit_goto(chan, context, exten, priority + 1);
+	if (ast_channel_internal_bridge(chan) || ast_channel_pbx(chan)) { /* This channel is currently in the PBX */
+		if (ast_test_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP)) {
+			priority += 1;
+		}
+		ast_explicit_goto(chan, context, exten, priority);
 		ast_softhangup_nolock(chan, AST_SOFTHANGUP_ASYNCGOTO);
 		ast_channel_unlock(chan);
 		return res;




More information about the asterisk-commits mailing list