<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>if you have:<br>
    </p>
    <p>modparam("uac", "reg_random_delay", 20)</p>
    <p>modparam("uac", "reg_timer_interval", 20)</p>
    <p>Then all are sent because the next timer callback is executed
      after 20secs, which is later than any delay value.</p>
    <p>Try:</p>
    <p>modparam("uac", "reg_random_delay", 300)</p>
    <p>modparam("uac", "reg_timer_interval", 10)</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 03.11.21 13:28, Sergiu Pojoga wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJZsGCmoGis1VKHwP98fezJNJVPqwStULRv2=H-w9Q76UgAkFA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi Daniel,
        <div><br>
        </div>
        <div>True. If I disable/re-enable or add registrations to a
          running system via rpc, then those are not sent simultaneously
          with the others.</div>
        <div><br>
        </div>
        <div>modparam("uac", "reg_timer_interval", 20)<br>
        </div>
        <div><br>
          Let me know if you see a problem here or not. I'll log an
          issue about it on the tracker, if true.<br>
          <br>
        </div>
        <div>Thanks.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, Nov 3, 2021 at 5:53 AM
          Daniel-Constantin Mierla <<a
            href="mailto:miconda@gmail.com" moz-do-not-send="true"
            class="moz-txt-link-freetext">miconda@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Hello,</p>
            <p>registrations are sent on a timer callback function
              executed every N secods that is specified via a modparam
              (check the readme). If the next timer callback is going to
              be executed after the delay value (or when the
              registration expires), then the (new) registrations are
              sent on the current callback execution. Could be this
              situation.</p>
            <p>Cheers,<br>
              Daniel<br>
            </p>
            <div>On 03.11.21 08:36, Henning Westerholt wrote:<br>
            </div>
            <blockquote type="cite">
              <div>
                <p class="MsoNormal"><span>Hello Sergiu,</span></p>
                <p class="MsoNormal"><span> </span></p>
                <p class="MsoNormal"><span lang="EN-GB">Interesting. I
                    suspected something like this in the past as well
                    but never looked into the randomness features in
                    uac.</span></p>
                <p class="MsoNormal"><span lang="EN-GB"> </span></p>
                <p class="MsoNormal"><span lang="EN-GB">Let’s wait a bit
                    if somebody else might comment on it, otherwise
                    please open an issue about it on our tracker.</span></p>
                <p class="MsoNormal"><span lang="EN-GB"> </span></p>
                <p class="MsoNormal"><span lang="EN-GB">Cheers,</span></p>
                <p class="MsoNormal"><span lang="EN-GB"> </span></p>
                <p class="MsoNormal"><span lang="EN-GB">Henning</span></p>
                <p class="MsoNormal"><span lang="EN-GB"> </span></p>
                <p class="MsoNormal"><span lang="EN-GB">-- </span></p>
                <p class="MsoNormal"><span lang="EN-GB">Henning
                    Westerholt – </span><span><a
                      href="https://skalatan.de/blog/" target="_blank"
                      moz-do-not-send="true"><span
                        style="color:rgb(5,99,193)" lang="EN-GB">https://skalatan.de/blog/</span></a></span><span
                    lang="EN-GB"></span></p>
                <p class="MsoNormal"><span lang="EN-GB">Kamailio
                    services – </span><span><a
                      href="https://gilawa.com/" target="_blank"
                      moz-do-not-send="true"><span
                        style="color:rgb(5,99,193)" lang="EN-GB">https://gilawa.com</span></a></span><span
                    lang="EN-GB"></span></p>
                <p class="MsoNormal"><span lang="EN-GB"> </span></p>
                <div
style="border-right:none;border-bottom:none;border-left:none;border-top:1pt
                  solid rgb(225,225,225);padding:3pt 0cm 0cm">
                  <p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b>
                    Sergiu Pojoga <a href="mailto:pojogas@gmail.com"
                      target="_blank" moz-do-not-send="true"><pojogas@gmail.com></a>
                    <br>
                    <b>Sent:</b> Wednesday, November 3, 2021 4:41 AM<br>
                    <b>To:</b> Henning Westerholt <a
                      href="mailto:hw@gilawa.com" target="_blank"
                      moz-do-not-send="true"><hw@gilawa.com></a><br>
                    <b>Cc:</b> Kamailio (SER) - Users Mailing List <a
                      href="mailto:sr-users@lists.kamailio.org"
                      target="_blank" moz-do-not-send="true"><sr-users@lists.kamailio.org></a><br>
                    <b>Subject:</b> Re: [SR-Users] UAC reg_random_delay</p>
                </div>
                <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                <div>
                  <p class="MsoNormal" style="margin-left:35.4pt">Hi
                    Henning,</p>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt">That's
                      my understanding as well, but in reality
                      seems like it all happens simultaneously, without
                      some kind of delay.</p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt">Here's
                      what I have:</p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span><i>modparam("uac",
                        "reg_random_delay", 20)</i></p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>10 uac records</p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>expires=300</p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>reg_delay=0</p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt">kamcmd
                      uac.reg_dump | egrep delay<br>
                      reg_delay: 13<br>
                      reg_delay: 7<br>
                      reg_delay: 3<br>
                      reg_delay: 2<br>
                      reg_delay: 8<br>
                      reg_delay: 1<br>
                      reg_delay: 2<br>
                      reg_delay: 14<br>
                      reg_delay: 17<br>
                      reg_delay: 18<br>
                      <br>
                      Following restart of Kamailio:</p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>1st  x10 REGISTERs are
                      all sent out the same millisecond.</p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>Contacts saved, received
                      200 OK with Expires: 300</p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>after 280 seconds,
                      another x10 REGISTERs are all sent out the same
                      millisecond</p>
                    <p class="MsoNormal" style="margin-left:71.4pt"> <span
                        style="font-size:10pt;font-family:Symbol"><span>·<span
                            style="font:7pt "Times New Roman"">        
                          </span></span></span>and so on</p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt">Thanks.</p>
                  </div>
                </div>
                <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                <div>
                  <div>
                    <p class="MsoNormal" style="margin-left:35.4pt">On
                      Tue, Nov 2, 2021 at 2:59 PM Henning Westerholt
                      <<a href="mailto:hw@gilawa.com" target="_blank"
                        moz-do-not-send="true"
                        class="moz-txt-link-freetext">hw@gilawa.com</a>>
                      wrote:</p>
                  </div>
                  <blockquote
