[Asterisk-cvs] asterisk channel.c,1.129,1.130

markster at lists.digium.com markster at lists.digium.com
Fri Jul 9 07:11:57 CDT 2004


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

Modified Files:
	channel.c 
Log Message:
Swap states early in masquerade process (bug #1987)


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- channel.c	9 Jul 2004 10:08:09 -0000	1.129
+++ channel.c	9 Jul 2004 10:57:43 -0000	1.130
@@ -2152,6 +2152,7 @@
 {
 	int x,i;
 	int res=0;
+	int origstate;
 	char *tmp;
 	struct ast_var_t *varptr;
 	struct ast_frame *cur, *prev;
@@ -2234,6 +2235,14 @@
 	clone->_softhangup = AST_SOFTHANGUP_DEV;
 
 
+	/* And of course, so does our current state.  Note we need not
+	   call ast_setstate since the event manager doesn't really consider
+	   these separate.  We do this early so that the clone has the proper
+	   state of the original channel. */
+	origstate = original->_state;
+	original->_state = clone->_state;
+	clone->_state = origstate;
+
 	if (clone->pvt->fixup){
 		res = clone->pvt->fixup(original, clone);
 		if (res) 
@@ -2302,11 +2311,6 @@
 	
 	/* Our native formats are different now */
 	original->nativeformats = clone->nativeformats;
-
-	/* And of course, so does our current state.  Note we need not
-	   call ast_setstate since the event manager doesn't really consider
-	   these separate */
-	original->_state = clone->_state;
 	
 	/* Context, extension, priority, app data, jump table,  remain the same */
 	/* pvt switches.  pbx stays the same, as does next */




More information about the svn-commits mailing list