Blocking weird caller strings

By default I find myself using the inbound routes to effectively block a lot of numbers that I do not want getting past my system, I also use it to put spam callers into a nice “Music On Hold Forever” because that’s the way I roll.

My question is, how do I block weird number strings like this one I got just the other day “V3071127180005234077”. Entering this in my normal way yields an error “Please enter a valid number”, my normal _V3071127180005234077 will not work.

I guess I could use the format _XXXNXXXXXX and _1NXXNXXXXXX instead of “Allow Any CID”. This should only allow 10 or 11 digit phone numbers, but what about international numbers?

For instance, I get calls coming in from England on a regular basis, numbers look like 011441634XXXXXX. How could I format that in the Pattern Matching? Something like 011+44NXXNXXXXXX?

You need to stop the calls at source, lookinto a properly setup Fail2ban to start with. Asterisk 10 or greater will be needed to counteract the latest wave of knuckle-draggers.

That is what I am attempting to do, use inbound routes of which I have been using successfully for years to catch numbers I want to route to say a terminate destination. I use the format _304NXXXXXX and send it to a destination of my ring all group. Numbers with _888NXXXXXX I send to the terminate call with X settings of which work really well.
What I want to do is stop anything outside of a 10 digit _XXXNXXXXXX so someone with anything other then a 10 digit number can’t pass my screening set up by my route. for instance, allow _304NXXXXXX but not _304NXXXXXXX is accomplished by setting _XXXNXXXXXX in my routes to allow all, anything outside of the constraints of that would not pass. This is where I am trying to figure out how to allow international calls from certain countries to be allowed. I do not know the format for say England.
This has nothing to do with fail2ban, it is not about hackers or anyone trying to access my system, this is only for keeping out spam calls that use random and sometimes made up numbers.
I find using this more effective than using the blacklist, the blacklist is used for single numbers only, with this I can block area codes, certain numbers and even city codes, the possibilities are endless.
So all I am seeking is the formatting for the number format for the UK, would it be something like _1441634NXXXXXX??

I thought Fail2ban was for hackers or someone trying to use my services? Which is in place and working, I have seen many attempts from the morons trying that.

I am mainly looking for the weird inbound calls using the above CID and or phone number. I am trying to stop anyone from using anything but 7 digit which really is not used much anymore, 10 digit and some international numbers.

My Asterisk Version is 11.5.1

If I understand you correctly you are asking to stop accepting incoming calls with those CID’s, however I believe you should only accept calls from DID’s configured in your inbound routes. Accepting any DID may be nice when you add a few DID’s at your provider and route to your system there’s nothing to do and the call comes in, but I believe that to be a problem and thus program each and every accepted number into the inbound routes.

That’s just my perspective.

Good Luck!

They are hackers and the are trying to use your services. Apparently either you have set-up fail2ban badly or you are actively allowing anonymous calls.

I just thought of something, this is not going to work for me as international calls do not normally pass CID to the USA. So I am scrapping this idea… Thanks for all your help so far.