[OpenSIPS-Users] avp not saved or restored. Usrloc/Registrar module

Rik Broers RBroers at motto.nl
Thu Sep 26 11:37:11 CEST 2013

Hello List,

I'm having trouble getting $avp(attr) filled after the lookup("location")

I do the following:
On incoming register

modparam("auth_db", "load_credentials", "$avp(type)=type")
modparam("registrar", "attr_avp", "$avp(attr)")
modparam("usrloc", "attr_column", "attr")

if (is_method("REGISTER"))
                xlog("Register incoming");

                # authenticate the REGISTER requests
                if (!www_authorize("", "subscriber"))
                        www_challenge("", "0");

                xlog("attr avp : $avp(attr) ... type avp : $avp(type)");
                if (!save("location"))


This works. It prints nicely both values in the Log but when I check the location table the ATTR column is still NULL.
Also when I put it by hand on a value in the DB after Lookup("location") the AVP is still not filled..

I'm trying to have a custom value ready from DB on every incoming INVITE so I can decide on different scenario's.
During invite I do the following:
lookup("location","m", "$fu");

If I understand the documentation the $avp(attr) should be filled with the value provided during save.

In testing I got the value during every invite with proxy_authorize (which filled $avp(type) ). Unfortunately it seems that the other end is incapable of authorizing on invites so I have to save the value during register..

What's going wrong? And is there maybe an easier module to achieve what I want?

I'm using version: opensips 1.10.0-notls (x86_64/linux)

Kind regards,
Met vriendelijke groet,

Rik Broers
Voice engineer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130926/48bd7187/attachment.htm>

More information about the Users mailing list