[asterisk-dev] (not so) new format for zapata.conf

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Jan 16 15:39:15 MST 2007


Hi

chan_zap currently reads configuration from both zapata.conf and
users.conf . 

I'm ignoring the trunkgroups setup for now and focusing on channels
setup. 

In zapata.conf this is al done in one big section: [channels] .
users.conf has introduced a new format: seaperate sections that use
'zapconf' instead of 'channels'. If the keyword 'zapconf' is present in
a certain section, its contents will be processed with the channels
defined only in the end (and thus affected from all of the other
keywords in that section).

Thus the following in users.conf:

[user1]
signalling = fxo_ks
zapconf = 1
callerid = User 1 <6001>

[user2]
signalling = fxo_ks
zapconf = 2
mailbox=user2 at context


Is equivalent to the following snippet on zapata.conf's [channels]
section:

signalling = fxo_ks
callerid = User 1 <6001>
channel => 1

signalling = fxo_ks
mailbox=user2 at context
channel => 2


This is a bit simpler than the current zapata.conf syntax, but still
badly location-sensitive: in the above example it would be preffered if
user2 won't magically inherit the callerid settings from user1.

The changes I thus propose:

1. Use the patch from http://bugs.digium.com/view.php?id=7877 to allow
sections not to affect one another.

2. The [channels] section of zapata.conf and [general] section of
users.conf will be processed as before. However after processing them,
each users.conf section processed will use a copy of the original
configuration from after (1). See the todo comment in the end of
http://bugs.digium.com/file_download.php?file_id=12805&type=bug ).

3. The parser will scan zapata.conf itself for extra configurations
sections with the same format (any name beginning with "channel", any
name that is not "trunkgroups" or "channels"?) and will process them the
same way at the users.conf sections are processed.

Implementing (3) is simple: just an extra loop in setup_zap, similar to
the one scanning users.conf . The patch linked above already simplifies
things by making the keyword "zapconf" behave like "channel" (actually 
generate a channel) but the processing is only done at the end of the
section.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-dev mailing list