<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<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 Johan and Ben.</p>
<p><br>
</p>
<p>Yes. AVPops is a easy solution. However, it is easy for dada stored in DB.</p>
<p>What about data stored in RAM?</p>
<p><br>
</p>
<p>I'm using db_mode = 0 for module usrloc (so user location is always in RAM). So, if AVPops could extract data from the RAM too, as it does with queries and DB, it would be very easy.</p>
<p><br>
</p>
<p>I have looked for a solution using avp_db_query, but it works only over DB, not over RAM.</p>
<p>That is why I started trying to use function lookup() and avp attr, to get caller specific information.&nbsp;<br>
</p>
<p><br>
</p>
<p>Best regards.<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: &#43;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 &lt;users-bounces@lists.opensips.org&gt; em nome de johan de clercq &lt;johan@democon.be&gt;<br>
<b>Enviado:</b> quarta-feira, 22 de junho de 2016 07:35<br>
<b>Para:</b> 'OpenSIPS users mailling list'; 'sevpal'<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?</font>
<div>&nbsp;</div>
</div>
<div>
<div style="">
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">Ben is correct. &nbsp;In my opinion, a very easy solution.
</span></p>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<a name="_MailEndCompose"><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span></a></p>
<span style=""></span>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif"> users-bounces@lists.opensips.org [mailto:users-bounces@lists.opensips.org]
<b>On Behalf Of </b>Newlin, Ben<br>
<b>Sent:</b> Tuesday, June 21, 2016 5:24 PM<br>
<b>To:</b> sevpal &lt;sevpal@aol.com&gt;; OpenSIPS users mailling list &lt;users@lists.opensips.org&gt;<br>
<b>Subject:</b> Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?</span></p>
</div>
</div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
&nbsp;</p>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">It also seems like AVPOPS module [1] may be a good solution here as it has functions to pull data from a database into AVPs based by user.</span></p>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span></p>
<div>
<div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.5pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">[1]
<a style="color: blue; text-decoration: underline;" href="http://www.opensips.org/html/docs/modules/2.2.x/avpops.html">
http://www.opensips.org/html/docs/modules/2.2.x/avpops.html</a></span></p>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.5pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
</div>
</div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.5pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">Ben Newlin</span><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif"></span></p>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif">&nbsp;</span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">From: </span></b><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&lt;<a style="color: blue; text-decoration: underline;" href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>&gt;
 on behalf of sevpal &lt;<a style="color: blue; text-decoration: underline;" href="mailto:sevpal@aol.com">sevpal@aol.com</a>&gt;<br>
<b>Reply-To: </b>sevpal &lt;<a style="color: blue; text-decoration: underline;" href="mailto:sevpal@aol.com">sevpal@aol.com</a>&gt;, OpenSIPS users mailling list &lt;<a style="color: blue; text-decoration: underline;" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
<b>Date: </b>Tuesday, June 21, 2016 at 11:20 AM<br>
<b>To: </b>OpenSIPS users mailling list &lt;<a style="color: blue; text-decoration: underline;" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>&gt;<br>
<b>Subject: </b>Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?</span></p>
</div>
<div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
&nbsp;</p>
</div>
<div>
<div>
<div>
<div>
<div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Hi, have you tried/considered running a simple query on the database and parsing for the information you need?</span></p>
</div>
<div>
<div>
<div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">&nbsp;</span></p>
</div>
<div>
<div>
<p style="background: whitesmoke none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">From:</span></b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">
<a style="color: blue; text-decoration: underline;" href="mailto:pimenta@inatel.br" title="pimenta@inatel.br">
Rodrigo Pimenta Carvalho</a> </span></p>
</div>
<div>
<p style="background: whitesmoke none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">Sent:</span></b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black"> Tuesday, June 21, 2016 10:39 AM</span></p>
</div>
<div>
<p style="background: whitesmoke none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">To:</span></b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">
<a style="color: blue; text-decoration: underline;" href="mailto:users@lists.opensips.org" title="users@lists.opensips.org">
OpenSIPS users mailling list</a> </span></p>
</div>
<div>
<p style="background: whitesmoke none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black">Subject:</span></b><span style="font-size:10.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:black"> Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without
 side effects?</span></p>
