<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><tt>Hi, Rodrigo!</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>Have you tried restoring the R-URI after the caller lookup?
        Something like:</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>$var(ru) = $ru;</tt></p>
    <p><tt>lookup("location", "", "$fu"); # this takes the caller from
        FROM uri, which I think is more suitable than from contact uri</tt></p>
    <p><tt>$ru = $var(ru);</tt></p>
    <p><tt># continue your processing here<br>
      </tt></p>
    <p><tt>....</tt></p>
    <p><tt># now do the real lookup for the callee</tt></p>
    <p><tt>lookup("location");</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>Don't do the lookups in the reversed way, because you might
        loose some contacts.</tt></p>
    <p><tt><br>
      </tt></p>
    <p><tt>Best regards,</tt></p>
    <pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 06/20/2016 09:02 PM, Rodrigo Pimenta
      Carvalho wrote:<br>
    </div>
    <blockquote
cite="mid:BY2PR02MB1655B3FBF2C75AF9E585B066B52A0@BY2PR02MB1655.namprd02.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
        <p>Dear OpenSIPS-users,</p>
        <p><br>
        </p>
        <p>The table location has the column attr where I use to <span>store
            specific additional information for each registration</span>.</p>
        <p>Whenever A calls B, I have to read this specific information
          from the A record and from the B record. That is, I need to
          get and handle specific information about the caller and
          callee.</p>
        <p><br>
        </p>
        <p>For the callee, I use to invoke the lookup("location")
          function that put the needed information in the attr_avp. That
          is good and works very well. Then, I just have to read the
          attr_avp to get such specific information.</p>
        <p><br>
        </p>
        <p>For the caller, I use to invoke:</p>
        <p><br>
        </p>
        <p><span style="color: rgb(0, 111, 201);">$var(aorChamador) =
            $(ct.fields(uri));</span></p>
        <p><span><span style="color: rgb(0, 111, 201);">lookup("location","","$var(aorChamador)");</span><br>
          </span></p>
        <p><br>
        </p>
        <p>However it causes amazing side effect in the SIP signaling.
          Ex: When A calls B, B stays quiet and A rings. So A can answer
          A. Crazy!</p>
        <p>According to the documentation, lookup will <span><span>overwritten</span></span>
          the
          <span>Request-URI. <span>I guess that is why the SIP
              signaling become incoherent.</span></span></p>
        <p><span><span><br>
            </span></span></p>
        <p><span><span>How could I get the caller attr specific
              information without side effects?</span></span></p>
        <p><span><span><br>
            </span></span></p>
        <p><span><span>Any hint will be very helpful!!</span></span></p>
        <p><span><span><br>
            </span></span></p>
        <p><span><span>Best regards.</span></span><br>
        </p>
        <p><br>
        </p>
        <div id="Signature">
          <div name="divtagdefaultwrapper"
            style="font-family:Calibri,Arial,Helvetica,sans-serif;
            font-size:; margin:0">
            <div class="BodyFragment"><font size="2">
                <div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
                  Inatel Competence Center<br>
                  Software<br>
                  Ph: +55 35 3471 9200 RAMAL 979<br>
                </div>
              </font></div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>
    <br>
  </body>
</html>