Hi all,
due to malformed INVITEs I'm receiving from clients I like to use sanity module. But after few test I'm affraid I don't understand correctly how it works :-)
1. I try to load the module:
loadmodule "sanity.so" modparam("sanity", "default_checks", "999")
and kamailio rejects config with the:
ERROR:core:set_mod_param_regex: parameter <default_checks> not found in module <sanity>
2. When I comment out "modparam", kamailio starts successfuly, but: All INVITEs (from all clients) are reject through this snippet of code
if (method=="INVITE") { if (sanity_check("128")) { xlog("L_ERR", "bad INVITE SDP body length from $si:$sp\n"); exit; } else if (sanity_check("1024", "7")) { xlog("L_ERR", "malformed INVITE from $si:$sp\n"); exit; } }
I don't think that all of them could have bad length on SDP body (about 120 diffenet UAC types), so I assume I use "sanity" wrong way...
Could you, please, shed some light to proper usage of sanity module? Thank you very much!
Best regards,
kokoska.rokoska
On Tuesday 31 March 2009, kokoska rokoska wrote:
Hi all,
due to malformed INVITEs I'm receiving from clients I like to use sanity module. But after few test I'm affraid I don't understand correctly how it works :-)
- I try to load the module:
loadmodule "sanity.so" modparam("sanity", "default_checks", "999")
and kamailio rejects config with the:
ERROR:core:set_mod_param_regex: parameter <default_checks> not found in module <sanity>
Hi kokoska,
the default_checks parameter is a INT, not a string. Remove the quotes from the number. The module documentation is wrong, i'll fix this.
Cheers,
Henning
Henning Westerholt napsal(a):
On Tuesday 31 March 2009, kokoska rokoska wrote:
Hi all,
due to malformed INVITEs I'm receiving from clients I like to use sanity module. But after few test I'm affraid I don't understand correctly how it works :-)
- I try to load the module:
loadmodule "sanity.so" modparam("sanity", "default_checks", "999")
and kamailio rejects config with the:
ERROR:core:set_mod_param_regex: parameter <default_checks> not found in module <sanity>
Hi kokoska,
the default_checks parameter is a INT, not a string. Remove the quotes from the number. The module documentation is wrong, i'll fix this.
Cheers,
Henning
Thank you very much, Hennig, for you clarification! BTW: Yes, you are right, I get it from docs :-)
Best regrads,
kokoska.rokoska
On Tuesday 31 March 2009, kokoska rokoska wrote:
- When I comment out "modparam", kamailio starts successfuly, but:
All INVITEs (from all clients) are reject through this snippet of code
if (method=="INVITE") { if (sanity_check("128")) { xlog("L_ERR", "bad INVITE SDP body length from $si:$sp\n"); exit; } else if (sanity_check("1024", "7")) { xlog("L_ERR", "malformed INVITE from $si:$sp\n"); exit; } }
I don't think that all of them could have bad length on SDP body (about 120 diffenet UAC types), so I assume I use "sanity" wrong way...
Hi kokoska,
you should get a exact error message in the reply, which indicates the check that failed. The parameter in the sanity_check is the sum of all checks, so this includes also a bit more checks, take a look in the documentation.
Cheers,
Henning
Henning Westerholt napsal(a):
On Tuesday 31 March 2009, kokoska rokoska wrote:
- When I comment out "modparam", kamailio starts successfuly, but:
All INVITEs (from all clients) are reject through this snippet of code
if (method=="INVITE") { if (sanity_check("128")) { xlog("L_ERR", "bad INVITE SDP body length from $si:$sp\n"); exit; } else if (sanity_check("1024", "7")) { xlog("L_ERR", "malformed INVITE from $si:$sp\n"); exit; } }
I don't think that all of them could have bad length on SDP body (about 120 diffenet UAC types), so I assume I use "sanity" wrong way...
Hi kokoska,
you should get a exact error message in the reply, which indicates the check that failed.
Thank you very much, Henning, for your reply!
Yes, but I could "rearm" the checks only i deep night - due to load :-) I will look at it.
The parameter in the sanity_check is the sum of all checks, so this includes also a bit more checks, take a look in the documentation.
I know that parameter is sum of all checks, but I think - based on the docs - that if I explicitly specify what test I want ("128"), only the selected test is done. Am I wrong? Or, may be, should I use integer insted of string (and thus docs are a little bit missleading)?
Thank you once more for your time, Henning!
Best regards,
kokoska.rokoska
On Tuesday 31 March 2009, kokoska rokoska wrote:
Thank you very much, Henning, for your reply!
Yes, but I could "rearm" the checks only i deep night - due to load :-) I will look at it.
The parameter in the sanity_check is the sum of all checks, so this includes also a bit more checks, take a look in the documentation.
I know that parameter is sum of all checks, but I think - based on the docs - that if I explicitly specify what test I want ("128"), only the selected test is done. Am I wrong? Or, may be, should I use integer insted of string (and thus docs are a little bit missleading)?
According to the docs and the code, it should work the same way as the module parameter. But the example shows it a bit different.. You need to use quotes in the function, it don't work without it.
Cheers,
Henning
Henning Westerholt napsal(a):
On Tuesday 31 March 2009, kokoska rokoska wrote:
Thank you very much, Henning, for your reply!
Yes, but I could "rearm" the checks only i deep night - due to load :-) I will look at it.
The parameter in the sanity_check is the sum of all checks, so this includes also a bit more checks, take a look in the documentation.
I know that parameter is sum of all checks, but I think - based on the docs - that if I explicitly specify what test I want ("128"), only the selected test is done. Am I wrong? Or, may be, should I use integer insted of string (and thus docs are a little bit missleading)?
According to the docs and the code, it should work the same way as the module parameter. But the example shows it a bit different.. You need to use quotes in the function, it don't work without it.
Thank you very much, Henning, for your response!
If I catch it properly, the conclusion is: If I want only Content-Legth check for INVITEs, I should use:
if (method=="INVITE") { if (sanity_check("128")) { ...
This is exactly what I have done :-) I will try it once more at about midnight and let you know how it works...
Thank you for your help!
Best regards,
kokoska.rokoska