<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>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.<br>


<br></div>Example:<br></div>Host IP is: 1.1.1.1<br></div>Service IP is: 2.2.2.2<br></div><div>Device is at: 5.5.5.5<br></div><div>Proxy: 9.9.9.9<br></div><div>Gateway: 8.8.8.8<br></div><div><br></div>Kamailio listen IPs:<br>


</div><div>tcp:<a href="http://1.1.1.1:15060" target="_blank">1.1.1.1:15060</a> (used just for XMLRPC querys)<br></div>tcp:<a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a><br></div>udp:<a href="http://1.1.1.1:5062" target="_blank">1.1.1.1:5062</a><br>

<div>
udp:<a href="http://2.2.2.2:5060" target="_blank">2.2.2.2:5060</a><br><br></div><div>The Host IP should only be used for some management functions, not for routing.<br></div><div><br></div><div>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.<br>


<br>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:<br><br>U 2014/05/13 16:15:31.225132 <a href="http://9.9.9.9:5060">9.9.9.9:5060</a> -> <a href="http://2.2.2.2:5060">2.2.2.2:5060</a><br>

INVITE sip:user@5.5.5.5:5060;uniq=F373C9746E87D6271688292199F83;transport=tcp SIP/2.0<br>
Record-Route: <sip:9.9.9.9;lr><br>Record-Route: <sip:2.2.2.2;lr;ftag=as458ff869><br>Via: SIP/2.0/UDP 9.9.9.9;branch=z9hG4bK17ec.ea7c017baba4072b27c5b0b9daa23346.0<br>Route: <sip:2.2.2.2;lr;received=sip:5.5.5.5:4956%3Btransport%3Dtcp><br>


Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK17ec.7db07192e57ae94739d5c3e1444d7ef3.0<br>Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK5ba05442<br><br></div>Up until now everything looks good. But this is what the loadbalancer sends out:<br>

<br>T 2014/05/13 16:15:31.226987 <a href="http://2.2.2.2:5060">2.2.2.2:5060</a> -> <a href="http://5.5.5.5:4956">5.5.5.5:4956</a> [A]<br>INVITE sip:user@5.5.5.5:5060;uniq=F373C9746E87D6271688292199F83;transport=tcp SIP/2.0<br>

Record-Route: <sip:1.1.1.1:15060;transport=tcp;r2=on;lr;ftag=as458ff869><br>Record-Route: <sip:2.2.2.2;r2=on;lr;ftag=as458ff869><br>Record-Route: <sip:9.9.9.9;lr><br>Record-Route: <sip:2.2.2.2;lr;ftag=as458ff869><br>

Via: SIP/2.0/TCP 1.1.1.1:15060;branch=z9hG4bK17ec.99e285f5a9e03594d3f7ae6048d1868d.0<br>Via: SIP/2.0/UDP 9.9.9.9;branch=z9hG4bK17ec.ea7c017baba4072b27c5b0b9daa23346.0<br>Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK17ec.7db07192e57ae94739d5c3e1444d7ef3.0<br>

Via: SIP/2.0/UDP 8.8.8.8:5060;branch=z9hG4bK5ba05442<br><br></div>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.<br>

<br></div>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?<br><br></div>Best Regards,<br>Sebastian<br>

<div><div><div><div><div></div></div></div></div></div></div>