I'm still struggling with this problem. My setup is:
mobile ---- sipproviderA ---- kamailio1 ----- kamailio2 ----- SIP user 20111101
The SIP user calls the mobile and every thing works fine until the mobile hangup and the sipproviderA sends a BYE to kamailio1. That bye message has to "Route" headers:
Kamilio1 just forwards that message to kamailio2 and sends it back to kamailio1. BYE is then never send to the SIP user. I don't know why sipproviderA would send such a message. Maybe it si because I'm sending something strange to sipproviderA when the call is established or maybe sipproviderA is just sending a strange BYE message. Any ideas?
I can solve the problem by doing very ugle hack in kamailio1 and I think this can be done better?
I have included an ngrep from kamailio1 below.
$ ngrep -d eth0 -W byline port 5060 (from kamailio1)
Record-Route: <sip:188.166.3.25;lr=on;nat=yes>.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Max-Forwards: 69.
Contact: "20111101" <sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25>.
User-Agent: Jitsi2.8.5426Mac OS X.
Content-Type: application/sdp.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Content-Length: 376.
.
v=0.
s=-.
c=IN IP4 188.166.3.25.
t=0 0.
m=audio 13268 RTP/AVP 0 8 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=rtcp-xr:voip-metrics.
a=sendrecv.
a=rtcp:13269.
m=video 13300 RTP/AVP 96.
a=rtpmap:96 H263-1998/90000.
a=fmtp:96 CUSTOM=1920,1200,2;VGA=2;CIF=1;QCIF=1.
a=recvonly.
a=rtcp:13301.
#
SIP/2.0 100 trying -- your call is important to us.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Server: kamailio (4.2.4 (x86_64/linux)).
Content-Length: 0.
.
#
Record-Route: <sip:188.226.200.111;lr=on>.
Record-Route: <sip:188.166.3.25;lr=on;nat=yes>.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Max-Forwards: 68.
Contact: "20111101" <sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25>.
User-Agent: Jitsi2.8.5426Mac OS X.
Content-Type: application/sdp.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Content-Length: 376.
.
v=0.
s=-.
c=IN IP4 188.166.3.25.
t=0 0.
m=audio 13268 RTP/AVP 0 8 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=rtcp-xr:voip-metrics.
a=sendrecv.
a=rtcp:13269.
m=video 13300 RTP/AVP 96.
a=rtpmap:96 H263-1998/90000.
a=fmtp:96 CUSTOM=1920,1200,2;VGA=2;CIF=1;QCIF=1.
a=recvonly.
a=rtcp:13301.
#
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Record-route: <sip:188.226.200.111;lr>,<sip:188.166.3.25;lr;nat=yes>.
Content-Length: 0.
.
#
SIP/2.0 183 Session progress.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Record-route: <sip:188.226.200.111;lr>,<sip:188.166.3.25;lr;nat=yes>.
Content-Type: application/sdp.
Content-Length: 195.
.
v=0.
o=CARRIER 1430313091 1430313091 IN IP4 62.41.83.53.
s=SIP Call.
c=IN IP4 62.41.83.53.
t=0 0.
m=audio 9002 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=ptime:20.
#
SIP/2.0 183 Session progress.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Record-route: <sip:188.226.200.111;lr>,<sip:188.166.3.25;lr;nat=yes>.
Content-Type: application/sdp.
Content-Length: 195.
.
v=0.
o=CARRIER 1430313091 1430313091 IN IP4 62.41.83.53.
s=SIP Call.
c=IN IP4 62.41.83.53.
t=0 0.
m=audio 9002 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=ptime:20.
#
SIP/2.0 200 Ok.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Record-route: <sip:188.226.200.111;lr>,<sip:188.166.3.25;lr;nat=yes>.
Content-Type: application/sdp.
Content-Length: 195.
.
v=0.
o=CARRIER 1430313102 1430313102 IN IP4 62.41.83.53.
s=SIP Call.
c=IN IP4 62.41.83.53.
t=0 0.
m=audio 9002 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=ptime:20.
#
SIP/2.0 200 Ok.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.6e47f27f72a51e0a556d44c52407e608.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-69fcd8010ce9974b6339836ce5ffa19a.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 INVITE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Record-route: <sip:188.226.200.111;lr>,<sip:188.166.3.25;lr;nat=yes>.
Content-Type: application/sdp.
Content-Length: 195.
.
v=0.
o=CARRIER 1430313102 1430313102 IN IP4 62.41.83.53.
s=SIP Call.
c=IN IP4 62.41.83.53.
t=0 0.
m=audio 9002 RTP/AVP 0 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=ptime:20.
#
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 ACK.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.f7d715aa12609cd69c14240306531c9c.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-e619ba80aa9706d16d736d8d345411f8.
Max-Forwards: 69.
Route: <sip:188.226.200.111;lr>.
Contact: "20111101" <sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25>.
User-Agent: Jitsi2.8.5426Mac OS X.
Content-Length: 0.
.
#
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 2 ACK.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bKf4cd.499fde07c98618e26e3381195f8d0dc6.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bKf4cd.f7d715aa12609cd69c14240306531c9c.0.
Via: SIP/2.0/UDP 10.0.0.100:5060;rport=20578;received=80.71.132.145;branch=z9hG4bK-333935-e619ba80aa9706d16d736d8d345411f8.
Max-Forwards: 68.
Contact: "20111101" <sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25>.
User-Agent: Jitsi2.8.5426Mac OS X.
Content-Length: 0.
.
-------------> mobile hangup
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 70.
Route: <sip:188.166.3.25;lr;nat=yes>.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 69.
Route: <sip:188.166.3.25;lr;nat=yes>.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bK25cd.0d0182e8ec6af3861b81fb66c2c53fed.0.
Via: SIP/2.0/UDP 188.226.200.111;rport=5060;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 68.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bK25cd.225265ec743545685dd849cc3e0153b9.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bK25cd.0d0182e8ec6af3861b81fb66c2c53fed.0.
Via: SIP/2.0/UDP 188.226.200.111;rport=5060;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 67.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bK25cd.0d0182e8ec6af3861b81fb66c2c53fed.0.
Via: SIP/2.0/UDP 188.226.200.111;rport=5060;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 68.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 69.
Route: <sip:188.166.3.25;lr;nat=yes>.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bK25cd.225265ec743545685dd849cc3e0153b9.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bK25cd.0d0182e8ec6af3861b81fb66c2c53fed.0.
Via: SIP/2.0/UDP 188.226.200.111;rport=5060;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 67.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bK25cd.0d0182e8ec6af3861b81fb66c2c53fed.0.
Via: SIP/2.0/UDP 188.226.200.111;rport=5060;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 68.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 69.
Route: <sip:188.166.3.25;lr;nat=yes>.
Route: <sip:188.226.200.111;lr>.
Content-Length: 0.
.
#
BYE sip:20111101@80.71.132.145:20578;transport=udp;registering_acc=188_166_3_25 SIP/2.0.
Via: SIP/2.0/UDP 188.226.200.111;branch=z9hG4bK25cd.225265ec743545685dd849cc3e0153b9.0.
Via: SIP/2.0/UDP 188.166.3.25;branch=z9hG4bK25cd.0d0182e8ec6af3861b81fb66c2c53fed.0.
Via: SIP/2.0/UDP 188.226.200.111;rport=5060;branch=z9hG4bK25cd.9061966270be463b49b821a0fe0e52e2.0.
Via: SIP/2.0/UDP 77.72.169.128:5060;branch=z9hG4bKf4cd.d3de4986b90b75bf9449ec324740d8c1.0.
Call-ID: 0d190b50e45cf14206a715e69f4e3910@0:0:0:0:0:0:0:0.
CSeq: 1 BYE.
Server: (Very nice Sip Registrar/Proxy Server).
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE.
Max-Forwards: 67.
Content-Length: 0.