Pattern matching - xx != 11

I am creating a dial plan for my home. One of the goals is to keep everything as transparent as possible to the rest of the family. (No “9 to get out”, etc.)

My home office (study) phone is connected to Line 1 of a PAP2T. The remainder of the house phones are connected to Line 1 on a SPA3102. The FXO port of the SPA3102 is connected to the PSTN service.

Here’s what I have so far:

; Extension 10 - house phones
exten => 10,1,Answer()
exten => 10,n,Dial(SIP/spa3102_line1)
exten => 10,n,Hangup()
; Extension 70 - study
exten => 70,1,Answer()
exten => 70,n,Dial(SIP/pap2t_line1)
exten => 70,n,Hangup()

; 10-digit local numbers
exten => _NXXNXXXXXX,1,Answer()
exten => _NXXNXXXXXX,n,Dial(SIP/spa3102_pstn/${EXTEN})
exten => _NXXNXXXXXX,n,Hangup()
; NANP long-distance
exten => _1NXXNXXXXXX,1,Answer()
exten => _1NXXNXXXXXX,n,Dial(SIP/spa3102_pstn/${EXTEN})
exten => _1NXXNXXXXXX,n,Hangup()
; International
exten => _011.,1,Answer()
exten => _011.,n,Dial(SIP/spa3102_pstn/${EXTEN})
exten => _011.,n,Hangup()
; Emergency and other “magic” numbers
exten => _N11,1,Answer()
;exten => _N11,n,Dial(SIP/spa3102_pstn/${EXTEN})
exten => _N11,n,SayDigits(${EXTEN})
exten => _N11,n,Hangup()

exten => s,1,Answer()
exten => s,n,Dial(SIP/spa3102_line1&SIP/pap2t_line1)
exten => s,n,Hangup()

include => extensions
include => external
exten => s,1,Answer()
exten => s,n,DISA(no-password,study)
exten => s,n,Hangup()[/code]
(I’m sure that some of the Answer() and Hangup() calls are unnecessary; pointers to which ones can be removed would be appreciated.)

When dialing 911, I have to dial # or wait for several seconds before the extension is recognized. This makes perfect sense; as far as the dial plan knows I may be trying to dial 911-222-3333. My goal is to speed this detection up.

It seems like this would be possible if the 10-digit and NANP extensions could match on N{foo}, rather than NXX – where {foo} somehow represents any combination of 2 digits other than 11. Is this possible?


Not a perfect solution, but I realized that I can match on _N[02-9]X and _N1[02-9]. I also figured out that this is only necessary for 10-digit local calling.