[OpenSIPS-Users] How to log INVITEs with failed authentication

Vlad Paiu vladpaiu at opensips.org
Tue Mar 13 16:47:24 CET 2012


Hello,

You could check for the presence of the Proxy-Authorization header. 
Something like
     if (is_present_hf("Proxy-Authorization"))
         xlog("L_ERROR","Auth error for $fU@$fd from $si cause -1 
INVITE\n");

Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com


On 03/13/2012 05:42 PM, Adam Raszynski wrote:
> Hi All,
>
> I would like to log all INVITE requests sent by users with wrong 
> authentication details
>
> The problem is that I only need really failed auth INVITE attempts 
> (with wrong username/password), not all requests sent with no 
> credentials (before challenged by OpenSIPS).
>
> Following script logs also requests with no credentials, it would be 
> great if someone will help me to correct it:
>
> if (!check_source_address("0")) {
> if (!proxy_authorize("", "subscriber")) {
> xlog("L_ERROR","Auth error for $fU@$fd from $si cause -1 INVITE\n");
> proxy_challenge("", "0");
> exit;
> }
> if (!db_check_from()) {
> sl_send_reply("403","Forbidden, use FROM=ID");
> exit;
> }
> consume_credentials();
> # caller authenticated
> }
>
>
> Best Regards,
> Adam
>
>
> _______________________________________________
> 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/20120313/e65e51a5/attachment.htm>


More information about the Users mailing list