<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <tt>Hi all,<br>
      I'm using kamailio 3.1 and I have some problems with parallel
      forking.<br>
      I need to implement parallel forking to different users registered
      on kamailio.<br>
      So, when call arrives with R-URI=
      <a class="moz-txt-link-freetext" href="sip:003912345678@">sip:003912345678@</a>&lt;IP_server&gt;, I need to fork te call to (for
      example) 2 users: 1001 and 1001.<br>
      <br>
      To do that, I've created my usr_preferences table like this:<br>
      <br>
    </tt>
    <pre>+----+------+------------------+--------+-----------+------+-------+---------------------+
|<i> id | uuid | username                | domain | attribute | type | value | </i>last_modified       |
+----+------+------------------+--------+-----------+------+-------+---------------------+
|<i>  1 |      | </i><tt>003912345678</tt><i>     |        | fork      |    0 | 1001  |              |
</i>|<i>  2 |      | </i><tt>003912345678</tt><i>     |        | fork      |    0 | 1002  |              |
</i>+----+------+------------------+--------+-----------+------+-------+---------------------+</pre>
    <br>
    <tt>and I've added a code to my kam.cfg like this:<br>
      <br>
    </tt>
    <pre>if (is_method("INVITE")) 
{
        
        xlog("L_INFO", "REQUEST Invite - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
        if(avp_db_load("$ru/username","$avp(s:fork)"))
        {
            avp_pushto("$ru/username","$avp(s:fork)/g");

        }
        
        if(!lookup("location"))
        {

                xlog("L_INFO", "Local user offline - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
                sl_send_reply("404", "User Offline");
                exit;
        }
        else
        {

                xlog("L_INFO", "Local user online - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
                t_relay();
        }

}</pre>
    <br>
    <tt><br>
      If 1001 and 1002 are registered everything works fine (1001
      Ringing and 1002 ringing).<br>
      If</tt><tt> only 1001</tt> <tt>registered everything works fine (</tt><tt>1001
      ringing and 1002 is offline.).</tt> <br>
    <br>
    <tt>But when 1002 is registered and 1001 in offline, kamailio try to
      call 1001, find that it's offline ( and I get 404 User Offline")
      but no call to 1002 is attempted.<br>
      <br>
      <br>
      <br>
      What's wrong ?<br>
      <br>
      <br>
      <br>
      Regards,<br>
    </tt><tt><br>
      Daniel</tt><br>
    <p class="western" style="margin-bottom: 0cm;"><br>
    </p>
  </body>
</html>