<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-15"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Thank you Daniel,<br>
    <br>
    That was what I was looking for.<br>
    <br>
    Cheers,<br>
    Daniel G.<br>
    <br>
    <br>
    <br>
    Il 21/01/2011 12:04, Daniel-Constantin Mierla ha scritto:
    <blockquote cite="mid:4D39683A.9060401@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-15"
        http-equiv="Content-Type">
      <title></title>
      Hello,<br>
      <br>
      <tt>the problem is that lookup(location) is handling only R-URI,
        so if ruri is for user XYZ and that is offline, then will return
        false.<br>
        <br>
        Since you create many branches with avp_pushto(), other
        destinations added as extra branches will be not attempted
        because of lookup(location) condition.<br>
        <br>
        The best is to relay the call after the avp_pushto(), so you
        will get two branches (or more) coming back via loopback and
        then you do lookup location for each:<br>
        <br>
        if(src_ip!=myself)<br>
        {<br>
           if(avp_db_load("$ru/username","$avp(s:fork)"))<br>
           {<br>
             avp_pushto("$ru/username","$avp(s:fork)/g");<br>
             t_relay();<br>
             exit;<br>
           }<br>
        }<br>
        <br>
        if(!lookup("location")) ....<br>
        <br>
        Be sure you skip authentication or other checks when the
        requests comes back due to such loop, using if(src_ip==myself)
        conditions.<br>
        <br>
        Cheers,<br>
        Daniel<br>
      </tt> <br>
      <br>
      On 1/21/11 11:10 AM, Daniel Grotti wrote:
      <blockquote cite="mid:4D395B79.4070504@klarya.it" type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-15">
        <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 moz-do-not-send="true"
            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>
        <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<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>
<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>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
    </blockquote>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="CONTENT-TYPE" content="text/html;
        charset=ISO-8859-15">
      <title></title>
      <meta name="GENERATOR" content="OpenOffice.org 3.1 (Win32)">
      <meta name="AUTHOR" content="Alberto Vinci">
      <meta name="CREATED" content="20091103;16310000">
      <meta name="CHANGEDBY" content="Alberto Vinci">
      <meta name="CHANGED" content="20091103;16320000">
      <style type="text/css">
        <!--
                @page { margin-left: 2cm; margin-right: 2cm; margin-top: 2.5cm; margin-bottom: 2cm }
                P { margin-bottom: 0.21cm; direction: ltr; color: #000000; widows: 2; orphans: 2 }
                P.western { font-family: "Times New Roman", serif; font-size: 12pt; so-language: it-IT }
                P.cjk { font-family: "Calibri", sans-serif; font-size: 12pt }
                P.ctl { font-family: "Times New Roman", serif; font-size: 12pt; so-language: ar-SA }
                A:link { color: #0000ff }
        -->
        </style>
      <p class="western" style="margin-bottom: 0cm;"><img
          src="cid:part1.05000704.09050407@klarya.it" name="Immagine 4"
          height="18" width="255" align="BOTTOM" border="0"><font
          face="Verdana, sans-serif"><font size="2"><span lang="en-US"><br>
            </span></font></font><font color="#589e48"><font
            face="Arial, sans-serif"><font size="2"><span lang="en-US"><b>Ing.
Daniel
                  Grotti - </b></span></font></font></font><font
          color="#589e48"><font face="Arial, sans-serif"><font
              style="font-size: 8pt;" size="1"><span lang="en-US"><i>System
                  Engineer</i></span></font></font></font></p>
      <font color="#589e48"><font face="Arial, sans-serif"><font
            style="font-size: 8pt;" size="1"><span lang="en-US"><i>Certified
                Asterisk Professional dCAP</i></span></font></font></font>
      <p class="western" style="margin-bottom: 0cm;" lang="en-US"><font
          color="#1f497d"><font face="Arial, sans-serif"><font
              style="font-size: 9pt;" size="2"><i>Mobile:
                +39 331 6907200<br>
                Office: +39 059 821672 <br>
                Fax: +39 059
                821492</i></font></font></font></p>
      <p class="western" style="margin-bottom: 0cm;"><font
          color="#1f497d"><font face="Arial, sans-serif"><font
              style="font-size: 9pt;" size="2"><span lang="en-US"><i>Web</i></span></font></font></font><font
          color="#92d050"><font face="Arial, sans-serif"><font
              style="font-size: 9pt;" size="2"><span lang="en-US"><i>:
                </i></span></font></font></font><font color="#0000ff"><u><a
              href="http://www.klarya.it/"><font color="#92d050"><font
                  face="Arial, sans-serif"><font style="font-size: 9pt;"
                    size="2"><span lang="en-US"><i>www.klarya.it</i></span></font></font></font></a></u></font><font
          color="#1f497d"><font face="Arial, sans-serif"><font
              style="font-size: 9pt;" size="2"><span lang="en-US"><i>
                  <br>
                </i></span></font></font></font><font color="#000099"><font
            face="Verdana, sans-serif"><font style="font-size: 7pt;"
              size="1"><span lang=""><b><img
                    src="cid:part2.00050006.03090509@klarya.it"
                    name="Immagine 5" height="61" width="170"
                    align="BOTTOM" border="0"></b></span></font></font></font><font
          color="#000099"><font face="Verdana, sans-serif"><font
              style="font-size: 7pt;" size="1"><span lang="en-US"><b><br>
                </b></span></font></font></font><font color="#000099"><font
            face="Verdana, sans-serif"><font style="font-size: 7pt;"
              size="1"><span lang=""><b><img
                    src="cid:part1.05000704.09050407@klarya.it"
                    name="Immagine 6" height="18" width="255"
                    align="BOTTOM" border="0"></b></span></font></font></font><font
          color="#000099"><font face="Verdana, sans-serif"><font
              style="font-size: 7pt;" size="1"><span lang="en-US"><b><br>
                </b></span></font></font></font><br>
      </p>
      <p class="western" style="margin-bottom: 0cm;" lang="en-US"><font
          color="#76923c"><font face="Arial, sans-serif"><font
              style="font-size: 8pt;" size="1">This
              e-mail transmission may contain legally privileged and/or
              confidential information. Please do not read it if you are
              not the intended recipient(s). Any use, distribution,
              reproduction or disclosure by any other person is strictly
              prohibited. If you have received this e-mail in error,
              please notify the sender and destroy the original
              transmission</font></font></font><font color="#76923c"><font
            face="Arial, sans-serif"><font style="font-size: 9pt;"
              size="2"><span lang="en-US">.</span></font></font></font></p>
      <p class="western" style="margin-bottom: 0cm;"><br>
      </p>
    </div>
  </body>
</html>