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

Rik Broers RBroers at motto.nl
Fri Sep 27 08:08:53 CEST 2013


The problem of getting the Variable into the database is now solved!
The was some integer and char mismatch in the database. Putting every used column on the same type (char) it worked!

But I am still struggling to get the AVP filled after a lookup, I have a successful match according to logging. But the AVP is not there.

Regards,
Met vriendelijke groet,

Rik Broers
Voice engineer


From: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] On Behalf Of Rik Broers
Sent: donderdag 26 september 2013 11:37
To: users at lists.opensips.org
Subject: [OpenSIPS-Users] avp not saved or restored. Usrloc/Registrar module

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");
                        exit;
                }

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

                exit;
        }

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/20130927/993a761a/attachment-0001.htm>


More information about the Users mailing list