[OpenSIPS-Users] Log authentication errors

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Aug 27 18:15:57 CEST 2010


Note that by checking the return code of www_authorize() you can get the 
reason of the failure:
http://www.opensips.org/html/docs/modules/1.6.x/auth_db.html#id228268

Regards,
Bogdan

Stanisław Pitucha wrote:
> On 27/08/10 16:36, Joan wrote:
>   
>> At the moment I still have some doubts on where to put the logging
>> part, to minimize the false positives (setting like in the example it
>> marks the first packet as wrong)
>>     
>
> Not tested at all - but something like that should work.
>
> if (is_method("REGISTER")) {
>         # authenticate the REGISTER requests
>         if (!www_authorize("", "subscriber")) {
>                 if (is_present_hf("Authorization"))
>                         xlog("L_ERR","Auth error for $fU@$fd from $si");
>                 www_challenge("", "0");
>                 exit;
>         }
>
> Regards,
> Stan
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
20 - 24 September 2010, Frankfurt, Germany
www.voice-system.ro




More information about the Users mailing list