[SR-Users] Problem with t_relay() and VPN tunnel

Alex Balashov abalashov at evaristesys.com
Fri Aug 6 01:51:28 CEST 2010


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_socket

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 at 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 at 192.168.1.2
> <mailto:sip%3A2002 at 192.168.1.2>>;tag=1837944796
> To: <sip:1004 at 192.168.1.2 <mailto:sip%3A1004 at 192.168.1.2>>
> Call-ID: 19722852989 at 192.168.1.2 <mailto:19722852989 at 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 at 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/



More information about the sr-users mailing list