style="border-top:none;border-right:none;border-bottom:none;border-left:1pt
                    solid rgb(204,204,204);padding:0cm 0cm 0cm
                    6pt;margin-left:4.8pt;margin-right:0cm">
                    <div>
                      <div>
                        <p class="MsoNormal" style="margin-left:35.4pt">Hello,</p>
                        <p class="MsoNormal" style="margin-left:35.4pt"> </p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">this are two different
                            concepts:</span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB"> </span></p>
                        <p style="margin-left:71.4pt"> <span
                            style="font-size:10pt;font-family:Symbol"><span>·<span
                                style="font:7pt "Times New
                                Roman""> </span></span></span><span
                            lang="EN-GB">reg_random_delay is a global
                            parameter to randomize the registration
                            delay for the records</span></p>
                        <p style="margin-left:71.4pt"> <span
                            style="font-size:10pt;font-family:Symbol"><span>·<span
                                style="font:7pt "Times New
                                Roman""> </span></span></span><span
                            lang="EN-GB">reg_delay is a parameter for
                            the individual contacts</span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB"> </span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">So it seems to randomize the
                            reg_delay value due to the set
                            reg_random_delay for records with reg_delay
                            = 0.</span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">Could you maybe also observe a
                            second registration after the initial
                            registration, if it stills send out all
                            requests the same time?</span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB"> </span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">Cheers,</span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB"> </span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">Henning</span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB"> </span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">-- </span></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">Henning Westerholt – </span><a
                            href="https://skalatan.de/blog/"
                            target="_blank" moz-do-not-send="true"><span
                              style="color:rgb(5,99,193)" lang="EN-GB">https://skalatan.de/blog/</span></a></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB">Kamailio services – </span><a
                            href="https://gilawa.com/" target="_blank"
                            moz-do-not-send="true"><span
                              style="color:rgb(5,99,193)" lang="EN-GB">https://gilawa.com</span></a></p>
                        <p class="MsoNormal" style="margin-left:35.4pt"><span
                            lang="EN-GB"> </span></p>
                        <div
style="border-right:none;border-bottom:none;border-left:none;border-top:1pt
                          solid rgb(225,225,225);padding:3pt 0cm 0cm">
                          <p class="MsoNormal"
                            style="margin-left:70.8pt"><b>From:</b>
                            sr-users <<a
                              href="mailto:sr-users-bounces@lists.kamailio.org"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">sr-users-bounces@lists.kamailio.org</a>>
                            <b>On Behalf Of </b>Sergiu Pojoga<br>
                            <b>Sent:</b> Monday, November 1, 2021 4:20
                            PM<br>
                            <b>To:</b> Kamailio (SER) - Users Mailing
                            List <<a
                              href="mailto:sr-users@lists.kamailio.org"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a>><br>
                            <b>Subject:</b> [SR-Users] UAC
                            reg_random_delay</p>
                        </div>
                        <p class="MsoNormal" style="margin-left:70.8pt"> </p>
                        <div>
                          <p class="MsoNormal"
                            style="margin-left:70.8pt">Hi there,</p>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">May I know what
                              exactly is supposed to be "delayed" in the
                              UAC registration?</p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"><i>modparam("uac",
                                "reg_random_delay", 20)</i></p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">I have records
                              stored in DB with <i>reg_delay=0</i>.
                              When doing <i>uac.reg_dump</i>, I do see
                              the value of <i>reg_delay</i> being
                              random for various records.</p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">However, after
                              restarting Kamailio, the registrations are
                              all sent out <b>simultaneously</b>, there
                              doesn't seem to be a "delay", whatever the
                              purpose is supposed to be.</p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">Can someone
                              clarify please?</p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">Kamailio 5.5.0</p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">Thanks.
                              Regards,</p>
                          </div>
                          <div>
                            <p class="MsoNormal"
                              style="margin-left:70.8pt">--Sergiu</p>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
            </blockquote>
            <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone)
  * <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
          </div>
          __________________________________________________________<br>
          Kamailio - Users Mailing List - Non Commercial Discussions<br>
            * <a href="mailto:sr-users@lists.kamailio.org"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a><br>
          Important: keep the mailing list in the recipients, do not
          reply only to the sender!<br>
          Edit mailing list options or unsubscribe:<br>
            * <a
            href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
        </blockquote>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
Nov 08-11, 2021 (Europe Timezone) - Feb 21-24, 2022 (America Timezone)
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>