[OpenSIPS-Devel] Help needed for working with data lumps
Roger Schreiter
roger at planinternet.de
Thu Jul 7 02:07:55 CEST 2011
Hello
doing a series of tests, I could finally answer
my questions. Here are the answers for the archive,
maybe they'll help someone else later:
Exchange a body content (whole or part of multypart):
> 1. stick an anchor using
> l = anchor_lump(msg, offset, 0, 0);
Not needed.
> 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);
Just do step 2 and 3. Use lump, got in step 2, for step 3!
It worked fine for me.
> ISUP-messages may contain 0-bytes. Will insert_new_lump
> use the "len"-parameter and thus maybe also copy zeroes
Yes, 0-byte in the content won't make troubles.
> Will I have to adjust the content length parameter(s)
> (of body and maybe also of part) manually or is it done
> automatically?
Yes, in my tests, the content length parameter was
adjusted automatically.
Roger.
More information about the Devel
mailing list