[Home]

Summary:ASTERISK-09226: [patch] separate sections in zapata.conf
Reporter:Tzafrir Cohen (tzafrir)Labels:
Date Opened:2007-04-08 14:29:11Date Closed:2008-03-12 17:46:40
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_zap
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) conf_sample
( 1) fix_cleanups
( 2) skipchannel_options
( 3) zapata_sections
Description:As chan_zap already supports parsing separate sections from users.conf, there's no reason why it should parse sections in zapata.conf as well.

Possible issues:

* The name of the section is meaningless. This is quite unexpected.

* Which should be parsed first: users.conf's sections or zapata.conf's sections?


****** ADDITIONAL INFORMATION ******

Similar code shold probably work with 1.4, but not with 1.2.
Comments:By: Tzafrir Cohen (tzafrir) 2007-06-13 12:32:07

One comment: chan_zap still has a number of global configuration variables: stored as statics. With a new configuration scheme (actually: even with the one ued today in users.conf) the effect of them in a non-global configuration section is surprising: they will apply to all the channels.

The globas left are, I believe:

static char defaultcic[64] = "";
static char defaultozz[64] = "";
static char progzone[10] = "";
static int usedistinctiveringdetection = 0;
static int distinctiveringaftercid = 0;


I would suggest that it should only be possible to set those parameters in the global sections (the [channels] section of zapata.conf and [general] section of users.conf. Sorry, no code for implementing that yet.

By: Digium Subversion (svnbot) 2007-09-28 21:56:28

Repository: asterisk
Revision: 84118

------------------------------------------------------------------------
r84118 | tzafrir | 2007-09-28 21:56:26 -0500 (Fri, 28 Sep 2007) | 7 lines

Patch from ASTERISK-9226 - separate sections in zapata.conf:
Will process sections in zapata.conf for channels just like it processes
sections in users.conf - configuration does not "flow freely" in them.

Note that this change is fully backward-compatible - the semantics of
[channels] in zapata.conf and of users.conf remains the same.

------------------------------------------------------------------------

By: Tzafrir Cohen (tzafrir) 2007-10-05 18:27:28

Patch is now included in the branch team/group/zapata_conf .

By: Tzafrir Cohen (tzafrir) 2007-11-19 11:54:47.000-0600

Part of the ugliness and non-intiutiveness of zapata.conf is because spans are configured through channels.

Many of the parameters that really only affect spans must be sent indirectly through channels. Should we have separate section(s) for spans?

(ab)use the existing trunkgroups ?

By: Tzafrir Cohen (tzafrir) 2007-11-19 12:12:26.000-0600

After a brief look at the parsing code, it seems that "signalling" is the only parameter that mixes pri parameters and channel parameters.

But in fact this mixing is probably wrong: only in the case where chan.sig is set to SIG_PRI , will pri.nodetype be set to something different.

So in such a case we should have:

[channel]
signalling = pri

[span]
prisignalling = pri_cpe


Just a thought. This is a different matter from the small (!) change described in the patch above.

By: Kevin P. Fleming (kpfleming) 2008-03-04 18:29:37.000-0600

I'm fine with the idea of this patch, but the team/group/zapata_conf branch is woefully out of date (and contains other changes), and the latest patch here doesn't come close to applying any longer... and it appears that some of the changes made here are already in place in trunk, albeit in a slightly different form.

Tzafrir, if you want to post an updated patch that provides just the new feature that this issue is about, I'll get it committed right away.

By: Tzafrir Cohen (tzafrir) 2008-03-05 19:01:23.000-0600

Notes as I work on refreshing the patch:

* users.conf syntax does not support 'crv =>'. Hence this wll not be supported in sections. As I don't fully understand this functionality, I don't know exactly what's the best strategy to fix that.

* iflock is released too soon. In a separate patch here.

* As a by-product of using users.conf -style config parsing, unknown keywords will be silently ignored.

By: Tzafrir Cohen (tzafrir) 2008-03-06 20:29:28.000-0600

fix_cleanups is some extra cleanups that need to be done on error handling. I believe it should generally be applied to 1.4 ass welll, as it is a bug fix.

zapata_sections is the patch itself. However it is based on the fix_cleanups patch.

TODO: get the sample file updates from the old branch.

By: Kevin P. Fleming (kpfleming) 2008-03-07 12:49:11.000-0600

CRVs are used for GR-303 signaling, and are unlikely to ever be useful for someone using users.conf for configuration chan_zap.

You should be able to pass a flag into process_zap indicating whether the config structure came from users.conf or zapata.conf, so that it can warn about unknown config options when zapata.conf is being parsed.

By: Tzafrir Cohen (tzafrir) 2008-03-09 21:39:34

conf_sample - updates the sample configuration file.

skipchannel_options passes the requested flag:

The last argument of process_zap() is called 'skipchannels'. It is
intended when calling it to process sections from users.conf , and has
two effect:

1. Not process 'channel =>' and 'crv =>' keywords (only build channel at
  the end of the section).
2. Skip warnings for unknown keywords, as with users.conf this is
  expected.

Processing of sections in zapata.conf requires only (1). Using (2) as
well would hide configuration file typos.

This patch makes that parameter a bit-field with two separate options .
Note that now the default call is to this parameter with a value of 0
rather than 1. Thus it is possible to use (1) without (2).

By: Digium Subversion (svnbot) 2008-03-12 16:33:38

Repository: asterisk
Revision: 108286

U   trunk/CHANGES
U   trunk/channels/chan_zap.c
U   trunk/configs/zapata.conf.sample

------------------------------------------------------------------------
r108286 | kpfleming | 2008-03-12 16:33:37 -0500 (Wed, 12 Mar 2008) | 13 lines

add support for named sections in zapata.conf, and fix a few bugs in config file parsing

(closes issue ASTERISK-9226)
Reported by: tzafrir
Patches:
     fix_cleanups uploaded by tzafrir (license 46)
     zapata_sections uploaded by tzafrir (license 46)
     skipchannel_options uploaded by tzafrir (license 46)
     conf_sample uploaded by tzafrir (license 46)

patches updated by me to better conform to coding guidelines and fix some problems


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=108286

By: Digium Subversion (svnbot) 2008-03-12 17:46:40

Repository: asterisk
Revision: 108349

_U  branches/1.6.0/

------------------------------------------------------------------------
r108349 | russell | 2008-03-12 17:46:39 -0500 (Wed, 12 Mar 2008) | 20 lines

Blocked revisions 108286 via svnmerge

........
r108286 | kpfleming | 2008-03-12 16:37:40 -0500 (Wed, 12 Mar 2008) | 13 lines

add support for named sections in zapata.conf, and fix a few bugs in config file parsing

(closes issue ASTERISK-9226)
Reported by: tzafrir
Patches:
     fix_cleanups uploaded by tzafrir (license 46)
     zapata_sections uploaded by tzafrir (license 46)
     skipchannel_options uploaded by tzafrir (license 46)
     conf_sample uploaded by tzafrir (license 46)

patches updated by me to better conform to coding guidelines and fix some problems


........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=108349