[SR-Users] 2 kamailio servers sharing one database and one dns name

David Thomson jdavidthomson at hotmail.com
Fri Mar 22 05:19:10 CET 2013


Hi Barry,

Thanks for trying to help me out. 

Unfortunately your suggestion didn't work out. Not sure why. I tried a few other functions like t_relay_to. 

Guess I still have a lot to learn about this kamailio stuff in more complex setups. 

Any other ideas, anyone?

Ttyl,
Dave
-----Original Message-----
From: Barry Flanagan <barry at flanagan.ie>
Date: Thu, 21 Mar 2013 12:01:18 
To: <sr-users at lists.sip-router.org>
Subject: Re: [SR-Users] 2 kamailio servers sharing one database and one dns
	name

On 20 March 2013 03:05, David Thomson <jdavidthomson at hotmail.com <mailto:jdavidthomson at hotmail.com> > wrote:

 

 
hi,


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 siptest.testdomain.com <http://siptest.testdomain.com>  with 2 public ip's - one for Server1 and one for Server2) and setup in round robin mode. 


The scenario is as follows:
User 1 registers to Server1
User 2 registers to Server2


User1 tries to call User2 but Server1 throws an error and the call doesn't ever connect to User2: 


 WARNING: usrloc [udomain.c:321]: non-local socket <udp:xxx.xxx.xxx.xxx:5060>...ignoring.  






Hi

 
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. 


I did this many years ago on OpenSER using the following just before the consume_credentials() line.  


On each of the servers you want to check that the src_ip is not that of the OTHER sever so they don't keep sending back and forth forever :-) So in the example below 10.0.1.1 is the IP of the other server. 


--------8<-----------------------------------------

       if (!src_ip==10.0.1.1) {
               t_replicate("udp:10.0.1.1:5060 <http://10.0.1.1:5060> "); 
               xlog("L_INFO", "Replicating $ct, URI = $ru");
       };


       consume_credentials();
--------8<----------------------------------------- 


Have a look at http://www.kamailio.org/docs/modules/3.3.x/modules/tm.html#t_replicate


Hope this helps. 


-Barry



More information about the sr-users mailing list