This tutorial is based on Asterisk 1.6.2 and FreePBX 2.8
The FreePBX General Settings menu page controls some system-wide FreePBX settings.
A couple of the most useful settings on this page are the “Country Indications” and “Allow Anonymous Inbound SIP Calls?” settings –
“Country Indications” – controls the ring tone that you will hear where a rintone is generated by the system.
“Allow Anonymous Inbound SIP Calls?” – controls whether your system will accept inbound SIP calls from devices/trunks that are not registered with the system. While it is safer to have this set to “No” it is often necessarily to set it to “Yes” to allow connections to your trunk providers.
Setting “Allow Anonymous Inbound SIP Calls” to Yes is potentially unsafe. It gives attacks a chance to connect to your server via SIP in an attempt to compromise it. Please see here for more information – http://sysadminman.net/blog/2011/sip-scanning-attacks-freepbx-allow-anonymous-3276
If you do need to set it to “Yes” then also create a generic Inbound Route and set the destiation to Terminate Call / Hangup. This will ensure that calls that come in that are not specified in a specific Inbound Route will get dropped.