--- asterisk-1.2.13/app.c 2006-07-12 15:46:56.000000000 +0000 +++ asterisk-1.2.13-patch/app.c 2006-11-15 02:27:22.000000000 +0000 @@ -85,11 +85,12 @@ if (res < 1) break; collect[x++] = res; + if (collect[x-1] == '#') { + /* Not a valid extension, ending in #, assume the # was to finish dialing */ + collect[x-1] = '\0'; + break; + } 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'; - } break; } }