<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    You added sleep(1000), which is sleep for 1000 seconds -- that's
    quite some time to wait (more than 15min) before sending next
    registration.<br>
    <br>
    Also, the extra parameter is not really needed, you can test that
    ticks==0, as condition for first iteration.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 10/9/12 2:12 PM, Rene Bormann wrote:<br>
    </div>
    <blockquote cite="mid:50741490.6020907@gmx.de" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div style="font-family: Courier New,Courier,monospace;">
        <div style="font-family: Courier New,Courier,monospace;"><span
            style="font-family: Courier New,Courier,monospace;">Thanks
            Daniel for you prompt answer.<br>
            <br>
            Find the patch file attached.<br>
            <br>
            - ren&eacute;<br>
          </span><br>
          <blockquote style="border: 0px none;"
            cite="mid:507413B0.8040104@gmail.com" type="cite">
            <div style="margin:30px 25px 10px 25px;" class="__pbConvHr">
              <div style="display:table;width:100%;border-top:1px solid
                #EDEEF0;padding-top:5px">
                <div
                  style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
                    photoaddress="miconda@gmail.com"
                    photoname="Daniel-Constantin Mierla"
                    src="cid:part1.04090207.01000006@gmail.com"
                    name="compose-unknown-contact.jpg" width="25px"
                    height="25px"></div>
                <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
                  <a moz-do-not-send="true"
                    href="mailto:miconda@gmail.com" style="color:#737F92
                    !important;padding-right:6px;font-weight:bold;text-decoration:none
                    !important;">Daniel-Constantin Mierla</a></div>
                <div
                  style="display:table-cell;white-space:nowrap;vertical-align:middle;">
                  <font color="#9FA2A5"><span style="padding-left:6px">Dienstag,
                      9. Oktober 2012 14:08</span></font></div>
              </div>
            </div>
            <div
              style="color:#888888;margin-left:24px;margin-right:24px;"
              __pbrmquotes="true" class="__pbConvBody">
              <meta http-equiv="Content-Type" content="text/html;
                charset=ISO-8859-1">
              Hello,<br>
              <br>
              you added an extra parameter to the function as well, so
              there should be other modifications. Better send the patch
              with your changes to see if there is something wrong. If
              you got it from git, run:<br>
              <br>
              git diff &gt;/path/to/patchfile<br>
              <br>
              Cheers,<br>
              Daniel<br>
              <br>
              <div class="moz-cite-prefix">On 10/9/12 2:00 PM, Rene
                Bormann wrote:<br>
              </div>
              <br>
              <div>-- <br>
                Daniel-Constantin Mierla - <a moz-do-not-send="true"
                  href="http://www.asipto.com"
                  class="moz-txt-link-freetext">http://www.asipto.com</a><br>
                <a moz-do-not-send="true"
                  href="http://twitter.com/#%21/miconda"
                  class="moz-txt-link-freetext">http://twitter.com/#!/miconda</a>
                - <a moz-do-not-send="true"
                  href="http://www.linkedin.com/in/miconda"
                  class="moz-txt-link-freetext">http://www.linkedin.com/in/miconda</a><br>
                Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a
                  moz-do-not-send="true" href="http://asipto.com/u/kat"
                  class="moz-txt-link-freetext">http://asipto.com/u/kat</a><br>
                Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012
                - <a moz-do-not-send="true"
                  href="http://asipto.com/u/katu"
                  class="moz-txt-link-freetext">http://asipto.com/u/katu</a></div>
            </div>
            <div style="margin:30px 25px 10px 25px;" class="__pbConvHr">
              <div style="display:table;width:100%;border-top:1px solid
                #EDEEF0;padding-top:5px">
                <div
                  style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
                    photoaddress="reb423@gmx.de" photoname="Rene
                    Bormann" src="cid:part1.04090207.01000006@gmail.com"
                    name="compose-unknown-contact.jpg" width="25px"
                    height="25px"></div>
                <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
                  <a moz-do-not-send="true" href="mailto:reb423@gmx.de"
                    style="color:#737F92
                    !important;padding-right:6px;font-weight:bold;text-decoration:none
                    !important;">Rene Bormann</a></div>
                <div
                  style="display:table-cell;white-space:nowrap;vertical-align:middle;">
                  <font color="#9FA2A5"><span style="padding-left:6px">Dienstag,
                      9. Oktober 2012 14:00</span></font></div>
              </div>
            </div>
            <div
              style="color:#888888;margin-left:24px;margin-right:24px;"
              __pbrmquotes="true" class="__pbConvBody">
              <meta content="text/html; charset=ISO-8859-1"
                http-equiv="content-type">
              <div style="font-family: Courier New,Courier,monospace;">
                <div style="font-family: -moz-fixed"
                  class="moz-text-flowed">Hello&nbsp;@all,
                  <br>
                  <br>
