I have this setup for kamailio + asterisk, in which kamailio is supposed to listen on all ethernet interfaces on UDP port 5060, and will forward traffic from/to asterisk running on the same machine, and listening on localhost, udp port 5080. The scenario for the problematic call is somewhat like this:

SIP-PROVIDER<--->NAT<--192.168.0.0/16-->eth0:192.168.10.10<--KAMAILIO-->127.0.0.1<--ASTERISK

Our firewall/NAT has been configured to redirect SIP traffic from the SIP provider to the kamailio+asterisk machine at IP 192.168.10.10. The attached file sip-traffic-from-eth0.txt shows a tcpdump capture of an incoming call at eth0. Then, kamailio is supposed to redirect this traffic to asterisk. The attached file sip-traffic-from-localhost.txt shows a tcpdump capture of the same call at 127.0.0.1. The issue is that the INVITE is received, then routed to asterisk, which sends back the 200 OK, but then there is no ACK from the SIP provider. From the point of view of the caller of the SIP provider, the destination just keeps ringing until timeout.

Am I right in assuming that the two Record-Route headers should not appear on 
the traffic as seen from eth0, and that they are the source of the trouble? Can 
you see any additional issues I might have not seen in the traffic?
17:28:33.937424 IP 38.126.208.41.sip > 192.168.10.10.sip: SIP, length: 786
E.....@.....&~.)..

.......tINVITE sip:18773527849@192.168.10.10:5060 SIP/2.0
Max-Forwards: 69
Session-Expires: 3600;Refresher=uac
Supported: timer
To: "unknown" <sip:18773527849@192.168.10.10:5060>
From: <sip:+17194931256@38.126.208.41>;tag=3608663313-890004
P-Asserted-Identity:<sip:+17194931256@23.29.21.120:5060>
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Via: SIP/2.0/UDP 38.126.208.41:5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Contact: sip:+17194931256@38.126.208.41:5060
Content-Type: application/sdp
Content-Length: 258

v=0
o=msw.chance4minutes.net 1234 0 IN IP4 38.126.208.46
s=sip call
c=IN IP4 38.126.208.46
t=0 0
m=audio 33304 RTP/AVP 0 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:20

17:28:33.938644 IP 192.168.10.10.sip > 38.126.208.41.sip: SIP, length: 371
E.......@.....

&~.).....{..SIP/2.0 100 trying -- your call is important to us
To: "unknown" <sip:18773527849@192.168.10.10:5060>
From: <sip:+17194931256@38.126.208.41>;tag=3608663313-890004
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Via: SIP/2.0/UDP 
38.126.208.41:5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e;rport=5060
Server: kamailio (4.1.3 (x86_64/linux))
Content-Length: 0


17:28:34.948700 IP 192.168.10.10.sip > 38.126.208.41.sip: SIP, length: 1014
E.......@.....

&~.).......iSIP/2.0 200 OK
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080;alias=127.0.0.1~5080~1>
Content-Type: application/sdp
Require: timer
Content-Length: 255

v=0
o=root 1346608964 1346608964 IN IP4 192.168.10.10
s=Asterisk PBX 11.8.1
c=IN IP4 192.168.10.10
t=0 0
m=audio 19688 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=nortpproxy:yes

17:28:35.448190 IP 192.168.10.10.sip > 38.126.208.41.sip: SIP, length: 1014
E.......@.....

&~.).......iSIP/2.0 200 OK
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080;alias=127.0.0.1~5080~1>
Content-Type: application/sdp
Require: timer
Content-Length: 255

v=0
o=root 1346608964 1346608964 IN IP4 192.168.10.10
s=Asterisk PBX 11.8.1
c=IN IP4 192.168.10.10
t=0 0
m=audio 19688 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=nortpproxy:yes

17:28:36.449186 IP 192.168.10.10.sip > 38.126.208.41.sip: SIP, length: 1014
E.......@.....

&~.).......iSIP/2.0 200 OK
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080;alias=127.0.0.1~5080~1>
Content-Type: application/sdp
Require: timer
Content-Length: 255

v=0
o=root 1346608964 1346608964 IN IP4 192.168.10.10
s=Asterisk PBX 11.8.1
c=IN IP4 192.168.10.10
t=0 0
m=audio 19688 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=nortpproxy:yes

17:28:38.448384 IP 192.168.10.10.sip > 38.126.208.41.sip: SIP, length: 1014
E.......@.....

&~.).......iSIP/2.0 200 OK
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080;alias=127.0.0.1~5080~1>
Content-Type: application/sdp
Require: timer
Content-Length: 255

v=0
o=root 1346608964 1346608964 IN IP4 192.168.10.10
s=Asterisk PBX 11.8.1
c=IN IP4 192.168.10.10
t=0 0
m=audio 19688 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
a=nortpproxy:yes

17:28:40.226543 IP 38.126.208.41.sip > 192.168.10.10.sip: SIP, length: 382
E.....@....I&~.)..

........CANCEL sip:18773527849@192.168.10.10:5060 SIP/2.0
Max-Forwards: 69
To: "unknown" <sip:18773527849@192.168.10.10:5060>
From: <sip:+17194931256@38.126.208.41>;tag=3608663313-890004
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 CANCEL
Via: SIP/2.0/UDP 38.126.208.41:5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Contact: sip:+17194931256@38.126.208.41:5060
Content-Length: 0


17:28:40.738253 IP 38.126.208.41.sip > 192.168.10.10.sip: SIP, length: 382
E.....@....H&~.)..

........CANCEL sip:18773527849@192.168.10.10:5060 SIP/2.0
Max-Forwards: 69
To: "unknown" <sip:18773527849@192.168.10.10:5060>
From: <sip:+17194931256@38.126.208.41>;tag=3608663313-890004
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 CANCEL
Via: SIP/2.0/UDP 38.126.208.41:5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Contact: sip:+17194931256@38.126.208.41:5060
Content-Length: 0


