[Asterisk-cvs] asterisk/res res_features.c,1.48,1.49

kpfleming at lists.digium.com kpfleming at lists.digium.com
Thu Apr 21 22:04:40 CDT 2005


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv12928/res

Modified Files:
	res_features.c 
Log Message:
add ability to send transferring party to a dialplan target after they blind transfer another party (bug #4056, with mods)


Index: res_features.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_features.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- res_features.c	21 Apr 2005 06:02:44 -0000	1.48
+++ res_features.c	22 Apr 2005 02:55:14 -0000	1.49
@@ -144,6 +144,40 @@
 	struct ast_channel *peer;
 };
 
+static void check_goto_on_transfer(struct ast_channel *chan) 
+{
+	struct ast_channel *xferchan;
+	char *goto_on_transfer;
+
+	goto_on_transfer = pbx_builtin_getvar_helper(chan, "GOTO_ON_BLINDXFR");
+
+	if (goto_on_transfer && !ast_strlen_zero(goto_on_transfer) && (xferchan = ast_channel_alloc(0))) {
+		char *x;
+		struct ast_frame *f;
+		
+		for (x = goto_on_transfer; x && *x; x++)
+			if (*x == '^')
+				*x = '|';
+
+		strcpy(xferchan->name, chan->name);
+		/* Make formats okay */
+		xferchan->readformat = chan->readformat;
+		xferchan->writeformat = chan->writeformat;
+		ast_channel_masquerade(xferchan, chan);
+		ast_parseable_goto(xferchan, goto_on_transfer);
+		xferchan->_state = AST_STATE_UP;
+		ast_clear_flag(xferchan, AST_FLAGS_ALL);	
+		xferchan->_softhangup = 0;
+		if ((f = ast_read(xferchan))) {
+			ast_frfree(f);
+			f = NULL;
+			ast_pbx_start(xferchan);
+		} else {
+			ast_hangup(xferchan);
+		}
+	}
+}
+
 static void *ast_bridge_call_thread(void *data) 
 {
 	struct ast_bridge_thread_obj *tobj = data;
@@ -550,6 +584,7 @@
 			strncpy(transferee->context, transferer_real_context, sizeof(transferee->context)-1);
 			transferee->priority = 0;
 		}
+		check_goto_on_transfer(transferer);
 		return res;
 	} else {
 		if (option_verbose > 2)	




More information about the svn-commits mailing list