aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-28 16:37:45 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-28 16:37:45 +0000
commitab1d90ba28cb163f64552d9f930b9da07011edb4 (patch)
treeda7bec4990b783d4279d28d500f2883b7c01b9f9 /apps/app_dial.c
parent30c35d0943c9041d27834ff1d9f1e9de660bebb4 (diff)
Add incomplete matching to PBX code and app_dial
(closes issue #12351) Reported by: Corydon76 Patches: 20080402__pbx_incomplete__3.diff.txt uploaded by Corydon76 (license 14) pbx_incomplete_with_timeout.diff uploaded by fabled (license 448) Tested by: Corydon76, fabled git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114773 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 0cc865a1a..5730d99d7 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1619,6 +1619,13 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
} else { /* Nobody answered, next please? */
res = 0;
}
+
+ /* 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 {
const char *number;
@@ -1958,7 +1965,7 @@ out:
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_KEEPALIVE)) {
+ if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_KEEPALIVE) && (res != AST_PBX_INCOMPLETE)) {
if (calldurationlimit)
chan->whentohangup = 0;
res = 0;
@@ -2059,9 +2066,9 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
}
}
- if (res < 0)
+ if (res < 0 || res == AST_PBX_INCOMPLETE) {
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;