mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 23:38:23 +00:00
protect ResponseTimeout and DigitTimeout apps from crashing when called in non-PBX channels (bug #4078)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
8
pbx.c
8
pbx.c
@@ -5626,6 +5626,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)
|
||||
@@ -5635,6 +5639,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)
|
||||
|
||||
Reference in New Issue
Block a user