<div dir="ltr">The problem was in invalid nonce value as you can see from the debug message<br><br><div style="font-size:12.8px"><font face="monospace, monospace"> 0(3411) DEBUG: auth [api.c:136]: auth_check_hdr_md5(): auth:pre_auth: Invalid nonce value received (ret 2)</font></div><div><font face="monospace, monospace"><br></font></div><br>I was debugging for a while and I was also analyzing pcap dump when I realized that kamailioB was forwarding and both replying for the REGISTER message eg. UA answered first for 401 Unauthorized from kamailioB with it's nonce which was of course on both kamailio's invalid (kamailioB does not have UA registered and kamailioA was expecting different nonce). This was happening over and over and it was unable to sync the nonce's so I was getting 401 Unauthorized over and over.<div><br></div><div><br></div><div>After that i just simply add <font face="monospace, monospace">exit()</font> after the <font face="monospace, monospace">forward()</font>, kamailioB stopped responsing for the REGISTER and everything started to work.</div><div><br></div><div><br></div><div>I hope that this response will help in the future someone who forget to exit after forwarding the request :-)</div><div><br></div><div>Thanks anyway</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 7, 2016 at 7:50 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    run kamailio with debug=3 in kamailio.cfg, you should see more
    details about what happens during authorization time.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 06/03/16 19:35, Cockhootec Yahrabee
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">Hi everyone,
        <div><br>
        </div>
        <div>I am trying to forward registration from one kamailio
          instance to another one eg.</div>
        <div><br>
        </div>
        <div><font face="monospace, monospace">UA1 <---> kamailioB
            <------> kamailioA</font></div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I am trying to register on `kamailioA` with UA1. I have UA1
          registered on kamailioA. I am routing SIP messages by adding
          this to `request_route` block:<br>
          <br>
          <div><font face="monospace, monospace">        if (uri !=
              myself)</font></div>
          <div><font face="monospace, monospace">        {</font></div>
          <div><font face="monospace, monospace">               
              forward(otherKamailioIP, 5060);</font></div>
          <div><font face="monospace, monospace">        }</font></div>
        </div>
        <div><br>
        </div>
        <div>Where I am using as `otherKamilioIP on kamailioA the
          kamailioB IP address and vice versa.</div>
        <div><br>
        </div>
        <div>I can clearly see in Wireshark, that the SIP messages are
          routed correctly but I am getting 401 Unauthorized which is
          sent from kamailioA to kamailioB and then from kamailioB to
          UA1.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I printed value of `auth_check` following this <a href="http://lists.sip-router.org/pipermail/sr-users/2014-November/085851.html" target="_blank"></a><a href="http://lists.sip-router.org/pipermail/sr-users/2014-November/085851.html" target="_blank">http://lists.sip-router.org/pipermail/sr-users/2014-November/085851.html</a>
          and I am getting return code of `-1` which is according to the
          documentation <a href="http://kamailio.org/docs/modules/4.2.x/modules/auth_db.html#auth_db.f.www_authenticate" target="_blank">http://kamailio.org/docs/modules/4.2.x/modules/auth_db.html#auth_db.f.www_authenticate</a>
          the GENERIC ERROR.</div>
        <div><br>
        </div>
        <div>I don't know what to do next. Does anyone encounter this
          kind of error before?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thanks in advance</div>
        <div><br>
        </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://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>
Kamailio Advanced Training, Berlin, March 7-9, 2016 - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</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" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>