HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with SIP Messages 163
Using Compact Form
USING COMPACT
F
ORM
SIP provides a mechanism for representing header field names in a compact
form. For example, the header, “
from: Bob <sip:bob@proxy.com>” will
become “
f: Bob <sip:bob@proxy.com>” when compact form is used.
“SET” COMPACT FORM
F
UNCTIONALITY
Table 9-1 represents the headers that can accept compact form and the API
functions that should be used to set compact form to each header.
As you can see in Table 9-1, the compact form for Call-ID and Content-Length
is set by the message itself. The reason is that these two headers are not kept as
objects but as string and integer.
“GET” COMPACT
F
ORM FUNCTIONALITY
The SIP Message API also provides a Get function for each of the above
headers, which lets the application check if a header uses compact form. The
function format is RvSipXXXHeaderGetComactForm(). An exception is the
Call-ID and Content-Length headers were the format is
Table 9-1 Setting Compact Form
Header Name
Compact
Form Functions to Set Compact Form
To t RvSipPartyHeaderSetCompactForm()
From f RvSipPartyHeaderSetCompactForm()
Via v RvSipViaHeaderSetCompactForm()
Contact m RvSipContactHeaderSetCompactForm()
Allow-Events u RvSipAllowEventsHeaderSetCompactForm()
Content-Type c RvSipContentTypeHeaderSetCompactForm()
Event o RvSipEventHeaderSetCompactForm()
Refer-To r RvSipReferToHeaderSetCompactForm()
Referred-By b RvSipReferredByHeaderSetCompactForm()
Session-Expires x RvSipSessionExpiresHeaderSetCompactForm()
Call-ID i RvSipMsgSetCallIdCompactForm()
Content-Length l RvSipMsgSetContentLengthCompactForm()