diff options
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/main/pbx.c b/main/pbx.c index 956450bc1..3ac257bad 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4631,8 +4631,8 @@ static int collect_digits(struct ast_channel *c, int waittime, char *buf, int bu /* As long as we're willing to wait, and as long as it's not defined, keep reading digits until we can't possibly get a right answer anymore. */ digit = ast_waitfordigit(c, waittime); - if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { - c->_softhangup = 0; + if (c->_softhangup & AST_SOFTHANGUP_ASYNCGOTO) { + c->_softhangup &= ~AST_SOFTHANGUP_ASYNCGOTO; } else { if (!digit) /* No entry */ break; @@ -4703,22 +4703,22 @@ static enum ast_pbx_result __ast_pbx_run(struct ast_channel *c, while (!(res = ast_spawn_extension(c, c->context, c->exten, c->priority, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL), &found, 1))) { - if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT + if ((c->_softhangup & AST_SOFTHANGUP_TIMEOUT) && ast_exists_extension(c, c->context, "T", 1, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { 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 */ memset(&c->whentohangup, 0, sizeof(c->whentohangup)); c->_softhangup &= ~AST_SOFTHANGUP_TIMEOUT; - } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT + } else if ((c->_softhangup & AST_SOFTHANGUP_TIMEOUT) && ast_exists_extension(c, c->context, "e", 1, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { pbx_builtin_raise_exception(c, "ABSOLUTETIMEOUT"); /* If the AbsoluteTimeout is not reset to 0, we'll get an infinite loop */ memset(&c->whentohangup, 0, sizeof(c->whentohangup)); c->_softhangup &= ~AST_SOFTHANGUP_TIMEOUT; - } else if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { - c->_softhangup = 0; + } else if (c->_softhangup & AST_SOFTHANGUP_ASYNCGOTO) { + c->_softhangup &= ~AST_SOFTHANGUP_ASYNCGOTO; continue; } else if (ast_check_hangup(c)) { ast_debug(1, "Extension %s, priority %d returned normally even though call was hung up\n", @@ -4765,10 +4765,10 @@ static enum ast_pbx_result __ast_pbx_run(struct ast_channel *c, } } - if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) { - c->_softhangup = 0; + if (c->_softhangup & AST_SOFTHANGUP_ASYNCGOTO) { + c->_softhangup &= ~AST_SOFTHANGUP_ASYNCGOTO; continue; - } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT + } else if ((c->_softhangup & AST_SOFTHANGUP_TIMEOUT) && ast_exists_extension(c, c->context, "T", 1, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { set_ext_pri(c, "T", 1); @@ -4814,9 +4814,9 @@ static enum ast_pbx_result __ast_pbx_run(struct ast_channel *c, error = 1; /* we know what to do with it */ break; } - } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT) { + } else if (c->_softhangup & AST_SOFTHANGUP_TIMEOUT) { /* If we get this far with AST_SOFTHANGUP_TIMEOUT, then we know that the "T" extension is next. */ - c->_softhangup = 0; + c->_softhangup &= ~AST_SOFTHANGUP_TIMEOUT; } else { /* keypress received, get more digits for a full extension */ int waittime = 0; if (digit) @@ -9274,7 +9274,7 @@ static int pbx_builtin_waitexten(struct ast_channel *chan, const char *data) if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 1, S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { ast_verb(3, "Timeout on %s, continuing...\n", chan->name); - } else if (chan->_softhangup == AST_SOFTHANGUP_TIMEOUT) { + } else if (chan->_softhangup & AST_SOFTHANGUP_TIMEOUT) { ast_verb(3, "Call timeout on %s, checking for 'T'\n", chan->name); res = -1; } else if (ast_exists_extension(chan, chan->context, "t", 1, |