<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    you should not use index when setting an avp to null -- remove the
    [0].<br>
    <br>
    Then you can print details of branches voa $branch(...) variable to
    see what are the results of your operations.<br>
    <br>
    A branch can be added also by providing the uri as parameter for
    append_branch() -- see the documentation of the function in the
    corex module.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 09/02/15 08:18, Raśl Alexis Betancor
      Santana wrote:<br>
    </div>
    <blockquote
cite="mid:444942784.2487.1423466337664.JavaMail.zimbra@dimension-virtual.com"
      type="cite">
      <div style="font-family: arial, helvetica, sans-serif; font-size:
        12pt; color: #000000">
        <div><br data-mce-bogus="1">
        </div>
        <div>Hi all,</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>I'm getting crazy trying to setup a kamailio to do a
          parallel call forward to multiple destinations based on a
          query to the DB.</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>I do the db query and get the RURI's of the destinations I
          could forward the call to in parallel, then when I get the
          resulset I do:</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>[...]</div>
        <div><br data-mce-bogus="1">
        </div>
        <div> $var(cf_idx) = 0;<br>
          while(is_avp_set("$(avp(s:cf_destinations)[0])"))<br>
          {<br>
          $ru = $(avp(s:cf_destinations)[0]);             # Set the new
          RURI to call to<br>
          $(avp(s:cf_destinations)[0]) = $null;           # Setting it
          to $null pull the value from the stack<br>
          $(avp(s:callee_fr_inv_timer)[*]) = $(avp(s:cf_timeouts)[0]) *
          1000;<br>
          t_set_fr("$avp(s:callee_fr_inv_timer)");<br>
          $(avp(s:cf_timeouts)[0]) = $null;<br>
          route(ROUTE_ACC_CF);                          # Do the ACC<br>
          $(avp(s:acc_state)[*]) = "cfna";<br>
          $(avp(s:hih_cause)[*]) = "404";<br>
          $var(cf_idx) = $var(cf_idx) + 1;<br>
          append_branch();<br>
        </div>
        <div>}</div>
        <div>route(ROUTE_EXECUTE_CF_LOOP);     # Some final task and
          then t_relay<br>
        </div>
        <div><br data-mce-bogus="1">
        </div>
        <div>[...]</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>But only the last RURI get called</div>
        <div><br data-mce-bogus="1">
        </div>
        <div>How do I do to accomplish this? ... I need to change the
          $ru of each new branch, so when request get loop-back to the
          proxy, it do again all the lookup logic.</div>
        <div><br data-mce-bogus="1">
        </div>
        <div><br data-mce-bogus="1">
        </div>
        <div>Best regards</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a 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>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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 World Conference, May 27-29, 2015
Berlin, Germany - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>