diff --git a/main/pbx.c b/main/pbx.c index 41027c35a1..685610583c 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -2439,7 +2439,7 @@ static int __ast_pbx_run(struct ast_channel *c) if (option_verbose > 1) ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name); if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { - c->_softhangup =0; + c->_softhangup = 0; } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT) { /* atimeout, nothing bad */ } else { @@ -2449,7 +2449,9 @@ static int __ast_pbx_run(struct ast_channel *c) break; } } - if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT && ast_exists_extension(c,c->context,"T",1,c->cid.cid_num)) { + if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { + c->_softhangup = 0; + } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT && ast_exists_extension(c,c->context,"T",1,c->cid.cid_num)) { set_ext_pri(c, "T", 0); /* 0 will become 1 with the c->priority++; at the end */ /* If the AbsoluteTimeout is not reset to 0, we'll get an infinite loop */ c->whentohangup = 0;