<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Alexey,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">You have not provided the list of columns you want to the sql_cacher config. Please review
<a href="https://opensips.org/docs/modules/3.2.x/sql_cacher.html#param_cache_table">
https://opensips.org/docs/modules/3.2.x/sql_cacher.html#param_cache_table</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">You need to add something like:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">columns=column_1 column_2 column_3<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">Ben Newlin</span><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.opensips.org> on behalf of Alexey <slackway2me@gmail.com><br>
<b>Date: </b>Monday, February 12, 2024 at 1:23 AM<br>
<b>To: </b>users@lists.opensips.org <users@lists.opensips.org><br>
<b>Subject: </b>Re: [OpenSIPS-Users] variable/avp value check<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt"> EXTERNAL EMAIL - Please use caution with links and attachments <br>
<br>
Hi list,<br>
<br>
We implemented next config:<br>
<br>
# cachedb module<br>
loadmodule "cachedb_local.so"<br>
modparam("cachedb_local", "cachedb_url", "local:///my_cache")<br>
modparam("cachedb_local", "cache_collections", "my_cache")<br>
<br>
# sql_cacher module<br>
loadmodule "sql_cacher.so"<br>
modparam("sql_cacher", "cache_table", "id=my_cache<br>
db_url=mysql://opensips:opensipsrw@x.x.x.x/opensips<br>
cachedb_url=local:///my_cache<br>
table=test<br>
key=base_id<br>
on_demand=0<br>
")<br>
<br>
<br>
$avp(list) = $sql_cached_value(my_cache:base_id:key1);<br>
xlog(" local_cash id = $(avp(list)[*])\n");<br>
avp_print();<br>
<br>
<br>
<br>
The DB is something like that:<br>
+----+------------+-----------+---+<br>
| id | base_id | comment |<br>
+----+------------+-----------+---+<br>
| 1 | 111 | id_111 |<br>
| 2 | 222 | id_222 |<br>
| 3 | 333 | id_333 |<br>
| 4 | ... | id_... |<br>
+----+------------+-----------+---+<br>
<br>
<br>
It seems the $sql_cached_value can extract the only one row<br>
which is mentioned in the ‘key’ value from the cached DB.<br>
But our goal is to extract the whole column (array)<br>
from the DB and store that array to $avp.<br>
<br>
Is there any way to extract the whole column<br>
(base_id in my sample) from the cached DB ?<br>
Maybe you can provide right way to make request via<br>
$avp(a) = $sql_cached_value(caching_name:column_name_1:key1); ?<br>
<br>
We expect something similar to<br>
avp_db_query("select base_id from test","$avp(list)");<br>
xlog("avp(list)=$(avp(list)[*])\n");<br>
<br>
<br>
Thanks in advance !<br>
<br>
-- <br>
best regards, Alexey<br>
<a href="https://alexeyka.zantsev.com">https://alexeyka.zantsev.com</a><br>
<br>
_______________________________________________<br>
Users mailing list<br>
Users@lists.opensips.org<br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>