Silencing login errors in the CLI

We are a VOIP provider to the public, and as such we have many transient customers. Over time, this has resulted in a fair number of ATAs in the field that attempt to log in, but are denied, or have had their configuration removed entirely. Unfortunately, this means that using the Asterisk CLI is becoming increasingly difficult, as more than half of the messages I get now end in “No matching peer found” or “Wrong password”.

I’ve already created a workaround to this problem by keeping the customer’s SIP configuration around, and removing their dialplan and sending outbound calls to a recording about how the account is cancelled, but that doesn’t help with legacy customers who stupidly refuse to remove their non-working ATA from the network. It’s also worth noting that I’m really not at all interested in the script kiddies and their login failures.

Is there any way to get Asterisk to stop reporting bad logins to the CLI? I’m fine if it logs them, I just don’t care to see them while I’m debugging dialplans.

your best bet will be to find the parts of chan_sip.c which are doing the logging and change the level of log it’s using.

I believe all those are LOG_WARNING level, you probably want to change them to LOG_DEBUG so they don’t crowd the CLI. Do a grep search on chap_sip for the particular message which is annoying you.

change:
ast_log(LOG_WARNING,“blahbla”)

to:
ast_log(LOG_DEBUG,“blahblah”)

make all
make install
restart asterisk
done.