This is SIP capure. 
Kamailio listen on 172.20.11.172 & 192.168.10.10
Caller is 172.20.11.208
Called user that pickup call is 192.168.10.20
Other group member is 172.20.11.152


Callee (172.20.11.208) make a call to group number 5000
172.20.11.208  --> 172.20.11.172
--------------
Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:5000@172.20.11.172 SIP/2.0
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: sip:5000@172.20.11.172
CSeq: 20 INVITE
Call-ID: q0KGluu3Sr
Contact: <sip:1004@172.20.11.208:6090>;+sip.instance="<urn:uuid:a6e51976-8d02-4f51-a065-0f836be30038>"


Kamailio replies with 100 Trying
172.20.11.172 --> 172.20.11.208
--------------
Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: sip:5000@172.20.11.172
CSeq: 20 INVITE
Call-ID: q0KGluu3Sr
Server: kamailio (4.1.5 (i386/linux))
Content-Length: 0

Kamailio lookup db and send 1st INVITE to 1st group member (1000@172.20.11.152)
172.20.11.172 --> 172.20.11.152
--------------
Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:1000@172.20.11.152:5090 SIP/2.0
Record-Route: <sip:172.20.11.172;lr=on;nat=yes>
Via: SIP/2.0/UDP 172.20.11.172;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.0
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: sip:5000@172.20.11.172
CSeq: 20 INVITE
Call-ID: q0KGluu3Sr
Max-Forwards: 69
Contact: <sip:1004@172.20.11.208:6090>;+sip.instance="<urn:uuid:a6e51976-8d02-4f51-a065-0f836be30038>"


Kamailio sends 2nd INVITE to 2nd group member (1001@192.168.10.20) using another network interface
192.168.10.10 --> 192.168.10.20
--------------
Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:1001@192.168.10.20:6090 SIP/2.0
Record-Route: <sip:192.168.10.10;r2=on;lr=on;nat=v46>
Record-Route: <sip:172.20.11.172;r2=on;lr=on;nat=v46>
Record-Route: <sip:172.20.11.172;lr=on;nat=yes>
Via: SIP/2.0/UDP 192.168.10.10;branch=z9hG4bK208d.ba27ec12b58ce991e5f589b977bb7075.0
Via: SIP/2.0/UDP 172.20.11.172;rport=5060;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.1
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: sip:5000@172.20.11.172
CSeq: 20 INVITE
Call-ID: q0KGluu3Sr
Contact: <sip:1004@172.20.11.172:5060>;+sip.instance="<urn:uuid:a6e51976-8d02-4f51-a065-0f836be30038>"


Kamailio receive 100 trying from 172.20.11.152
172.20.11.152 --> 172.20.11.172
--------------
Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.20.11.172;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.0
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: sip:5000@172.20.11.172
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE


Kamailio receive 180 ringing from 172.20.11.152
172.20.11.152 --> 172.20.11.172
--------------
Session Initiation Protocol (180)
Status-Line: SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 172.20.11.172;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.0
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: <sip:5000@172.20.11.172>;tag=puL7wn8
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE
Record-route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio sends 180 ringing to caller 
172.20.11.172 --> 172.20.11.208
--------------
Session Initiation Protocol (180)
Status-Line: SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: <sip:5000@172.20.11.172>;tag=puL7wn8
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE
Record-route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio receive 100 trying from 192.168.10.20
192.168.10.20 --> 192.168.10.10
--------------
Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.10.10;branch=z9hG4bK208d.ba27ec12b58ce991e5f589b977bb7075.0
Via: SIP/2.0/UDP 172.20.11.172;rport=5060;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.1
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: sip:5000@172.20.11.172
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE


