All pastes #217226 Raw Edit

Something

public text v1 · immutable
#217226 ·published 2006-10-23 14:51 UTC
rendered paste body
Index: res/res_features.c
===================================================================
--- res/res_features.c	(revision 44820)
+++ res/res_features.c	(working copy)
@@ -803,19 +804,23 @@
 	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);
-	res = ast_bridge_call(transferer, newchan, &bconfig);
-	if (newchan->_softhangup || newchan->_state != AST_STATE_UP || !transferer->_softhangup) {
-		ast_hangup(newchan);
-		if (ast_stream_and_wait(transferer, xfersound, transferer->language, ""))
-			ast_log(LOG_WARNING, "Failed to play transfer sound!\n");
-		finishup(transferee);
-		transferer->_softhangup = 0;
-		return FEATURE_RETURN_SUCCESS;
-	}
-	
+
 	if (check_compat(transferee, newchan))
 		return -1;
 
+	if(ast_check_hangup(transferer)) {
+		res = ast_bridge_call(transferee, newchan, &bconfig);
+	} else {
+		res = ast_bridge_call(transferer, newchan, &bconfig);
+		if (newchan->_softhangup || newchan->_state != AST_STATE_UP || !transferer->_softhangup) {
+			ast_hangup(newchan);
+			if (ast_stream_and_wait(transferer, xfersound, transferer->language, ""))
+				ast_log(LOG_WARNING, "Failed to play transfer sound!\n");
+			finishup(transferee);
+			transferer->_softhangup = 0;
+			return FEATURE_RETURN_SUCCESS;
+		}
+	}
 	ast_indicate(transferee, AST_CONTROL_UNHOLD);
 	
 	if ((ast_autoservice_stop(transferee) < 0)
@@ -1152,7 +1157,7 @@
 			x = 0;
 			started = ast_tvnow();
 			to = timeout;
-			while (!ast_check_hangup(caller) && timeout && (chan->_state != AST_STATE_UP)) {
+			while (/*!ast_check_hangup(caller) && */timeout && (chan->_state != AST_STATE_UP)) {
 				struct ast_frame *f = NULL;
 
 				monitor_chans[0] = caller;