[svn-commits] file: trunk r89072 - /trunk/main/pbx.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 6 17:08:37 CST 2007


Author: file
Date: Tue Nov  6 17:08:36 2007
New Revision: 89072

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89072
Log:
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

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=89072&r1=89071&r2=89072
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Tue Nov  6 17:08:36 2007
@@ -2541,36 +2541,36 @@
 				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);
+			} 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 {
+					if (c->cdr)
+						ast_cdr_update(c);
 					error = 1;
-				} else {
-					pbx_builtin_raise_exception(c, "ERROR");
-					continue;
+					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)




More information about the svn-commits mailing list