aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-06 23:08:36 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-06 23:08:36 +0000
commitf5b510445fca62d9ede61507a03499a5d6e9dd72 (patch)
tree2cfd508954c594b6434887b8e5dcfeccc5395cb4
parent4b2fc9d3e738dbb2e7dd297de2f35e571e350691 (diff)
Fix up some PBX logic that became broken. The code would exit prematurely when it should have been collecting more digits.
(closes issue #11175) Reported by: pj git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89072 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/pbx.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 3d4e812ec..d740e91cd 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2541,37 +2541,37 @@ static int __ast_pbx_run(struct ast_channel *c)
pos = 0;
dst_exten[pos++] = digit = res;
dst_exten[pos] = '\0';
- }
- if (res == AST_PBX_KEEPALIVE) {
+ } else if (res == AST_PBX_KEEPALIVE) {
ast_debug(1, "Spawn extension (%s,%s,%d) exited KEEPALIVE on '%s'\n", c->context, c->exten, c->priority, c->name);
ast_verb(2, "Spawn extension (%s, %s, %d) exited KEEPALIVE on '%s'\n", c->context, c->exten, c->priority, c->name);
error = 1;
- }
- ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
- ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
-
- if ((res == AST_PBX_ERROR) && ast_exists_extension(c, c->context, "e", 1, c->cid.cid_num)) {
- /* if we are already on the 'e' exten, don't jump to it again */
- if (!strcmp(c->exten, "e")) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited ERROR while already on 'e' exten on '%s'\n", c->context, c->exten, c->priority, c->name);
- error = 1;
+ } else {
+ ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
+ ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", c->context, c->exten, c->priority, c->name);
+
+ if ((res == AST_PBX_ERROR) && ast_exists_extension(c, c->context, "e", 1, c->cid.cid_num)) {
+ /* if we are already on the 'e' exten, don't jump to it again */
+ if (!strcmp(c->exten, "e")) {
+ if (option_verbose > 1)
+ ast_verbose(VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited ERROR while already on 'e' exten on '%s'\n", c->context, c->exten, c->priority, c->name);
+ error = 1;
+ } else {
+ pbx_builtin_raise_exception(c, "ERROR");
+ continue;
+ }
+ }
+
+ if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) {
+ c->_softhangup = 0;
+ } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT) {
+ /* atimeout, nothing bad */
} else {
- pbx_builtin_raise_exception(c, "ERROR");
- continue;
+ if (c->cdr)
+ ast_cdr_update(c);
+ error = 1;
+ break;
}
}
-
- if (c->_softhangup == AST_SOFTHANGUP_ASYNCGOTO) {
- c->_softhangup = 0;
- } else if (c->_softhangup == AST_SOFTHANGUP_TIMEOUT) {
- /* atimeout, nothing bad */
- } else {
- if (c->cdr)
- ast_cdr_update(c);
- error = 1;
- break;
- }
}
if (error)
break;