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

svnbot reviewboard at asterisk.org
Thu Jun 6 16:40:52 CDT 2013


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

(Updated June 6, 2013, 4:40 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers, jrose and rmudgett.


Changes
-------

Committed in revision 390751


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 390711 
  /trunk/bridges/bridge_builtin_features.c 390711 
  /trunk/channels/chan_dahdi.c 390711 
  /trunk/channels/chan_mgcp.c 390711 
  /trunk/channels/chan_misdn.c 390711 
  /trunk/channels/chan_sip.c 390711 
  /trunk/channels/chan_unistim.c 390711 
  /trunk/channels/sig_analog.c 390711 
  /trunk/channels/sip/include/sip.h 390711 
  /trunk/include/asterisk/channel.h 390711 
  /trunk/include/asterisk/features.h 390711 
  /trunk/include/asterisk/features_config.h PRE-CREATION 
  /trunk/main/bridging.c 390711 
  /trunk/main/features.c 390711 
  /trunk/main/features_config.c PRE-CREATION 
  /trunk/main/manager.c 390711 

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/657ffc88/attachment-0001.htm>


More information about the asterisk-dev mailing list