diff options
author | Mark Michelson <mmichelson@digium.com> | 2008-04-09 17:48:33 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2008-04-09 17:48:33 +0000 |
commit | 28bd5d88c15627cbc1856489b1ee2db171e49042 (patch) | |
tree | 7b73a93c13bae697d6280737fe71dd6b17c462e8 /main | |
parent | d314fd5336cdb43e05c8eb8dfad509d50c5d6d6f (diff) |
There was a subtle logical difference between 1.4 and trunk with regards to how timeouts
were handled. In 1.4, if the absolute timeout were reached on a call, no matter what
the return value of ast_spawn_extension was, the pbx would attempt to go to the 'T'
extension or hangup otherwise. The rearrangement of this function in trunk made this check
only happen in the case that ast_spawn_extension returned 0. If ast_spawn_extension returned
1, then the fact that the timeout expired resulted in a no-op, and would cause an infinite
loop to occur in __ast_pbx_run. This change fixes this problem. Now timeouts will
behave as they did in 1.4
(closes issue #11550)
Reported by: pj
Tested by: putnopvut
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/pbx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 4a7b60576..25a4dbde7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -3592,8 +3592,12 @@ static int __ast_pbx_run(struct ast_channel *c) if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { c->_softhangup = 0; continue; - } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT) { - /* atimeout, nothing bad */ + } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT && ast_exists_extension(c, c->context, "T", 1, c->cid.cid_num)) { + set_ext_pri(c, "T", 1); + /* If the AbsoluteTimeout is not reset to 0, we'll get an infinite loop */ + c->whentohangup = 0; + c->_softhangup &= ~AST_SOFTHANGUP_TIMEOUT; + continue; } else { if (c->cdr) ast_cdr_update(c); |