<div dir="ltr"><div><div><div><div>Hi Daniel,<br><br></div>Maybe you can share with me full config of your load-balancer? It will be really nice if I can take a look on it. I'm very new in kamailio and for me is very difficult to complile working config from short code snippets. :)<br><br></div>You mentioned that you have 2 load-balancer. Does this 2 load-balancers share one domain-name?<br><br></div><div>I was thinking to use dispatcher module for load balancing. Do you use dispatcher module in your config?<br></div><div><br></div>With kind regards,<br><br></div>Jurijs<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-21 12:25 GMT+03:00 Daniel Tryba <span dir="ltr"><<a href="mailto:d.tryba@pocos.nl" target="_blank">d.tryba@pocos.nl</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tuesday 21 July 2015 11:13:15 Jurijs Ivolga wrote:<br>
> My set-up is working as it is with default settings, when 2 servers share<br>
> same DB in case if our subscribers do not use NAT.<br>
><br>
> If subscribers are behind NAT, then in this case such set-up will not work,<br>
> as described here:<br>
><br>
> <a href="http://kb.smartvox.co.uk/opensips/clustering-opensips-part-2/" rel="noreferrer" target="_blank">http://kb.smartvox.co.uk/opensips/clustering-opensips-part-2/</a><br>
><br>
> Please check diagram under "Far-end NAT traversal on multi-homed or<br>
> clustered servers".<br>
<br>
Adding the Path header on save() should solve this problem. The top most path<br>
is either the register server itself or the other one. If it is the otherone<br>
the INVITE should be send there. But like I said in<br>
<a href="http://lists.sip-router.org/pipermail/sr-users/2015-April/087872.html" rel="noreferrer" target="_blank">http://lists.sip-router.org/pipermail/sr-users/2015-April/087872.html</a><br>
I hate NAT :(<br>
<br>
I didn't look further into my routing problems but solved it with<br>
loadbalancers.<br>
<br>
> I believe in my case solution will be only when I will have one more<br>
> Kamailio in front of my servers and it will dispatch all request to 2<br>
> servers, in this case I will eliminate this NAT issue.<br>
<br>
This solved my problem. Path points to loadbalancer and received in path to<br>
the external received address/port.<br>
<br>
UA1 registered to register1 via loadbalancer1<br>
UA2 registered to register2 via loadbalancer2<br>
<br>
if UA1 calls UA2, the call will go:<br>
UA1->LB1->random register->LB2 (based on path)->UA2 (based on path)<br>
<br>
These loadbalancers are very simple and essentially stateless.<br>
<br>
modparam("path", "use_received", 1)<br>
<br>
...<br>
<br>
request_route {<br>
        route(NATDETECT);<br>
        route(WITHINDLG);<br>
<br>
        if (is_method("INVITE|SUBSCRIBE"))<br>
        {<br>
                record_route();<br>
        }<br>
<br>
        if(!is_in_subnet($si, "myvoicesubnet"))<br>
        {<br>
                add_path_received("vialoadalancers");<br>
                $rd="mydomain";<br>
<br>
                ds_select_dst(1, 0);<br>
                t_on_failure("RTF_DISPATCH");<br>
        }<br>
        else<br>
        {<br>
                add_path("fromregistrars");<br>
<br>
                remove_hf("Route");<br>
<br>
                loose_route();<br>
        }<br>
<br>
        route(RELAY);<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
<br>
Telefoon: 088 0100 700<br>
Sales: <a href="mailto:sales@pocos.nl">sales@pocos.nl</a> | Service: <a href="mailto:servicedesk@pocos.nl">servicedesk@pocos.nl</a><br>
<a href="http://www.pocos.nl/" rel="noreferrer" target="_blank">http://www.pocos.nl/</a> | Croy 9c, 5653 LC Eindhoven | Kamer van Koophandel<br>
17097024<br>
<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" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</font></span></blockquote></div><br></div>