Kamailio receive 180 ringing from 192.168.10.20
192.168.10.20 --> 192.168.10.10
--------------
Session Initiation Protocol (180)
Status-Line: SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.10.10;branch=z9hG4bK208d.ba27ec12b58ce991e5f589b977bb7075.0
Via: SIP/2.0/UDP 172.20.11.172;rport=5060;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.1
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: <sip:5000@172.20.11.172>;tag=-iPr1gn
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE
Record-route: <sip:192.168.10.10;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio sends 180 ringing to caller 
172.20.11.172 --> 172.20.11.208
--------------
Session Initiation Protocol (180)
Status-Line: SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: <sip:5000@172.20.11.172>;tag=-iPr1gn
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE
Record-route: <sip:192.168.10.10;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio receive 200 OK from 192.168.10.20
192.168.10.20 --> 192.168.10.10
--------------
Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.10.10;branch=z9hG4bK208d.ba27ec12b58ce991e5f589b977bb7075.0
Via: SIP/2.0/UDP 172.20.11.172;rport=5060;branch=z9hG4bK208d.8d88bd630566a8d23640dbb14fa4f9ef.1
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: <sip:5000@172.20.11.172>;tag=-iPr1gn
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE
Contact: <sip:1001@192.168.10.20:6090>;+sip.instance="<urn:uuid:6382d45f-042d-4be8-b6bd-1621911e88a9>"
Record-route: <sip:192.168.10.10;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio sends 200 OK to caller
172.20.11.172 --> 172.20.11.208
--------------
Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 Ok
Via: SIP/2.0/UDP 172.20.11.208:6090;branch=z9hG4bK.BLejEhqfD;rport=6090
From: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
To: <sip:5000@172.20.11.172>;tag=-iPr1gn
Call-ID: q0KGluu3Sr
CSeq: 20 INVITE
Contact: <sip:1001@192.168.10.20:6090>;+sip.instance="<urn:uuid:6382d45f-042d-4be8-b6bd-1621911e88a9>"
Record-route: <sip:192.168.10.10;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;r2=on;lr=on;nat=v46>
Record-route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio CANCEL other leg (messages removed...not so useful)
--------------

Kamailio receive BYE from 192.168.10.20
192.168.10.20 --> 192.168.10.10
--------------
Internet Protocol Version 4, Src: 192.168.10.20 (192.168.10.20), Dst: 192.168.10.10 (192.168.10.10)
User Datagram Protocol, Src Port: 6090 (6090), Dst Port: sip (5060)
Session Initiation Protocol (BYE)
Request-Line: BYE sip:1004@172.20.11.172:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.20:6090;branch=z9hG4bK.20aa9gXIY;rport
From: <sip:5000@172.20.11.172>;tag=-iPr1gn
To: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
CSeq: 111 BYE
Call-ID: q0KGluu3Sr
Route: <sip:192.168.10.10;r2=on;lr=on;nat=v46>
Route: <sip:172.20.11.172;r2=on;lr=on;nat=v46>
Route: <sip:172.20.11.172;lr=on;nat=yes>


Kamailio replies with 404 Not Here
192.168.10.10 --> 192.168.10.20
--------------
Internet Protocol Version 4, Src: 192.168.10.10 (192.168.10.10), Dst: 192.168.10.20 (192.168.10.20)
User Datagram Protocol, Src Port: sip (5060), Dst Port: 6090 (6090)
Session Initiation Protocol (404)
Status-Line: SIP/2.0 404 Not here
Message Header
Via: SIP/2.0/UDP 192.168.10.20:6090;branch=z9hG4bK.20aa9gXIY;rport=6090
From: <sip:5000@172.20.11.172>;tag=-iPr1gn
To: <sip:1004@172.20.11.172>;tag=TNzDNgaNN
CSeq: 111 BYE
Call-ID: q0KGluu3Sr
Server: kamailio (4.1.5 (i386/linux))
Content-Length: 0


----Messaggio originale----
Da: davy.van.de.moere@gmail.com
Data: 22-set-2014 13.52
A: "marino.mileti@alice.it"<marino.mileti@alice.it>, "Kamailio (SER) - Users Mailing List"<sr-users@lists.sip-router.org>
Ogg: Re: [SR-Users] Kamailio multihomed - BYE problem

Could you show us some SIP headers? 

2014-09-22 13:50 GMT+02:00 davy van de moere <davy.van.de.moere@gmail.com>:
A very long shot, look into handle_ruri_alias().



2014-09-22 12:58 GMT+02:00 marino.mileti@alice.it <marino.mileti@alice.it>:
Hi,

I'm having a problem with routing of BYEs in my multi homed Kamailio.

My setup is a Kamailio v4.1.5 with two NIC (172.20.11.0 & 192.168.10.0) and three phones. Two phones (1 for each LAN) are in a group, so using alias_db I can call them in parallel mode. Caller is on 172.20 network...
When I answer from phone on 192.168.10.0, RTP is ok ... but on BYE Kamailio replies with 404 Not Here...and the RURI of BYE has the IP of Kamailio instead the IP of the callee.
When I answer from phone on 172.20.11.0, RTP is still ok and also BYE is managed correctly from Kamailio and the RURI of BYE has the IP of the callee.

How can i solve this issue?
Many thanks

_______________________________________________
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