Adding a new parameter

From reSIProcate
Jump to: navigation, search

NOTE that proprietary or experimental parameters may be better added at runtime rather than at compile time. See Extension Parameter.

NOTE that you MUST update the gperf hash description files and run the test drivers to ensure that the new hash function works as intended. The hash output from gperf MUST be modified to produce a case-insensitive hash. At present, the autotools (resiprocate/sip/autotools/...) build system contains a rule that does this properly, I am not certain that the build/Makefile system does this correctly.

ParameterTypeEnums.hxx[edit]

Add a call to the macro defineParam to the enum. The arugments are:

* parameter access token name
* RFC name
* resip parameter type
* reference

For example:

defineParam(accessType, "access-type", DataParameter, "RFC 2046"),

Note that the macro call is followed by a comma.

The new parameter will be accessible as p_ followed by the parameter access token name. This accessor will be available on any header. The usual exists and remove methods will also be available.

ParameterHash.gperf[edit]

Near the end of the file and before the "%%", add the RFC name in lower case, a comma, and ParameterTypes:: followed by the access token name. For example:

access-type, ParameterTypes::accessType

ParameterTypes.hxx[edit]

Add the same macro call used in ParameterTypeEnums.hxx. Note that the macro call is followed by a semi-colon.

ParameterTypes.cxx[edit]

Add the same macro call used in ParameterTypeEnums.hxx. Note that the macro call is followed by a semi-colon.

ParserCategory.hxx[edit]

Add the same macro call used in ParameterTypeEnums.hxx to the public part of the class declaration for ParserCategory, after the definition of the defineParamm macro. Note that the macro call is followed by a semi-colon.

ParserCategory.cxx[edit]

Add the same macro call used in ParameterTypeEnums.hxx, after the definition of the defineParamm macro. Note that the macro call is followed by a semi-colon.