Hello,
i tried to reproduce, but I got no same result. If the avp is null, the
returned values is false in comparisons.
Could you send log messages and backtrace?
Cheers,
Daniel
On 03/23/07 10:37, Asterisk Expert wrote:
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
------------------------------------------------------------------------
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users