[SR-Users] Wrong Via and RR header added in UDP2TCP scenario

Sebastian Damm damm at sipgate.de
Tue May 13 16:36:52 CEST 2014


Hi,

we have a setup, where we have a TCP loadbalancer, which converts the
requests from attached devices using TCP into UDP for the rest of our
setup. This loadbalancer has a service IP, and additionally the host IP, it
listens to different addresses.

Example:
Host IP is: 1.1.1.1
Service IP is: 2.2.2.2
Device is at: 5.5.5.5
Proxy: 9.9.9.9
Gateway: 8.8.8.8

Kamailio listen IPs:
tcp:1.1.1.1:15060 (used just for XMLRPC querys)
tcp:2.2.2.2:5060
udp:1.1.1.1:5062
 udp:2.2.2.2:5060

The Host IP should only be used for some management functions, not for
routing.

We've had the problem at first, that when converting from TCP to UDP,
Kamailio did not use the same IP but instead the first configured one. I
got rid of that by using force_send_socket.

Now I'm calling a registered device. Since the registered device is saved
with a path, the request comes in via UDP with the following parameters:

U 2014/05/13 16:15:31.225132 9.9.9.9:5060 -> 2.2.2.2:5060
INVITE sip:user at 5.5.5.5:5060;uniq=F373C9746E87D6271688292199F83;transport=tcp
SIP/2.0
Record-Route: <sip:9.9.9.9;lr>
Record-Route: <sip:2.2.2.2;lr;ftag=as458ff869>
Via: SIP/2.0/UDP
9.9.9.9;branch=z9hG4bK17ec.ea7c017baba4072b27c5b0b9daa23346.0
Route: <sip:2.2.2.2;lr;received=sip:5.5.5.5:4956%3Btransport%3Dtcp>
Via: SIP/2.0/UDP
2.2.2.2;branch=z9hG4bK17ec.7db07192e57ae94739d5c3e1444d7ef3.0
Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK5ba05442

Up until now everything looks good. But this is what the loadbalancer sends
out:

T 2014/05/13 16:15:31.226987 2.2.2.2:5060 -> 5.5.5.5:4956 [A]
INVITE sip:user at 5.5.5.5:5060;uniq=F373C9746E87D6271688292199F83;transport=tcp
SIP/2.0
Record-Route: <sip:1.1.1.1:15060;transport=tcp;r2=on;lr;ftag=as458ff869>
Record-Route: <sip:2.2.2.2;r2=on;lr;ftag=as458ff869>
Record-Route: <sip:9.9.9.9;lr>
Record-Route: <sip:2.2.2.2;lr;ftag=as458ff869>
Via: SIP/2.0/TCP 1.1.1.1:15060
;branch=z9hG4bK17ec.99e285f5a9e03594d3f7ae6048d1868d.0
Via: SIP/2.0/UDP
9.9.9.9;branch=z9hG4bK17ec.ea7c017baba4072b27c5b0b9daa23346.0
Via: SIP/2.0/UDP
2.2.2.2;branch=z9hG4bK17ec.7db07192e57ae94739d5c3e1444d7ef3.0
Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK5ba05442

As you can see, the the packet is sent out through the correct socket. But
in RR and Via header it advertises the other TCP socket. This breaks BYEs
later on.

Is there some way, I can influence, which IP and port Kamailio writes into
those headers? Or is this a bug, that Kamailio doesn't check the sending
socket correctly?

Best Regards,
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140513/3c8943d1/attachment.html>


More information about the sr-users mailing list