[Asterisk-cvs] asterisk pbx.c,1.230,1.231

kpfleming at lists.digium.com kpfleming at lists.digium.com
Tue Apr 26 21:58:36 CDT 2005


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

Modified Files:
	pbx.c 
Log Message:
protect ResponseTimeout and DigitTimeout apps from crashing when called in non-PBX channels (bug #4078)


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.230
retrieving revision 1.231
diff -u -d -r1.230 -r1.231
--- pbx.c	22 Apr 2005 13:11:34 -0000	1.230
+++ pbx.c	27 Apr 2005 02:48:25 -0000	1.231
@@ -5626,6 +5626,10 @@
 
 static int pbx_builtin_rtimeout(struct ast_channel *chan, void *data)
 {
+	/* If the channel is not in a PBX, return now */
+	if (!chan->pbx)
+		return 0;
+
 	/* Set the timeout for how long to wait between digits */
 	chan->pbx->rtimeout = atoi((char *)data);
 	if (option_verbose > 2)
@@ -5635,6 +5639,10 @@
 
 static int pbx_builtin_dtimeout(struct ast_channel *chan, void *data)
 {
+	/* If the channel is not in a PBX, return now */
+	if (!chan->pbx)
+		return 0;
+
 	/* Set the timeout for how long to wait between digits */
 	chan->pbx->dtimeout = atoi((char *)data);
 	if (option_verbose > 2)




More information about the svn-commits mailing list