Adding a new method

From reSIProcate
Jump to: navigation, search

A method not known to the parser will have type resip::UNKNOWN. You can get to the string with, for example:

if (msg->header(h_RequestLine).getMethod() == UNKNOWN)
{
   const Data& methodName = msg->header(h_RequestLine).unknownMethodName();
   ...
}

To add a built in header:
You must have gperf.

  1. MethodTypes.hxx: add defineMethod(name, "name", "RFC ref"),
    before MAX_METHODS
  2. MethodTypes.cxx: add defineMethod(name, "name", "RFC ref"),
    to MethodNames[] initializer in the same position
  3. Methodhash.gperf: add name, name
    on its own line before the last %%
  4. compile and run stack/test/testParserCategories