[OpenSIPS-Users] How to deal with return code in www_authorize

Bogdan-Andrei Iancu bogdan at opensips.org
Wed May 28 08:07:57 CEST 2014


Hi Tito,

you can do :

switch ( www_authorize(...) ) {
     case 1 :
         # success
         break;
     case -1:
         break;
     case -2:
         # wrong passwd
         break;
     default:
         ....
}


or if you want to actually print the ret code :

$var(rc) = www_authorize(...);
xlog("Return code is $var(rc) \n")

switch ( $var(rc) ) {
     case 1 :
         # success
         break;
     case -1:
         break;
     case -2:
         # wrong passwd
         break;
     default:
         ....
}

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 28.05.2014 07:45, Tito Cumpen wrote:
> Group,
>
>
> I am looking for the ability to deal with return code -2 in a switch 
> statement with the intent to trigger a reply specifying that the 
> password is incorrect during registration. Can anyone provide 
> examples? I have tried including my case statement within 
> www_authorize but have not been able to trigger the return code.
>
>
> Thanks,
> Tito
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

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


More information about the Users mailing list