Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 error on invite response #1395

Closed
kelf47 opened this issue Jan 11, 2018 · 5 comments
Closed

500 error on invite response #1395

kelf47 opened this issue Jan 11, 2018 · 5 comments

Comments

@kelf47
Copy link

kelf47 commented Jan 11, 2018

Description

In some calls I'm getting a 500 error on invite message reponse without reason message.
Some times it works well and others the 500 error arises with the same code and situation.

Log Messages

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

SIP Traffic

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.
.

Additional Information

  • Kamailio Version - output of kamailio -v
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

@miconda
Copy link
Member

miconda commented Jan 11, 2018

Do you have any sl_send_reply()/send_reply()/t_reply() in kamailio.cfg that has the second parameter a variable? If yes, that variable might not be set (or set to an empty string)...

Kamailio doesn't send many 500 responses internally in the code, so likely is from kamailio.cfg.

@kelf47
Copy link
Author

kelf47 commented Jan 11, 2018

The second parameter of the sl_send_reply() is the default message string for each code.
This is my kamailio.cfg file:
https://gist.github.com/kelf47/fda4b4e61ceeff8dbf29a9ceff123d4a

@miconda
Copy link
Member

miconda commented Jan 11, 2018

Looking more at the debug messages, the SIP response without the reason text is received by Kamailio, not generated by Kamailio ...

Can you check that? Sniff sip traffic on all interfaces in case there is a spiral/loop. Also, maybe you can share more debug messages printed by pid 21953, before those that you pasted in the first post.

@kelf47
Copy link
Author

kelf47 commented Jan 12, 2018

this is a more accurate debug trace:
https://gist.github.com/kelf47/94895023630792c5b4b47ac629692225

The 500 code seems to be sent indeed by client (using pjsip).

@miconda
Copy link
Member

miconda commented Jan 15, 2018

Closing, the issue of missing reason text is not in kamailio.

Maybe you can get an workaround in kamailio with:

@miconda miconda closed this as completed Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants