Hi Heinanen
When I was using the version 1.1.0, I needed to set a preferred route to my voip 123. This way, it was necessary to insert this underscores after 0. They match any single character (like dot in regular expressions). I used it because the prefix needs to match the longest user part.
prefix-------------------from_uri-------grp_id--------priority 0123456------------------------%------------ 1 ---------------1 0________-------------sip:123@.*----------- 2 ---------------0
If I call to number 01234560000 with voip 777, the GW 1 will be selected. Instead, when I use voip 123, the GW 2 is returned. This way, all the calls originated by voip 123 having a size of user part equal 7 or greater, will match with the second line. It does not happens with I have these lines (without the underscores):
prefix-------------------from_uri-------grp_id--------priority
0123456------------------------%------------ 1 ---------------1
0-----------------------sip:123@.*----------- 2 ---------------0
In this case, GW 1 will be always selected to any voip. It works in version 1.1.0, but I need to set this behavior in 1.2.0.
I know that from_uri in this version is a regular expression. So, I added a '^' in the beginning.
prefix-------------------from_uri-------grp_id--------priority
0123456-------------------------------------- 1 ---------------1
0________------------^sip:123@.*--------- 2 ---------------0
The version 1.2.0 always use the LCR in memory. I looked for the query used by 1.1.0 in lcr_mod.h but I didn't find it. So, I don't know if the underscores is necessary because it is used by the MySQL. In my test, just the GW 1 was selected when I called using voip 123.
Using other words: I want to route all the calls originated by voip 123 through GW 2 (when beginning with a 0) and the others to GW 1.
Thanks for your help, Heinanen.
Bruno
----- Mensagem original ---- De: Juha Heinanen jh@tutpro.com Para: Bruno Machado bsmufu@yahoo.com.br Cc: users@openser.org Enviadas: Quinta-feira, 3 de Maio de 2007 12:36:33 Assunto: [Users] LCR module (1.2.0)
Bruno Machado writes:
prefix----------from_uri-------grp_id--------priority 0123456------------------------------ 1 ---------------1 0________------^sip:123.*--------- 2 ---------------0
Ok. The LCR documentation tells that the column 'from_uri' must be a regular expression in this version. The route selected is the first line. I'd like to route the voip number 123 through GW 2, but it doesn't happens.
i don't understand based on the above, how your lcr table looks like and which uri you are trying to call. what are the underscores after 0? prefix is just a prefix, nothing else.
-- juha
__________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/
bruno,
according to lcr/README file
A gateway matches a request if user part of Request-URI and "From" URI match the prefix and From pattern of the gateway. Matching gateways are then ordered for forwarding purpose (1) according to longest user part match, (2) according to gateway's priority, and (3) randomly.
so if you have one lcr entry with sip:123@.* as from_uri regexp and another lcr entry with empty from_uri, and call comes from 123, then both of these entries match if their prefixes match and the one with longest prefix will be selected of if same length, one with priority.
i'll add a note about empty from_uri entry into README.
-- juha