<p>Hi,</p>

<p>It seems OpenSIPS (11.1.1) is incorrectly parsing body of MESSAGE requests which end with one, two or three digits. For example, the following three body contents will result in:</p>

<p>REQUEST:</p>

<pre>
MESSAGE MESSAGE sip:bob@example.com SIP/2.0
[SIP headers]
test 1
</pre>

<p>RESPONSE:</p>

<pre>
SIP/2.0 400 Bad Request (Invalid content length 5 / 6)
[SIP headers]
</pre>

<p>REQUEST:</p>

<pre>
MESSAGE MESSAGE sip:bob@example.com SIP/2.0
[SIP headers]
test 12
</pre>

<p>RESPONSE:</p>

<pre>
SIP/2.0 400 Bad Request (Invalid content length 5 / 7)
[SIP headers]
</pre>

<p>REQUEST:</p>

<pre>
MESSAGE MESSAGE sip:bob@example.com SIP/2.0
[SIP headers]
test 123
</pre>

<p>RESPONSE:</p>

<pre>
SIP/2.0 400 Bad Request (Invalid content length 5 / 8)
[SIP headers]
</pre>

<p>four and more digits as last characters are working OK:</p>

<p>REQUEST:</p>

<pre>
MESSAGE MESSAGE sip:bob@example.com SIP/2.0
[SIP headers]
test 1234
</pre>

<p>RESPONSE:</p>

<pre>
SIP/2.0 200 OK
[SIP headers]
</pre>

<p>Regards,<br>
Chris</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/358">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyODk5NDc0OSwiZGF0YSI6eyJpZCI6NDU4NTcyNjN9fQ==--2d1856323f32581ade2891ab51df080015aec95a.gif" width="1" /></p>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"View this Issue on GitHub","action":{"@type":"ViewAction","url":"https://github.com/OpenSIPS/opensips/issues/358","name":"View Issue"}}</script>