diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-04-27 02:48:25 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-04-27 02:48:25 +0000 |
commit | fefe2e8b4f443c5856a355d119b439c06c2dd1e1 (patch) | |
tree | 064333262e039890cbd97e9915f30af36d01eea5 /pbx.c | |
parent | cd932e2234a613c3eb5c7be7a6758c48b5d29400 (diff) |
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
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) |