First of all thank you for your replies.

I think I am quite close to solution. But still have NAT issues in some cases.

I have added a bunch of code to the standard kamailio script.

I defined a new flag
#!define SOCK_FLAG 8

added these parameters to registrar module.
modparam("registrar", "sock_flag", SOCK_FLAG)
modparam("registrar", "sock_hdr_name", "Sock-Info")

set this flag in the nat test section 
        if (nat_uac_test("19")) {
                if (is_method("REGISTER")) {
                        fix_nated_register();
                } else {
                        fix_nated_contact();
                }
                setflag(FLT_NATS);
                setflag(SOCK_FLAG);
        }

and send it to the peer proxy to replicate client registration. I also added received parameter to the replicated packet.
                if ($si!=$sel(cfg_get.peer.srv_ip))
                {
                        add_rcv_param();
                        t_replicate("sip:10.173.187.226:5060;transport=udp");
                }


Now, the issue is, the original proxy that receives the registration works as expected.Replicated proxy, has the location data as expected. But if I sent a call over second proxy, UA does not respond. I can see the INVITE packet that comes from replicated proxy on my client PC, but UA does not respond to INVITE that comes from second proxy.

AOR:: 1002@test.example.net
Contact:: sip:1002@10.173.191.72:1031;transport=udp;registering_acc=test_example_net Q=
Expires:: 544
Callid:: 443bb84315de2e2b637a55ab44c0b759@0:0:0:0:0:0:0:0
Cseq:: 256
User-agent:: Jitsi2.4.4997Linux
Received:: sip:10.173.191.72:1024
State:: CS_NEW
Flags:: 0
Cflag:: 192
Socket:: udp:10.192.208.194:5060
Methods:: 4294967295
Ruid:: uloc-52de6613-3dd4-28
Reg-Id:: 0
Last-Keepalive:: 1390512267
Last-Modified:: 1390512267

This is the ul show output on original proxy. Replicated proxy has nearly same values except Cflag and Socket. On replicated proxy, Cflag is 0 and Socket points to the original proxy. Is this output normal? Do I have anything missing in the setup?

Thanks.

/Volkan


2014/1/21 Daniel-Constantin Mierla <miconda@gmail.com>
Hello,

run with debug=3 in config file and see if there are log messages that gives you more details about what happens.

Typically, when doing replication, you may need to replicate received and sometime socket information -- that can be done via headers and then added to avps before saving to location in the second peer. Look at the readme of registrar module for those parameters.

Cheers,
Daniel


On 19/01/14 14:05, Volkan Oransoy wrote:
Hi all,

I am trying to setup an active-active pair of sip proxies. I have connected two kamailio boxes to the same PostgreSQL database and my usrloc db_mode is 3. I can see the registration data in the database but "ul show" outputs of two device is not same. I think writing registration data to the same db is not enough. 

I have found a method to replicate the registraiton process. With t_replicate, I synchronize REGISTER requests to both boxes. But I had to disable shared database because of uniqe id validations.

route[REGISTRAR] {
        if (is_method("REGISTER"))
        {
                if(isflagset(FLT_NATS))
                {
                        setbflag(FLB_NATB);
                }
                if (!save("location"))
                        sl_reply_error();
                t_replicate("sip:10.1.1.2:5060;transport=udp");
                exit;
        }
}


My media servers randomly sends calls to SIP proxies. If Media server send the call to the original registrar then the replicated, call initiates normally. But when UA registered in first proxy, and Media server sends the call to the send one, even if second one has UA in location table, call does not initiate.

Does anyone have an idea about this kind of an active active setup?

Thanks in advance. Best regards,

/Volkan


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users