Hey Klaus<div><br></div><div>The way you described works for me (on EC2) and I think is a good solution.</div><div><br></div><div>Be sure to set mhomed=1 in your config.</div><div><br></div><div>Richard</div><div><br><div class="gmail_quote">
On 4 January 2013 17:57, Ovidiu Sas <span dir="ltr">&lt;<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello Klauss,<br>
<br>
I use record_route_preset for this kind of scenarios:<br>
<a href="http://kamailio.org/docs/modules/3.3.x/modules_k/rr.html#id2550086" target="_blank">http://kamailio.org/docs/modules/3.3.x/modules_k/rr.html#id2550086</a><br>
That was the main reason that I enhanced record_route_preset with the<br>
second parameter (see the Note on string2).<br>
<br>
I haven&#39;t tried your idea with two sockets.  Let us know if it&#39;s working.<br>
If you need to use the same port on the internal and external<br>
interface, you could add a new IP to the host and listen on two<br>
sockets on the same port and force the socket when sending a request<br>
out.<br>
listen=udp:10.10.0.2<br>
listen=udp:10.10.0.3 advertise pu.bl.ic.ip<br>
<br>
<br>
Regards,<br>
Ovidiu Sas<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
VoIP Embedded, Inc.<br>
<a href="http://www.voipembedded.com" target="_blank">http://www.voipembedded.com</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, Jan 3, 2013 at 5:11 AM, Klaus Darilion<br>
&lt;<a href="mailto:klaus.mailinglists@pernau.at">klaus.mailinglists@pernau.at</a>&gt; wrote:<br>
&gt; Hi!<br>
&gt;<br>
&gt; Up to now I could avoid Kamailio setups with Kamailio behind NAt. But this<br>
&gt; time I have to deal with it. That&#39;s why I want to ask what others did as<br>
&gt; best practice.<br>
&gt;<br>
&gt; The scenario is:<br>
&gt;<br>
&gt;<br>
&gt; Asterisk 1----\       Kamailio+RTPPROXY<br>
&gt;                \         |10.10.0.2<br>
&gt; Asterisk n------\        |<br>
&gt;                  --------|------------- FW --SIP-trunk--- ITSP<br>
&gt; Freeswitch 1----/              10.10.0.1   public-IP<br>
&gt;                /<br>
&gt; Freeswitch n--/<br>
&gt;            10.10.0.x<br>
&gt;<br>
&gt; Kamailio and rtpproxy have a private IP. Internal communication uses private<br>
&gt; IPs, external communication uses a public IP which is NATed 1:1 to<br>
&gt; Kamailio&#39;s IP address. No registrations, just forwarding of messages.<br>
&gt;<br>
&gt; Using the global &quot;advertised_address&quot; setting with the public IP does not<br>
&gt; work, as there is also internal communication. Using<br>
&gt; set_advertised_address() is also cumbersome.<br>
&gt;<br>
&gt; So it seems, the easiest solution would be to use 2 sockets on Kamailio,<br>
&gt; e.g. port 5050 and port 5060. Then I could use the listen with dedicated<br>
&gt; advertised addresses:<br>
&gt; listen=udp:<a href="http://10.10.0.2:5050" target="_blank">10.10.0.2:5050</a><br>
&gt; listen=udp:<a href="http://10.10.0.2:5060" target="_blank">10.10.0.2:5060</a> advertise pu.bl.ic.ip:5060<br>
&gt;<br>
&gt; If I understand it correctly, this should solve all issues with<br>
&gt; Record-Routing and Via-headers.<br>
&gt;<br>
&gt; For RTP-Proxy it seems necessary to detect the direction of each message and<br>
&gt; set the IP address in rtpproxy_manage(&quot;&quot;,&quot;ip.add.re.ss&quot;) manually.<br>
&gt;<br>
&gt; Thus, it seems straight forward - or do I miss something? Any comments and<br>
&gt; practical experience?<br>
&gt;<br>
&gt; Thanks<br>
&gt; Klaus<br>
<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>