Extension Pattern Matching not working

Asterisk on Mipsel chipset. I believe that at one point, pattern matching was workng as intended. Specifically, the use-case where

91(NXX) NXX-XXXX would use a different GTalk channel.

What needs to be changed in the dialplan to correctly implement?

This is what a successful call should look like:

[quote] == Using SIP RTP CoS mark 5
– Executing [18005551212@mario-default:1] Dial(“SIP/101-00000001”, “Gtalk/MyAccount/18005551212@voice.google.com”) in new stack
– Called Gtalk/MyAccount/18005551212@voice.google.com
– Gtalk/18005551212@voice.google.com-667e is ringing
– Gtalk/18005551212@voice.google.com-667e answered SIP/101-00000001
== Spawn extension (mario-default, 18005551212, 1) exited non-zero on ‘SIP/101-00000001’[/quote]

Instead this is what is observed:

[quote] == Using SIP RTP CoS mark 5
[Apr 14 21:25:09] NOTICE[24908]: chan_sip.c:22942 handle_request_invite: Call from ‘101’ ( to extension ‘19180055512’ rejected because extension not found in context ‘mario-default’.[/quote]

It would seem that the context, labelled gv-out2, is not trapping the attempt to dial 918005551212?

This is the redacted dialplan:

[code]; * Default starting context for internal SIP devices
include => gv-outbound
include => gv-out2

; Direct Dialing from handset: if no area code, appends (212) area code by default
exten => _411,3,Dial(Gtalk/MyAccount/18005551212@voice.google.com) ; BING 411
; MAP Extension 911 to my local Police
exten => _911,1,Dial(Gtalk/MyAccount/212police#@voice.google.com)
;append an area code if necessary
exten => _NXXXXXX,1,Set(CALLERID(dnid)=1212${CALLERID(dnid)} )
exten => _NXXXXXX,n,Goto(1212${EXTEN},1)
;append a 1 if necessary
exten => _NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
exten => _NXXNXXXXXX,n,Goto(1${EXTEN},1)
;do our real dialing
exten => _1NXXNXXXXXX,1,Dial(Gtalk/MyAccount/${EXTEN}@voice.google.com)
;exten => _+1NXXNXXXXXX,1,Dial(Gtalk/MyAccount/${EXTEN}@voice.google.com)

; User Dials 9 then number myGtalkAccount account (202)
; Map Extension 911 to my local police
exten => _9911,1,Dial(Gtalk/myGtalkAccount/202police#@voice.google.com)
; Append area code 202 if necessary
exten => _9NXXXXXX,1,Set(CALLERID(dnid)=1202${CALLERID(dnid)})
; {EXTEN:1} is NXXXXXX (everything after the first dialed number, in this case 9)
exten => _9NXXXXXX,n,Goto(91202${EXTEN:1},1)
;append a 1 if necessary
exten => _9NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
; {EXTEN:1} is NXXNXXXXXX(everything after the first dialed number, in this case 9)
exten => _9NXXNXXXXXX,n,Goto(91${EXTEN:1},1)
;do our real dialing
exten => _91NXXNXXXXXX,1,Dial(Gtalk/myGtalkAccount/${EXTEN:1}@voice.google.com)
;exten => _+1NXXNXXXXXX,1,Dial(Gtalk/myGtalkAccount/${EXTEN}@voice.google.com)[/code]

Included contexts are only used if there is no match in the including context.

When I dial 91800551212, I am not sure where in the dialplan that a 1 is appended:

What is the preferred method to determine where this 1 is appended?

I would have thought that this line would ‘trap’ the extension and dial out via Google voice:

exten => _91NXXNXXXXXX,1,Dial(Gtalk/myGtalkAccount/${EXTEN:1}@voice.google.com)

Any constructive \ actionable troubleshooting advice is appreciated. Thank you.

I misread your original dialplan and assumed that the includes were followed by specific rules in the same context.

The 1 is being pre-pended by the phone, or the person dialing. The overall number is too short to match your number which does contain a 1.