]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
protect ResponseTimeout and DigitTimeout apps from crashing when called in non-PBX...
authorRussell Bryant <russell@russellbryant.com>
Sun, 15 May 2005 23:26:29 +0000 (23:26 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sun, 15 May 2005 23:26:29 +0000 (23:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5685 65c4cc65-6c06-0410-ace0-fbb531ad65f3

pbx.c

diff --git a/pbx.c b/pbx.c
index 0f962966d89399ef666162c28f2770ccf8b62d68..ded9be66d6c8d227bced399a692a1043095a0157 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
@@ -4619,6 +4619,10 @@ static int pbx_builtin_atimeout(struct ast_channel *chan, void *data)
 
 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)
@@ -4628,6 +4632,10 @@ static int pbx_builtin_rtimeout(struct ast_channel *chan, void *data)
 
 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)