[Serusers] functions to add/replace body/headers

Jan Janak jan at iptel.org
Tue Apr 1 15:36:57 CEST 2003


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20030401/4bb588d5/attachment.pgp>


More information about the sr-users mailing list