<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
We are using opensips 1.5.3 on a multi-homed system. This system has
three IP address"z<br>
<br>
1- one public IP address on the Internet<br>
2- one private IP address provided by a client open vpn connection.<br>
3- another private IP address as open vpn server.<br>
<br>
When using SIP over TCP to reach another SIP system on the Internet,
fails to open new outbound TCP connections.<br>
For instance, <br>
<br>
UAC ----> opensips proxy ----> other SIP system<br>
<br>
if we setup a static route (using t_relay('tcp:othersystem') to the
other system, it fails to relay the INVITE packet from opensips
proxy to the outside sysem<br>
<br>
A wireshark capture shows that the source address of the TCP packet
SYN using is in fact a <u>private address</u>.<br>
<br>
I looked at the code of <br>
<br>
struct tcp_connection* tcpconn_connect(struct socket_info*
send_sock, union sockaddr_union* server, int type) in tcp_main.c<br>
<br>
and I wonder why we bind the socket to the selected out_socket
rather than let the operating system select the proper IP address?<br>
<br>
my_name_len = sockaddru_len(send_sock->su);<br>
memcpy( &my_name, &send_sock->su, my_name_len);<br>
su_setport( &my_name, 0);<br>
if (bind(s, &my_name.s, my_name_len )!=0) {<br>
LM_ERR("bind failed (%d) %s\n",
errno,strerror(errno));<br>
goto error;<br>
}<br>
<br>
I looked at the code of get_send_socket() in foward.c and in case of
tcp, it seems that we select the "main IP address" which value is
determined at startup in main.c<br>
In case of multihomed system, the value of this "main Ip address"
seems not to be deterministc.<br>
<br>
As a conclution: would it hurt if we would remove the bind() call
from tcpconn_connect() ? <br>
<br>
Emmanuel BUU<br>
IVèS<br>
<a class="moz-txt-link-freetext" href="http://www.ives.fr/">http://www.ives.fr/</a><br>
<br>
</body>
</html>