Below is a sample dial plan for NZ on Grandstream HTxxx ATA devices.


{<1=>[2-9]xxxxxx|111|[2-9]xxxxxx|0[34679][0-9]xxxxxx|02[0-9]xxxxxxx|0508xxxxxx|0800xxxxxx|0900xxxxx|026[1-4]xxxxx|12=0800xxxxxx|[0-1]xx|017[02]|x+}

 

 

Please note this string may, or may not be fully complete for all NZ regional number plans. If there are additional number plans that need to be added for full NZ compatibility please share via support@snappernet.co.nz so we can add to the above template. If you want we'll add your name to this article for some kudos  ;)


Purpose

This dial plan is designed for Grandstream analogue gateways operating in New Zealand. It defines the set of allowed number patterns users may dial and includes optional number translation (e.g., stripping a leading '1' if present).

It ensures:

  • Compliance with New Zealand's current telecommunications numbering plan

  • Proper formatting for mobile, landline, toll-free, premium, VoIP, and emergency calls

  • Prevention of invalid call attempts (remove the trailing x+ to drop unmatched calls)

  • Consistency and reliability across business and residential deployments

Pattern Breakdown

PatternDescription
<1=>[2-9]xxxxxxStrips a leading “1” from 7-digit numbers starting with digits 2–9. Useful when users habitually dial a “1” before a local number (as was once common with long-distance calls).
111Emergency number. Required for compliance and safety.
[2-9]xxxxxx7-digit local numbers (no area code). May be used in closed-number systems or local PBX environments.
0[34679][0-9]xxxxxxNZ landline numbers. Covers all valid geographic area codes (03, 04, 06, 07, 09) and their 2-digit subcodes. Example: 03 366 1234.
02[0-9]xxxxxxxMobile and VoIP numbers. Covers all mobile prefixes from 020 to 029. These include standard mobile carriers, data SIMs, M2M, and VoIP services.
0508xxxxxxToll-free/shared-cost numbers used by businesses.
0800xxxxxxToll-free numbers commonly used for freephone services.
0900xxxxxPremium-rate numbers, typically used for paid services (e.g., competitions, voting lines).
026[1-4]xxxxxSatellite, VoIP, and M2M services. Less common, but valid.
[0-1]xxShort service codes such as 018, 123, 019, 017.
017[02]Operator and information services (e.g., 0170, 0172).
 x+ at end
Catches and allows everything else


Implementation Notes

  • Configure this dial plan under the relevant Account → Call Settings → Dial Plan section in the Grandstream web UI.

  • Grandstream uses first-match logic, so the order of expressions matters. More specific patterns (e.g., stripping a digit) should come first.

  • The syntax {...} wraps all valid expressions, with each rule separated by a | (pipe symbol).

  • Use x for digits 0–9, and square brackets [] to specify digit ranges or sets.

Optional Enhancements

OptionDescription
00x+ or \+x+Add support for international dialing via 00 or + (you may need to escape the +)
x+Add a catch-all rule for diagnostic purposes (can help you log or block non-matching numbers)
!patternBlock certain number patterns if desired (e.g., legacy numbers or specific prefixes)

Example Use Cases

Dialed NumberMatched PatternAction Taken
1555123<1=>[2-9]xxxxxxStrips leading 1 → dials 555123 (not common in modern use but supported for legacy)
021234567802[0-9]xxxxxxxMobile call allowed
08001234560800xxxxxxToll-free call
018[0-1]xxDirectory assistance