Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 326143) +++ apps/app_dial.c (working copy) @@ -2423,9 +2423,6 @@ /* SIP, in particular, sends back this error code to indicate an * overlap dialled number needs more digits. */ - if (chan->hangupcause == AST_CAUSE_INVALID_NUMBER_FORMAT) { - res = AST_PBX_INCOMPLETE; - } /* almost done, although the 'else' block is 400 lines */ } else { @@ -2883,7 +2880,7 @@ senddialendevent(chan, pa.status); ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status); - if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_INCOMPLETE)) { + if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan)) { if (!ast_tvzero(calldurationlimit)) memset(&chan->whentohangup, 0, sizeof(chan->whentohangup)); res = 0; @@ -2999,9 +2996,9 @@ } } - if (res < 0 || res == AST_PBX_INCOMPLETE) { + if (res < 0) break; - } else if (res > 0) { /* Trying to send the call elsewhere (1 digit ext) */ + else if (res > 0) { /* Trying to send the call elsewhere (1 digit ext) */ if (onedigit_goto(chan, context, (char) res, 1)) { res = 0; break; Index: include/asterisk/pbx.h =================================================================== --- include/asterisk/pbx.h (revision 326143) +++ include/asterisk/pbx.h (working copy) @@ -47,7 +47,6 @@ #define AST_PBX_HANGUP -1 /*!< Jump to the 'h' exten */ #define AST_PBX_OK 0 /*!< No errors */ #define AST_PBX_ERROR 1 /*!< Jump to the 'e' exten */ -#define AST_PBX_INCOMPLETE 12 /*!< Return to PBX matching, allowing more digits for the extension */ /*! @} */ #define PRIORITY_HINT -1 /*!< Special Priority for a hint */ Index: main/pbx.c =================================================================== --- main/pbx.c (revision 326143) +++ main/pbx.c (working copy) @@ -377,23 +377,6 @@ Congestion - - - Returns AST_PBX_INCOMPLETE value. - - - - If specified, then Incomplete will not attempt to answer the channel first. - Most channel types need to be in Answer state in order to receive DTMF. - - - - Signals the PBX routines that the previous matched extension is incomplete - and that further input should be allowed before matching can be considered - to be complete. Can be used within a pattern match when certain criteria warrants - a longer match. - - Do Nothing (No Operation). @@ -978,7 +961,6 @@ static int pbx_builtin_background(struct ast_channel *, const char *); static int pbx_builtin_wait(struct ast_channel *, const char *); static int pbx_builtin_waitexten(struct ast_channel *, const char *); -static int pbx_builtin_incomplete(struct ast_channel *, const char *); static int pbx_builtin_resetcdr(struct ast_channel *, const char *); static int pbx_builtin_setamaflags(struct ast_channel *, const char *); static int pbx_builtin_ringing(struct ast_channel *, const char *); @@ -1150,7 +1132,6 @@ { "GotoIfTime", pbx_builtin_gotoiftime }, { "ImportVar", pbx_builtin_importvar }, { "Hangup", pbx_builtin_hangup }, - { "Incomplete", pbx_builtin_incomplete }, { "NoOp", pbx_builtin_noop }, { "Proceeding", pbx_builtin_proceeding }, { "Progress", pbx_builtin_progress }, @@ -4716,8 +4697,6 @@ char dst_exten[256]; /* buffer to accumulate digits */ int pos = 0; /* XXX should check bounds */ int digit = 0; - int invalid = 0; - int timeout = 0; /* loop on priorities in this context/exten */ while (!(res = ast_spawn_extension(c, c->context, c->exten, c->priority, @@ -4766,19 +4745,6 @@ pos = 0; dst_exten[pos++] = digit = res; dst_exten[pos] = '\0'; - } else if (res == AST_PBX_INCOMPLETE) { - ast_debug(1, "Spawn extension (%s,%s,%d) exited INCOMPLETE on '%s'\n", c->context, c->exten, c->priority, c->name); - ast_verb(2, "Spawn extension (%s, %s, %d) exited INCOMPLETE on '%s'\n", c->context, c->exten, c->priority, c->name); - - /* Don't cycle on incomplete - this will happen if the only extension that matches is our "incomplete" extension */ - if (!ast_matchmore_extension(c, c->context, c->exten, 1, - S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { - invalid = 1; - } else { - ast_copy_string(dst_exten, c->exten, sizeof(dst_exten)); - digit = 1; - pos = strlen(dst_exten); - } } 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); @@ -4832,8 +4798,7 @@ * hangup. We have options, here. We can either catch the failure * and continue, or we can drop out entirely. */ - if (invalid - || !ast_exists_extension(c, c->context, c->exten, 1, + if (!ast_exists_extension(c, c->context, c->exten, 1, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { /*!\note * If there is no match at priority 1, it is not a valid extension anymore. @@ -4880,15 +4845,12 @@ if (collect_digits(c, waittime, dst_exten, sizeof(dst_exten), pos)) break; - if (res == AST_PBX_INCOMPLETE && ast_strlen_zero(&dst_exten[pos])) - timeout = 1; - if (!timeout - && ast_exists_extension(c, c->context, dst_exten, 1, + if (ast_exists_extension(c, c->context, dst_exten, 1, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { /* Prepare the next cycle */ set_ext_pri(c, dst_exten, 1); } else { /* No such extension */ - if (!timeout && !ast_strlen_zero(dst_exten)) { + if (!ast_strlen_zero(dst_exten)) { /* An invalid extension */ if (ast_exists_extension(c, c->context, "i", 1, S_COR(c->caller.id.number.valid, c->caller.id.number.str, NULL))) { @@ -9057,26 +9019,6 @@ return __ast_answer(chan, delay, answer_cdr); } -static int pbx_builtin_incomplete(struct ast_channel *chan, const char *data) -{ - const char *options = data; - int answer = 1; - - /* Some channels can receive DTMF in unanswered state; some cannot */ - if (!ast_strlen_zero(options) && strchr(options, 'n')) { - answer = 0; - } - - /* If the channel is hungup, stop waiting */ - if (ast_check_hangup(chan)) { - return -1; - } else if (chan->_state != AST_STATE_UP && answer) { - __ast_answer(chan, 0, 1); - } - - return AST_PBX_INCOMPLETE; -} - AST_APP_OPTIONS(resetcdr_opts, { AST_APP_OPTION('w', AST_CDR_FLAG_POSTED), AST_APP_OPTION('a', AST_CDR_FLAG_LOCKED),