Index: chan_zap.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v retrieving revision 1.418 diff -u -r1.418 chan_zap.c --- chan_zap.c 17 Mar 2005 23:12:15 -0000 1.418 +++ chan_zap.c 20 Mar 2005 03:57:28 -0000 @@ -152,8 +152,6 @@ #define DCHAN_AVAILABLE (DCHAN_PROVISIONED | DCHAN_NOTINALARM | DCHAN_UP) -static int cur_emdigitwait = 250; /* Wait time in ms for digits on EM channel */ - static char context[AST_MAX_EXTENSION] = "default"; static char cid_num[256] = ""; static char cid_name[256] = ""; @@ -583,7 +581,6 @@ int dtmfrelax; /* whether to run in relaxed DTMF mode */ int fake_event; int zaptrcallerid; /* should we use the callerid from incoming call on zap transfer or not */ - int emdigitwait; int answeronpolarityswitch; int hanguponpolarityswitch; int polarityonanswerdelay; @@ -4993,9 +4990,24 @@ if (res < 1) ast_dsp_digitreset(p->dsp); break; default: - /* If we got it, get the rest */ - res = my_getsigstr(chan,dtmfbuf + 1,' ', p->emdigitwait); - break; + /* If we got the first digit, get the rest */ + len = 1; + while((len < AST_MAX_EXTENSION-1) && ast_matchmore_extension(chan, chan->context, dtmfbuf, 1, p->cid_num)) { + if (ast_exists_extension(chan, chan->context, dtmfbuf, 1, p->cid_num)) + timeout = matchdigittimeout; + else + timeout = gendigittimeout; + res = ast_waitfordigit(chan, timeout); + if (res < 0) { + ast_log(LOG_DEBUG, "waitfordigit returned < 0...\n"); + ast_hangup(chan); + return NULL; + } else if (res) { + dtmfbuf[len++] = res; + } else + break; + } + break; } } if (res == -1) { @@ -6748,7 +6760,6 @@ tmp->restrictcid = restrictcid; tmp->use_callingpres = use_callingpres; tmp->priindication_oob = priindication_oob; - tmp->emdigitwait = cur_emdigitwait; if (tmp->usedistinctiveringdetection) { if (!tmp->use_callerid) { ast_log(LOG_NOTICE, "Distinctive Ring detect requires 'usecallerid' be on\n"); @@ -10071,8 +10082,6 @@ cur_rxflash = atoi(v->value); } else if (!strcasecmp(v->name, "debounce")) { cur_debounce = atoi(v->value); - } else if (!strcasecmp(v->name, "emdigitwait")) { - cur_emdigitwait = atoi(v->value); } else if (!strcasecmp(v->name, "polarityonanswerdelay")) { polarityonanswerdelay = atoi(v->value); } else if (!strcasecmp(v->name, "answeronpolarityswitch")) {