<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <font size="-1"><font face="Courier New, Courier, monospace">Just
        some additional information. I've been reading up on variables,
        <br>
        script-operations, etc, and I cant find any(simple) way to cause
        <br>
        what I call a "roll-over" timer. <br>
        That is, setting the timer(C) between the different
        serial-forked <br>
        targets low, but keeping a normal timer c for non-serial forked<br>
        scenarios, and the last target in a serial fork.<br>
        <br>
        Also, even though I am a complete n00b when it comes to the
        opensips<br>
        source, I got the _parallell_ forking to work, by hacking
        serialize.c<br>
        and making sure that it doesnt completly bail out if the
        q-values are<br>
        the same. <br>
        This will most certainly cause a lot of unnecessary sorting
        which the<br>
        old logic in the lcr-module was able to avoid, if I understood
        the <br>
        docs properly. <br>
        But at least now my call to serialize_branches() doesnt fail.<br>
        <br>
        &nbsp;if (branch.s == 0) {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LM_DBG("nothing to do - all same q!\n");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // return 0; // This causes parallell fork to fail<br>
        &nbsp;}<br>
        <br>
        Regards<br>
        Taisto<br>
        <br>
      </font></font><br>
    Taisto Qvist skrev 2010-09-28 18:56:
    <blockquote cite="mid:4CA21E25.1090801@ip-solutions.se" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <title></title>
      <font size="-1"><font face="Courier New, Courier, monospace">It
          seems like I cried "yay" to soon.<br>
          <br>
          Serialforking does work even though I cant figure out(trying
          the rtfm-concept)<br>
          how I can reduce the "timer C" for only the serial-forking
          scenario, which<br>
          I was capable of doing with the lcr module....but now
          Parallell forking doesnt<br>
          work anymore :-(<br>
          <br>
          I changed my script to:<br>
          --------------------------<br>
          lookup("location", "m");<br>
          switch ($retcode)<br>
          {<br>
          case 1:<br>
          &nbsp;&nbsp;&nbsp; log(2, "(lab2) - Contact found in location server,
          rerouting.\n");<br>
          &nbsp;&nbsp;&nbsp; if (!serialize_branches(0))<br>
          &nbsp;&nbsp;&nbsp; {<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log(1, "(lab2) - Unable to load contacts for serial
          forking\n");<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_reply("500", "Server Internal Error (Serial fork)");<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
          &nbsp;&nbsp;&nbsp; }<br>
          &nbsp;&nbsp;&nbsp; if ( !next_branches() )<br>
          &nbsp;&nbsp;&nbsp; {<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; t_reply("509", "Serial fork error");<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
          &nbsp;&nbsp;&nbsp; }<br>
          &nbsp;&nbsp;&nbsp; return(1);<br>
          ---------------------------<br>
          <br>
          But when my to UA's register with the SAME q-value, I get
          failure in next_branches().<br>
          <br>
          -------------------<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]: (lab2) - Its
          a valid local user<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:core:comp_scriptvar: int 20 : 0 / 0<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]: (lab2) -
          Stateful LS lookup()<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:registrar:lookup: setting as ruri <a
            moz-do-not-send="true" class="moz-txt-link-rfc2396E"
            href="sip:jane@10.10.2.33:5060">&lt;sip:jane@10.10.2.33:5060&gt;</a><br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:registrar:lookup: looking for branches<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:registrar:lookup: setting branch <a
            moz-do-not-send="true" class="moz-txt-link-rfc2396E"
            href="sip:jane@10.10.2.33:5061">&lt;sip:jane@10.10.2.33:5061&gt;</a><br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]: (lab2) -
          Contact found in location server, rerouting.<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:core:serialize_branches: nothing to do - all same q!<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:core:next_branches: no AVPs -- we are done!<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          ERROR:core:do_action: next_branches failed<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:core:parse_headers: flags=ffffffffffffffff<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:core:check_ip_address: params 10.10.10.11, sip.core.net, 0<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:core:_shm_resize: resize(0) called<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:cleanup_uac_timers: RETR/FR timers reset<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:set_timer: relative timeout is 500000<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:insert_timer_unsafe: [4]: 0xb5b89738 (332300000)<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:set_timer: relative timeout is 32<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:insert_timer_unsafe: [0]: 0xb5b89754 (363)<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:_reply_light: reply sent out. buf=0x81cf0e0: SIP/2.0
          5..., shmem=0xb5b8b678: SIP/2.0 5<br>
          Sep 28 20:41:54 sip-laptop2 opensips_lab2[2586]:
          DBG:tm:_reply_light: finished<br>
          <br>
          -------------------<br>
          Concerning the timer issue, I suppose I could fiddle with the
          normal fr_inv_timer, <br>
          but since I only want to reduce it from its default of 180s, I
          would have to find <br>
          out wether (serial) forking will occur, and these functions
          doesnt seem to give me <br>
          that information.<br>
          <br>
          What I am doing wrong, with regards breaking normal parallell
          fork, I havent go <br>
          a clue, and I hope you can help!<br>
          <br>
          Regards<br>
          Taisto <br>
          <br>
          <br>
          <br>
        </font></font><br>
      Bogdan-Andrei Iancu skrev 2010-09-28 17:14:
      <blockquote cite="mid:4CA20638.8090400@voice-system.ro"
        type="cite">
        <pre wrap="">Hi Taiso,

the load_contacts() and next_contact() are deprecated, better use the 
core functions:
    serialize_branches() 
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/DocsCoreFcn16#toc128">http://www.opensips.org/Resources/DocsCoreFcn16#toc128</a>
    next_branches() <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips.org/Resources/DocsCoreFcn16#toc112">http://www.opensips.org/Resources/DocsCoreFcn16#toc112</a>

which works in the same way.

Regards,
Bogdan</pre>
        <br>
      </blockquote>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
  </body>
</html>