Kamailio sanity_check(“1511“, “7“)之释疑

在例子里面经常见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")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值