[OpenSIPS-Users] Basic example of Opensips with db_text and avpops
Bogdan-Andrei Iancu
bogdan at opensips.org
Fri Jul 18 14:57:24 CEST 2014
Hi Paul,
The usage of avp_db_load() is no right . see:
http://www.opensips.org/html/docs/modules/1.11.x/avpops.html#id293741
Instead of:
avp_db_load("$to/username", "s:site1/usr_preferences");
try:
avp_db_load("$to/username", "$avp(site1)/usr_preferences");
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 18.07.2014 00:43, Paul Williams wrote:
> Can anyone help me with a basic integration example of db_text module
> to store some custom data and reference that data using an AVP variable.
>
> These are the errors received.. I know this has to do with my
> avp_db_load, but I wanted to make sure I set everything else up as well.
>
> Jul 17 17:19:13 ServerName /usr/sbin/opensips[5526]:
> ERROR:avpops:parse_avp_db: error - bad avp flags
> Jul 17 17:19:13 ServerName/usr/sbin/opensips[5526]:
> ERROR:avpops:fixup_db_avp: parse failed
> Jul 17 17:19:13 ServerName/usr/sbin/opensips[5526]:
> ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 214
> Jul 17 17:19:13 ServerName/usr/sbin/opensips[5526]: ERROR:core:main:
> failed to fix configuration with err code -1
>
> Here's my current setup.
> I have a file called usr_preferences in the /etc/opensips/dbtext directory
>
> Contents are....
> id(int,auto) username(str) attribute(str) value(str)
> 1:1234:site1:9545551212
> 2:i5678:site2:7183334444
>
>
> my opensipsctl file has
> # database path used by dbtext or db_berkeley
> DB_PATH="/etc/opensips/dbtext"
>
>
>
> my relevant modules and params are
>
> loadmodule "db_text.so"
> modparam("db_text", "db_mode", 1)
>
> loadmodule "avpops.so"
> modparam("avpops", "db_url", "text:///")
> modparam("avpops", "avp_table", "usr_preferences")
>
>
> I'm referencing as
> avp_db_load("$to/username", "s:site1/usr_preferences");
>
> Any insight would be helpful, I'm sure I'm making some silly mistakes,
> but I've tried numerous combinations at this point.
> And yes, I've searched all over the place, but couldn't find anything
> that clarified exactly. I also read the docs and the book.
>
>
>
> _______________________________________________
> 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/20140718/4817912d/attachment.htm>
More information about the Users
mailing list