On 20 March 2013 03:05, David Thomson <span dir="ltr">&lt;<a href="mailto:jdavidthomson@hotmail.com" target="_blank">jdavidthomson@hotmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div dir="ltr">



<div dir="ltr">hi,<div><br></div><div>I have two kamailio 3.3.4 servers sharing one database.  usrloc module is loaded on both machines.  The DNS name for the machines is shared (i.e <a href="http://siptest.testdomain.com" target="_blank">siptest.testdomain.com</a> with 2 public ip&#39;s - one for Server1 and one for Server2) and setup in round robin mode.</div>

<div><br></div><div>The scenario is as follows:</div><div>User 1 registers to Server1</div><div>User 2 registers to Server2</div><div><br></div><div>User1 tries to call User2 but Server1 throws an error and the call doesn&#39;t ever connect to User2:</div>

<div><br></div><div> WARNING: usrloc [udomain.c:321]: non-local socket &lt;udp:xxx.xxx.xxx.xxx:5060&gt;...ignoring.  </div><div><br></div></div></div></div></blockquote><div><br></div><div><br></div><div>Hi</div><div><br>

</div><div>I think you can use the t_replicate function within your register route so that each server will replicate the registration request to the other. </div><div><br></div><div>I did this many years ago on OpenSER using the following just before the consume_credentials() line. </div>

<div><br></div><div>On each of the servers you want to check that the src_ip is not that of the OTHER sever so they don&#39;t keep sending back and forth forever :-) So in the example below 10.0.1.1 is the IP of the other server.</div>

<div><br></div><div>--------8&lt;-----------------------------------------</div><div><div>       if (!src_ip==10.0.1.1) {</div><div>               t_replicate(&quot;udp:<a href="http://10.0.1.1:5060">10.0.1.1:5060</a>&quot;);</div>

<div>               xlog(&quot;L_INFO&quot;, &quot;Replicating $ct, URI = $ru&quot;);</div><div>       };</div><div><br></div><div>       consume_credentials();</div></div><div>--------8&lt;-----------------------------------------</div>

<div><br></div><div>Have a look at <a href="http://www.kamailio.org/docs/modules/3.3.x/modules/tm.html#t_replicate">http://www.kamailio.org/docs/modules/3.3.x/modules/tm.html#t_replicate</a></div><div><br></div><div>Hope this helps.</div>

<div><br></div><div>-Barry</div><div><br></div></div>