<h3>Description</h3>
<p>I used <a href="https://github.com/kamailio/kamailio/blob/f073f72af6a507e8113e06dc07ad161e3f4632c3/src/core/parser/parse_body.c#L528">get_body_part_by_filter</a> to extract a body part from a <code>multipart/mixed</code> message. It works as expected but for every body part it compares and do not match (until finding the one that matches the filter) it shows error log messages like:</p>
<p><code>ERROR: <core> [core/parser/parse_body.c:513]: part_multipart_headers_cmp(): part_multipart_headers_cmp. error. "-2". "MIME types mismatch".</code></p>
<p>The comparison of body parts shouldn´t be logged as errors, since they are not.</p>

<h3>Expected behavior</h3>
<p>No error logs.</p>
<h4>Actual observed behavior</h4>
<p>Error log messages.</p>
<h4>Log Messages</h4>

<pre><code>ERROR: <core> [core/parser/parse_body.c:513]: part_multipart_headers_cmp(): part_multipart_headers_cmp. error. "-2". "MIME types mismatch".
</code></pre>
<h3>Possible Solutions</h3>

<p>Do not show logs or change log level.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>5.1
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>CentOS 7
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1746">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZSGtYhiyaNVQiVybTu1SWVYWV22eks5u0C0xgaJpZM4Y6S9Q">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZZsLcEVRwS0AF44j1dv7RruYFRniks5u0C0xgaJpZM4Y6S9Q.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Body part comparison error logs (#1746)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1746"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1746",
"url": "https://github.com/kamailio/kamailio/issues/1746",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Body part comparison error logs (#1746)",
"sections": [
{
"text": "",
"activityTitle": "**Y. Luis**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@y-luis",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1746
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1746,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1746\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1746"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 417935184\n}"
}
],
"themeColor": "26292E"
}
]</script>