Voice
Dial plans that do not fight you
Applies to Any platform This applies to any PBX or call manager, whatever the vendor; the rules are about dial plan design, not one product's syntax.
Dial plans become difficult not because the logic is hard but because rules accumulate over years, each added to fix one case, until nobody can predict what a given number will do.
Choose one internal format
Decide on a canonical form and normalise everything into it at the edge. E.164 — plus, country code, full number — is the sensible choice because it is unambiguous and every external system understands it.
Convert incoming numbers to canonical form as they arrive; convert outgoing numbers to whatever the provider wants as they leave. In between, everything speaks one format. Most dial plan complexity is caused by having several formats in flight simultaneously.
Longest match, and the ambiguity trap
Patterns are matched longest-first. The failure comes from overlapping patterns where a shorter one matches while the system waits to see if a longer one will. That produces inter-digit timeout: the call eventually goes through after an unexplained pause.
Users report “it takes ages to connect”. The cause is an overlapping pattern, and the fix is to make patterns unambiguous rather than to shorten the timeout.
Emergency numbers first, and tested
Emergency calling must work from every device, in every state, without a prefix, and must present a location that means something. Test it deliberately — with the operator’s test number where one exists — and test it again after any change to the dial plan.
This is the one part of a dial plan where an untested assumption is unacceptable.
Write down the reason
Each rule should carry a comment saying why it exists. A translation rule that strips a digit for one destination will be a mystery within a year, and the person who finds it will either leave it there forever or remove it and break something.
Test systematically
Keep a list of representative numbers — internal, local, national, mobile, international, emergency, premium — and test the whole list after any change. Most dial plan incidents are regressions in a case nobody thought to check.
Related reading