在例子里面经常见sanity_check("1511", "7")
函数原型为:sanity_check(msg_checks, uri_checks) # 第一个参数是检查整个message,第二个参数是检查uri
检查的掩码如下:
ruri sip version - (1) - checks if the SIP version in the request URI is supported, currently only 2.0.
ruri scheme - (2) - checks if the URI scheme of the request URI is supported (sip[s]|tel[s]) by Kamailio
required headers - (4) -checks if the minimum set of required headers To, From, CSeq, Call-ID and Via is present in the request.
via sip version - (8) - disabled.
via protocol - (16) - disabled.
Cseq method - (32) - checks if the method from the CSeq header is equal to the request method.
Cseq value - (64) - checks if the number in the CSeq header is a valid unsigned integer.
content length - (128) - checks if the size of the body matches with the value from the Content-Length header.
expires value - (256) - checks if the value of the Expires header is a valid unsigned integer.
proxy require - (512) - checks if all items of the Proxy-Require header are present in the list of the extensions from the module parameter proxy_require.
parse uri's - (1024) - checks if the specified URIs are present and parseable by the Kamailio parsers
digest credentials (2048) - Check all instances of digest credentials in a message. The test checks whether there are all required digest parameters and that they have meaningful values. NOTE: the message will be considered invalid if the authorization scheme differs from "digest",
duplicated To/From tags (4096) - checks for the presence of duplicated tags in To/From headers.
Authorization header (8192) - checks if the Authorization header is valid if the scheme is "digest" (see "digest credentials" above), always returns success for other schemes.
first via header (16384) - checks if the first Via header is available, can be parsed and has an address value.
7=1 or 2 or 4,也就是同时做这几个检查:
1-ruri sip version
2-ruri scheme
4-required headers
1511是啥意思,您自己去算
顺便说下,GB28181如果要跟Kamailio对接,很多地方都需要调整,其中一个调整就是:
sanity_check("1383", "7")