[OpenSER-Users] Parse error in "avpops" module
Hi, using OpenSer 1.2.1 and trying to use "usr_preferences" MySQL table for loading AVP's. My conf: loadmodule "avpops.so" ... modparam("avpops", "db_url","mysql://openser:openserrw@localhost/openser") modparam("avpops", "avp_table","usr_preferences") modparam("avpops","use_domain",1) ... route[5] # Auth { line #543: if (avp_db_load("$ru/domain","s:trusted_ips") && avp_check("s:trusted_ips", "eq/$sp/gi")) { xlog("L_INFO", "Authorized by usr_preferences AVPs\r\n"); } .... } I get this error: 0(0) ERROR:avops:parse_avp_db:: error - bad avp flags 0(0) ERROR:avpops:fixup_db_avp: parse failed 0(0) ERROR: fix_actions: fixing failed (code=-1) at cfg line 543 0(0) ERROR: fix_expr : fix_actions error ERROR: error -1 while trying to fix configuration Any idea of what I'm doing wrong? Thanks a lot for any help. -- Iñaki Baz Castillo ibc@in.ilimit.es
Try to use "$avp(s:trusted_ips)" instead... Iñaki Baz Castillo a écrit :
Hi, using OpenSer 1.2.1 and trying to use "usr_preferences" MySQL table for loading AVP's.
My conf:
loadmodule "avpops.so" ... modparam("avpops", "db_url","mysql://openser:openserrw@localhost/openser") modparam("avpops", "avp_table","usr_preferences") modparam("avpops","use_domain",1) ... route[5] # Auth { line #543: if (avp_db_load("$ru/domain","s:trusted_ips") && avp_check("s:trusted_ips", "eq/$sp/gi")) { xlog("L_INFO", "Authorized by usr_preferences AVPs\r\n"); } .... }
I get this error:
0(0) ERROR:avops:parse_avp_db:: error - bad avp flags 0(0) ERROR:avpops:fixup_db_avp: parse failed 0(0) ERROR: fix_actions: fixing failed (code=-1) at cfg line 543 0(0) ERROR: fix_expr : fix_actions error ERROR: error -1 while trying to fix configuration
Any idea of what I'm doing wrong?
Thanks a lot for any help.
El Tuesday 31 July 2007 15:44:59 Marc LEURENT escribió:
Try to use "$avp(s:trusted_ips)" instead...
Yes :) that was the error, but in the doc http://www.openser.org/docs/modules/1.2.x/avpops.html#AEN226 there is an example with no $avp: avp_db_load("$ru/domain","i:/domain_preferences"); Thanks. -- Iñaki Baz Castillo ibc@in.ilimit.es
The syntax you use is pretty old, you missed two releases, see: http://openser.org/dokuwiki/doku.php/install:1.0.x-to-1.1.x#avpops http://openser.org/dokuwiki/doku.php/install:1.1.x-to-1.2.x#avpops if you need to migrate older installations to 1.2 Daniel On 07/31/07 16:37, Iñaki Baz Castillo wrote:
Hi, using OpenSer 1.2.1 and trying to use "usr_preferences" MySQL table for loading AVP's.
My conf:
loadmodule "avpops.so" ... modparam("avpops", "db_url","mysql://openser:openserrw@localhost/openser") modparam("avpops", "avp_table","usr_preferences") modparam("avpops","use_domain",1) ... route[5] # Auth { line #543: if (avp_db_load("$ru/domain","s:trusted_ips") && avp_check("s:trusted_ips", "eq/$sp/gi")) { xlog("L_INFO", "Authorized by usr_preferences AVPs\r\n"); } .... }
I get this error:
0(0) ERROR:avops:parse_avp_db:: error - bad avp flags 0(0) ERROR:avpops:fixup_db_avp: parse failed 0(0) ERROR: fix_actions: fixing failed (code=-1) at cfg line 543 0(0) ERROR: fix_expr : fix_actions error ERROR: error -1 while trying to fix configuration
Any idea of what I'm doing wrong?
Thanks a lot for any help.
El Tuesday 31 July 2007 15:37:01 Iñaki Baz Castillo escribió:
if (avp_db_load("$ru/domain","s:trusted_ips") && avp_check("s:trusted_ips", "eq/$si/gi")) {
I get this error:
0(0) ERROR:avops:parse_avp_db:: error - bad avp flags 0(0) ERROR:avpops:fixup_db_avp: parse failed 0(0) ERROR: fix_actions: fixing failed (code=-1) at cfg line 543 0(0) ERROR: fix_expr : fix_actions error ERROR: error -1 while trying to fix configuration
It works in this way: if ( avp_db_load("$ru/domain", "$avp(s:trusted_ips)") && avp_check("$avp(s:trusted_ips)", "eq/$si/gi") ) { But it doesn't work in this way that is documented in http://www.openser.org/docs/modules/1.2.x/avpops.html#AEN226: if ( avp_db_load("$ru/domain", "s:trusted_ips") && avp_check("$avp(s:trusted_ips)", "eq/$si/gi") ) { Anyway it works now ;) -- Iñaki Baz Castillo ibc@in.ilimit.es
participants (3)
-
Daniel-Constantin Mierla -
Iñaki Baz Castillo -
Marc LEURENT