Thanks for clearing that up. Things make much more sense now :-)
Paul
On Sun, 20 Feb 2005 06:10:47 +0200, Juha Heinanen jh@lohi.tutpro.com wrote:
Java Rockx writes:
'%','%','2','1'
you didn't read the readme carefully enough. prefix is not pattern, but a prefix. so if you want a catch all rule, you have to have empty prefix, not %.
However when next_gw() is called the following SQL is executed:
SELECT gw.ip_addr, gw.port FROM gw, lcr WHERE 'sip:3212518888@sip.mycompany.com' LIKE lcr.from_uri AND '4073195555' LIKE CONCAT(lcr.prefix, '%') AND lcr.grp_id = gw.grp_id ORDER BY CHAR_LENGTH(lcr.prefix), lcr.priority DESC, RAND()
The ORDER BY clause causes the group #2 gateway to appear first in the result set because '%' sorts before '407319'.
the last gw will appear first in mysql result, but then gws are added to avps and the first will be the last.
-- juha