want&nbsp;to&nbsp;use&nbsp;the&nbsp;remote&nbsp;register&nbsp;function&nbsp;of&nbsp;the&nbsp;UAC&nbsp;module.
                  <br>
                  We&nbsp;need&nbsp;to&nbsp;register&nbsp;42&nbsp;accounts&nbsp;on&nbsp;one&nbsp;openSER&nbsp;server.
                  <br>
                  <br>
At&nbsp;kamailio&nbsp;startup&nbsp;those&nbsp;42&nbsp;remote&nbsp;register&nbsp;requests&nbsp;will&nbsp;be&nbsp;startet&nbsp;at&nbsp;the&nbsp;same&nbsp;time.
                  <br>
                  This leads to a kind of FlodAttact on the openSER
                  server of our provider, which will block&nbsp;us&nbsp;:-(
                  <br>
                  <br>
We&nbsp;would&nbsp;like&nbsp;to&nbsp;delay&nbsp;each&nbsp;initial&nbsp;remote&nbsp;register&nbsp;by&nbsp;1&nbsp;second.
                  <br>
                  <br>
                  We searched the UAC module and taught that at some
                  place the uac.so module has to
load&nbsp;the&nbsp;uacreg&nbsp;table&nbsp;and&nbsp;do&nbsp;some&nbsp;for&nbsp;loop&nbsp;to&nbsp;start&nbsp;the&nbsp;remote&nbsp;register&nbsp;process.<br>
                  <br>
                  We found function child_init() in uac.c where the
                  function uac_reg_load_db() is
                  called&nbsp;followed&nbsp;uac_reg_timer().
                  <br>
                  <br>
                  Our&nbsp;change&nbsp;to&nbsp;uac_reg_timer()&nbsp;is&nbsp;the&nbsp;sleep(1).
                  <br>
                  <br>
After&nbsp;compiling&nbsp;it&nbsp;seems&nbsp;to&nbsp;us&nbsp;-&nbsp;that&nbsp;this&nbsp;function&nbsp;is&nbsp;not&nbsp;called.
                  <br>
                  Is&nbsp;there&nbsp;anybody&nbsp;how&nbsp;has&nbsp;a&nbsp;tip&nbsp;for&nbsp;us?
                  <br>
                  <br>
                  Thanks,
                  <br>
                  <br>
                  Ren&eacute;
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  /**
                  <br>
                  &nbsp;*
                  <br>
                  &nbsp;*/
                  <br>
void&nbsp;uac_reg_timer(unsigned&nbsp;int&nbsp;ticks,&nbsp;unsigned&nbsp;int&nbsp;initial_reg_call)
                  <br>
                  {
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LM_ERR("-----------------------&nbsp;uac_reg_timer()&nbsp;--&nbsp;enter&nbsp;\n");
                  <br>
                  &lt;------&gt;int&nbsp;i;
                  <br>
                  &lt;------&gt;reg_item_t&nbsp;*it&nbsp;=bsp;NULL;
                  <br>
                  &lt;------&gt;time_t&nbsp;tn;
                  <br>
                  <br>
                  &lt;------&gt;tn&nbsp;=bsp;time(NULL);
                  <br>
                  &lt;------&gt;for(i=&nbsp;i&lt;_reg_htable-&gt;htsize;&nbsp;i++)
                  <br>
                  &lt;------&gt;{
                  <br>
                  &lt;------&gt;&lt;------&gt;/*&nbsp;free&nbsp;entries&nbsp;*/
                  <br>
&lt;------&gt;&lt;------&gt;it&nbsp;=bsp;_reg_htable-&gt;entries[i].byuuid;
                  <br>
                  &lt;------&gt;&lt;------&gt;while(it)
                  <br>
                  &lt;------&gt;&lt;------&gt;{
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LM_ERR("-----------------------&nbsp;uac_reg_timer()&nbsp;--&nbsp;1&nbsp;\n");
                  <br>
                  <br>
&lt;------&gt;&lt;------&gt;&lt;------&gt;if&nbsp;(initial_reg_call&nbsp;=nbsp;1)
                  <br>
                  &lt;------&gt;&lt;------&gt;&lt;------&gt;{
                  <br>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  LM_ERR("----------------------- uac_reg_timer() -- 2
                  \n");
                  <br>
&lt;------&gt;&lt;------&gt;&lt;------&gt;&lt;------&gt;sleep(1);
                  <br>
                  &lt;------&gt;&lt;------&gt;&lt;------&gt;}
                  <br>
&lt;------&gt;&lt;------&gt;&lt;------&gt;uac_reg_update(it-&gt;r,&nbsp;tn);
                  <br>
&lt;------&gt;&lt;------&gt;&lt;------&gt;it&nbsp;=bsp;it-&gt;next;
                  <br>
                  &lt;------&gt;&lt;------&gt;}
                  <br>
                  &lt;------&gt;}
                  <br>
                  }
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                </div>
              </div>
              <div>_______________________________________________<br>
                SIP Express Router (SER) and Kamailio (OpenSER) -
                sr-users mailing list<br>
                <a moz-do-not-send="true"
                  class="moz-txt-link-abbreviated"
                  href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
                <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
              </div>
            </div>
            <div style="margin:30px 25px 10px 25px;" class="__pbConvHr">
              <div style="display:table;width:100%;border-top:1px solid
                #EDEEF0;padding-top:5px">
                <div
                  style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
                    photoaddress="bormann@bbtel.de" photoname="Ren&eacute;
                    Bormann" src="cid:part1.04090207.01000006@gmail.com"
                    name="compose-unknown-contact.jpg" width="25px"
                    height="25px"></div>
                <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
                  <a moz-do-not-send="true"
                    href="mailto:bormann@bbtel.de" style="color:#737F92
                    !important;padding-right:6px;font-weight:bold;text-decoration:none
                    !important;">Ren&eacute; Bormann</a></div>
                <div
                  style="display:table-cell;white-space:nowrap;vertical-align:middle;">
                  <font color="#9FA2A5"><span style="padding-left:6px">Dienstag,
                      9. Oktober 2012 13:55</span></font></div>
              </div>
            </div>
            <div
              style="color:#888888;margin-left:24px;margin-right:24px;"
              __pbrmquotes="true" class="__pbConvBody">Hello @all,
              <br>
              <br>
              want to use the remote register function of the UAC
              module.
              <br>
              We need to register 42 accounts on one openSER server.
              <br>
              <br>
              At kamailio startup those 42 remote register requests will
              be startet at the same time.
              <br>
              This leads to a kind of FlodAttact on the openSER server
              of our provider, which will block us :-(
              <br>
              <br>
              We would like to delay each initial remote register by 1
              second.
              <br>
              <br>
              We searched the UAC module and taught that at some place
              the uac.so module has to load the uacreg table and do some
              for loop to start the remote register process.
              <br>
              <br>
              We found function child_init() in uac.c where the function
              uac_reg_load_db() is called followed uac_reg_timer().
              <br>
              <br>
              Our change to uac_reg_timer() is the sleep(1).
              <br>
              <br>
              After compiling it seems to us - that this function is not
              called.
              <br>
              Is there anybody how has a tip for us?
              <br>
              <br>
              Thanks,
              <br>
              <br>
              Ren&eacute;
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              /**
              <br>
              &nbsp;*
              <br>
              &nbsp;*/
              <br>
              void uac_reg_timer(unsigned int ticks, unsigned int
              initial_reg_call)
              <br>
              {
              <br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LM_ERR("----------------------- uac_reg_timer() --
              enter \n");
              <br>
              &lt;------&gt;int i;
              <br>
              &lt;------&gt;reg_item_t *it = NULL;
              <br>
              &lt;------&gt;time_t tn;
              <br>
              <br>
              &lt;------&gt;tn = time(NULL);
              <br>
              &lt;------&gt;for(i=0; i&lt;_reg_htable-&gt;htsize; i++)
              <br>
              &lt;------&gt;{
              <br>
              &lt;------&gt;&lt;------&gt;/* free entries */
              <br>
              &lt;------&gt;&lt;------&gt;it =
              _reg_htable-&gt;entries[i].byuuid;
              <br>
              &lt;------&gt;&lt;------&gt;while(it)
              <br>
              &lt;------&gt;&lt;------&gt;{
              <br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LM_ERR("-----------------------
              uac_reg_timer() -- 1 \n");
              <br>
              <br>
              &lt;------&gt;&lt;------&gt;&lt;------&gt;if
              (initial_reg_call == 1)
              <br>
              &lt;------&gt;&lt;------&gt;&lt;------&gt;{
              <br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              LM_ERR("----------------------- uac_reg_timer() -- 2 \n");
              <br>
&lt;------&gt;&lt;------&gt;&lt;------&gt;&lt;------&gt;sleep(1);
              <br>
              &lt;------&gt;&lt;------&gt;&lt;------&gt;}
              <br>
              &lt;------&gt;&lt;------&gt;&lt;------&gt;uac_reg_update(it-&gt;r,
              tn);
              <br>
              &lt;------&gt;&lt;------&gt;&lt;------&gt;it =
              it-&gt;next;
              <br>
              &lt;------&gt;&lt;------&gt;}
              <br>
              &lt;------&gt;}
              <br>
              }
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
            </div>
          </blockquote>
          <br>
          <div class="moz-signature">-- <br>
            -----------------------------------------<br>
            <br>
            Telefonkonferenzen zum Festnetzpreis!<br>
            <br>
            Einfach kostenlos Konferenzraum anfordern <br>
            <br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a moz-do-not-send="true"
              class="moz-txt-link-freetext"
              href="http://www.talkyoo.net">http://www.talkyoo.net</a><br>
            <br>
            -----------------------------------------<br>
            <br>
            Ren&eacute; Bormann<br>
            Gesch&auml;ftsf&uuml;hrer<br>
            <br>
            BB Tel GmbH<br>
            Jungfernstieg 30, 20354 Hamburg<br>
            Register: Amtsgericht Hamburg, HRB 86074<br>
            Gesch&auml;ftf&uuml;hrer: Ren&eacute; Bormann<br>
            <br>
            Tel: +49 (0) 1805 - 65 777 777 *<br>
            Fax: +49 (0) 1805 - 65 777 799 *<br>
            <br>
            <a moz-do-not-send="true" class="moz-txt-link-freetext"
              href="http://www.bbtel.de">http://www.bbtel.de</a><br>
            -----------------------------------------<br>
            <br>
            *&nbsp; (bbtel.de 14ct/min) <br>
            ** (es entstehen die Kosten, die ihre <br>
            Telefongesellschaft zu einer Hamburger <br>
            Festnetz-Rufnummer berechnet.)<br>
            -----------------------------------------<br>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/katu">http://asipto.com/u/katu</a></pre>
  </body>
</html>