I've helped several people with their dialing rules by suggesting fixes to what they have already done, but never showed the forum how I setup my own dialing rules. This example follows my coding philosophy. I tried to include the most common requirements.
First, a lot of people don't 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 it's passed to the Phone OutboundCallRoute.
- The Phone OutboundCallRoute determines the trunk and makes the call.
The dialed number can be modified.
Notice there is no mention of the trunk DigitMaps. The trunk DigitMaps do nothing by themselves. They are only relevant when referred to by the Phone DigitMap or Phone OutboundCallRoute.
Here's what I'm trying to accomplish in this example:
SP1 - 7, 10 or 11 digits numbers. Add local area code to 7 digits.
SP2 - 10 digits numbers with prefix "2". Strip prefix and replace with "1". International calls.
VG3 - 11 digit 1-800 numbers.
LIne - 7 and 10 digit numbers with prefix 9. Strip prefix. Replace prefix with "1" on 10 digit call. Skip adding country code for area code "602". "9" for dial tone on PSTN line.
Setup a user defined DigitMap to only validate and not modify the dialed number for all trunks. I'm naming it "ud1" and it looks like this:
([129]?xxxxxxxxxx|9?xxxxxxx|011xx.|9)
[129]?xxxxxxxxxx validates 10 and 11 digit numbers for all trunks.
9?xxxxxxx validates 7 digit numbers for SP1 and Line.
011xx. validates international calls for SP2.
9 for Line.
Place (Mud1)| at the beginning of the default Phone DigitMap.
If you don't want to create a User Defined DigitMap place the above rules at the beginning of the default Phone DigitMap.
Trunk DigitMaps:
SP1 DigitMap = (1?xxxxxxxxxx|<480>xxxxxxx)
SP2 DigitMap = (<2:1>xxxxxxxxxx|011xx.)
VG3 DigitMap = (18(00|88|77|66|55|44)xxxxxxx)
Line DigitMap = (<9:>602xxxxxxx|<9:1>xxxxxxxxxx|<9:>xxxxxxx|<9:>)
Place the following at the beginning of the default Phone OutboundCallRoute:
{(Mvg3):vg3},{Msp1:sp1},{(Msp2):sp2},{(Mli):li},
All the substitution is accomplished in the Phone OutboundCallRoute by referring back to the Trunk DigitMaps. Notice that I placed VG3 first. If I didn't all 1-800 numbers would go out SP1.
For those of you that re-route calls from another ATA/OBiApp this coding technique incorporates very easily without changing any code. The remote ATA/OBIApp would dial the outgoing number in the same format as the local OBi. Setup Speed Dial #9 on the OBION App to dial "9" to get dial tone on the PSTN line.
SP2 X_InboundCallRoute:
{(userid)>(Mvg3):vg3},{(userid)>(Msp1):sp1},{(userid)>(Msp2):sp2},{(userid)>(Mli):li},{(userid)>:},{ph}
OBiTalk InboundCallRoute:
{(2xxxxxxxx)>(Mvg3):vg3},{(2xxxxxxxx)>(Msp1):sp1},{(2xxxxxxxx)>(Msp2):sp2},{(2xxxxxxxx)>(Mli):li}}
That's it.
To summarize my coding technique:
- The Phone DigitMap only does validation. No modifications.
- A trunk's DigitMap only contains rules for its self.
- Refer back to the trunk DigitMaps in the Phone OutboundCallRoute or InboundCallRoutes.
-When you code this way the Phone OutboundCallRoute and all the InboundCallRoutes can use the same DigitMaps.
I'm biased, but I think this config is concise and easy to understand and modify.
You can look at a trunk DigitMap and know exactly what's happening on that trunk.
I'm not saying this is the only way to go. Ultimately it's the end user that decides which technique is best for his/her requirements.
Disclaimer:
I did not test this config, so please don't beat me up too badly if you find errors.