RestComm / jss7

RestComm Java SS7 Stack and Services
http://www.restcomm.com/
GNU Affero General Public License v3.0
191 stars 224 forks source link

RuleComparator Issue #315

Closed vinhdhqdce closed 4 years ago

vinhdhqdce commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST?:

kind bug

What happened:

In the class org.mobicents.protocols.ss7.sccp.impl.router.RuleComparator

The function comapreLength.

if (digits1.length() == digits2.length()) { return 0;}

Because it return 0 then in some case, the rulesMap is not correct in order

example config: Test_sccprouter2.txt The rule ID = 22 MUST be above the rule with ID = 2 because they have the same called digits = "326" and the rule ID = 22 has pattern calling digit, and in the rule ID = 2 is null. But with this Comparator, the rule with ID = 2 allway on top in this case

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Remove the condition digits1.length() == digits2.length() or just return digits1.compareTo(digits2)

Anything else we need to know?:

Environment:

yulianoifa-mobius commented 4 years ago

Hi You may always change the id of the rules and as result receive the correct behaviour ( e.g setting the rule 2 id 2222 for example )