Intercontext Dialing

I am having some trouble setting up an isolated context of extensions that can only dial other internal extensions. I am trying to isolate the internal extensions in the internal context but I want the extensions in the internal context to also be able to dial extensions in the international context. I cannot include the international context in the internal context because that will enable the internal context to dial outbound which is not wanted.

Sample extensions.conf:

[internal]
exten=>_XXXX,1,Dial(SIP/${EXTEN})
exten=>_XXXX,2,Voicemail,u${EXTEN}@default

[international]
include=>local
include=>longdistance
include=>international
exten=>_XXXX,1,Dial(SIP/${EXTEN})
exten=>_XXXX,2,Voicemail,u${EXTEN}@default

you’re not making too much sense. first you want internal callers to only make internal calls, then you want them to be able to call internationally … which is it ? you also have a (not) nice loop there in
[international]

i’m guessing you want to have some extensions only call internally, and some to have outbound access. if so, setup 2 “internal” contexts, e.g. [internal-only] and [internal-full]. create your internal only dialplan in [internal-only] and then include this in [internal-full], adding your longdistance and internal contexts too.

then, set your users context= entries in sip/iax/zapata.conf accordingly.

hey presto, restricted dialling on a per-user basis.

Sorry, if I sounded confusing. There are two sets of contexts that extensions belong to, the international context can dial internationally and can also dial extensions in both contexts but the internal context can only dial extensions in the internal context and they are unable to dial extensions in the international context. I need extensions in the internal context to also be able to dial ‘ONLY’ extensions in in the international context (but not be able to dial outbound).

[internal]
exten=>_XXXX,1,Dial(SIP/${EXTEN})
exten=>_XXXX,2,Voicemail,u${EXTEN}@default

[international]
include=>internal
include=>local
include=>longdistance
include=>international-out
exten=>_XXXX,1,Dial(SIP/${EXTEN})
exten=>_XXXX,2,Voicemail,u${EXTEN}@default

if your extensions are 4 digits then what you have will work. but [international] doesn’t need to include [internal]

i’m paraphrasing here : you have users (not extensions) defined that “start” in 2 different contexts. you want users from both to be able to call each other, but users with their start context set to [internal] should not be able to make any outbound calls. if that’s the case then as i say, what you have should be fine.

if it’s not, post a log file fragment for a failed call.

You are right, I had tried it earlier with some problems. There must have been some kind of typo somewhere. Thanx.

suggestion- dont include internal in international. separate things more and use includes

make contexts:
internal1 internal2 extensions incoming outgoing international. None includes the others except as follows.

internal1 includes extensions, outgoing, and international
internal2 includes extensions, and outgoing (not international)

outgoing and international contain trunks that can dial out/intl. No phones or users are placed directly in these contexts with context=. They include nothing, except possibly for other providers.

extensions has entries for your extensions. it does not include anything (except maybe branch office extension contexts) and no phones are directly placed in extensions with context=
Extensions would be your internal context as you have it now.

incoming can (if you want) include extensions. Incoming is also where your IVR would be. trunks (SIP providers and telco lines) go in this context with context=

while slightly more complicated, the end result of this is destination contexts are separated from user contexts, and you get greater control over who can dial what.
hope that helps!