[sr-dev] [kamailio/kamailio] do not generate waring when used UDP protocol and no "Content-Length" header (Issue #3210)

sergey-safarov notifications at github.com
Mon Aug 8 19:32:24 CEST 2022


### Description
According to [RFC3261](https://datatracker.ietf.org/doc/html/rfc3261#section-20.14)

>    The Content-Length header field indicates the size of the message-
>    body, in decimal number of octets, sent to the recipient.
>    Applications SHOULD use this field to indicate the size of the
>    message-body to be transferred, regardless of the media type of the
>    entity.  If a stream-based protocol (such as TCP) is used as
>    transport, the header field MUST be used. 

When UDP protocol is used then this header is optional.
When Kamailio receives an OPTIONS request like in the example, then it floods Kamailio logs with messages like
```
sanity [sanity.c:612]: check_cl(): content length header missing in request
```

OPTIONS message example
```
OPTIONS sip:sbc-0.example.com:5060 SIP/2.0
Via: SIP/2.0/UDP 64.58.61.151:5060;branch=z9hG4bKl7oo3f30a0som61aeu00
Call-ID: 49bc1fcac14b779958dad4b9c43954b400149n2 at 64.58.61.151
To: sip:ping at sbc-0.example.com
From: <sip:ping at 64.58.61.151>;tag=8fbe5af9178677655bc3a5388c2a8b8c00149n2
Max-Forwards: 70
CSeq: 299694 OPTIONS
Route: <sip:3.236.25.4:5060;lr>
```

### Expected behavior
Do not generate warnings about SIP messages that are allowed according to RFC.

#### Actual observed behavior
Generated warning when "Content-Length" header missing and used UDP protocol.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3210
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3210 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20220808/8481a3f8/attachment.htm>


More information about the sr-dev mailing list