Problem with t_relay() and VPN tunnel
Hi, I have two SIP servers, *A* and *B*, connected each other though a OPENVPN tunnel. The server *B* needs to t_relay() every SIP message containing the method MESSAGE to the server *A* but these messages never reach destination. I have tested the tunnel connectivity and works fine. I wrote a Perl script (located in *B*) that sends SIP MESSAGES to Kamailio (located in *A*) trying to figure out what is happening but these messages are received by *A* and processed correctly but when *B* does the same from Kamailio, it is never received. Here is the route part of kamailio.cfg in *B*: Observation: ($rU == "1004") result is *true* * if(is_method("MESSAGE")) { if($rU == "1004") { xlog("L_INFO","En 1004"); rewritehost("10.8.0.1"); if (!t_relay()) xlog("L_INFO","MIO Error en t_relay"); t_reply("200", "Ok"); xlog("L_INFO","MIO despues rewrite"); exit; } .....* The perl script that WORKS: *$msg = 'MESSAGE sip:1004@192.168.1.2:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2 From: "2002" <sip:2002@192.168.1.2 <sip%3A2002@192.168.1.2>>;tag=1837944796 To: <sip:1004@192.168.1.2 <sip%3A1004@192.168.1.2>> Call-ID: 19722852989@192.168.1.2 CSeq: 15773 MESSAGE Contact: <sip:2002@**PublicIP-protected**:5060> Max-Forwards: 29 User-Agent: DBL Content-Type: text/plain Content-Length: 34 +595981[protected] hello from kamailio '; use IO::Socket; my $sock = IO::Socket::INET->new( Proto=>'udp', PeerHost=>'192.168.2.102', PeerPort=>'5060'); print "Sending msg $msg\n"; $sock->send($msg) or die "error sending $!\n"; *Please help! Thanks in advance. Carlos.
1) Is Kamailio also listening on the VPN tunnel interface? Kamailio cannot send messages out of interfaces on which it is not listening. 2) Is the message existing out of the right interface? http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.0.x#force_send_soc... On 08/05/2010 07:48 PM, Carlos Ruiz Diaz wrote:
Hi,
I have two SIP servers, *A* and *B*, connected each other though a OPENVPN tunnel. The server *B* needs to t_relay() every SIP message containing the method MESSAGE to the server *A* but these messages never reach destination.
I have tested the tunnel connectivity and works fine. I wrote a Perl script (located in *B*) that sends SIP MESSAGES to Kamailio (located in *A*) trying to figure out what is happening but these messages are received by *A* and processed correctly but when *B* does the same from Kamailio, it is never received.
Here is the route part of kamailio.cfg in *B*:
Observation: ($rU == "1004") result is *true* / if(is_method("MESSAGE")) { if($rU == "1004") { xlog("L_INFO","En 1004");
rewritehost("10.8.0.1");
if (!t_relay()) xlog("L_INFO","MIO Error en t_relay");
t_reply("200", "Ok"); xlog("L_INFO","MIO despues rewrite"); exit; } ...../
The perl script that WORKS:
/$msg = 'MESSAGE sip:1004@192.168.1.2:5060 <http://sip:1004@192.168.1.2:5060> SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2 From: "2002" <sip:2002@192.168.1.2 <mailto:sip%3A2002@192.168.1.2>>;tag=1837944796 To: <sip:1004@192.168.1.2 <mailto:sip%3A1004@192.168.1.2>> Call-ID: 19722852989@192.168.1.2 <mailto:19722852989@192.168.1.2> CSeq: 15773 MESSAGE Contact: <sip:2002@//*PublicIP-protected*//:5060> Max-Forwards: 29 User-Agent: DBL Content-Type: text/plain Content-Length: 34
+595981[*protected*] hello from kamailio ';
use IO::Socket;
my $sock = IO::Socket::INET->new( Proto=>'udp', PeerHost=>'192.168.2.102', PeerPort=>'5060');
print "Sending msg $msg\n";
$sock->send($msg) or die "error sending $!\n";
/Please help!
Thanks in advance.
Carlos.
_______________________________________________ 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
-- Alex Balashov - Principal Evariste Systems LLC 1170 Peachtree Street 12th Floor, Suite 1200 Atlanta, GA 30309 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
The IP: *192.168.2.102 *corresponds to address in LAN *A*, *10.8.0.1* is the VPN address of the same machine in the *A* network. Switching from one to another still results in Perl script working and Kamailio not working. On Thu, Aug 5, 2010 at 7:48 PM, Carlos Ruiz Diaz <carlos.ruizdiaz@gmail.com>wrote:
Hi,
I have two SIP servers, *A* and *B*, connected each other though a OPENVPN tunnel. The server *B* needs to t_relay() every SIP message containing the method MESSAGE to the server *A* but these messages never reach destination.
I have tested the tunnel connectivity and works fine. I wrote a Perl script (located in *B*) that sends SIP MESSAGES to Kamailio (located in * A*) trying to figure out what is happening but these messages are received by *A* and processed correctly but when *B* does the same from Kamailio, it is never received.
Here is the route part of kamailio.cfg in *B*:
Observation: ($rU == "1004") result is *true* * if(is_method("MESSAGE")) { if($rU == "1004") { xlog("L_INFO","En 1004");
rewritehost("10.8.0.1");
if (!t_relay()) xlog("L_INFO","MIO Error en t_relay");
t_reply("200", "Ok"); xlog("L_INFO","MIO despues rewrite"); exit; } .....*
The perl script that WORKS:
*$msg = 'MESSAGE sip:1004@192.168.1.2:5060 SIP/2.0 Via: SIP/2.0/UDP 192.168.1.2 From: "2002" <sip:2002@192.168.1.2 <sip%3A2002@192.168.1.2>
;tag=1837944796 To: <sip:1004@192.168.1.2 <sip%3A1004@192.168.1.2>> Call-ID: 19722852989@192.168.1.2 CSeq: 15773 MESSAGE Contact: <sip:2002@**PublicIP-protected**:5060> Max-Forwards: 29 User-Agent: DBL Content-Type: text/plain Content-Length: 34
+595981[protected] hello from kamailio ';
use IO::Socket;
my $sock = IO::Socket::INET->new( Proto=>'udp', PeerHost=>'192.168.2.102', PeerPort=>'5060');
print "Sending msg $msg\n";
$sock->send($msg) or die "error sending $!\n";
*Please help!
Thanks in advance.
Carlos.
Nice post. I have also started using Nord vpn for android <https://www.reviewsdir.com/best-vpn-android/> and it is really very good. But before buying this I did a lot of research and found a lot of options. I had to find a good service which is affordable and NordVPN provides amazing functionalities at very affordable prices. -- View this message in context: http://sip-router.1086192.n5.nabble.com/Problem-with-t-relay-and-VPN-tunnel-... Sent from the Users mailing list archive at Nabble.com.
participants (3)
-
Alex Balashov -
Carlos Ruiz Diaz -
Rogar8