[OpenSER-Users] Hints about to capture codes negative www_authorize??

Marcio mrgalhan at gmail.com
Wed May 28 13:43:39 CEST 2008


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 at 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 at lists.openser.org
>> http://lists.openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> --
> http://www.asipto.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20080528/0bbe0bc9/attachment.htm 


More information about the Users mailing list