Thoughts, tips and ideas on next-gen technology by: Moshe Brevda


Restricting call transfers with FreePBX

So, you've managed to lock down your pbx. No unwanted calls to any premium rate numbers anymore. Some of your users cant even call home unless you whitelist their number (I mean you Susan, the chatty, always on the phone secretary!). But they have discovered one way to beat the system: [censored! (but here is a hint: it has to do with call transfers)]. Here is a simple and effective way restrict call transfers to internal extensions only.

First, a little technical jargon to confuse/impress you: transferring a call with asterisk, is almost like placing one. Asterisk takes the extension (i.e. any number) that you called and tries to find a matching extension in the "call-transfer-context" - whatever that may be. With freepbx, that context is set to from-internal, the omnipresent FreePBX context. For more on how FreePBX works with asterisk contexts and extensions, see here.

To restrict calls from being transferred to local extensions only, all you need to do is to replace the default context with a more restrictive one. To do that, open /etc/asterisk/globals_custom.conf and add the following one line:


This will restrict all transfers to local extensions only. If you need more fine grained control over the context, concider creating a whitelist based context.

Moshe Brevda, FreePBX Development Team
lazytt - FreePBX forums
hi365 - IRC

Found this tip useful? Don't forget to donate by click the donate button to the right!