[Asterisk-cvs] asterisk pbx.c,1.108,1.109

markster at lists.digium.com markster at lists.digium.com
Sun Apr 4 17:30:32 CDT 2004


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

Modified Files:
	pbx.c 
Log Message:
Save appl and data around exec (bug #1301)


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- pbx.c	2 Apr 2004 07:24:33 -0000	1.108
+++ pbx.c	4 Apr 2004 21:30:24 -0000	1.109
@@ -367,6 +367,10 @@
 	/* This function is special.  It saves the stack so that no matter
 	   how many times it is called, it returns to the same place */
 	int res;
+	
+	char *saved_c_appl;
+	char *saved_c_data;
+	
 	int stack = c->stack;
 	int (*execute)(struct ast_channel *chan, void *data) = app->execute; 
 	if (newstack && stack > AST_CHANNEL_MAX_STACK - 2) {
@@ -391,11 +395,18 @@
 	} else {
 		if (c->cdr)
 			ast_cdr_setapp(c->cdr, app->name, data);
+
+		// save channel values
+		saved_c_appl= c->appl;
+		saved_c_data= c->data;
+
 		c->appl = app->name;
 		c->data = data;		
 		res = execute(c, data);
-		c->appl = NULL;
-		c->data = NULL;		
+		// restore channel values
+		c->appl= saved_c_appl;
+		c->data= saved_c_data;
+
 		/* Any application that returns, we longjmp back, just in case. */
 		if (c->stack != stack + 1)
 			ast_log(LOG_WARNING, "Stack is not at expected value\n");




More information about the svn-commits mailing list