HP-UX Multimedia Streaming Protocols (MSP) Programmer's Guide

The rtsp_init_response_msg function dynamically allocates memory for the
rtsp_msg_t structure and sets the status code and the reason phrase in the
message to the specified values.
The declaration of rtsp_init_response_msg is as follows:
#include <rtsp.h>
rtsp_error_t rtsp_init_response_msg(
int status_code,
uint8_t *reason_phrase,
rtsp_msg_t *req_msg,
rtsp_msg_t **msg
);
You must pass the following arguments to rtsp_init_response_msg:
status_code
Integer status code to be set in the message.
reason_phrase
Pointer to a location containing the NULL terminated reason_phrase to be set
in the message. If the reason_phrase argument is NULL, then the API uses the
reason phrase corresponding to the status code.
req_msg
Pointer to a location containing an RTSP request message from which the Cseq,
Session, and Timestamp headers are copied.
msg
Pointer to a location where the address of the new RTSP response message is
returned.
Upon success, rtsp_init_response_msg returns RTSP_SUCCESS and places
the address of the allocated rtsp_msg_t structure in the location pointed to by
the msg argument. Upon failure, rtsp_init_response_msg returns one of the
following error values:
RTSP_EINVAL
The status_code argument contains an invalid value.
The msg argument is NULL.
The value in the location pointed to by the msg argument is not NULL.
RTSP_ENOMEM
Dynamic memory allocation failure.
40 Using MSP APIs