[asterisk-commits] tringenbach: trunk r277657 - /trunk/main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 16 18:23:19 CDT 2010


Author: tringenbach
Date: Fri Jul 16 18:23:15 2010
New Revision: 277657

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=277657
Log:
Merged revisions 277625 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277625 | tringenbach | 2010-07-16 17:43:39 -0500 (Fri, 16 Jul 2010) | 9 lines
  
  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:
    trunk/main/features.c

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=277657&r1=277656&r2=277657
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Fri Jul 16 18:23:15 2010
@@ -1839,6 +1839,8 @@
 
 	ast_party_connected_line_init(&connected_line);
 	if (!ast_check_hangup(transferer)) {
+		int hangup_dont = 0;
+
 		/* Transferer is up - old behaviour */
 		ast_indicate(transferer, -1);
 		if (!newchan) {
@@ -1871,7 +1873,18 @@
 		ast_channel_lock(transferer);
 		ast_party_connected_line_copy(&connected_line, &transferer->connected);
 		ast_channel_unlock(transferer);
+
+		/* 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 (ast_check_hangup(newchan) || !ast_check_hangup(transferer)) {
 			ast_hangup(newchan);
 			if (ast_stream_and_wait(transferer, xfersound, ""))




More information about the asterisk-commits mailing list