HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

Working with SIP Messages 179
Working With Multipart MIME
the Content-Disposition header of a Body Part, use the
functions, RvSipBodyPartGetContentDisposition() and
RvSipBodyPartSetContentDisposition().
All headers other than Content-Type and Content-Disposition
are held in a list within the Body Part object.
RvSipOtherHeaderHandle represents each of these headers.
This also refers to headers that have special objects defined for
them in the SIP Stack, such as To, From, CSeq, etc. To add,
remove, modify or view a header form the list use the functions,
RvSipBodyPartPushHeader(), RvSipBodyPartGetHeader() and
RvSipBodyPartRemoveHeader().
PARSING A MULTIPART
B
ODY
The SIP Stack allows you to parse a textual multipart Body into a list of Body
Parts. In order to parse a multipart Body, the Body object must contain a
Content-Type header with the multipart media type and a valid boundary. The
SIP Stack parses the Body according to the boundary given in the Content-Type
header.
After parsing a multipart Body, the Body object contains a list of Body Part
objects.
Note After parsing the Body object, each of the Body Parts holds its headers as
parsed and its Body as a string. If the Body Part contains a multipart Body, you
have to specifically parse it (recursively).
You can view and modify the Body Part list of a Parsed Body using the
functions, RvSipBodyGetBodyPart(), RvSipBodyPushBodyPart() and
RvSipBodyRemoveBodyPart().
Sample Code
The following code demonstrates how to parse the Body of a message and
afterwards view the Body Parts of which it consisted.