<div dir="ltr"><div>Thanks for the reply Liviu, let me know if I can do anything to help, this is a dev environment so I can try anything on it if it can be usefull. <br></div><div><br></div><div>Dominic<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 20, 2018 at 10:11 AM Liviu Chircu <<a href="mailto:liviu@opensips.org">liviu@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p><tt>Hi Dominic,</tt></p>
    <p><tt>The 200 OK returned by OpenSIPS should definitely contain a
        120s expiry time.  Thanks for the detailed explanation - I will
        look into this asap.<br>
      </tt></p>
    <p><tt>Best regards,</tt><br>
    </p>
    <pre class="m_82527738546540315moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="m_82527738546540315moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
    <div class="m_82527738546540315moz-cite-prefix">On 20.09.2018 16:29, Dominic wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">
          <div>Hi all, I have the following setup:</div>
          <div>-sip device is registering to OpenSIPS setup as a
            mid_registrar who then fowards registers to asterisk once
            they are authenticated<br>
          </div>
          <div>-OpenSIPS is setup in contact throttling mode with
            outgoing expires set to 3600 sec. <br>
          </div>
          <div><br>
          </div>
          <div>The scenario I came accross is the following:</div>
          <div><br>
          </div>
          <div>
            <pre>              "Registration - OpenSips mid_registrar"              
                                                                       
       ┌─┐                                                             
       ║"│                                                             
       └┬┘                                                             
       ┌┼┐                                                             
        │                       ┌────────┐                   ┌────────┐
       ┌┴┐                      │OpenSips│                   │Asterisk│
      Alice                     └────────┘                   └────────┘
        │REGISTER (expires 3600 sec)│                            │     
        │───────────────────────────>                            │     
        │                           │                            │     
        │     401 Unauthorized      │                            │     
        │<───────────────────────────                            │     
        │                           │                            │     
        │REGISTER (expires 3600 sec)│                            │     
        │───────────────────────────>                            │     
        │                           │                            │     
        │                           │ REGISTER (expires 3600 sec)│     
        │                           │ ───────────────────────────>     
        │                           │                            │     
        │                           │  200 OK (expires 120 sec)  │     
        │                           │ <───────────────────────────     
        │                           │                            │     
        │ 200 OK (expires 3600 sec) │                            │     
        │<───────────────────────────                            │     
        │                           │                            │     
        │                           │                            │     
        │                           │                            │     
        │                           │                            │     
      Alice                     ┌────────┐                   ┌────────┐
       ┌─┐                      │OpenSips│                   │Asterisk│
       ║"│                      └────────┘                   └────────┘
       └┬┘                                                             
       ┌┼┐                                                             
        │                                                              
       ┌┴┐                                      </pre>
          </div>
          <div><br>
          </div>
          <div>1-the sip device sends a REGISTER to OpenSIPS (expires
            3600)</div>
          <div>2-OpenSIPS authentifies the REGISTER and sends back
            challenge to the sip device</div>
          <div>3-sip devices sends authenticated REGISTER to OpenSIPS,
            here the expires would normally be changed to 3600 but in
            this case it was already set at 3600.</div>
          <div>4-Asterisk receives the REGISTER, alters the expires to
            120secs and replies 200 ok to OpenSIPS</div>
          <div>5-OpenSIPS forwards the 200 ok but with 3600 sec expires.</div>
          <div><br>
          </div>
          <div>My Questions is:<br>
          </div>
          <div>I was expecting OpenSIPS to automatically update the
            expires in it's usrloc to 120 seconds and send 120 sec in
            its 200 ok. Should I be doing something in a return route
            for the REGISTERs in order to update that and send the
            correct value or should opensips be doing that
            automatically? Currently I am calling
            mid_registrar_save("location") when I receive the REGISTER
            but doing nothing when I receive the 200 ok.</div>
          <div><br>
          </div>
          <div>Thanks in advance</div>
          <div>Dominic<br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="m_82527738546540315mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
Users mailing list
<a class="m_82527738546540315moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_82527738546540315moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>