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

170 HP-UX C SIP Stack Programmers Guide
Handling Messages with Syntax Errors
You can use this function in the RvSipTransportBadSyntaxStartLineMsgEv()
callback to check and fix the defected start-line.
RvSipMsgGetHeaderExt(), RvSipMsgGetHeaderByTypeExt(),
RvSipMsgGetHeaderByNameExt()
These three function extend the functionality of functions that already exists in
the SIP Stack API. RvSipMsgGetHeaderExt() extends the
RvSipMsgGetHeader() function; RvSipMsgGetHeaderByTypeExt() extends the
RvSipMsgGetHeaderByType function; and RvSipMsgGetHeaderByNameExt()
extends the RvSipMsgGetHeaderByName.
These functions enable the application to specify whether it wishes to get only
legal headers or both legal and illegal headers. (An illegal header is a header
with a bad-syntax string.)
Note Using the regular function retrieves only legal headers.
RvSipMsgStartLineFix()
Fixes a start-line with bad-syntax information. When a message is received with
a bad syntax start line, the start line string is kept as a separate “bad-syntax”
string in the message. Use this function in the
RvSipTransportBadSyntaxStartLineMsgEv() callback to fix a defected start-
line.
When fixing a start line, you need to supply a string with a correct start line. The
Stack will parse this string into the message. If parsing succeeds, the function
will place all fields inside the message start-line parameters and will remove the
bad syntax string. If parsing fails, the start line bad-syntax string remains
untouched.
RvSipHeaderIsBadSyntax()
This function identifies if a given header is or is not a bad-syntax header.
A
DDITIONAL BAD SYNTAX
F
UNCTIONS
A SIP header has the following grammar: header-name: header-value. When a
header contains a syntax error, the header-value is kept as a separate bad-syntax
string. The following functions are supplied for each of the SIP Stack headers.
“XXX” in the function name represents the header name.