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

164 HP-UX C SIP Stack Programmers Guide
Handling Messages with Syntax Errors
RvSipMsgGetXXXCompactForm().
FORCING COMPACT
F
ORM ON THE ENTIRE
M
ESSAGE
The application can instruct a message to force all of its headers to use compact
form. This is done by calling the function RvSipMsgForceCompactForm().
When such a message is encoded, all headers that can take compact form will be
encoded with compact form.
Headers that handled by the Stack as Other headers and are added to the
message by the application will not use compact form. It is the responsibility of
the application to set such header names with compact form. Other headers that
are added to the message by the Stack, such as Supported header, will be
encoded with compact form.
Note This flag effects only the encoding results of full messages. If you retrieve
a specific header from the message and encode it, it will not be encoded with
compact form if this specific header is not marked with compact form.
Note The Address header list and headers in multipart mime bodies are not
effected by this flag and will not be encoded with compact form.
HANDLING
M
ESSAGES WITH
SYNTAX ERRORS
When the SIP Stack receives an incoming SIP message, the message can contain
headers with various syntax errors. The SIP Stack default behavior (which was
the only possible behavior until version 3.0) is to automatically discard
incoming messages with syntax errors as if the message was never received.
version 3.0 introduces other possibilities to handle such messages. In this
chapter, a message with syntax errors is referred to as a “bad syntax message”.
BAD SYNTAX
PARAMETER
Version 3.0 introduces a new parameter that is added to each of the message
parts, called StrBadSyntax. The Stack parses bad syntax messages as regular
messages. The message still holds all message parts including start line, separate
headers, header list, and message body. However, a message part that has a
syntax error is held entirely as a string in the StrBadSyntax parameter and all
other fields are set to NULL or UNDEFINED (-1).