Digit Map can be very powerful; however the documentation in the manuals is, err, minimal.
DrayTek Vigor 2700V and 2800V models allow up to 6 SIP accounts (with different or same provider) plus PSTN (on 2700VL models only); which can be mapped to 2 telephone handsets.
- Incoming PSTN calls will ring both handsets.
- For each of the 6 SIP accounts, you can indicate whether incoming calls from this provider should ring the phone connected to FXS1 or FXS2 (confusingly labelled on the VoIP > SIP Accounts page as VoIP1 and VoIP2).
- For outgoing calls, the default SIP Account is specified in the VoIP > Phone Settings page for each of the FXS ports.
- You can dial “#0” to connect to the PSTN line (VL models only), then dial the PSTN number.
- You can, however, use the VoIP >> DialPlan Setup >> Digit Map page to define which calls should go out through which provider.
Firstly, be aware that some customers have become confused because DrayTek have labelled the FXS ports (where you plug in your telephone handsets) “VoIP1” and “VoIP2”, and have labelled the 6 VoIP SIP accounts “VoIP1”-“VoIP6”.
Digit Map can be used in several ways to:
- create “Trunk Line” prefixes for each VoIP provider (e.g. dial 3 for VoIP1, 4 for VoIP2, 5 for VoIP3)
- select different VoIP providers for calls to different places, allowing you to take advantage of the best rates from each provider.
- map prefixes (e.g. your VoIP provider might require you to dial the country and/or area code before local PSTN numbers)
The following example shows all these types.
For example, if you dial “3678912”; the Vigor recognises the “3” plus Min 6 other digits and activates the first rule. The Prefix Number “3” is stripped off and “678912” is passed to VoIP1 provider as the subscribers number to call.
Similarly dial “4” for VoIP2, or dial “5” for VoIP3. Note that it is up to you to dial the number as expected by the VoIP provider.
Select VoIP provider based on destination
In this example we want calls to New Zealand to be sent via VoIP3 provider. We want to continue dialling phone numbers the same as we are used to with PSTN, so we have set the Prefix Number to “001164” (“0011” is ISD prefix, “64” is New Zealand country code) and Min Len to 8 (because NZ phone numbers have 1 digit Area code then 7 digit numbers). We want the “001164” prefix to be sent to VoIP3 as part of the number being called, so select Mode of “none”.
This is where it gets tricky but interesting. Rather than just selecting a VoIP provider, you can alter the phone number that is being dialled. The second block in the example, maps the PSTN dialling we are familiar with to the format required by our VoIP provider.
For example, I live in Sydney and want to call local Sydney PSTN numbers (8 digits starting starting with a 9) through VoIP1 account, and my VoIP provider requires that I dial the 02 area code prefix before the number. The rule with the “9” prefix achieves this, but how ? When I dial a local number “98765432”, the Vigor matches the prefix of “9” plus 7 other digits (Min Len), so activates the rule. The Vigor adds the OP Number ( “02”) before the number dialled, and sends “0298765432” to VoIP1 provider.
Similarly the example rule with prefix “0” will match calls to cellphones and interstate and international calls (excluding New Zealand, described in “Select VoIP provider based on destination”), and send them also via VoIP1, but without changing the number dialled.
The most complex mapping is undertaken with the “Replace” Mode. For example, with prefix of “123”, Min Len of 6, mode of “Replace” and OP Number “4321”; dialling “123456789” would match the rule “123” plus minimum of 6 other digits, and result in “4321456789” being sent to the VoIP provider.
Min Len and Max Len
Note that “Min Len” is the minimum length of the number you will dial _excluding_ the prefix digits.
In the local call example (with prefix of “9”), it is very easy to set Min Len to 8 thinking that local PSTN numbers are 8 digits long – but the Digit Map rule isn’t activated and the Vigor simply uses the default VoIP provider. You need to think “9” plus 7 other digits.
To avoid this situation you might choose to set Min Len to a low value and Max Len to a high value (such as 5 and 20) for all your rules.
In the above example there are 2 Digit Map rules which could be activated for a phone number starting with a “0”. the Vigor tries first to match the most specific rule (usually the one with the longest prefix) then the next most specific rule, and so on until a match is detected or all rules are exhausted (resulting in the default provider being used).
So if we dial “0401234567”, the Vigor first fails to match with “001164” prefix number; but it does match the “0” prefix rule.
How many Digit Map rules can I have ?
The Digit Map table has 20 entries, but we suspect that in practice you may not be able to use them all. Also, the more rules you have, the more confusing it becomes for you to see which rule is being applied.
Note that you may be able to minimise the number of rules by having rules overlap (as discussed above). Set the VoIP Provider you want to use for the majority of destinations as the Default SIP Account in the Phone Settings, then only enter the exceptions into the Digit Map.