Fix negative lookahead
This commit is contained in:
parent
f43910e328
commit
b7eef0e69e
|
|
@ -287,9 +287,9 @@
|
|||
if (ivr_menu_direct_dial == "true") then
|
||||
local negative_lookahead = "";
|
||||
if (#direct_dial_exclude > 0) then
|
||||
negative_lookahead = "(?!"..table.concat(direct_dial_exclude, "|")..")";
|
||||
negative_lookahead = "(?!^("..table.concat(direct_dial_exclude, "|")..")$)";
|
||||
end
|
||||
local direct_dial_regex = string.format("/^%s(\\d{%s,%s})$/", negative_lookahead, direct_dial_digits_min, direct_dial_digits_max);
|
||||
local direct_dial_regex = string.format("/^(%s\\d{%s,%s})$/", negative_lookahead, direct_dial_digits_min, direct_dial_digits_max);
|
||||
table.insert(xml, [[ <entry action="menu-exec-app" digits="]]..direct_dial_regex..[[" param="set ${cond(${user_exists id $1 ]]..domain_name..[[} == true ? user_exists=true : user_exists=false)}" description="direct dial"/>\n]]);
|
||||
--table.insert(xml, [[ <entry action="menu-exec-app" digits="]]..direct_dial_regex..[[" param="set ${cond(${user_exists} == true ? user_exists=true : ivr_max_failures=${system(expr ${ivr_max_failures} + 1)})}" description="increment max failures"/>\n]]);
|
||||
table.insert(xml, [[ <entry action="menu-exec-app" digits="]]..direct_dial_regex..[[" param="playback ${cond(${user_exists} == true ? ]]..sound_prefix..[[ivr/ivr-call_being_transferred.wav : ]]..sound_prefix..[[ivr/ivr-that_was_an_invalid_entry.wav)}" description="play sound"/>\n]]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue