<div dir="ltr">Cool! Thanks for the fast and thorough response. I will try this out. Would TCP not work the same way, if I omit udp? </div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 27, 2017 at 12:08 AM, Alex Balashov <span dir="ltr"><<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Nov 27, 2017 at 12:00:10AM -0500, Daniel Greenwald wrote:<br>
<br>
> Should Kam put two record-route headers on, one with PUBLICIP and one<br>
> with PRIVATEIP? How is this accomplished?<br>
<br>
</span>Yep, you're exactly on the right track.<br>
<br>
For purposes of this discussion, 10.0.0.1 is the internal IP (and also<br>
the IP to which an external IP is NAT'd), 192.0.0.1 is the public<br>
IP, and we're using UDP only.<br>
<br>
1) Add two listeners on the same interface, one of which advertises the<br>
public interface and the other of which does not[1], e.g.<br>
<br>
   # "External" interface.<br>
<br>
   listen=udp:<a href="http://10.0.0.1:5060" rel="noreferrer" target="_blank">10.0.0.1:5060</a> advertise <a href="http://192.0.0.1:5060" rel="noreferrer" target="_blank">192.0.0.1:5060</a><br>
<br>
   # "Internal" interface. Same network address, but by necessity,<br>
   # different port.<br>
<br>
   listen=udp:<a href="http://10.0.0.1:5080" rel="noreferrer" target="_blank">10.0.0.1:5080</a><br>
<br>
2) Use the following setting to enable double Record-Route, though it's<br>
on by default so if it's not set you can just omit it.<br>
<br>
   modparam("rr", "enable_double_rr", 1)<br>
<br>
3) Set mhomed=0[3] as its routing logic will fail you here, and use<br>
$fs[4] to steer initial requests manually, e.g.<br>
<br>
   route[INBOUND_INVITE] {<br>
      ...<br>
<br>
      $fs = 'udp:<a href="http://10.0.0.1:5080" rel="noreferrer" target="_blank">10.0.0.1:5080</a>';<br>
<br>
      if(!t_relay())<br>
         sl_reply_error();<br>
   }<br>
<br>
   route[OUTBOUND_INVITE] {<br>
      ...<br>
<br>
      $fs = 'udp:<a href="http://10.0.0.1:5060" rel="noreferrer" target="_blank">10.0.0.1:5060</a>';<br>
<br>
      if(!t_relay())<br>
         sl_reply_error();<br>
   }<br>
<br>
Do the same for any other types of _initial_ requests you wish to route<br>
between the interfaces, e.g. if you're passing on REGISTERs, SUBSCRIBE,<br>
etc.<br>
<br>
4) Profit. Everything else should fall into place "automagically",<br>
including a) in-dialog requests, by way of the appropriate Route set and<br>
b) replies.<br>
<br>
-- Alex<br>
<br>
[1] <a href="https://www.kamailio.org/wiki/cookbooks/5.0.x/core#listen" rel="noreferrer" target="_blank">https://www.kamailio.org/wiki/<wbr>cookbooks/5.0.x/core#listen</a><br>
<br>
[2] <a href="https://kamailio.org/docs/modules/5.0.x/modules/rr.html#idp25575876" rel="noreferrer" target="_blank">https://kamailio.org/docs/<wbr>modules/5.0.x/modules/rr.html#<wbr>idp25575876</a><br>
<br>
[3] <a href="https://www.kamailio.org/wiki/cookbooks/5.0.x/core#mhomed" rel="noreferrer" target="_blank">https://www.kamailio.org/wiki/<wbr>cookbooks/5.0.x/core#mhomed</a><br>
<br>
[4] <a href="https://www.kamailio.org/wiki/cookbooks/5.0.x/pseudovariables#fs_-_forced_socket" rel="noreferrer" target="_blank">https://www.kamailio.org/wiki/<wbr>cookbooks/5.0.x/<wbr>pseudovariables#fs_-_forced_<wbr>socket</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: <a href="tel:%2B1-706-510-6800" value="+17065106800">+1-706-510-6800</a> / <a href="tel:%2B1-800-250-5920" value="+18002505920">+1-800-250-5920</a> (toll-free)<br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</font></span></blockquote></div><br></div>