<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">According to <a href="https://datatracker.ietf.org/doc/html/rfc3261#section-20.14" rel="nofollow">RFC3261</a></p>
<blockquote>
<p dir="auto">The Content-Length header field indicates the size of the message-<br>
body, in decimal number of octets, sent to the recipient.<br>
Applications SHOULD use this field to indicate the size of the<br>
message-body to be transferred, regardless of the media type of the<br>
entity.  If a stream-based protocol (such as TCP) is used as<br>
transport, the header field MUST be used.</p>
</blockquote>
<p dir="auto">When UDP protocol is used then this header is optional.<br>
When Kamailio receives an OPTIONS request like in the example, then it floods Kamailio logs with messages like</p>
<pre class="notranslate"><code class="notranslate">sanity [sanity.c:612]: check_cl(): content length header missing in request
</code></pre>
<p dir="auto">OPTIONS message example</p>
<pre class="notranslate"><code class="notranslate">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@64.58.61.151
To: sip:ping@sbc-0.example.com
From: <sip:ping@64.58.61.151>;tag=8fbe5af9178677655bc3a5388c2a8b8c00149n2
Max-Forwards: 70
CSeq: 299694 OPTIONS
Route: <sip:3.236.25.4:5060;lr>
</code></pre>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Do not generate warnings about SIP messages that are allowed according to RFC.</p>
<h4 dir="auto">Actual observed behavior</h4>
<p dir="auto">Generated warning when "Content-Length" header missing and used UDP protocol.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3210">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZOTRWCKDUX5CEHVPADVYFACRANCNFSM5555H7TQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZPRDE462KMOX7PZDOLVYFACRA5CNFSM5555H7T2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4T3HNYEA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3210</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3210",
"url": "https://github.com/kamailio/kamailio/issues/3210",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>