The IP: <i>192.168.2.102 </i>corresponds to address in LAN <b>A</b>, <i>10.8.0.1</i> is the VPN address of the same machine in the <b>A</b> network. Switching from one to another still results in Perl script working and Kamailio not working.<br>
<br><div class="gmail_quote">On Thu, Aug 5, 2010 at 7:48 PM, Carlos Ruiz Diaz <span dir="ltr"><<a href="mailto:carlos.ruizdiaz@gmail.com">carlos.ruizdiaz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I have two SIP servers, <b>A</b> and <b>B</b>, connected each other though a OPENVPN tunnel. The server <b>B</b> needs to t_relay() every SIP message containing the method MESSAGE to the server <b>A</b> but these messages never reach destination. <br>
<br>I have tested the tunnel connectivity and works fine. I wrote a Perl script (located in <b>B</b>) that sends SIP MESSAGES to Kamailio (located in <b>A</b>) trying to figure out what is happening but these messages are received by <b>A</b> and processed correctly but when <b>B</b> does the same from Kamailio, it is never received.<br>
<br>Here is the route part of kamailio.cfg in <b>B</b>:<br><br>Observation: ($rU == "1004") result is <b>true</b><br><i><br> if(is_method("MESSAGE"))<br> { <br> if($rU == "1004") <br>
{<br> xlog("L_INFO","En 1004");<br><br> rewritehost("10.8.0.1");<br><br> if (!t_relay())<br> xlog("L_INFO","MIO Error en t_relay");<br>
<br> t_reply("200", "Ok");<br> xlog("L_INFO","MIO despues rewrite");<br> exit;<br> }<br>
.....</i> <br><br>The perl script that WORKS:<br><br><i>$msg = 'MESSAGE <a href="http://sip:1004@192.168.1.2:5060" target="_blank">sip:1004@192.168.1.2:5060</a> SIP/2.0<br>Via: SIP/2.0/UDP 192.168.1.2<br>From: "2002" <<a href="mailto:sip%3A2002@192.168.1.2" target="_blank">sip:2002@192.168.1.2</a>>;tag=1837944796<br>
To: <<a href="mailto:sip%3A1004@192.168.1.2" target="_blank">sip:1004@192.168.1.2</a>><br>Call-ID: <a href="mailto:19722852989@192.168.1.2" target="_blank">19722852989@192.168.1.2</a><br>CSeq: 15773 MESSAGE<br>Contact: <sip:2002@</i><i><b>PublicIP-protected</b></i><i>:5060><br>
Max-Forwards: 29<br>User-Agent: DBL<br>Content-Type: text/plain<br>Content-Length: 34<br><br>+595981[<b>protected</b>]<br>hello from kamailio<br>';<br><br>use IO::Socket;<br><br>my $sock = IO::Socket::INET->new( Proto=>'udp',<br>
PeerHost=>'192.168.2.102',<br> PeerPort=>'5060');<br><br>print "Sending msg $msg\n";<br><br>$sock->send($msg) or die "error sending $!\n";<br>
<br></i>Please help!<br><br>Thanks in advance.<br><font color="#888888"><br>Carlos.<br><br>
</font></blockquote></div><br>