Basically, the same characters as Asterisk Dialplan Patterns?, but adds the pipe | symbol.
Special Characters for Pattern Matching
X matches any digit from 0-9
Z matches any digit form 1-9
N matches any digit from 2-9
[1237-9] matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
. wildcard, matches one or more characters
| seperates dialing prefix from number
9|NXXXXXX Matches “95551234” but passes “5551234”
[2-7]XX Matches numbers 200-799
Outgoing calls in AMP are sent out using Trunks, according to the Outgoing Routing configuration.
Local calls on POTS, Long-distance on IAX2 (North America)
This is a basic setup with two trunks, with local calls on area code 613.
Configure ZAP trunk as follows:
This dial rule will match numbers “1817NXXXXX” and drop the “1817” to place the call locally (dialing 1+areacode on a POTS line generally causes Mabell to play an error message).
These rules will add “1817” to any 7-digit number, or 1 to a 10-digit number.
We also need two routes:
This will send numbers dialed as “1817NXXXXXX” or “817NXXXXX”, toll-free numbers, 7-digit numbers, and 911 to be matched by this route. Calls will first be sent on our POTS lines, and if they’re all used up, our IAX trunk.
Any numbers dialed as 10 or 11 digit long-distances numbers, as well as overseas calls will be sent on this route, using our IAX first. Since we set max channels to 3, after 3 calls, it will use our POTS line(s).
Two offices, extensions only
This example is just simply linking extensions at two offices, each with a * box. We’re only linking extensions, not sharing lines.
Let’s say we have the following extensions at each office:
* Office A: 100-199 (with the exception of below)
* Office B: 103, 104, 105, 119, 200-299,
At both offices, we need to setup an IAX trunk, and put the context as from-internal.
Route dial pattern at office A:
Route dial pattern at office B:
Then at both, set the only trunk to be the IAX trunk configured to connect at the other office. By setting max channels on those trunks, you can limit calls. Once the limit has been reached (with no other trunks to use) the caller will just hear a busy signal.