[SR-Users] Dispatcher with kam & fs behind nat

Daniel Greenwald dgreenwald at gmail.com
Mon Nov 27 06:28:26 CET 2017


Cool! Thanks for the fast and thorough response. I will try this out. Would
TCP not work the same way, if I omit udp?

On Mon, Nov 27, 2017 at 12:08 AM, Alex Balashov <abalashov at evaristesys.com>
wrote:

> On Mon, Nov 27, 2017 at 12:00:10AM -0500, Daniel Greenwald wrote:
>
> > Should Kam put two record-route headers on, one with PUBLICIP and one
> > with PRIVATEIP? How is this accomplished?
>
> Yep, you're exactly on the right track.
>
> For purposes of this discussion, 10.0.0.1 is the internal IP (and also
> the IP to which an external IP is NAT'd), 192.0.0.1 is the public
> IP, and we're using UDP only.
>
> 1) Add two listeners on the same interface, one of which advertises the
> public interface and the other of which does not[1], e.g.
>
>    # "External" interface.
>
>    listen=udp:10.0.0.1:5060 advertise 192.0.0.1:5060
>
>    # "Internal" interface. Same network address, but by necessity,
>    # different port.
>
>    listen=udp:10.0.0.1:5080
>
> 2) Use the following setting to enable double Record-Route, though it's
> on by default so if it's not set you can just omit it.
>
>    modparam("rr", "enable_double_rr", 1)
>
> 3) Set mhomed=0[3] as its routing logic will fail you here, and use
> $fs[4] to steer initial requests manually, e.g.
>
>    route[INBOUND_INVITE] {
>       ...
>
>       $fs = 'udp:10.0.0.1:5080';
>
>       if(!t_relay())
>          sl_reply_error();
>    }
>
>    route[OUTBOUND_INVITE] {
>       ...
>
>       $fs = 'udp:10.0.0.1:5060';
>
>       if(!t_relay())
>          sl_reply_error();
>    }
>
> Do the same for any other types of _initial_ requests you wish to route
> between the interfaces, e.g. if you're passing on REGISTERs, SUBSCRIBE,
> etc.
>
> 4) Profit. Everything else should fall into place "automagically",
> including a) in-dialog requests, by way of the appropriate Route set and
> b) replies.
>
> -- Alex
>
> [1] https://www.kamailio.org/wiki/cookbooks/5.0.x/core#listen
>
> [2] https://kamailio.org/docs/modules/5.0.x/modules/rr.html#idp25575876
>
> [3] https://www.kamailio.org/wiki/cookbooks/5.0.x/core#mhomed
>
> [4] https://www.kamailio.org/wiki/cookbooks/5.0.x/
> pseudovariables#fs_-_forced_socket
>
> --
> Alex Balashov | Principal | Evariste Systems LLC
>
> Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20171127/1fca15fc/attachment.html>


More information about the sr-users mailing list