[asterisk-dev] [Code Review] 2578: Refactor features configuration

Mark Michelson reviewboard at asterisk.org
Thu Jun 6 15:01:56 CDT 2013



> On June 6, 2013, 7:17 p.m., rmudgett wrote:
> > /trunk/main/features_config.c, lines 1367-1368
> > <https://reviewboard.asterisk.org/r/2578/diff/4/?file=39237#file39237line1367>
> >
> >     Need to add "courtesytone" option as it is used by one-touch monitor (as well as parking).

There's going to be some potential overlap here since parking has its own courtesytone option. I'll add it back in and document it as being just the tone used when automon and automixmon are used.


> On June 6, 2013, 7:17 p.m., rmudgett wrote:
> > /trunk/main/features_config.c, line 1430
> > <https://reviewboard.asterisk.org/r/2578/diff/4/?file=39237#file39237line1430>
> >
> >     Should this now show the atxfer submenu settings?

In my opinion all of the features settings should be shown by this CLI command rather than just the featuremap, applicationmap, and feature groups. However, my goal here was just to tweak the CLI command to use the new API to show what it already showed rather than change what it output.

For what it's worth, I think it might also be useful for the CLI command to take a channel as an argument so that channel-specific settings can be seen as well.


- Mark


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2578/#review8832
-----------------------------------------------------------


On June 6, 2013, 2:28 p.m., Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2578/
> -----------------------------------------------------------
> 
> (Updated June 6, 2013, 2:28 p.m.)
> 
> 
> Review request for Asterisk Developers, jrose and rmudgett.
> 
> 
> Bugs: ASTERISK-21542
>     https://issues.asterisk.org/jira/browse/ASTERISK-21542
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This change separates features configuration out of features.c into a separate features_config.c file. In addition, a features_config.h file has been added as a means of getting configured values. The configuration changes are as follows:
> 
> * Configuration for features uses the config framework now.
> * The FEATURE and FEATUREMAP functions use the same handlers as the configuration. Therefore, any configuration item available in the config file is also available for the FEATURE and FEATUREMAP functions
> * Because the FEATURE and FEATUREMAP functions are more complete, feature configuration retrieval is done per channel rather than globally. Global configuration can be retrieved, but this is a rare occurrence.
> * The CLI command to show feature configuration has been moved into the features_config.c file as well
> * Three new options for attended transfers were added: atxfercomplete, atxferabort, and atxferthreeway. Now the key combinations for completing, aborting, and conferencing an attended transfer are no longer hard coded.
> 
> Since feature configuration is handled differently than it used to be, it meant that several items from features.h and features.c could be removed altogether:
> 
> * All functions having to do with configuration parsing have been removed from features.c. This includes functions that were used to modify the dialplan due to parking options being parsed.
> * Functions that retrieved call features have been removed. This includes the removal of ast_call_feature, its associated locks, the builtin_features array, and functions used to find dynamic features.
> 
> The result of removing some of the above meant that there was quite a bit of dead code in features.c. However, I did not remove this code and instead opted to comment it out for several reasons. The following bits have been commented out rather than being removed.
> 
> * All builtin feature operations in features.c have been commented out. These items had already been "dead" for a while, but now that nothing references them, they had to be commented out in order to compile with devmode enabled. I left these commented out since there are currently tasks to make the builtin features feature-complete. Leaving the old code around as an example is not a bad thing.
> * The unit tests in features.c have been commented out. The new parking code currently does not have unit tests, so keeping the old unit tests around but commented out allows for them to be used as a guide when writing new tests.
> 
> There was a tangential change as well: an AST_FEATURES_DTMF_MASK constant was added that can be used to tell if a builtin feature requires DTMF. This was necessary for setting up bridge features since the ast_call_feature structure was removed.
> 
> Things I'm looking for in this review:
> 
> * Are there items in features.c that I have commented out that should just plain be removed instead?
> * Are there any items in features.c that I removed that should not have been?
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_dial.c 390667 
>   /trunk/bridges/bridge_builtin_features.c 390667 
>   /trunk/channels/chan_dahdi.c 390667 
>   /trunk/channels/chan_mgcp.c 390667 
>   /trunk/channels/chan_misdn.c 390667 
>   /trunk/channels/chan_sip.c 390667 
>   /trunk/channels/chan_unistim.c 390667 
>   /trunk/channels/sig_analog.c 390667 
>   /trunk/channels/sip/include/sip.h 390667 
>   /trunk/include/asterisk/channel.h 390667 
>   /trunk/include/asterisk/features.h 390667 
>   /trunk/include/asterisk/features_config.h PRE-CREATION 
>   /trunk/main/bridging.c 390667 
>   /trunk/main/features.c 390667 
>   /trunk/main/features_config.c PRE-CREATION 
>   /trunk/main/manager.c 390667 
> 
> Diff: https://reviewboard.asterisk.org/r/2578/diff/
> 
> 
> Testing
> -------
> 
> Tested configuration parsing. Ensured that general features, featuremap items, applicationmap items, and featuregroups were set and retrievable properly.
> 
> Tested that the FEATURE and FEATUREMAP dialplan functions overrode the global configuration in features.conf
> 
> Tested that items in the featuremap and applicationmap could be triggered mid-call. This includes the new attended transfer options.
> 
> 
> Thanks,
> 
> Mark Michelson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130606/1abbf21e/attachment-0001.htm>


More information about the asterisk-dev mailing list