<h3>Description</h3>
<p>Kamailio dies complaining about a bad char in some header.  I can say that I just updated from the nightly-devel apt repo, this problem never happened in latest v5.1 release.</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>I don't know how to reproduce yet.</p>
<h4>Debugging Data</h4>

<p><a href="https://github.com/kamailio/kamailio/files/2512570/BT-FULL_core.kamailio.3329.1540415468.txt">BT-FULL_core.kamailio.3329.1540415468.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512571/BT-FULL_core.kamailio.3330.1540415471.txt">BT-FULL_core.kamailio.3330.1540415471.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512572/BT-FULL_core.kamailio.3331.1540415467.txt">BT-FULL_core.kamailio.3331.1540415467.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512573/BT-FULL_core.kamailio.3333.1540415469.txt">BT-FULL_core.kamailio.3333.1540415469.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512574/INFO-LOCALS_core.kamailio.3329.1540415468.txt">INFO-LOCALS_core.kamailio.3329.1540415468.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512575/INFO-LOCALS_core.kamailio.3330.1540415471.txt">INFO-LOCALS_core.kamailio.3330.1540415471.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512576/INFO-LOCALS_core.kamailio.3331.1540415467.txt">INFO-LOCALS_core.kamailio.3331.1540415467.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512577/INFO-LOCALS_core.kamailio.3333.1540415469.txt">INFO-LOCALS_core.kamailio.3333.1540415469.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512578/LIST_core.kamailio.3329.1540415468.txt">LIST_core.kamailio.3329.1540415468.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512579/LIST_core.kamailio.3330.1540415471.txt">LIST_core.kamailio.3330.1540415471.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512580/LIST_core.kamailio.3331.1540415467.txt">LIST_core.kamailio.3331.1540415467.txt</a><br>
<a href="https://github.com/kamailio/kamailio/files/2512581/LIST_core.kamailio.3333.1540415469.txt">LIST_core.kamailio.3333.1540415469.txt</a></p>
<h4>Log Messages</h4>

<p>The relevant log lines are:</p>
<pre><code>Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: ["910609864" <sip:;:929] .
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: "910609864" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: ["910609864" <sip:;:929] .
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: "910609864" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: ["910609864" <sip:;:929] .
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: "910609864" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: pv [pv_core.c:1892]: pv_get_hdr(): error parsing headers
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/parse_addr_spec.c:718]: parse_addr_spec(): unexpected char [<] in status 6: ["910609864" <sip:;:929] .
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:164]: get_hdr_field(): bad to header
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: <core> [core/parser/msg_parser.c:337]: parse_headers(): bad header field [To: "910609864" <sip:;:929<>64@138.99.136.3>;tag=as664d068c#015#012Call-ID: 032f010653fed9170365045a4e1002]
Oct 24 16:11:11 sbc01 sbc[3330]: ERROR: pv [pv_core.c:704]: pv_get_callid(): cannot parse Call-Id header
</code></pre>
<h4>SIP Traffic</h4>

<p>I have enabled a mirror server to capture all traffic, once the problem happens again I will be able to update this issue with SIP traffic.</p>
<h3>Possible Solutions</h3>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>root@sbc01:/var/tmp# kamailio -v
version: kamailio 5.2.0-pre1 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 6.3.0
root@sbc01:/var/tmp#
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>root@sbc01:/var/tmp# uname -a
Linux sbc01.vozelia.com.pa 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux
root@sbc01:/var/tmp#

root@sbc01:/var/tmp# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.5 (stretch)
Release:        9.5
Codename:       stretch
root@sbc01:/var/tmp#
</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/1687">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZWerTkiKs8SUsOPzn3UowAlHQhI3ks5uoOxXgaJpZM4X5L1n">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZfMpr2UPJ7xpyKDLuoq8VK3mqRgkks5uoOxXgaJpZM4X5L1n.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":"Core generated by Kamailio when a bad char is found in header (#1687)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1687"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1687",
"url": "https://github.com/kamailio/kamailio/issues/1687",
"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": "Core generated by Kamailio when a bad char is found in header (#1687)",
"sections": [
{
"text": "",
"activityTitle": "**Joel Serrano**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@joelsdc",
"facts": [
{
"name": "Repository: ",
"value": "kamailio/kamailio"
},
{
"name": "Issue #: ",
"value": 1687
}
]
}
],
"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\": 1687,\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\": 1687\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1687"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 400866663\n}"
}
],
"themeColor": "26292E"
}
]</script>