<h3>Description</h3>
<p>In some calls I'm getting a 500 error on invite message reponse without reason message.<br>
Some times it works well and others the 500 error arises with the same code and situation.</p>
<h4>Log Messages</h4>
<pre><code>Jan 11 13:48:47 kamailio-alone /usr/sbin/kamailio[21953]: DEBUG: <core> [parser/msg_parser.c:616]: parse_msg(): SIP Reply  (status):
Jan 11 13:48:47 kamailio-alone /usr/sbin/kamailio[21953]: DEBUG: <core> [parser/msg_parser.c:618]: parse_msg():  version: <SIP/2.0>
Jan 11 13:48:47 kamailio-alone /usr/sbin/kamailio[21953]: DEBUG: <core> [parser/msg_parser.c:620]: parse_msg():  status:  <500>
Jan 11 13:48:47 kamailio-alone /usr/sbin/kamailio[21953]: DEBUG: <core> [parser/msg_parser.c:622]: parse_msg():  reason:  <>

DEBUG: <core> [msg_translator.c:2246]: generate_res_buf_from_sip_res(): copied size: orig:130, new: 14, rest: 420 msg=#012SIP/2.0 500 #015#012Via: SIP/2.0/UDP 37.133.221.218:9773;rport=9773;received=37.133.221.218;branch=z9hG4bKPj8d748325-ecc1-40dd-9f19-0edbe38f46a0#015#012Record-Route: <sip:146.185.142.19:9773;lr>#015#012Call-ID: 36fa4c8e-2e61-4b24-a775-584b2616b889#015#012From: <sip:+34639446862@146.185.142.19>;tag=179c6cb5-593e-4442-8596-1f40def7b336#015#012To: <sip:+34696501510@146.185.142.19>;tag=206c2f8e-2b61-4c51-af6b-7332e1830952#015#012CSeq: 9763 INVITE#015#012Content-Length:  0

</code></pre>
<h4>SIP Traffic</h4>
<pre><code>U 2018/01/11 13:55:40.134061 37.133.221.218:9773 -> 146.185.142.19:9773
INVITE sip:+34696501510@146.185.142.19:9773 SIP/2.0.
Via: SIP/2.0/UDP 37.133.221.218:9773;rport;branch=z9hG4bKPj042d70a5-e935-4129-90d2-29ba7679fdc3.
Max-Forwards: 70.
From: sip:+34639446862@146.185.142.19;tag=bc792be2-981c-45b9-9d59-cd46951d60cd.
To: sip:+34696501510@146.185.142.19.
Contact: <sip:+34639446862@37.133.221.218:9773;ob>.
Call-ID: 0cbfc14f-69bb-4390-887a-ed9f673c58bc.
CSeq: 25548 INVITE.
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.
Supported: replaces, 100rel, timer, norefersub.
Session-Expires: 1800.
Min-SE: 90.
Content-Type: application/sdp.
Content-Length:   476.
.
v=0.
o=- 3724667739 3724667739 IN IP4 192.168.1.141.
s=pjmedia.
b=AS:84.
t=0 0.
a=X-nat:0.
m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 96.
c=IN IP4 192.168.1.141.
b=TIAS:64000.
a=rtcp:4001 IN IP4 192.168.1.141.
a=sendrecv.
a=rtpmap:98 speex/16000.
a=rtpmap:97 speex/8000.
a=rtpmap:99 speex/32000.
a=rtpmap:104 iLBC/8000.
a=fmtp:104 mode=30.
a=rtpmap:3 GSM/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:9 G722/8000.
a=rtpmap:96 telephone-event/8000.
a=fmtp:96 0-16.


U 2018/01/11 13:55:40.143355 146.185.142.19:9773 -> 37.133.221.218:9773
SIP/2.0 100 trying -- your call is important to us.
Via: SIP/2.0/UDP 37.133.221.218:9773;rport=9773;branch=z9hG4bKPj042d70a5-e935-4129-90d2-29ba7679fdc3;received=37.133.221.218.
From: sip:+34639446862@146.185.142.19;tag=bc792be2-981c-45b9-9d59-cd46951d60cd.
To: sip:+34696501510@146.185.142.19.
Call-ID: 0cbfc14f-69bb-4390-887a-ed9f673c58bc.
CSeq: 25548 INVITE.
Server: kamailio (4.3.4 (x86_64/linux)).
Content-Length: 0.
.


