I've defined my dialplan as showed below. My internal lines are numbered as 12345XX, and internal users can call another by the entire 7-digits extension, or by just last 2 digits.

[invalid]
exten => _X.,1,Playback(pbx-invalid)
exten => _X.,2,Hangup()

[internal]
include => invalid
exten => _XX,1,Dial(SIP/12345${EXTEN}) ; Short alias for internal lines
exten => _12345XX,1,Dial(SIP/${EXTEN}) ; Long alias for internal lines

[local]
exten => _XXXXXXX,1,Dial(Zap/g1/${EXTEN}) ; Local area calls

[full]
include => internal
include => local

(As it's defined, local also include invalid context)

My idea is that, if any user authorized to make only internal calls dial any number different than 12345XX, he/she'll receive the invalid message. Besides if any user authorized to make local calls dial any internal number, the call is routed internally (not via a NOT toll free call through the Zap channel).

My question is: Is there a way to NOT propagate the "invalid" context when the "internal" context is included by other? The problem I see is that, if any user authorized to make local and internal calls (e.g., in the full context), dial a number different than 12345XX, it receives the PBX-INVALID message, instead of dialing the external number through the Zap channel. Or if I switch the include order in the "full" context, even internal calls are routed through the Zap channel!!!

I know that maybe this dialplan is not the best in this case, but my final question is how to avoid the propagation of "preincluded" context beyond the scope of the context that explicitaly include it.

Thanks a lot for your answer.

--
Atly.
Álvaro Palma
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to