[asterisk-commits] tringenbach: branch 1.4 r277625 - /branches/1.4/res/res_features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 16 17:43:43 CDT 2010


Author: tringenbach
Date: Fri Jul 16 17:43:39 2010
New Revision: 277625

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=277625
Log:
Save and restore AST_FLAG_BRIDGE_HANGUP_DONT on attended transfer.

ast_bridge_call() clears AST_FLAG_BRIDGE_HANGUP_DONT. But during an attended
transfer, ast_bridge_call() is called for a second bridge on the same channel,
and it clears that flag, which still needs to get set for when the original
ast_bridge_call() gets control back and checks it.

Review: https://reviewboard.asterisk.org/r/741

Modified:
    branches/1.4/res/res_features.c

Modified: branches/1.4/res/res_features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/res/res_features.c?view=diff&rev=277625&r1=277624&r2=277625
==============================================================================
--- branches/1.4/res/res_features.c (original)
+++ branches/1.4/res/res_features.c Fri Jul 16 17:43:39 2010
@@ -970,6 +970,8 @@
 	}
 
 	if (!ast_check_hangup(transferer)) {
+		int hangup_dont = 0;
+
 		if (check_compat(transferer, newchan)) {
 			/* we do mean transferee here, NOT transferer */
 			finishup(transferee);
@@ -978,7 +980,18 @@
 		memset(&bconfig,0,sizeof(struct ast_bridge_config));
 		ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT);
 		ast_set_flag(&(bconfig.features_callee), AST_FEATURE_DISCONNECT);
+
+		/* ast_bridge_call clears AST_FLAG_BRIDGE_HANGUP_DONT, but we don't
+		   want that to happen here because we're also in another bridge already
+		 */
+		if (ast_test_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT)) {
+			hangup_dont = 1;
+		}
 		res = ast_bridge_call(transferer, newchan, &bconfig);
+		if (hangup_dont) {
+			ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_DONT);
+		}
+
 		if (newchan->_softhangup || !transferer->_softhangup) {
 			ast_hangup(newchan);
 			if (ast_stream_and_wait(transferer, xfersound, transferer->language, ""))




More information about the asterisk-commits mailing list