To use the functions for flag operations inside a module you have to include the “flags.h”, file located in OpenSER's sources directory “sip_router”. The name of the functions is the same as the ones to use from configuration file, but now you have to provide the pointer to “sip_msg” structure as the first parameter. The second parameter is the number of the flag to operate on.
The next example presents the prototypes of these functions (just look into “flags.h” file to see them).