<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Razvan Crainea.</p>
<p><br>
</p>
<p>I didn't know about this possibility.</p>
<p><br>
</p>
<p>I will try this idea now.</p>
<p><br>
</p>
<p>Thank you very much!!</p>
<p><br>
</p>
<p>Best regards.<br>
</p>
<p><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>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> users-bounces@lists.opensips.org <users-bounces@lists.opensips.org> em nome de Răzvan Crainea <razvan@opensips.org><br>
<b>Enviado:</b> terça-feira, 21 de junho de 2016 04:24<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?</font>
<div> </div>
</div>
<div>
<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 id="LPlnk374063" 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 type="cite">
<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>_______________________________________________
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>
</div>
</div>
</div>
</body>
</html>