<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><tt>Hi</tt><tt>,</tt><tt><br>
</tt><tt><br>
</tt><tt>I guess you try to load from avpops table the "myvar" avp
belonging to UUID "1.2.3.4" (which is actually the src IP) ?</tt><tt><br>
</tt><tt><br>
</tt><tt>So:</tt><tt><br>
</tt><tt><br>
</tt><tt>1) are you sure you properly order the values according
to the dbtext header . Note that the official db structure is a
bit different (see </tt><tt>scripts/dbtext/opensips/usr_preferences
)</tt><tt><br>
</tt><tt><br>
</tt><tt>2) run in debug mode 4 to see more logs from opensips
when the query is performed.</tt><tt><br>
</tt><tt><br>
</tt><tt>3) you may try to temporary use db_mysql (where you can
trace the actual query to DB level) to see which is the faulty
part - the why you do the query or the way you have the data in
DB.</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt>Regards,</tt><br>
<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>
On 15.09.2014 21:33, <a class="moz-txt-link-abbreviated" href="mailto:discodog62@aol.com">discodog62@aol.com</a> wrote:<br>
</div>
<blockquote
cite="mid:8D19F2A9D89481D-1E14-396D@webmail-m216.sysops.aol.com"
type="cite"><font size="2" color="black" face="arial"><font
style="font-size: small; background-color: rgb(255, 255,
255);" size="2" face="arial">I am confused on the avpops
module. I am hoping some one can straight things out for me.
</font><span style="font-size: small; background-color:
rgb(255, 255, 255);"></span>
<div style="font-size: small; background-color: rgb(255, 255,
255);"><font size="2" face="arial"><br>
</font></div>
<div style="font-size: small; background-color: rgb(255, 255,
255);"><font size="2" face="arial">I am using opensips 1.8</font>
<div style="font-size: 10pt;"><br>
</div>
<div style="font-size: 10pt;">Here is my relevant setup</div>
<div style="font-size: 10pt;"><br>
</div>
<div style="font-size: 10pt;">1.2.3.4 is the IP that I am
sending the call from.</div>
<div style="font-size: 10pt;"><br>
</div>
<div><font face="arial">loadmodule "avpops.so"</font></div>
<div><font face="arial"><br>
</font></div>
<div><font face="arial">modparam("avpops",
"db_url","text:///etc/opensips/dbtext") </font></div>
<div><font face="arial">modparam("avpops","avp_table","avpops")</font></div>
<div><font face="arial"><br>
</font></div>
<div><font face="arial">my avpops db_text file</font></div>
<div><font face="arial"><br>
</font></div>
<div><font face="arial">
<div>id(int,auto) username(string) attribute(string)
value(string) uuid(string) domain(string) type(int)</div>
<div>1::myvar:AAAAA:1.2.3.4::</div>
</font></div>
<div style="font-size: 10pt;"><br>
</div>
<div style="font-size: 10pt;"><br>
</div>
<div style="font-size: 10pt;"><span style="font-size: 10pt;">I
am hoping that I can use the avpops module to do the
following....</span></div>
<div style="font-size: 10pt;"><br>
</div>
<div style="font-size: 10pt;">when a call comes in I would
like to use the source ip to match the UUID and load the
attribute value into my variable $avp(myvar).</div>
<div style="font-size: 10pt;"><br>
</div>
<div>
<div><font face="arial">avp_db_load("$si","$avp(myvar)/avpops");</font></div>
<div><font face="arial"> </font></div>
<div><font face="arial"> xlog("L_INFO","****** Updated AVP:
$avp(</font>myvar<font face="arial">) ******\n");</font></div>
</div>
<div><font face="arial"><br>
</font></div>
<div><font face="arial">When I do this I see <null> in
my $svp(myvar).</font></div>
<div><font face="arial"><br>
</font></div>
<div><font face="arial">I also tried assigning the $si to a
avp variable as well </font></div>
<div><font face="arial"><br>
</font></div>
<div><font face="arial">$avp(tst_uuid) = $si;</font></div>
<div><font face="arial"><br>
</font></div>
<div>avp_db_load("<span style="font-size: 10pt;">$avp(tst_uuid)</span><span
style="font-size: 10pt;">","$avp(myvar)/avpops");</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">same results.</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">I added the avp_print()</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">and I would see this</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div>
<div><font face="arial">Sep 15 11:10:07 [15608]
<a class="moz-txt-link-freetext" href="INFO:avpops:ops_print_avp">INFO:avpops:ops_print_avp</a>: p=0x7fa1364ae880,
flags=0x0002</font></div>
<div><font face="arial">Sep 15 11:10:07 [15608]
<a class="moz-txt-link-freetext" href="INFO:avpops:ops_print_avp">INFO:avpops:ops_print_avp</a>:
id=<1></font></div>
<div><font face="arial">Sep 15 11:10:07 [15608]
<a class="moz-txt-link-freetext" href="INFO:avpops:ops_print_avp">INFO:avpops:ops_print_avp</a>:
val_str=<1.2.3.4 / 13></font></div>
</div>
</div>
</font>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
</body>
</html>