[OpenSIPS-Devel] [opensips] Wrong rule selected in dialplan translation when both string and regexp rules are matched (#696)
paolodepa
notifications at github.com
Thu Nov 12 11:23:52 CET 2015
Let's say we are translating a destination matching two dialplan rules, the first working on exact string match and the second working on regexp match: I'm getting selected the exact match rule ONLY IF its priority is bigger (>) than the regexp rule; the regexp rule is selected otherwise.
I would have expected the opposite behaviour.
I'm facing this issue on 1.11.5 version but, looking at the source code, the problem should be present also in 2.1.X.
In detail, I suppose that replacing this code snippet into the function "translate" (dp_repl.c):
/* pick the rule with lowest table index if both match and prio are equal */
if ((string_res | regexp_res) == 0) {
if (rulep->pr < rrulep->pr) {
rulep = rrulep;
with:
/* pick the rule with lowest table index if both match and prio are equal */
if ((string_res | regexp_res) == 0) {
if (rrulep->pr < rulep->pr) {
rulep = rrulep;
would make the job.
---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/696
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20151112/b66a4a6d/attachment.htm>
More information about the Devel
mailing list