Hints On Route Dial Patterns and Trunk Dial Rules
Hints On Route Dial Patterns and Trunk Dial Rules
New users of FreePBX are often confused by the fact that there is a place to
enter "Dial Rules" when creating a new Trunk, and "Dial Patterns" when
creating a new Outbound Route. Since the construction of these seems similar,
users try to do something in the wrong place and it doesn't work. This is a brief
attempt to explain the difference.
Trunk Dial Rules
First let's deal with trunks, because they are perhaps the easiest to understand.
The thing to remember about Trunk Dial Rules is that they are ONLY used for
adding numbers to, or subtracting numbers from the number being sent to the
trunk. Trunk Dial Rules are NEVER used to allow or restrict numbers that may
be dialed. Therefore, it follows that any entry not containing a | character (to
strip off number at the start of the entry) or a + character (to add numbers at
the start of an entry) is totally useless - it will simply waste processor time
while the system looks at those entries.
Route Dial Patterns
Route Dial Patterns are used to specify what numbers are allowed to go out via
that route. When a call is placed, the actual number dialed by the user is
compared with the Dial Patterns in each route (from highest to lowest priority)
until a match is found. If no match is found in any route, the call fails (there is
"no route" for that call). If the number dialed matches a pattern in more than
one route, only the rules in the route with the highest priority are used. In
other words, if a call tries to use that route and fails, it does not keep trying
additional routes to see if it matches another. This is actually desirable
behavior because it allows you to force certain calls to go out via lowercost
routes. Route Dial Patterns cannot be used to add digits to the number dialed
by the user. However, you can strip off leading digits before passing them to a
trunk. This is most useful if you use a specific dialing code to access a particular
route (for example, "9" to access an outside line). Note that each route can be
set to access one or more trunks. Each trunk may require different translations
(changing what was actually dialed to something else before sending it on is
called a translation in telephone-speak) so you don't want to strip digits at the
route level if only some of your trunks will require it and some don't. Route Dial
Patterns only allow calls, they cannot block calls. The only way to block certain
patterns is to make sure they are not included in any route. Or, you can include
the blocked pattern in a higher priority route, then make sure that route
doesn't send calls to any trunks that cost money. The easiest way to do this is
to create an ENUM trunk.