Hi.....

I'm grateful for the tip but within the Openser's Config the variable "$retval"  is not recognized....

Below the log....
  ERROR:core:pv_parse_spec: error searching pvar "retval"
May 28 08:18:57 i206529 openser: ERROR:core:pv_parse_spec: wrong char [
May 28 08:18:57 i206529 openser: CRITICAL:core:yyerror: parse error in config file, line 385, column 12-20: unknown script variable

and the config script...
............................omitted output.......................
        if (!www_authorize("rio.voip.br", "subscriber")) {
                xlog("L_ALERT", "REGISTER ($fU) ($ru) nao autorizado\n");
                log(1, "Enviando 401 - Unauthorized (Username)\n");
#               perl_exec("chkval"); # check retval but still not working...
                switch ($retval){
                        case 1:
                                log("process authentication success");
                        break;
                        case -1:
                                log("Non Existent User");
                        break;
                        case -2:
                                log("Invalid Password");
                        break;
                        case -3:
                                log("Stale Nonce");
                        break;
                        case -4:
                                log("No Credentials");
                        break;
                        default:
                                log("Process Other Requests Here");
                }
                www_challenge("rio.voip.br", "1");
                return;
........................omitted output................

Any hint of how I can make the Openser's config recognize the pvar "$retval"??

regards,
Marcio

2008/5/28 Daniel-Constantin Mierla <miconda@gmail.com>:
Hello,


On 05/27/08 22:13, Marcio wrote:
Hi,

Who would have tips on how to capture the return codes negative of the function "www_authorize" ???
I read somewhere that said to use $retval........but ...How can I to use it ("$retval") ??

-1 - Non existent user;
-2 - invalid passwd;
-3 - stale nonce;
-4 - no credentials;
-5 - error;

Any help will be greatly appreciated.
one mode is with switch statement:

www_authorize(...);
switch($retval)
{
  case -1:
        ........
  break;
  case -2:
        .......
  break;
  ....
}
http://www.openser.org/dokuwiki/doku.php/core-cookbook:devel#switch

Daniel

 thx,

Marcio
------------------------------------------------------------------------

_______________________________________________
Users mailing list
Users@lists.openser.org
http://lists.openser.org/cgi-bin/mailman/listinfo/users
 

--
http://www.asipto.com