U 2018/01/11 13:55:40.144092 146.185.142.19:9773 -> 37.133.221.218:1353
INVITE sip:+34696501510@37.133.221.218:1353;ob SIP/2.0.
Record-Route: <sip:146.185.142.19:9773;lr>.
Via: SIP/2.0/UDP 146.185.142.19:9773;branch=z9hG4bK6df7.9f8cf260e72edcb1fae300fb37edaa58.0.
Via: SIP/2.0/UDP 37.133.221.218:9773;received=37.133.221.218;rport=9773;branch=z9hG4bKPj042d70a5-e935-4129-90d2-29ba7679fdc3.
Max-Forwards: 69.
From: sip:+34639446862@146.185.142.19;tag=bc792be2-981c-45b9-9d59-cd46951d60cd.
To: sip:+34696501510@146.185.142.19.
Contact: <sip:+34639446862@37.133.221.218:9773;ob>.
Call-ID: 0cbfc14f-69bb-4390-887a-ed9f673c58bc.
CSeq: 25548 INVITE.
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.
Supported: replaces, 100rel, timer, norefersub.
Session-Expires: 1800.
Min-SE: 90.
Content-Type: application/sdp.
Content-Length:   476.
.
v=0.
o=- 3724667739 3724667739 IN IP4 192.168.1.141.
s=pjmedia.
b=AS:84.
t=0 0.
a=X-nat:0.
m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 96.
c=IN IP4 192.168.1.141.
b=TIAS:64000.
a=rtcp:4001 IN IP4 192.168.1.141.
a=sendrecv.
a=rtpmap:98 speex/16000.
a=rtpmap:97 speex/8000.
a=rtpmap:99 speex/32000.
a=rtpmap:104 iLBC/8000.
a=fmtp:104 mode=30.
a=rtpmap:3 GSM/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:9 G722/8000.
a=rtpmap:96 telephone-event/8000.
a=fmtp:96 0-16.


U 2018/01/11 13:55:40.459709 37.133.221.218:1353 -> 146.185.142.19:9773
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 146.185.142.19:9773;received=146.185.142.19;branch=z9hG4bK6df7.9f8cf260e72edcb1fae300fb37edaa58.0.
Via: SIP/2.0/UDP 37.133.221.218:9773;rport=9773;received=37.133.221.218;branch=z9hG4bKPj042d70a5-e935-4129-90d2-29ba7679fdc3.
Record-Route: <sip:146.185.142.19:9773;lr>.
Call-ID: 0cbfc14f-69bb-4390-887a-ed9f673c58bc.
From: <sip:+34639446862@146.185.142.19>;tag=bc792be2-981c-45b9-9d59-cd46951d60cd.
To: <sip:+34696501510@146.185.142.19>.
CSeq: 25548 INVITE.
Content-Length:  0.
.


U 2018/01/11 13:55:40.459844 37.133.221.218:1353 -> 146.185.142.19:9773
SIP/2.0 500 .
Via: SIP/2.0/UDP 146.185.142.19:9773;received=146.185.142.19;branch=z9hG4bK6df7.9f8cf260e72edcb1fae300fb37edaa58.0.
Via: SIP/2.0/UDP 37.133.221.218:9773;rport=9773;received=37.133.221.218;branch=z9hG4bKPj042d70a5-e935-4129-90d2-29ba7679fdc3.
Record-Route: <sip:146.185.142.19:9773;lr>.
Call-ID: 0cbfc14f-69bb-4390-887a-ed9f673c58bc.
From: <sip:+34639446862@146.185.142.19>;tag=bc792be2-981c-45b9-9d59-cd46951d60cd.
To: <sip:+34696501510@146.185.142.19>;tag=fe966b81-31e8-484a-9cce-625f31915529.
CSeq: 25548 INVITE.
Content-Length:  0.
.


U 2018/01/11 13:55:40.463028 146.185.142.19:9773 -> 37.133.221.218:1353
ACK sip:+34696501510@37.133.221.218:1353;ob SIP/2.0.
Via: SIP/2.0/UDP 146.185.142.19:9773;branch=z9hG4bK6df7.9f8cf260e72edcb1fae300fb37edaa58.0.
Max-Forwards: 69.
From: sip:+34639446862@146.185.142.19;tag=bc792be2-981c-45b9-9d59-cd46951d60cd.
To: <sip:+34696501510@146.185.142.19>;tag=fe966b81-31e8-484a-9cce-625f31915529.
Call-ID: 0cbfc14f-69bb-4390-887a-ed9f673c58bc.
CSeq: 25548 ACK.
Content-Length: 0.
.

</code></pre>
<h3>Possible Solutions</h3>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 4.4.6 (x86_64/linux) becbde
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, 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_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: becbde 
compiled on 08:18:45 Jul  3 2017 with gcc 5.4.0

</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/1395">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZRzSZL9MeH9M_wcFrmqhXcP-xwt6ks5tJhSYgaJpZM4Ra5Dq">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZS47oO-2PEMJzrFogsV0kTERDLa5ks5tJhSYgaJpZM4Ra5Dq.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/1395"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<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://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"500 error on invite response (#1395)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1395"}}}</script>