</div>
</div>
</div>
<div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
</div>
</div>
<div>
<div id="divtagdefaultwrapper">
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Hi
</span><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">Răzvan</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">I have tried that idea. But that didn't work. The SIP INVITE message is being changed by the OpenSIPS in a wrong way, in my point of view.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Do you know some way to save the entire SIP INVITE message before calling lookup() and then make the saved message take place after the lookup() execution?</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">My original message is:</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">INVITE <a style="color: blue; text-decoration: underline;" href="sip:6001@myDomain.com.br">
sip:6001@myDomain.com.br</a> SIP/2.0</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Via: SIP/2.0/TCP 192.168.21.40:5090;rport;branch=z9hG4bK876727215</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">From: &lt;<a style="color: blue; text-decoration: underline;" href="sip:crdphmacl_SPnuV5xqtnSX@myDomain.com.br">sip:crdphmacl_SPnuV5xqtnSX@myDomain.com.br</a>&gt;;tag=179920819</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">To: &lt;<a style="color: blue; text-decoration: underline;" href="sip:6001@myDomain.com.br">sip:6001@myDomain.com.br</a>&gt;</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Call-ID: 1410250893</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">CSeq: 21 INVITE</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Contact: &lt;<a style="color: blue; text-decoration: underline;" href="sip:crdphmacl_SPnuV5xqtnSX@xxx.yyy.240.204:60033;transport=tcp">sip:crdphmacl_SPnuV5xqtnSX@xxx.yyy.240.204:60033;transport=tcp</a>&gt;</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Proxy-Authorization: Digest username=&quot;crdphmacl_SPnuV5xqtnSX&quot;, realm=&quot;localhost&quot;, nonce=&quot;5769458c000001cc263a7c0d6995dc48d42288ec6f8e4048&quot;, uri=&quot;<a style="color: blue; text-decoration: underline;" href="sip:6001@myDomain.com.br">sip:6001@myDomain.com.br</a>&quot;,
 response=&quot;0f4c122d2a0a28dea6194c235cd77430&quot;, algorithm=MD5</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Content-Type: application/sdp</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Max-Forwards: 70</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Subject: Phone call</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Content-Length:&nbsp;&nbsp; 227</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
</div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">This is being changed to:</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">INVITE </span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:red"><a style="color: blue; text-decoration: underline;" href="sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81">sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81</a>
 SIP/2.0</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Record-Route: &lt;<a style="color: blue; text-decoration: underline;" href="sip:myDomain.com.br;transport=tcp;lr;nat=yes;did=0b.b9e0cfe5">sip:myDomain.com.br;transport=tcp;lr;nat=yes;did=0b.b9e0cfe5</a>&gt;</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Via: SIP/2.0/TCP myDomain.com.br:5060;branch=z9hG4bKe2db.49d54587.0;i=1</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Via: SIP/2.0/TCP 192.168.21.40:5090;received=xxx.yyy.240.204;rport=60672;branch=z9hG4bK716249970</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">From: &lt;<a style="color: blue; text-decoration: underline;" href="sip:crdphmacl_SPnuV5xqtnSX@myDomain.com.br">sip:crdphmacl_SPnuV5xqtnSX@myDomain.com.br</a>&gt;;tag=12586028</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">To: &lt;<a style="color: blue; text-decoration: underline;" href="sip:6001@myDomain.com.br">sip:6001@myDomain.com.br</a>&gt;</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Call-ID: 1106771604</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">CSeq: 21 INVITE</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Contact: &lt;<a style="color: blue; text-decoration: underline;" href="sip:crdphmacl_SPnuV5xqtnSX@xxx.yyy.240.204:60672;transport=tcp">sip:crdphmacl_SPnuV5xqtnSX@xxx.yyy.240.204:60672;transport=tcp</a>&gt;</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Content-Type: application/sdp</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Max-Forwards: 70</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Subject: Phone call</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"><br>
