[OpenSIPS-Devel] Help needed for working with data lumps

Roger Schreiter roger at planinternet.de
Wed Jul 6 14:28:26 CEST 2011


Hello,

I'm about to do my very first attempts to manipulate
data in an SIP body, maybe the only body, maybe part
of a multipart body (ISUP-body from SIP-T).

I'm a little bit confused, because the inline documentation
in data_lump.h does sometimes distinguish between header
and body data, whereas sometimes I think, it reads "header"
but means any of both, header or body.

Please tell me, whether following is the right attempt
and will lead to reliable results:

1. stick an anchor using
   l = anchor_lump(msg, offset, 0, 0);
   where offset is just the address relative to the message
   buffer beginn, where the body content starts.

2. delete the existing body (part) content with
   del_lump(msg, offset, len, 0);

3. insert the new body (part) content with
   insert_new_lump_after(l, s, len, 0);
   where l is the data lump got at step 1
         s is the string (char*) to be inserted.


ISUP-messages may contain 0-bytes. Will insert_new_lump
use the "len"-parameter and thus maybe also copy zeroes
and the part after (like memcopy does),
or will the part after a 0 be ignored (like strcpy does)?


Is that in general the right way to manipulate
an existing body or multipart body-part?

Will I have to adjust the content length parameter(s)
(of body and maybe also of part) manually or is it done
automatically?


Thanks for any hints!
Roger.


P.S.
The module will be called isup and will be contributed
to the package asap, maybe a first release in two or
three weeks.

The first release will allow to interpret the ISUP body and to
use the parameters from within the configuration and do some minor
manupulations. Later releases should offer much more, e.g. a versatile
SIP/SIP-T interworking.




More information about the Devel mailing list