[Asterisk-Users] Dialplan Design Q

info at beprojects.com info at beprojects.com
Tue Sep 13 13:35:42 MST 2005


I have to design a dialplan for mulitple contexts (multiple companies) 
and I'm not sure how to go about it and I thought someone may offer 
help.  Here is some background. There are three separate companies, 
let's say A, B and C.  Each has their own context and each has their own 
set of numbers (these are just examples, not the actual config):

[ContextA]
exten => 10,1,Dial(SIP/10,20)
exten => 11,1,Dial(SIP/11,20)
exten => 12,1,Dial(SIP/12,20)
include => outbound


[ContextB]
exten => 20,1,Dial(SIP/20,20)
exten => 21,1,Dial(SIP/21,20)
exten => 22,1,Dial(SIP/22,20)
include => outbound

[ContextC]
exten => 30,1,Dial(SIP/30,20)
exten => 31,1,Dial(SIP/31,20)
exten => 32,1,Dial(SIP/32,20)
include => outbound

[default]
exten => _1X,1,GoTo(ContextA,${EXTEN},1)
exten => _2X,1,GoTo(ContextA,${EXTEN},1)
exten => _3X,1,GoTo(ContextA,${EXTEN},1)

[outbound]
exten => _9XXXXXXXXXX,1,Dial(SIP/${EXTEN:1}@192.168.1.100)


So each user registers and they can call each other and they can dial 
9xxxxxxxxxx to dial local and ld.  The issue arises when they want/need 
to call the other companies in the other contexts.  I want the call to 
go direct to the other user instead of out our gateway and back in (like 
it is happening now).  I could go into each context and add the numbers 
for the other users, but that doesn't scale very well.  If I have 10 
different contexts and each has 4 phones, that's 40 entries per context. 
  I am looking for a fairly easy way to do this.  Any ideas?  (note that 
the extensions listed 10,11,20,30, etc are really 10 digits, I just 
didn't want to have to type them all out).

PA



More information about the asterisk-users mailing list