<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body 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="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 20.09.2018 16:29, Dominic wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANC2LAPY9xbkPsbsrM0uj4w7X296+yx-peH+s1aU2DDkhystOg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <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="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>