Hi,
are there functions in ser (or one of its modules) that can be used within another module to add or replace headers or message bodies?
I am thinking of something like:
add_header(&msg, header) replace_header(&msg, oldheader, newheader)
and
add_body(&msg, body) replace_body(&msg, oldbody, newbody)
If not, then is the best way to achieve this the use of the textops functions from modules/text?
thanks, Stephan
-- Stephan Reiff-Marganiec Research Fellow Department of Computing Science; University of Stirling email: srm@cs.stir.ac.uk tel: 01786 46 7448
Hello,
On 01-04 14:19, Stephan Reiff-Marganiec wrote:
Hi,
are there functions in ser (or one of its modules) that can be used within another module to add or replace headers or message bodies?
I am thinking of something like:
add_header(&msg, header) replace_header(&msg, oldheader, newheader)
There are functions for inserting/deleting text into/from a message. See for example modules/rr/common.c Function remove_first_route removes the 1st Route header field (or its part). Function insert_RR inserts a new Record-Route header field.
and
add_body(&msg, body) replace_body(&msg, oldbody, newbody)
You can use the same functions for body too.
If not, then is the best way to achieve this the use of the textops functions from modules/text?
No, the best way is to use functions from sip_router/data_lump.h as described above.
Jan.