aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-27 02:48:25 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-27 02:48:25 +0000
commit946dec8bcd169149558f9db04118f7b25b4d65c1 (patch)
tree064333262e039890cbd97e9915f30af36d01eea5 /pbx.c
parentbf8f7c97441f0107e4116e72dc577b35bec097ff (diff)
protect ResponseTimeout and DigitTimeout apps from crashing when called in non-PBX channels (bug #4078)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5510 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 9a358de3f..b721d4b0a 100755
--- a/pbx.c
+++ b/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)