Hello,
it became a trend to add anchors to each header used by some module to sip_msg structure. While the average is 15 headers per SIP message (some without anchors in the sip_msg), sip_msg has over 35.
Many of these are used only once, e.g., presence related headers are used by router as endpoint, not as a proxy. Intended to endpoint are subject, supported, unsupported, and perhaps others... Keeping them and cloning in TM when proxying makes no sense. They are not used for routing.
I think would be good to replace some anchors or at least for future the addition of anchors with functions like:
get_hdr_xyz(sip_msg) - that will take care of parsing and return the right hdr_field structure.
On another hand I propose to add sortcut to body (start and length) - in this case if there is a correction done by the parser, will be in effect everywhere. Looking now in the code, there are functions that extract body in different ways, some correcting the length by skipping \r, \n at the end.
Cheers, Daniel