[OpenSIPS-Users] avpops module

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Sep 16 09:09:59 CEST 2014


Hi,

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) ?

So:

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 
scripts/dbtext/opensips/usr_preferences )

2) run in debug mode 4 to see more logs from opensips when the query is 
performed.

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.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 15.09.2014 21:33, discodog62 at aol.com wrote:
> I am confused on the avpops module.  I am hoping some one can straight 
> things out for me.
>
> I am using opensips 1.8
>
> Here is my relevant setup
>
> 1.2.3.4 is the IP that I am sending the call from.
>
> loadmodule "avpops.so"
>
> modparam("avpops", "db_url","text:///etc/opensips/dbtext")
> modparam("avpops","avp_table","avpops")
>
> my avpops db_text file
>
> id(int,auto) username(string) attribute(string) value(string) 
> uuid(string) domain(string) type(int)
> 1::myvar:AAAAA:1.2.3.4::
>
>
> I am hoping that I can use the avpops module to do the following....
>
> 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).
>
> avp_db_load("$si","$avp(myvar)/avpops");
>  xlog("L_INFO","****** Updated AVP: $avp(myvar) ******\n");
>
> When I do this I see <null> in my $svp(myvar).
>
> I also tried assigning the $si to a avp variable as well
>
> $avp(tst_uuid) = $si;
>
> avp_db_load("$avp(tst_uuid)","$avp(myvar)/avpops");
>
> same results.
>
>
> I added the avp_print()
>
> and I would see this
>
> Sep 15 11:10:07 [15608] INFO:avpops:ops_print_avp: p=0x7fa1364ae880, 
> flags=0x0002
> Sep 15 11:10:07 [15608] INFO:avpops:ops_print_avp:  id=<1>
> Sep 15 11:10:07 [15608] INFO:avpops:ops_print_avp:  val_str=<1.2.3.4 / 13>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140916/d717adb3/attachment-0001.htm>


More information about the Users mailing list