Blocking Outbound Calls to Area Codes / States

If you run a large business, eventually you will run into problems with certain people or places, as the saying goes, you can’t make everyone happy all the time.

For example, say you need to stop calling a certain state, well obviously you can stop providing leads to those places, but when agents do their own due diligence and research to find prospects, it may be necessary to intervene.

Now, we are assuming you are running FreePBX, but this dialplan will also work in Asterisk if you put it in the right place.

  • First: identify the area codes that you want to block. Let’s say for example: 627, 585, and 343.
  • Find extensions_custom.conf.
  • Find (or add) the [outbound-allroutes-custom] heading.
  • Add the following dialplan:

exten => _627XXXXXXX,1,Hangup
exten => _585XXXXXXX,1,Hangup
exten => _343XXXXXXX,1,Hangup

Save the document and then reload asterisk with
$ asterisk -rx “core reload”

Now you’ve blocked calls to those area codes! 🙂
If you want, you can take it a step further and play a message saying ‘Calls to XXXXXX have been blocked’ before hanging up.

Tagged with: , , , ,
Posted in FreePBX, Tips n Tricks

Leave a Reply

Your email address will not be published. Required fields are marked *

*