<div dir="ltr">First of all thank you for your replies.<div><br></div><div>I think I am quite close to solution. But still have NAT issues in some cases.</div><div><br></div><div>I have added a bunch of code to the standard kamailio script.</div>
<div><br></div><div>I defined a new flag</div><div><div><font face="courier new, monospace">#!define SOCK_FLAG 8</font></div></div><div><font face="courier new, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">added these parameters to registrar module.</font></div>
<div><div><font face="courier new, monospace">modparam("registrar", "sock_flag", SOCK_FLAG)</font></div><div><font face="courier new, monospace">modparam("registrar", "sock_hdr_name", "Sock-Info")</font></div>
<div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">set this flag in the nat test section </div><div><div><font face="courier new, monospace">        if (nat_uac_test("19")) {</font></div>
<div><font face="courier new, monospace">                if (is_method("REGISTER")) {</font></div><div><font face="courier new, monospace">                        fix_nated_register();</font></div><div><font face="courier new, monospace">                } else {</font></div>
<div><font face="courier new, monospace">                        fix_nated_contact();</font></div><div><font face="courier new, monospace">                }</font></div><div><font face="courier new, monospace">                setflag(FLT_NATS);</font></div>
<div><font face="courier new, monospace">                setflag(SOCK_FLAG);</font></div><div><font face="courier new, monospace">        }</font></div></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">
and send it to the peer proxy to replicate client registration. I also added received parameter to the replicated packet.</div><div><div><font face="courier new, monospace">                if ($si!=$sel(cfg_get.peer.srv_ip))</font></div>
<div><font face="courier new, monospace">                {</font></div><div><font face="courier new, monospace">                        add_rcv_param();</font></div><div><font face="courier new, monospace">                        t_replicate("sip:10.173.187.226:5060;transport=udp");</font></div>
<div><font face="courier new, monospace">                }</font></div></div><div style="font-family:arial,helvetica,sans-serif"><br></div></div><div><br></div><div>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.</div>
<div><br></div><div><div><font face="courier new, monospace"><span class="" style="white-space:pre">    </span>AOR:: <a href="mailto:1002@test.example.net">1002@test.example.net</a></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">              </span>Contact:: sip:1002@10.173.191.72:1031;transport=udp;registering_acc=test_</font><span style="font-family:'courier new',monospace">example</span><font face="courier new, monospace">_net Q=</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Expires:: 544</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                     </span>Callid:: 443bb84315de2e2b637a55ab44c0b759@0:0:0:0:0:0:0:0</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Cseq:: 256</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>User-agent:: Jitsi2.4.4997Linux</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Received:: sip:<a href="http://10.173.191.72:1024">10.173.191.72:1024</a></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                   </span>State:: CS_NEW</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Flags:: 0</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                 </span>Cflag:: 192</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Socket:: udp:<a href="http://10.192.208.194:5060">10.192.208.194:5060</a></font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                   </span>Methods:: 4294967295</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Ruid:: uloc-52de6613-3dd4-28</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                      </span>Reg-Id:: 0</font></div>
<div><font face="courier new, monospace"><span class="" style="white-space:pre">                        </span>Last-Keepalive:: 1390512267</font></div><div><font face="courier new, monospace"><span class="" style="white-space:pre">                       </span>Last-Modified:: 1390512267</font></div>
</div><div><br></div><div>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?</div>
<div><br></div><div>Thanks.</div><div><br></div><div>/Volkan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/21 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    run with debug=3 in config file and see if there are log messages
    that gives you more details about what happens.<br>
    <br>
    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.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 19/01/14 14:05, Volkan Oransoy
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hi all,
        <div><br>
        </div>
        <div>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. </div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">route[REGISTRAR]
            {<br>
                    if (is_method("REGISTER"))<br>
                    {<br>
                            if(isflagset(FLT_NATS))<br>
                            {<br>
                                    setbflag(FLB_NATB);<br>
                            }<br>
                            if (!save("location"))<br>
                                    sl_reply_error();<br>
                           
            t_replicate(<a>"sip:10.1.1.2:5060;transport=udp"</a>);<br>
                            exit;<br>
                    }<br>
            }</blockquote>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>Does anyone have an idea about this kind of an active
          active setup?</div>
        <div><br>
        </div>
        <div>Thanks in advance. Best regards,</div>
        <div><br>
        </div>
        <div>/Volkan</div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a></pre>
  </font></span></div>

<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" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>