17:28:41.735630 IP 38.126.208.41.sip > 192.168.10.10.sip: SIP, length: 382
E.....@....G&~.)..

........CANCEL sip:18773527849@192.168.10.10:5060 SIP/2.0
Max-Forwards: 69
To: "unknown" <sip:18773527849@192.168.10.10:5060>
From: <sip:+17194931256@38.126.208.41>;tag=3608663313-890004
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 CANCEL
Via: SIP/2.0/UDP 38.126.208.41:5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Contact: sip:+17194931256@38.126.208.41:5060
Content-Length: 0


17:28:42.448287 IP 192.168.10.10.sip > 38.126.208.41.sip: SIP, length: 977
E.......@.....

&~.).......DSIP/2.0 200 OK
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080>
Content-Type: application/sdp
Require: timer
Content-Length: 241

v=0
o=root 1346608964 1346608964 IN IP4 201.234.196.171
s=Asterisk PBX 11.8.1
c=IN IP4 201.234.196.171
t=0 0
m=audio 15892 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


17:28:33.939167 IP 127.0.0.1.sip > 127.0.0.1.onscreen: SIP, length: 1049
E..5.`..@.pF.............!.5INVITE sip:18773527849@192.168.10.10:5060 SIP/2.0
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Max-Forwards: 68
Session-Expires: 3600;Refresher=uac
Supported: timer
To: "unknown" <sip:18773527849@192.168.10.10:5060>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
P-Asserted-Identity:<sip:+17194931256@23.29.21.120:5060>
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bK168f.5526d37832abb97e06fdbfd81cb97954.0
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Contact: sip:+17194931256@38.126.208.41:5060
Content-Type: application/sdp
Content-Length: 276

v=0
o=msw.chance4minutes.net 1234 0 IN IP4 192.168.10.10
s=sip call
c=IN IP4 192.168.10.10
t=0 0
m=audio 15954 RTP/AVP 0 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:20
a=nortpproxy:yes

17:28:33.941519 IP 127.0.0.1.onscreen > 127.0.0.1.sip: SIP, length: 788
E`.0.a..@.p................0SIP/2.0 100 Trying
Via: SIP/2.0/UDP 
127.0.0.1;branch=z9hG4bK168f.5526d37832abb97e06fdbfd81cb97954.0;received=127.0.0.1;rport=5060
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080>
Content-Length: 0


17:28:34.948100 IP 127.0.0.1.onscreen > 127.0.0.1.sip: SIP, length: 1089
E`.].n..@.o..............I.]SIP/2.0 200 OK
Via: SIP/2.0/UDP 
127.0.0.1;branch=z9hG4bK168f.5526d37832abb97e06fdbfd81cb97954.0;received=127.0.0.1;rport=5060
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080>
Content-Type: application/sdp
Require: timer
Content-Length: 241

v=0
o=root 1346608964 1346608964 IN IP4 201.234.196.171
s=Asterisk PBX 11.8.1
c=IN IP4 201.234.196.171
t=0 0
m=audio 15892 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

17:28:35.447663 IP 127.0.0.1.onscreen > 127.0.0.1.sip: SIP, length: 1089
E`.].o..@.o..............I.]SIP/2.0 200 OK
Via: SIP/2.0/UDP 
127.0.0.1;branch=z9hG4bK168f.5526d37832abb97e06fdbfd81cb97954.0;received=127.0.0.1;rport=5060
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080>
Content-Type: application/sdp
Require: timer
Content-Length: 241

v=0
o=root 1346608964 1346608964 IN IP4 201.234.196.171
s=Asterisk PBX 11.8.1
c=IN IP4 201.234.196.171
t=0 0
m=audio 15892 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

17:28:36.448754 IP 127.0.0.1.onscreen > 127.0.0.1.sip: SIP, length: 1089
E`.].p..@.o..............I.]SIP/2.0 200 OK
Via: SIP/2.0/UDP 
127.0.0.1;branch=z9hG4bK168f.5526d37832abb97e06fdbfd81cb97954.0;received=127.0.0.1;rport=5060
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080>
Content-Type: application/sdp
Require: timer
Content-Length: 241

v=0
o=root 1346608964 1346608964 IN IP4 201.234.196.171
s=Asterisk PBX 11.8.1
c=IN IP4 201.234.196.171
t=0 0
m=audio 15892 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

17:28:38.447963 IP 127.0.0.1.onscreen > 127.0.0.1.sip: SIP, length: 1089
E`.].{..@.o..............I.]SIP/2.0 200 OK
Via: SIP/2.0/UDP 
127.0.0.1;branch=z9hG4bK168f.5526d37832abb97e06fdbfd81cb97954.0;received=127.0.0.1;rport=5060
Via: SIP/2.0/UDP 
38.126.208.41:5060;rport=5060;branch=ec57cc3b3062a0e0717b71ff7a3eb71e
Record-Route: <sip:127.0.0.1;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
Record-Route: <sip:192.168.10.10;r2=on;lr=on;ftag=3608663313-890004;nat=yes>
From: <sip:ChanceBackup@38.126.208.41>;tag=3608663313-890004
To: "unknown" <sip:18773527849@192.168.10.10:5060>;tag=as74086a05
Call-ID: 72053-3608663313-889966@msw1
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:18773527849@201.234.196.171:5080>
Content-Type: application/sdp
Require: timer
Content-Length: 241

v=0
o=root 1346608964 1346608964 IN IP4 201.234.196.171
s=Asterisk PBX 11.8.1
c=IN IP4 201.234.196.171
t=0 0
m=audio 15892 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to