If you have installed FusionPBX from the installation scripts you will notice it has already some fail2ban configurations. If you are using my RPM's, it doe not include any kind of this configuration as my philosophy is to specialize in the package to do one thing, not a do-it-all. Anyway, if you are only using FusionPBX with FreeSWITCH as a personal PBX those rules should be more than enough.
I recommend you do a quick reading of my previous fail2ban post where I describe the gap between Layer 7 exposures versus Layer 3 controls. You will understand my thinking.
If you are being more serious about your PBX or you are running a business you will find at one point those rules are not enough. I will explain myself a little more. As a commercial service, your exposure to the world is bigger; your domain is advertised, telephones do DNS, HTTP and SIP request to your servers and sooner than later you will start getting your first kiddy scripts targeting your servers. As you grow, you will find your customers are far to be technical; they do many dumb things (wrong password because they changed something on the service or inside jobs from tech staff are some examples) which leads to fail2ban rule applications.
There is nothing more harmful than a bad review from an ignorant customer. They do not know why they are being blocked. So, here is where we need to tun fail2ban and add some important information to pre-block offending IP's.
CNAM allows you to see not only what number the call is coming from but a label of who is calling. This will be very useful as if you see a number 1 613 800 7370, that might mean nothing to you, a name like LUIS D will ring a bell who is calling. There are many CNAM databases, some are public and free, some are paid.
FreeSWITCH offers mod_cidlookup to deal with that. You will need to edit the configuration file to put some information that will allow the information pulling, but that is not enough. After that, you will need to do a dial plan configuration. I will talk in this article, about that dial plan.
CIDLookup is the FreeSWITCH module who handles the Name Caller automatic setting. This mean that when an incoming call happens, mod_cidlookup will handle and set the correct name. This way, when the extension rings, you won't see only a number, but a name as well.
Mod_cidlookup has many capabilities, it can consult a database in two levels and it can ask a WEB based service. In this article, I will explain the last one.
For starters, you must get an account in OpenCNAM. If you get a paid one you will get more accuracy.