Hello, > Thank you for your response. I had tried that before and it didn't work. I > am trying to look up the route for a dialed number, so its a full E.164 > number. Please see my query below when I try to look up the route for a USA > number; > > mysql> SELECT * FROM routes WHERE "^13237309880" RLIKE pattern ORDER BY > LENGTH(pattern) DESC; > +---------+------------+---------+----------+-------------+-----------------+------+ > | pattern | country | comment | trunks | connectcost | includedseconds > | cost | > +---------+------------+---------+----------+-------------+-----------------+------+ > | 880 | Bangladesh | Proper | Carrier | 0 | 30 | > 0.18 | > | 237 | Cameroon | Proper | Carrier | 0 | 30 | > 0.24 | > | 32 | Belgium | Proper | Carrier | 0 | 30 | > 0.06 | > | 1 | USA | USA | Carrier | 0 | 30 | > 0.04 | > +---------+------------+---------+----------+-------------+-----------------+------+
The pattern column should be: ^880.* ^237.* ^32.* ^1.* and the query: SELECT * FROM routes WHERE "13237309880" RLIKE pattern ORDER BY LENGTH(pattern) DESC It works. Best Regards, -- Nicol�s Gudi�o Buenos Aires - Argentina _______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
