Developing SIP Applications

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using Compact and Long Header Formats for SIP Messages

The following sections describe how to use the Oracle Communications Converged Application Server WlssSipServletMessage interface and configuration parameters to control SIP message header formats:

 


Overview of Header Format APIs and Configuration

Applications that operate on wireless networks may want to limit the size of SIP headers to reduce the size of messages and conserve bandwidth. JSR 116 provides the SipServletMessage.setHeader method, which enables application developers to set a given header to a specific string value, such as the compact (1-letter) format.

Oracle Communications Converged Application Server extends the SipServletMessage interface with WlssSipServletMessage. One feature of the WlssSipServletMessage API is the ability to set long or compact header formats for the entire SIP message using the setUseHeaderForm method.

In addition to WlssSipServletMessage, Oracle Communications Converged Application Server provides a container-wide configuration parameter that can control SIP header formats for all system-generated headers. This system-wide parameter can be used along with WlssSipServletMessage.setUseHeaderForm and SipServletMessage.setHeader to further customize header formats.

 


Summary of Compact Headers

Table 4-1 defines the compact header abbreviations described in the SIP specification ( RFC3261). Specifications that introduce additional headers may also include compact header abbreviations.

Table 4-1 Compact Header Abbreviations
Header Name (Long Format)
Compact Format
Call-ID
i
Contact
m
Content-Encoding
e
Content-Length
l
Content-Type
c
From
f
Subject
s
Supported
k
To
t
Via
v

 


Assigning Header Formats with WlssSipServletMessage

All instances of SipServletRequest, SipServletResponse, and WlssSipServletResponse can be cast to WlssSipServletMessage in order to use the extended API. A pair of getter/setter methods, setUseHeaderForm and getUseHeaderForm, are used to assign or retrieve the header formats used in the message. These methods assign or return a HeaderForm object, which is a simple Enumeration that describes the header format:

WlssSipServletResponse.setUseHeaderForm can be used in combination with SipServletMessage.setHeader and the container-level configuration parameter, use-compact-form. Summary of API and Configuration Behavior.

 


Summary of API and Configuration Behavior

Header formats can be specified at the header, message, and SIP Servlet container levels. Table 4-2 shows the header format that results when adding a new header with SipServletMessage.setHeader, given different container configurations and message-level settings with WlssSipServletResponse.setUseHeaderForm.

Table 4-2 API Behavior when Adding Headers
SIP Servlet Container Header Configuration ( use-compact-form Setting)
WlssSipServletMessage.
setUseHeaderForm Setting
SipServletMessage.
setHeader Value
Resulting Header
COMPACT
DEFAULT
“Content-Type”
“Content-Type”
COMPACT
DEFAULT
“c”
“c”
COMPACT
COMPACT
“Content-Type”
“c”
COMPACT
COMPACT
“c”
“c”
COMPACT
LONG
“Content-Type”
“Content-Type”
COMPACT
LONG
“c”
“Content-Type”
LONG
DEFAULT
“Content-Type”
“Content-Type”
LONG
DEFAULT
“c”
“c”
LONG
COMPACT
“Content-Type”
“c”
LONG
COMPACT
“c”
“c”
LONG
LONG
“Content-Type”
“Content-Type”
LONG
LONG
“c”
“Content-Type”
FORCE_COMPACT
DEFAULT
“Content-Type”
“c”
FORCE_COMPACT
DEFAULT
“c”
“c”
FORCE_COMPACT
COMPACT
“Content-Type”
“c”
FORCE_COMPACT
COMPACT
“c”
“c”
FORCE_COMPACT
LONG
“Content-Type”
“Content-Type”
FORCE_COMPACT
LONG
“c”
“Content-Type”
FORCE_LONG
DEFAULT
“Content-Type”
“Content-Type”
FORCE_LONG
DEFAULT
“c”
“Content-Type”
FORCE_LONG
COMPACT
“Content-Type”
“c”
FORCE_LONG
COMPACT
“c”
“c”
FORCE_LONG
LONG
“Content-Type”
“Content-Type”
FORCE_LONG
LONG
“c”
“Content-Type”

Table 4-3 shows the system header format that results when setting the header format with WlssSipServletResponse.setUseHeaderForm given different container configuration values.

Table 4-3 API Behavior for System Headers
SIP Servlet Container Header Configuration ( use-compact-form Setting)
WlssSipServletMessage.
setUseHeaderForm Setting
Resulting Contact Header
COMPACT
DEFAULT
“m”
COMPACT
COMPACT
“m”
COMPACT
LONG
“Contact”
LONG
DEFAULT
“Contact”
LONG
COMPACT
“m”
LONG
LONG
“Contact”
FORCE_COMPACT
DEFAULT
“m”
FORCE_COMPACT
COMPACT
“m”
FORCE_COMPACT
LONG
“Contact”
FORCE_LONG
DEFAULT
“Contact”
FORCE_LONG
COMPACT
“m”
FORCE_LONG
LONG
“Contact”


  Back to Top       Previous  Next