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

178 HP-UX C SIP Stack Programmers Guide
Working With Multipart MIME
/*==================================================================================*/
void AppSetContentTypeToMsg(
IN RvSipMsgHandle hMsg,
IN RvSipContentTypeHeaderHandle hContentType)
{
RvStatus rv;
RvSipBodyHandle hBody;
/*Gets the body object of the message.*/
hBody = RvSipMsgGetBodyObject(hMsg);
if (NULL == hBody)
{
/*Constructs a new body object if there is no body object for this message.*/
rv = RvSipBodyConstructInMsg(hMsg, &hBody);
if (RV_OK != rv)
{
printf("Failed to construct body in message\n");
return;
}
}
/*Sets the Content-Type header to the body object.*/
rv = RvSipBodySetContentType(hBody, hContentType);
if (RV_OK != rv)
{
printf("Failed to set Content-Type in body\n");
}
}
/*==================================================================================*/
HEADERS IN THE BODY
P
ART OBJECT
A Body Part object may contain the following MIME-part-headers, as described
in RFC 2046:
The Content-Type header of a Body Part is held within the
Body object of the Body Part object, as described earlier. To
modify or view the Content-Type header of a Body Part, get the
Body object from the Body Part and use the functions,
RvSipBodySetContentType() and
RvSipBodyGetContentType().
The Content-Disposition header of a Body Part is held within
the Body Part object, represented by
RvSipContentDispositionHeaderHandle. To modify and view