Exclamation ("!") character in dial patterns or rules

Inherited a freePBX system that has the exclamation (!) in the outbound route dial patterns. For example,


Now, I recognize this from Linksys PAP and SPA device dial strings; it means “not” or disallow.

Does the “!” have any meaning/affect in the freePBX dial patterns/rules? I found the following http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns for the use of “!” in asterisk.

I think the above use that the “!” is superfluous and does NOT bar the 976 or 900 numbers.

Insights appreciated.

With thanks,

You are correct… the exclamation point means something different in Asterisk. The easiest way to block certain patterns in FreePBX is to create an ENUM trunk (if you don’t already have one), then create a new outbound route that contains the patterns you want to block, and let it access ONLY the ENUM trunk (and make sure that route is higher in priority than the “regular” route that would otherwise match those patterns). There is no way you’re going to be able to complete a 900/976 call via ENUM (and if by chance it ever did go through via the ENUM trunk, you shouldn’t get the bill), so the call will fail.

If you only have a few patterns to block, here’s an easier way. For each pattern, create a Misc Application. For the feature code, use the pattern but put an underscore in front of it, (e.g. _900NXXXXXX for 900 calls dialed without a leading “1”). Then make the destination Terminate Call: Congestion, or send it to a system recording or handle it as you like. It seems Misc. Applications are processed before outbound routes, so that’s a pretty easy way to block just a handful of patterns. But the ENUM trunk trick is easier if you have a long list of patterns you want to block (such as high cost international numbers, etc.)


As I mentioned, I inherited this freePBX quite recently. I normally use a custom trunk that congestions out.

trunk sequence

LOCAL/[email protected]

where “forbidden-dials” is in


exten => _[0-9a-zA-Z*#].,1,Congestion(12)
exten => _[0-9a-zA-Z*#].,2,Hangup