</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">Content-Length:&nbsp;&nbsp; 224</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
</div>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">So, the caller is receiving its own SIP INVITE.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">That is why when A calls B, is A that rings, not B.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">It is becoming a bit complicated. So, I suspect I'm going to the incorrect direction....
</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Best regards.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<div id="Signature">
<div name="divtagdefaultwrapper">
<div>
<div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979</span></p>
</div>
</div>
</div>
</div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<div>
<div style="text-align: center; background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;" align="center">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">De:</span></b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">
<a style="color: blue; text-decoration: underline;" href="mailto:users-bounces@lists.opensips.org">
users-bounces@lists.opensips.org</a> &lt;<a style="color: blue; text-decoration: underline;" href="mailto:users-bounces@lists.opensips.org">users-bounces@lists.opensips.org</a>&gt; em nome de Răzvan Crainea &lt;<a style="color: blue; text-decoration: underline;" href="mailto:razvan@opensips.org">razvan@opensips.org</a>&gt;</span><span style="font-size:11.0pt; font-family:MingLiU; color:black"><br>
</span><b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">Enviado:</span></b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black"> terça-feira, 21 de junho de 2016 04:24</span><span style="font-size:11.0pt; font-family:MingLiU; color:black"><br>
</span><b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">Para:</span></b><span style="font-size:11.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">
<a style="color: blue; text-decoration: underline;" href="mailto:users@lists.opensips.org">
users@lists.opensips.org</a><br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">
</span></p>
<div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
</div>
</div>
<div>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">Hi, Rodrigo!</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">Have you tried restoring the R-URI after the caller lookup? Something like:</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">$var(ru) = $ru;</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">lookup(&quot;location&quot;, &quot;&quot;, &quot;$fu&quot;); # this takes the caller from FROM uri, which I think is more suitable than from contact uri</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">$ru = $var(ru);</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black"># continue your processing here</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">....</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black"># now do the real lookup for the callee</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">lookup(&quot;location&quot;);</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">Don't do the lookups in the reversed way, because you might loose some contacts.</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><tt style="font-family: &quot;Courier New&quot;;"><span style="font-size:10.0pt; color:black">Best regards,</span></tt><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black">Răzvan Crainea</span></pre>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black">OpenSIPS Solutions</span></pre>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black"><a style="color: blue; text-decoration: underline;" href="http://www.opensips-solutions.com" id="LPlnk925360">www.opensips-solutions.com</a></span></pre>
<div id="LPBorder_GT_14665081476460.4076791762148423" style="margin-bottom:15.0pt; overflow:auto">
<table class="MsoNormalTable" style="width:90.0%; background:white; border-top:dotted #C8C8C8 1.0pt; border-left:none; border-bottom:dotted #C8C8C8 1.0pt; border-right:none" width="90%" border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="border:none; padding:0in 0in 0in 0in" valign="top">
<div id="LPTitle_14665081476440.178337023690203">
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:16.0pt; font-family:&quot;Tahoma&quot;,sans-serif; color:#0078D7"><a style="color: blue; text-decoration: underline;" href="http://www.opensips-solutions.com/" target="_blank"><span style="text-decoration:none">Home &#8212; OpenSIPS Solutions</span></a></span></p>
</div>
<div id="LPMetadata_14665081476450.7986499792204279" style="margin-top:7.5pt; margin-bottom:12.0pt">
<p style="line-height: 10.5pt; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.5pt; font-family:&quot;Tahoma&quot;,sans-serif; color:#666666"><a style="color: blue; text-decoration: underline;" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></span></p>
</div>
<div id="LPDescription_14665081476460.5765572521696759">
<p style="line-height: 15pt; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.5pt; font-family:&quot;Tahoma&quot;,sans-serif; color:#666666">OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities.</span></p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">On 06/20/2016 09:02 PM, Rodrigo Pimenta Carvalho wrote:</span></p>
</div>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<div id="divtagdefaultwrapper">
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Dear OpenSIPS-users,</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">The table location has the column attr where I use to store specific additional information for each registration.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">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.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">For the callee, I use to invoke the lookup(&quot;location&quot;) 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.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">For the caller, I use to invoke:</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">$var(aorChamador) = $(ct.fields(uri));</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:#006FC9">lookup(&quot;location&quot;,&quot;&quot;,&quot;$var(aorChamador)&quot;);</span><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black"></span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">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!</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">According to the documentation, lookup will overwritten the Request-URI. I guess that is why the SIP signaling become incoherent.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">How could I get the caller attr specific information without side effects?</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Any hint will be very helpful!!</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">Best regards.</span></p>
<p style="background:white"><span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<div id="Signature">
<div name="divtagdefaultwrapper">
<div>
<div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-size:10.0pt; font-family:&quot;Calibri&quot;,sans-serif; color:black">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: &#43;55 35 3471 9200 RAMAL 979</span></p>
</div>
</div>
</div>
</div>
</div>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black">_______________________________________________</span></pre>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black">Users mailing list</span></pre>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black"><a style="color: blue; text-decoration: underline;" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a></span></pre>
<pre style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: &quot;Courier New&quot;;"><span style="color:black"><a style="color: blue; text-decoration: underline;" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></span></pre>
</blockquote>
<p style="background: white none repeat scroll 0% 0%; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">&nbsp;</span></p>
</div>
</div>
</div>
<div style="text-align: center; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;" align="center">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">
<hr size="2" width="100%" align="center">
</span></div>
<p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: &quot;Times New Roman&quot;,serif;">
<span style="font-family:&quot;Calibri&quot;,sans-serif; color:black">_______________________________________________<br>
Users mailing list<br>
<a style="color: blue; text-decoration: underline;" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a style="color: blue; text-decoration: underline;" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>