HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with SIP Messages 169
Handling Messages with Syntax Errors
Message API and retrieve the bad-syntax start line and fix it. Using this
callback, the application should instruct the Stack on how to handle the
message—discard, reject or continue processing.
Note A message with a bad syntax start line is not recognized as a request or a
response. Therefore, if you wish the Stack to continue the message processing,
you must fix the start line using the RvSipMsgStartLineFix() function. If you
choose not to fix the start line, the message will be ignored.
If you do not implement this event, the Stack will discard messages with a bad
syntax start line.
Note If the message contains a defected start line and defected headers, both the
above callback functions are called. The
RvSipTransportBadSyntaxStartLineMsgEv() is called first. If the application
fixes the start line and chooses the “continue message processing” option,
RvSipTransportBadSyntaxMsgEv() is also called.
BAD SYNTAX API The Message layer provides several API functions to get and fix bad syntax
elements in a message. The following API functions are available:
RvSipMsgGetBadSyntaxHeader()
Retrieves headers with a syntax error from a message according to a given
location. The message holds most headers in a sequential list. However, To,
From, Call-ID, CSeq, Content-Length, and Content-Type headers are held
separately.
This function scans all headers in the message, (the ones that are in the header
list and the ones that are not) and retrieves only headers with syntax errors. (This
function treats all headers as if they were located in one virtual list. The virtual
list includes the headers that are in the header list and the headers that are not.)
You can use this function in the RvSipTransportBadSyntaxMsgEv() callback to
check and fix bad syntax headers.
RvSipMsgGetStrBadSyntaxStartLine()
Gets the bad syntax start line from a message. When a message is received and
the start line contains a syntax error, the start line is kept as a separate bad
syntax string. This function retrieves this string.