zorlac,
Here is the coding guide. Let me know if this is helpful or totally useless.
First, you must understand the process. Here is what happens after a number is dialed.
The Phone DigitMap validates the number dialed.
The dialed number can be modified.
If the number is validated (matches a rule) it's passed to the Phone OutboundCallRoute.
The Phone OutboundCallRoute determines the trunk and routes the call.
The dialed number can be modified.
The trunk DigitMaps do nothing by themselves. You use them to organize the rules and they are only relevant when referred to by the Phone DigitMap or Phone OutboundCallRoute.
Decide how you're going to route calls to each trunk.
Here's what I'm trying to accomplish in this guide for an OBi110:
SP1 - 7, 10 or 11 digits numbers. Add local area code to 7 digits.
SP2 - 10 digits numbers with prefix "2". International calls.
VG1 - 10 digits numbers with prefix "8". 10 digit International calls for country code 44.
VG2 - 11 digit 1-800 numbers.
LIne - 7 and 10 digit numbers with prefix 9. Skip adding country code for area code "602". 911 and "#" for dial tone on PSTN line.
If a dialed number is unique, a prefix is not needed.
Then code each trunk DigitMap according to your requirements.
ITSP A DigitMap
(1xxxxxxxxxx|<1>[2-9]xxxxxxxxx|<1aaa>xxxxxxx)
aaa = Your local area code
ITSP B DigitMap
(<2:1>xxxxxxxxxx|011xx.)
Voice Gateway1 DigitMap
(<8:1>xxxxxxxxxx|01144xxxxxxxxxx)
Voice Gateway2 DigitMap
(18(00|88|77|66|55|44)xxxxxxx)
Line DigitMap
(<9:>602xxxxxxx|(<9:1>[2-9]xxxxxxxxx|<9:>xxxxxxx|911|<#:>)
Next, code the Phone DigitMap to validate dialed numbers for all trunks:
([1-9]|[1-9]x|1?xxxxxxxxxx|xxxxxxx|011xx.S3|(2|8|9)xxxxxxxxxx|9xxxxxxx|911S9|#|***|222222222)
[1-9] and [1-9]x validates speed dials
1?[2-9]xxxxxxxxx validates 10 and 11 digit numbers, including 800 numbers
xxxxxxx validates 7 digit numbers
011xx.S3 validates all international calls
(2|8|9)xxxxxxxxxx validates 10 digit numbers for SP2, VG1 and Line
911S9 for 911
# for dial tone on PSTN line.
*** for Auto Attendant #2
222222222 for Echo test
I removed all unused rules.
I don't modify the dialed number in the Phone Port DigitMap.
I don't use refer backs.
Now, code the Phone Port OutboundCallRoute using refer backs to the trunk DigitMaps.
The first trunk DigitMap that matches the dialed number will route the call out the specified trunk.
{(Mvg1):vg1},{(Mvg2):vg2},{(Msp1):sp1},{(Msp2):sp2},{(Mli):li},{(Mpp):pp},{***:aa2}
Processing moves left to right. VG2 must be placed before SP1. If it wasn't, all 1-800 numbers would be routed out SP1. Same for VG1 and SP2. If not, country code 44 would be routed out SP2. It doesn't matter the sequence of the other rules. I removed all unused code.
If you don't want to use single digit prefixes, just change them to anything you want.
That's it.