Asterisk security and "Failed to authenticate device" messag

chan_sip.c several times shows messages like this:

[2013-09-09 09:14:40] NOTICE[32002][C-00002bc8] chan_sip.c: Failed to authenticate device 1001sip:1001@176.xxx.xxx.xxx;tag=f6479c12

As this server is used for endpoint to public service, i need to open sip port. I think that there are invites that are trying to hack server, but this message is not useful for automatic banning this.

I’ve propose change few lines in chan_sip.c to include IP that originates this message:

18523c18523
< 			ast_log(LOG_NOTICE, "Failed to authenticate device %s [IP: %s]\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));
---
> 			ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From"));
24619c24619
< 			ast_log(LOG_NOTICE, "Failed to authenticate device %s [IP: %s]\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));
---
> 			ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From"));
25282c25282
< 			ast_log(LOG_NOTICE, "Failed to authenticate device %s [IP: %s]\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));
---
> 			ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From"));
27328c27328
< 		ast_log(LOG_NOTICE, "Failed to authenticate device %s [IP: %s]\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));
---
> 		ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From"));
27543c27543
< 			ast_log(LOG_NOTICE, "Failed to authenticate device %s for SUBSCRIBE [IP: %s]\n", sip_get_header(req, "From"), ast_sockaddr_stringify(addr));
---
> 			ast_log(LOG_NOTICE, "Failed to authenticate device %s for SUBSCRIBE\n", sip_get_header(req, "From"));

Patches posted here cannot be used, for legal reasons.

New features are only accepted against the trunk version.

The trunk version and version 11 already have a security log which is intended for this sort of purpose.