[Asterisk-cvs] asterisk channel.c,1.71,1.72

markster at lists.digium.com markster at lists.digium.com
Fri Jan 30 00:39:22 CST 2004


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

Modified Files:
	channel.c 
Log Message:
Merge variable lists


Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- channel.c	14 Jan 2004 06:04:46 -0000	1.71
+++ channel.c	30 Jan 2004 06:48:01 -0000	1.72
@@ -1929,7 +1929,7 @@
 	int x,i;
 	int res=0;
 	char *tmp;
-	void *tmpv;
+	struct ast_var_t *varptr;
 	struct ast_frame *cur, *prev;
 	struct ast_channel_pvt *p;
 	struct ast_channel *clone = original->masq;
@@ -2037,10 +2037,19 @@
 	for (x=0;x<AST_MAX_FDS;x++) {
 		original->fds[x] = clone->fds[x];
 	}
-	/* Move the variables */
-	tmpv = original->varshead.first;
+	/* Append variables from clone channel into original channel */
+	/* XXX Is this always correct?  We have to in order to keep MACROS working XXX */
+	varptr = original->varshead.first;
+	if (varptr) {
+		while(varptr->entries.next) {
+			varptr = varptr->entries.next;
+		}
+		varptr->entries.next = clone->varshead.first;
+	} else {
+		original->varshead.first = clone->varshead.first;
+	}
+	clone->varshead.first = NULL;
 	original->varshead.first = clone->varshead.first;
-	clone->varshead.first = tmpv;
 	/* Presense of ADSI capable CPE follows clone */
 	original->adsicpe = clone->adsicpe;
 	/* Bridge remains the same */




More information about the svn-commits mailing list