[OpenSIPS-Users] www_authorize return code
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Wed Jan 20 18:42:32 CET 2010
Hi Jayesh,
$retcode gives the return code of the LAST command you run in script. I
your case that is "log()" which is always true :D....You need to test
the $retcode value just after the pv_www_authorize(), otherwise you will
loose it.
Regards,
Bogdan
Jayesh Nambiar wrote:
> Hello All,
> I want to take my logic to a different route when authorize fails
> because of an invalid password. Ideally the www_authorize should
> return -2 when it fails because of invalid password.
> But the return code stays as 1 only every time, even if the auth fails
> or auth succeeds. I check the return code in the following manner:
> if (!pv_www_authorize("")) {
> log(1, "Authentication Failed");
> xlog("SCRIPT: Return Code is $retcode\n");
> }
> I can always see return code as 1, when I try registering using an
> invalid password.
> Am i missing something here, any pointers would be highly appreciated.
> I am using Opensips 1.6.1 !!
>
> --- Jayesh
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Bogdan-Andrei Iancu
www.voice-system.ro
More information about the Users
mailing list