[Users] OpenSER crashes when attempting to use null avp variable

Asterisk Expert asterisk.expert at gmail.com
Fri Mar 23 09:37:02 CET 2007


Hello,
I'm using openser 1.2.0. I have following section in my openser.cfg.

avp_db_query("SELECT active, accountcode FROM openser_ip_auth WHERE
ip_addr='$src_ip'","$avp(s:active);$avp(s:accountcode)");
        xlog("L_INFO", "\n$avp(s:active):::$avp(s:accountcode)\n");
        if (!avp_check("$avp(s:active)","eq/1/I"))
        {
            xlog("L_ERR", "$si [$Tf]: $rm $fu -> $ru: REGISTER: bad
credentials, ask for credentials\n");

            #authentication failed
            www_challenge("", "0");
            setflag(1);
            return;
        }
Basically I'm doing IP based authentication. I have used the similar method
in version 1.1 but openser 1.2.0 crashes if the query in avp_db_query
returns no rows which keeps those two avp variables null. Is this a bug or
I'm doing something wrong?
I also tried "==" operator for comparison but it crashes whenever it is
trying to access one of those two variables.
-- 
Regards
Ruchir Brahmbhatt
Ecosmob Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20070323/f9cbc3c3/attachment.htm 


More information about the Users mailing list