One simple thing you can do to stop unwanted callers with FreePBX is install the “Blacklist” module. Obviously this will only work if the Caller ID number is presented to your system when the caller rings.
To install the module click on the Tools tab in FreePBX and then the Module Admin menu option. Then click “Check for updates online” and you should see all the available modules. Select the “Blacklist” module and select “Download and install”