[Kamailio-Users] sanity_check question

Dubravko Caric dubravko_caric at yahoo.com
Mon Jul 20 13:55:44 CEST 2009


Hi all,

I have a question regarding sanity module (kamailio 1.5.1). Module documentation says "The function returns true if one of the checks failed", but as you can see in case 1 (request is valid) and case 2 (request is not valid because bad request uri) requests always enter function block.

Does anybody else have the same problem? Any help would be appreciated... 

Thanks a lot

/dubravko


*Case 1:*
if (is_method("REGISTER")) {
xlog("L_INFO", "ENTER REGISTER\n");         
if (sanity_check("128","6")) {
xlog("L_NOTICE", "SANITY $si:$sp TIME $Tf USER $fu METHOD $rm\n");
exit;
}
}

ENTER REGISTER
Jul 20 13:30:13 [8180] DBG:core:parse_headers: flags=2000
Jul 20 13:30:13 [8180] DBG:core:get_hdr_field: cseq <CSeq>: <1> <REGISTER>
Jul 20 13:30:13 [8180] DBG:core:get_hdr_field: content_length=0
Jul 20 13:30:13 [8180] DBG:core:parse_headers: flags=ffffffffffffffff
Jul 20 13:30:13 [8180] DBG:core:get_hdr_field: found end of header
Jul 20 13:30:13 [8180] DBG:sanity:sanity_check: all sanity checks passed
SANITY xxx.xxx.xxx.xxx:22355 TIME Mon Jul 20 13:30:13 2009 USER sip:bob at exmaple.com METHOD REGISTER
Jul 20 13:30:13 [8180] DBG:core:destroy_avp_list: destroying list (nil)
Jul 20 13:30:13 [8180] DBG:core:receive_msg: cleaning up

*Case 2:*
...
if (sanity_check("130","6")) {
...

ENTER REGISTER
Jul 20 13:34:06 [8226] WARNING:sanity:check_ruri_scheme: failed to parse request uri
Jul 20 13:34:06 [8226] DBG:core:parse_headers: flags=2000
Jul 20 13:34:06 [8226] DBG:core:get_hdr_field: cseq <CSeq>: <1> <REGISTER>
Jul 20 13:34:06 [8226] DBG:core:get_hdr_field: content_length=0
Jul 20 13:34:06 [8226] DBG:core:parse_headers: flags=ffffffffffffffff
Jul 20 13:34:06 [8226] DBG:core:get_hdr_field: found end of header
Jul 20 13:34:06 [8226] 
SANITY xxx.xxx.xxx.xxx:22359 TIME Mon Jul 20 13:34:06 2009 USER sip:bob at exmaple.com METHOD REGISTER
Jul 20 13:34:06 [8226] DBG:core:destroy_avp_list: destroying list (nil)
Jul 20 13:34:06 [8226] DBG:core:receive_msg: cleaning up



      




More information about the sr-users mailing list