<div dir="ltr"><div><div>Hi Bogdan,<br><br></div><div>Yes you are correct, it is a retransmission.<br><br>I've specifed port 5060 as the forced_socket in the registrant table but opensips (1.2.3.4 below) doesn't use it. Is there a way to force uac_registrant to use 5060, or alternatively make the uac_registrant module listen for replies on whatever port it decides to open ?<br><br>T 2017/04/21 11:05:26.960562 <a href="http://1.2.3.4:52945">1.2.3.4:52945</a> -> <a href="http://4.3.2.1:5060">4.3.2.1:5060</a> [AP]<br>REGISTER sip:<a href="http://imsreg.example.com">imsreg.example.com</a> SIP/2.0.<br><br>T 2017/04/21 11:05:27.381976 <a href="http://4.3.2.1:5060">4.3.2.1:5060</a> -> <a href="http://1.2.3.4:52945">1.2.3.4:52945</a> [AP]<br>SIP/2.0 401 Unauthorized.<br></div><div><br><br>mysql> SELECT * FROM registrant \G<br>*************************** 1. row ***************************<br>                    id: 1<br>             registrar: sip:<a href="http://imsreg.example.com">imsreg.example.com</a><br>                 proxy: NULL<br>                   aor: <a href="mailto:sip%3A%2B98765432101@ims.example.com">sip:+98765432101@ims.example.com</a><br>third_party_registrant: NULL<br>              username: +<a href="mailto:98765432101@ims.example.com">98765432101@ims.example.com</a><br>              password: 123<br>           binding_URI: <a href="mailto:sip%3A%2B98765432101@1.2.3.4">sip:+98765432101@1.2.3.4</a><br>        binding_params: NULL<br>                expiry: NULL<br><b>         forced_socket: tcp:<a href="http://1.2.3.4:5060">1.2.3.4:5060</a></b><br>1 row in set (0.00 sec)<br><br></div><div><br></div>Thank you,<br></div>Peter<br><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 21 April 2017 at 09:53, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <tt>Hi Pete,<br>
      <br>
      Looking to the logs, I see only one line :<span class="gmail-"><br>
      <br>
      Apr 21 09:58:56 dev01 /usr/local/opensips_2.2/sbin/<wbr>opensips[4766]:
      DBG:uac_registrant:reg_tm_<wbr>cback: tm [0x7f2ceb70b2f0] notification
      cb for FAKED_REPLY [408] reply at [1492761536]<br>
      <br></span>
      The "r</tt><tt><tt>eg_tm_cback" is the TM callback used to report
        back to the uac_registrant module the reply code for the sent
        REGISTER. And I see there a 408 timeout :-/ .....<br>
        <br>
        Even more, the "run_reg_tm_cback" function (that triggers the
        build of the auth hdr) does not show up logging anything (and
        there are some debug over there).<br>
        <br>
        So, are you sure that the 401 is actually received ? maybe the
        second REGISTER is actually a retransmission of the first one ?<br>
        <br>
      </tt>Best regards,<br>
    </tt>
    <pre class="gmail-m_4641661313998088094moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="gmail-m_4641661313998088094moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a>

OpenSIPS Summit May 2017 Amsterdam
  <a class="gmail-m_4641661313998088094moz-txt-link-freetext" href="http://www.opensips.org/events/Summit-2017Amsterdam.html" target="_blank">http://www.opensips.org/<wbr>events/Summit-2017Amsterdam.<wbr>html</a>
</pre><div><div class="gmail-h5">
    <div class="gmail-m_4641661313998088094moz-cite-prefix">On 04/21/2017 11:14 AM, Peter Baines
      (lists) wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="gmail-h5">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>Hello,<br>
                      <br>
                    </div>
                    I am trying to use the uac_registrant module (2.2)
                    to register via TCP but when it recieves the 401 it
                    is not adding the Authorization header.<br>
                    <br>
                  </div>
                  It does work with UDP so I get:<br>
                  <br>
                </div>
                REGISTER -> 401 (with WWW-Authenticate) ->
                REGISTER (with Authorization) -> 200 OK<br>
                <br>
              </div>
              However when I tell it to use TCP it doesn't add the
              Authorization header:<br>
              <br>
              UPDATE registrant SET forced_socket = 'tcp:<a href="http://1.2.3.4:5060" target="_blank">1.2.3.4:5060</a>';<br>
              <br>
            </div>
            REGISTER -> 401 (with WWW-Authenticate) -> REGISTER
            (no Authorization) -> 403 Forbidden<br>
            <br>
          </div>
          <div>I've included the debug log for the failing TCP REGSITER
            attempt: <a href="https://pastebin.com/gigJkWZX" target="_blank">https://pastebin.com/gigJkWZX</a><br>
            <br>
          </div>
          Regards,<br>
        </div>
        Peter</div>
      <br>
      <fieldset class="gmail-m_4641661313998088094mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
Users mailing list
<a class="gmail-m_4641661313998088094moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="gmail-m_4641661313998088094moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div></div></div></div></div></div>