<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 Liviu.</p>
<p><br>
</p>
<p><br>
</p>
<p>When I use &quot;modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 1)&quot; the following query works fine and gives me the right result:<br>
</p>
<p><br>
</p>
<p>avp_db_query(&quot;select attr from location where contact like '$(ct.fields(uri){s.select,0,;})%' and username = '$fU'&quot;, &quot;$avp(caller)&quot;);<br>
</p>
<p><br>
</p>
<p>When I use &quot;modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 0)&quot; the above query doesn't give me the right value.</p>
<p><br>
</p>
<p>It is true because the query seems to acts only over the database, not over data from cached memory. And in this case the data from database obviously is not equal to that from cached memory. As you told me: &quot;<tt>&quot;db_mode&quot; of the usrloc module has nothing
 to do with &quot;avp_db_query&quot;</tt>&quot;</p>
<p><br>
</p>
<p>So, in this case, how to execute queries over data from cached memory?</p>
<p><br>
</p>
<p>Any hint will be very helpful!<br>
</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: &#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" color="#000000" face="Calibri, sans-serif"><b>De:</b> users-bounces@lists.opensips.org &lt;users-bounces@lists.opensips.org&gt; em nome de Liviu Chircu &lt;liviu@opensips.org&gt;<br>
<b>Enviado:</b> segunda-feira, 18 de abril de 2016 10:50<br>
<b>Para:</b> users@lists.opensips.org<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to avoid increasingly memory comsuption with AVPs?</font>
<div>&nbsp;</div>
</div>
<div><tt>Yes you can, &quot;db_mode&quot; of the usrloc module has nothing to do with &quot;avp_db_query&quot; from the avpops module! :)</tt>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a title="Ctrl&#43;Clique ou toque para seguir o link" id="LPlnk576238" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;" id="LPBorder_GT_14610132111630.6391455703826809">
<table style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" id="LPContainer_14610132111600.7656256304926659" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;" id="ImageCell_14610132111610.76708630189011">
<div style="background-color: rgb(255, 255, 255); height: 0px; position: relative; margin: auto; display: table; width: 0px;" id="LPImageContainer_14610132111610.21610823534496926">
<a target="_blank" href="http://www.opensips-solutions.com/" style="display: table-cell; text-align: center;" id="LPImageAnchor_14610132111620.7267541445565867"><img aria-label="Imagem de visualização com link selecionado. Toque duas vezes para abrir o link." style="display: inline-block; margin-left: auto; margin-right: auto; max-width: 250px; max-height: 250px; height: 99px; width: 250px; border-width: 0px; vertical-align: bottom;" height="99" width="250" src="http://www.opensips-solutions.com/imgs/slideshow/slide3.jpg"></a></div>
</td>
<td colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" id="TextCell_14610132111620.7739613079444125">
<div id="LPRemovePreviewContainer_14610132111620.6593015523776115"></div>
<div style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: &quot;wf_segoe-ui_light&quot;,&quot;Segoe UI Light&quot;,&quot;Segoe WP Light&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; line-height: 21px;" id="LPTitle_14610132111620.14754722172202683">
<a target="_blank" href="http://www.opensips-solutions.com/" style="text-decoration: none;" id="LPUrlAnchor_14610132111630.02617029266672566">Home &#8212; OpenSIPS Solutions</a></div>
<div style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: &quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; font-size: 14px; line-height: 14px;" id="LPMetadata_14610132111630.6997381698413069">
www.opensips-solutions.com</div>
<div style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: &quot;wf_segoe-ui_normal&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;" id="LPDescription_14610132111630.1889454696177959">
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.</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="moz-cite-prefix">On 18.04.2016 15:10, 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>Hi Liviu.</p>
<p><br>
</p>
<p>Thank you very much!</p>
<p>So, I'm comfortable with OpenSIPS.</p>
<p><br>
</p>
<p>In my OpenSIPS config file I have:</p>
<p><br>
</p>
<p>loadmodule &quot;usrloc.so&quot;<br>
modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,&nbsp;&nbsp; 2) <br>
</p>
<p><br>
</p>
<p>Can I change db_mode to zero and still have every avp_db_query working well?</p>
<p>That is,&nbsp; with db_mode=0 I will avoid using Sqlite and every SQL operation over user location will apply just over data in&nbsp;memory cache. Am I correct?</p>
<p><br>
</p>
<p>Any hint will be very helpful!</p>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</body>
</html>