From: Anthony Minessale Date: Tue, 15 May 2018 22:48:53 +0000 (-0500) Subject: FS-11165: [freeswitch-core] Add more regex handling to dmachine -- squashme #resolve X-Git-Tag: v1.8.1~3^2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611e38e8cb0cae2817d3122df2f307b2cc862072;p=thirdparty%2Ffreeswitch.git FS-11165: [freeswitch-core] Add more regex handling to dmachine -- squashme #resolve --- diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index bdbbe390b5..8d1609ac2d 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -441,10 +441,10 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin } else { int pmatch = !strncmp(dmachine->digits, bp->digits, strlen(dmachine->digits)); - if (!exact_bp && pmatch && (!rmatches || bp->is_priority || is_timeout) && !strcmp(bp->digits, dmachine->digits)) { + if (!exact_bp && pmatch && (bp->first_match || !rmatches || bp->is_priority || is_timeout) && !strcmp(bp->digits, dmachine->digits)) { best = DM_MATCH_EXACT; exact_bp = bp; - if (bp->is_priority || dmachine->cur_digit_len == dmachine->max_digit_len) break; + if (bp->first_match || bp->is_priority || dmachine->cur_digit_len == dmachine->max_digit_len) break; } if (!(both_bp && partial_bp) && strlen(bp->digits) != strlen(dmachine->digits) && pmatch) {