[asterisk-users] File structure question

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Sep 3 02:12:14 MST 2006

On Thu, Aug 31, 2006 at 03:52:00PM -0500, Jay Moore wrote:
> I have a question on how I can better organize my .conf files.
> I have 3 different groups of people who use my VoIP service. Let's call 
> them 'Office', 'Factory' and 'Public'. In my Asterisk directory, I have 
> created three folders: 'office', 'factory' and 'public', inside each of 
> which has a sip.conf and an extensions.conf file with appropriate 
> account and extension information.
> Say, for example, I need to limit some users of the 'Public' group so 
> they cannot make calls outside the building. Obviously I would create 
> two separate contexts. One for users who can make calls outside the 
> build, and one for users who cannot. I would then assign the appropriate 
> context to each user.
> Right now, I have each appropriate context defined in the main 
> extensions.conf. What I'd like to do is reduce the clutter in 
> extensions.conf and move each context into the extensions.conf in the 
> appropriate subfolder. How do I tell the main extensions.conf file to 
> include the other extensions.conf files without putting an #include 
> <file> in a context of its own?
> I hope what I've explained makes sense. If not, please ask questions and 
> I'll try to answer.

#include is a verbatim text include. 

if extensions.conf has:

exten => aaa,1,Line1

#include "otherfile.conf"

exten => aaa,2,Line2

and othererfile.conf has:

exten => aaa,2,OtherLine1


exten => aaa,1,OtherLine2

You'll eventually get:

main: aaa: 
  1. Line1
  2. OtherLine1

other: aaa:
  1. OtherLine2
  2. Line2
Tzafrir Cohen         sip:tzafrir at local.xorcom.com
icq#16849755          iax:tzafrir at local.xorcom.com
+972-50-7952406          jabber:tzafrir at jabber.org
tzafrir.cohen at xorcom.com     http://www.xorcom.com

More information about the asterisk-users mailing list