Skip to content

Commit

Permalink
Properly take into account the dialplan priority in case entry matche…
Browse files Browse the repository at this point in the history
…s both string and regex rules

(cherry picked from commit 0625610)
  • Loading branch information
vladpaiu committed Dec 2, 2013
1 parent 0ee2e29 commit 8079e64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/dialplan/dp_repl.c
Expand Up @@ -334,7 +334,10 @@ int translate(struct sip_msg *msg, str input, str * output, dpl_id_p idp,

/* pick the rule with lowest table index if both match and prio are equal */
if ((string_res | regexp_res) == 0) {
if (rrulep->table_id < rulep->table_id) {
if (rulep->pr < rrulep->pr) {
rulep = rrulep;
} else if (rrulep->pr == rulep->pr &&
rrulep->table_id < rulep->table_id) {
rulep = rrulep;
}
}
Expand Down

0 comments on commit 8079e64

Please sign in to comment.