aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/app.c b/app.c
index a47776904..bbd3bfdad 100644
--- a/app.c
+++ b/app.c
@@ -84,14 +84,11 @@ int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect,
ast_playtones_stop(chan);
if (res < 1)
break;
+ if (res == '#')
+ break;
collect[x++] = res;
- if (!ast_matchmore_extension(chan, context, collect, 1, chan->cid.cid_num)) {
- if (collect[x-1] == '#') {
- /* Not a valid extension, ending in #, assume the # was to finish dialing */
- collect[x-1] = '\0';
- }
+ if (!ast_matchmore_extension(chan, context, collect, 1, chan->cid.cid_num))
break;
- }
}
if (res >= 0) {
if (ast_exists_extension(chan, context, collect, 1, chan->cid.cid_num))