<div dir="ltr"><font color="#3366ff"><font><font face="tahoma,sans-serif">Thanks Richard for the tip :)<br></font></font></font><div dir="ltr"><font color="#3366ff" face="tahoma, sans-serif"><br></font><div><font color="#3366ff" face="tahoma, sans-serif">Reda</font></div>

</div><br>
<br><br><div class="gmail_quote">On Sun, Jun 24, 2012 at 7:28 PM, Richard Brady <span dir="ltr">&lt;<a href="mailto:rnbrady@gmail.com" target="_blank">rnbrady@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Reda<br>
<br>
A bit late for a reply but I found your post recently and it helped me<br>
to solve a similar problem, so I wanted to share one possible<br>
solution.<br>
<div class="im"><br>
On 21 January 2012 23:19, Reda Aouad &lt;<a href="mailto:reda.aouad@gmail.com">reda.aouad@gmail.com</a>&gt; wrote:<br>
&gt; After endless tests, I tried to replace record_route_preset with insert_hf,<br>
&gt; writing the complete record route headers. A light started to come out of<br>
&gt; the tunnel.....<br>
&gt;<br>
&gt; Suppose User A is registered to port 53, User B to port 5060.<br>
&gt;<br>
&gt; In the case of double record route, when A sends an INVITE to B, I write the<br>
&gt; following in the SIP header of the INVITE forwarded to B :<br>
&gt; Record-Route: &lt;sip:public_ip:5060;r2=on;lr=on&gt;<br>
&gt; Record-Route: &lt;sip:public_ip:53;r2=on;lr=on&gt;<br>
&gt;<br>
&gt; The first transaction, INVITE / 200OK goes well, with Kamailio forwarding<br>
&gt; packets correctly from the corresponding socket of each user.<br>
&gt;<br>
&gt; The problem arises when User B sends BYE to the 5060 port, with both route<br>
&gt; headers in the SIP header of the BYE. I get the following error :<br>
&gt;     WARNING: rr [loose.c:747]: no socket found for match second RR<br>
&gt;<br>
&gt; after which Kamailio forwards the BYE from the 5060 socket to User A. User A<br>
&gt; being registered on port 53, ignores the packet coming with source port<br>
&gt; 5060. The BYE is never replied to.<br>
&gt;<br>
&gt; I guess that means that Kamailio is not able to find the private_ip:53<br>
&gt; socket from the public_ip:53 record-route header.<br>
&gt; I hope it was clear.<br>
<br>
</div>One way to get around this is to populate the RR with a hostname<br>
instead of an address. Then you can configure it so that the external<br>
clients resolve public_ip but the Kamailio server itself resolves<br>
private_ip. This can be done through an entry in /etc/hosts to<br>
override the public DNS entry.<br>
<br>
Not exactly elegant but it works for me.<br>
<div class="im"><br>
&gt; I think there&#39;s a fundamental issue with running Kamailio behind NAT and<br>
&gt; listening on multiple port numbers. Am I the only one suffering from this<br>
&gt; type of configuration?<br>
&gt;<br>
&gt; (Part of the problem is also tied to dumb ALG NAT routers which try to<br>
&gt; out-smart SIP servers, without which I wouldn&#39;t run Kamailio on multiple<br>
&gt; ports, and life would be much easier)<br>
<br>
</div>Regards,<br>
Richard<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>