[OpenSER-Devel] problem with avp_db_load
Dan Pascu
dan at ag-projects.com
Tue Oct 23 14:40:30 CEST 2007
There seems to be a problem with avp_db_load in trunk.
I have this db scheme:
modparam("avpops", "db_scheme", "user_timeout:username_col=username;domain_col=domain;value_col=timeout;table=subscriber;value_type=integer")
and then the following code:
$avp(s:can_uri) := "sip:dan at umts.ro";
avp_db_load("$avp(s:can_uri)/uri", "$avp(s:timeout)/$user_timeout");
xlog("L_INFO", "incoming timeout for dan at umts.ro: $avp(s:timeout)");
avp_print();
Which produces:
incoming timeout for dan at umts.ro: <null>
avpops:ops_print_avp: p=0xb4408b20, flags=0x0080
avpops:ops_print_avp: id=<34303>
avpops:ops_print_avp: val_int=<20>
avpops:ops_print_avp: p=0xb4408ae8, flags=0x0003
avpops:ops_print_avp: name=<can_uri>
avpops:ops_print_avp: val_str=<sip:dan at umts.ro / 15>
notice that instead of creating $avp(s:timeout) it created $avp(i:34303)
while this code:
avp_db_query("select timeout from subscriber where username = 'dan' and
domain = 'umts.ro'", "$avp(s:timeout)");
xlog("L_INFO", "incoming timeout for dan at umts.ro: $avp(s:timeout)");
avp_print();
produces:
incoming timeout for dan at umts.ro: 20
avpops:ops_print_avp: p=0xb4408b38, flags=0x0001
avpops:ops_print_avp: name=<timeout>
avpops:ops_print_avp: val_int=<20>
avpops:ops_print_avp: p=0xb4408ae8, flags=0x0003
avpops:ops_print_avp: name=<can_uri>
avpops:ops_print_avp: val_str=<sip:dan at umts.ro / 15>
avp_db_load used to work in 1.1.x. I'm not sure about 1.2.x since I never
ran that.
--
Dan
More information about the Devel
mailing list