<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 Bogdan-Andrei.</p>
<p><br>
</p>
<p>You are right. I have been used the attr_avp, as you explained, to save a specific information in each new record for table location. It works very well and such information goes to column attr.</p>
<p><br>
</p>
<p>However, I have created today a new column for such table: column <b>callerName</b>. And I have to save&nbsp;<span style="color: rgb(0, 111, 201);">$fn</span> in this new column for each new record too.</p>
<p><br>
</p>
<p>So, what I have just tried today is something like this:</p>
<p><br>
</p>
<p></p>
<div><span style="color: rgb(0, 111, 201);">modparam(&quot;registrar&quot;, &quot;attr_avp&quot;, &quot;$avp(attr)&quot;)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><br>
<span style="color: rgb(0, 111, 201);">modparam(&quot;registrar&quot;, &quot;attr_avp&quot;, &quot;$avp(<b>callerName</b>)&quot;)</span></div>
<p></p>
<p><br>
</p>
<p>...</p>
<p><br>
</p>
<p></p>
<div><span style="color: rgb(0, 111, 201);">is_method(&quot;REGISTER&quot;)) {&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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</span><br>
<span style="color: rgb(0, 111, 201);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $avp(<b>callerName</b>) = $fn;</span><br>
<span style="color: rgb(0, 111, 201);">}</span><i><span style="color: rgb(0, 111, 201);"></span></i><br>
<br>
</div>
...
<p></p>
<p><br>
</p>
<p>But, in this case, the <span style="color: rgb(0, 111, 201);">$fn</span> overwrites the specific information, because it seems that attr_avp will pointer always to the same column Attr, no matter what the name I give to the AVP.
<br>
</p>
<p><br>
</p>
<p>Do&nbsp; you know how to put every information in its correct column?</p>
<p>Is it possble to have two attr_avps related to two different columns in table location?<br>
</p>
<p><br>
</p>
<p>Any hint will be very helpful!</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" face="Calibri, sans-serif" color="#000000"><b>De:</b> users-bounces@lists.opensips.org &lt;users-bounces@lists.opensips.org&gt; em nome de Bogdan-Andrei Iancu &lt;bogdan@opensips.org&gt;<br>
<b>Enviado:</b> sexta-feira, 10 de junho de 2016 07:39<br>
<b>Para:</b> OpenSIPS users mailling list<br>
<b>Cc:</b> Cleide Aparecida Ribeiro do Prado; Daniel Lopes Fússia<br>
<b>Assunto:</b> Re: [OpenSIPS-Users] How to update table location, but directly on memory cache (RAM)?</font>
<div>&nbsp;</div>
</div>
<div><tt>Hi Rodrigo,<br>
<br>
What you try to do is not consistent.<br>
<br>
Either you use db_mode 1 to be have immediate writting in DB from usrloc module (see
<a title="Ctrl&#43;Clique ou toque para seguir o link" id="LPlnk660142" class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/usrloc.html#id294459">
http://www.opensips.org/html/docs/modules/1.11.x/usrloc.html#id294459</a>) -&gt; it will be safe to run your script query after the save().<br>
<br>
Either push the extra info you want to save into DB (and memory cache) via the attr AVP (see
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/registrar.html#id293909">
http://www.opensips.org/html/docs/modules/1.11.x/registrar.html#id293909</a>) and opensips will do everything for you.<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 09.06.2016 17:42, 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><span><br>
</span></p>
<p><span>Hi.</span></p>
<p><span><br>
</span></p>
<p><span>My script has the configuration: <br>
</span></p>
<p><span><br>
</span></p>
<p><span></span></p>
<div><span style="color:rgb(0,111,201)">modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)</span><br>
<span style="color:rgb(0,111,201)">modparam(&quot;usrloc&quot;, &quot;timer_interval&quot;,3)</span><br>
<br>
Always after receiving a new register in table location, I must to execute a code like this:<br>
</div>
<br>
<p><span><span style="color:rgb(0,111,201)">avp_db_query(&quot;UPDATE location...</span></span></p>
<p><br>
<span></span></p>
<p>That is, an update will complement data in the new register.<br>
<span></span></p>
<p><span><br>
</span></p>
<p><span></span>However, how could I immediately update table location if data might be in
<span>memory cache</span> (RAM) for 3 seconds. It could fail obviously.</p>
<p>The command avp_db_query UPDATE is acting over the database on hard disc, not in
<span>obviously</span>.</p>
<p>So, is there a way to update table location even still in cache (RAM)? If yes, when data from RAM is recorded into the database, the register will already be updated.</p>
<p><br>
</p>
<p>Any hint will be very helpful!</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>
</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>