Hello list.
I have a couple of questions about the LCR module.
The first one is about the "ping" column in the gw table. I guess this column stores the "results" of execute a ping to the gateways in the LCR.gw table isn't?.
So how this "ping" is executed? It is just a simple ICMP message? Or maybe is an OPTIONS sip message to the gateway?. I saw in the lcr_mod.c file some ping_method, ping_interval variables, but in the README file there is nothing about the "ping". Could someone clarify this to me this?
Second. In the mysql "gw" table there is a column called "flags". According to the README file it said that this column can store gateways "capabilities". For example, and I hope that someone could guide me here, can i store the maximum channels available per gateway?, and use it to select or not select a gateway according the gateway channels used?.
I hope that someone could help me here.
Thank in advance,
Regards,
Ricardo Martinez.-
2009/8/27 Ricardo Martinez rmartinez@redvoiss.net:
Hello list.
I have a couple of questions about the LCR module.
The first one is about the “ping” column in the gw table. I guess this column stores the “results” of execute a ping to the gateways in the LCR.gw table isn’t?.
So how this “ping” is executed? It is just a simple ICMP message? Or maybe is an OPTIONS sip message to the gateway?. I saw in the lcr_mod.c file some ping_method, ping_interval variables, but in the README file there is nothing about the “ping”. Could someone clarify this to me this?
opsss, what the ****???
I use the following parameters in a LCR configuracion (I use m4):
modparam("lcr", "gw_uri_avp", "$avp(AVP_LCR_GW_URI)") modparam("lcr", "rpid_avp", "$avp(AVP_LCR_RPID)") modparam("lcr", "ruri_user_avp", "$avp(AVP_LCR_RURI_USER)") modparam("lcr", "flags_avp", "$avp(AVP_LCR_FLAGS)") modparam("lcr", "ping_interval", 10) modparam("lcr", "ping_from", "sip:pinger@mydomain.org") modparam("lcr", "ping_method", "PING") modparam("lcr", "positive_codes", "501;200;404;401;407;403") modparam("lcr", "negative_codes", "408;503")
As you say, the module doc doesn't talk about "ping" related parameters... how can it be??? something happened to the module doc?
Second. In the mysql “gw” table there is a column called “flags”. According to the README file it said that this column can store gateways “capabilities”. For example, and I hope that someone could guide me here, can i store the maximum channels available per gateway?, and use it to select or not select a gateway according the gateway channels used?.
No, it just gives you the possibility of storing flags (1 or 0) of each gateway. When a gateway is used, its flags are retrieved into "flags" AVP:
modparam("lcr", "flags_avp", "$avp(AVP_LCR_FLAGS)")
Hello Iñaki. Thanks for your answer. There are many new parameters of which was not aware!!!... positives_codes?, negative_codes?... Where can I find information about this?.
One more question. About the column "weight". According to the README file, weight is "an integer value from 1 to 254". So I guess if I have two gateways for a particular prefix, and I want to send 50% of the calls to one gateway and the other 50% of the calls to the other gateway, the correct syntax for the column is 50 and 50 ???. Maybe is a stupid questions but there is not much information in the README file.
Thanks for clarifying this.
Regards, Ricardo.-
-----Mensaje original----- De: Iñaki Baz Castillo [mailto:ibc@aliax.net] Enviado el: jueves, 27 de agosto de 2009 11:51 Para: Ricardo Martinez CC: users@lists.kamailio.org; Juha Heinanen Asunto: Re: [Kamailio-Users] LCR questions ( ping and flags columns )
2009/8/27 Ricardo Martinez rmartinez@redvoiss.net:
Hello list.
I have a couple of questions about the LCR module.
The first one is about the “ping” column in the gw table. I guess this column stores the “results” of execute a ping to the gateways in the LCR.gw table isn’t?.
So how this “ping” is executed? It is just a simple ICMP message? Or maybe is an OPTIONS sip message to the gateway?. I saw in the lcr_mod.c file some ping_method, ping_interval variables, but in the README file there is nothing about the “ping”. Could someone clarify this to me this?
opsss, what the ****???
I use the following parameters in a LCR configuracion (I use m4):
modparam("lcr", "gw_uri_avp", "$avp(AVP_LCR_GW_URI)") modparam("lcr", "rpid_avp", "$avp(AVP_LCR_RPID)") modparam("lcr", "ruri_user_avp", "$avp(AVP_LCR_RURI_USER)") modparam("lcr", "flags_avp", "$avp(AVP_LCR_FLAGS)") modparam("lcr", "ping_interval", 10) modparam("lcr", "ping_from", "sip:pinger@mydomain.org") modparam("lcr", "ping_method", "PING") modparam("lcr", "positive_codes", "501;200;404;401;407;403") modparam("lcr", "negative_codes", "408;503")
As you say, the module doc doesn't talk about "ping" related parameters... how can it be??? something happened to the module doc?
Second. In the mysql “gw” table there is a column called “flags”. According to the README file it said that this column can store gateways “capabilities”. For example, and I hope that someone could guide me here, can i store the maximum channels available per gateway?, and use it to select or not select a gateway according the gateway channels used?.
No, it just gives you the possibility of storing flags (1 or 0) of each gateway. When a gateway is used, its flags are retrieved into "flags" AVP:
modparam("lcr", "flags_avp", "$avp(AVP_LCR_FLAGS)")
Ricardo Martinez writes:
One more question. About the column "weight". According to the README file, weight is "an integer value from 1 to 254". So I guess if I have two gateways for a particular prefix, and I want to send 50% of the calls to one gateway and the other 50% of the calls to the other gateway, the correct syntax for the column is 50 and 50 ???. Maybe is a stupid questions but there is not much information in the README file.
50/50 when weights are the same no matter what this same value is.
-- juha
2009/8/27 Ricardo Martinez rmartinez@redvoiss.net:
Hello Iñaki. Thanks for your answer. There are many new parameters of which was not aware!!!... positives_codes?, negative_codes?... Where can I find information about this?.
No idea, for sure I got those parameters from the doc! Hope Juha could explain what happened to the doc ¿?¿?
One more question. About the column "weight". According to the README file, weight is "an integer value from 1 to 254". So I guess if I have two gateways for a particular prefix, and I want to send 50% of the calls to one gateway and the other 50% of the calls to the other gateway, the correct syntax for the column is 50 and 50 ???. Maybe is a stupid questions but there is not much information in the README file.
Yo can also leave its value as 0 in both cases (AFAIR).
2009/8/27 Iñaki Baz Castillo ibc@aliax.net:
2009/8/27 Ricardo Martinez rmartinez@redvoiss.net:
Hello Iñaki. Thanks for your answer. There are many new parameters of which was not aware!!!... positives_codes?, negative_codes?... Where can I find information about this?.
No idea, for sure I got those parameters from the doc! Hope Juha could explain what happened to the doc ¿?¿?
modparam("lcr", "ping_interval", 10)
Obvious :)
modparam("lcr", "ping_from", "sip:pinger@xtratelecom.es")
Obvious.
modparam("lcr", "ping_method", "PING")
The SIP request method (yeah, I use "PING" XD).
modparam("lcr", "positive_codes", "501;200;404;401;407;403")
If a server is marked as "down", it will be set marked as "up" when a ping request receives a "positive code".
modparam("lcr", "negative_codes", "408;503")
If a server is marked as "up", it will be set marked as "down" when a ping request receives a "negative code". Note that a server is never marked as "down" if it receives a "negative code" for a INVITE request or any other kind of request *received* ny the proxy. Marking as "down"/"up" just depends on LCR pinging.
Hope it helps.
Ricardo Martinez writes:
The first one is about the "ping" column in the gw table. I guess this column stores the "results" of execute a ping to the gateways in the LCR.gw table isn't?.
i don't think that anything is stored in the column by the proxy.
So how this "ping" is executed? It is just a simple ICMP message? Or maybe is an OPTIONS sip message to the gateway?. I saw in the lcr_mod.c file some ping_method, ping_interval variables, but in the README file there is nothing about the "ping". Could someone clarify this to me this?
if i remember correctly, it is an options request.
in the first version of sip-router, pinging has been replaced by a possibility to stop selecting a failing gw for a particular amount of time.
Second. In the mysql "gw" table there is a column called "flags". According to the README file it said that this column can store gateways "capabilities". For example, and I hope that someone could guide me here, can i store the maximum channels available per gateway?, and use it to select or not select a gateway according the gateway channels used?.
gateway selection algorithm does not take in account the flags. they are just stored into an avp when a particular gw has been selected. for example, you can use the flags to tell, in which header field it expect to receive uri of the caller.
-- juha
Hello Juha. Another question (in line).
-----Mensaje original----- De: Juha Heinanen [mailto:jh@tutpro.com] Enviado el: jueves, 27 de agosto de 2009 11:55 Para: Ricardo Martinez CC: users@lists.kamailio.org Asunto: [Kamailio-Users] LCR questions ( ping and flags columns )
Ricardo Martinez writes:
The first one is about the "ping" column in the gw table. I guess
this
column stores the "results" of execute a ping to the gateways in the LCR.gw table isn't?.
i don't think that anything is stored in the column by the proxy.
So, when you first create the Gateway in the mysql table, the column ping is filled with what value? Then, if a gateway is marked as down, the proxy does not change the value in the "ping" column for that gateway?
So how this "ping" is executed? It is just a simple ICMP message? Or maybe is an OPTIONS sip message to the gateway?. I saw in the
lcr_mod.c
file some ping_method, ping_interval variables, but in the README
file
there is nothing about the "ping". Could someone clarify this to me this?
if i remember correctly, it is an options request.
in the first version of sip-router, pinging has been replaced by a possibility to stop selecting a failing gw for a particular amount of time.
Second. In the mysql "gw" table there is a column called "flags". According to the README file it said that this column can store
gateways
"capabilities". For example, and I hope that someone could guide me here, can i store the maximum channels available per gateway?, and
use
it to select or not select a gateway according the gateway channels used?.
gateway selection algorithm does not take in account the flags. they are just stored into an avp when a particular gw has been selected. for example, you can use the flags to tell, in which header field it expect to receive uri of the caller.
-- juha
Ricardo Martinez writes:
Another question (in line).
i just restored the somehow missing documentation related to pinging of gws.
So, when you first create the Gateway in the mysql table, the column ping is filled with what value?
from the restored doc:
A gateway is subject for checking if its ping_column has value 1 (default is 0).
Then, if a gateway is marked as down, the proxy does not change the value in the "ping" column for that gateway?
right.
-- juha
Thanks to all for your answers. Now is very clear. I have one more question about the "ping feature". I was doing some test with two gateways, and I set ping_method to OPTIONS. So every 180 secs I see two options to the two gateways defined in my "gw" table. My questions is : If I have 100 gw's defined, there are going to be 100 "OPTIONS" messages at the same time every 180 secs?. Or there is a way to randomize the check interval for the gateways?
Hope you can help me here. Thanks,
Ricardo.-
-----Mensaje original----- De: Juha Heinanen [mailto:jh@tutpro.com] Enviado el: jueves, 27 de agosto de 2009 13:21 Para: Ricardo Martinez CC: users@lists.kamailio.org Asunto: RE: [Kamailio-Users] LCR questions ( ping and flags columns )
Ricardo Martinez writes:
Another question (in line).
i just restored the somehow missing documentation related to pinging of gws.
So, when you first create the Gateway in the mysql table, the column ping is filled with what value?
from the restored doc:
A gateway is subject for checking if its ping_column has value 1 (default is 0).
Then, if a gateway is marked as down, the proxy does not change the value in the "ping" column for that gateway?
right.
-- juha
Ricardo Martinez writes:
If I have 100 gw's defined, there are going to be 100 "OPTIONS" messages at the same time every 180 secs?. Or there is a way to randomize the check interval for the gateways?
looks like it sends the pings back-to-back each time the timer fires.
-- juha
Hello Juha. Sorry i didn't understand this. So I will have 100 "OPTIONS" message every 180 secs If I have have 100gw's defined? Is there any way to avoid this? , but still keep using the ping feature?
Thanks, Ricardo.-
-----Mensaje original----- De: Juha Heinanen [mailto:jh@tutpro.com] Enviado el: viernes, 28 de agosto de 2009 0:47 Para: Ricardo Martinez CC: users@lists.kamailio.org Asunto: RE: [Kamailio-Users] LCR questions ( ping and flags columns )
Ricardo Martinez writes:
If I have 100 gw's defined, there are going to be 100 "OPTIONS"
messages
at the same time every 180 secs?. Or there is a way to randomize the check interval for the gateways?
looks like it sends the pings back-to-back each time the timer fires.
-- juha
Ricardo Martinez writes:
Sorry i didn't understand this. So I will have 100 "OPTIONS" message every 180 secs If I have have 100gw's defined?
from reading the code, looks like it is what happens.
Is there any way to avoid this? , but still keep using the ping feature?
not using the current code and in the next release the whole ping business is gone.
-- juha