Dialogic Dialogic Global Call IP IP Phone User Manual


 
172 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
IP-Specific Operations
4.9 Setting and Retrieving SIP Message Header Fields
The Dialogic
®
Global Call API supports the setting and retrieving of SIP message header fields in
various SIP message types, including INFO, INVITE, NOTIFY, OPTIONS, REFER, and
SUBSCRIBE requests. These messages may be implicitly created and sent as a result of a Global
Call function call (for example, gc_MakeCall( ) sends INVITE, gc_InvokeXfer( ) sends REFER,
and gc_ReqService( ) sends REGISTER), or they may be messages that are explicitly constructed
and then sent via gc_Extension( ), such as INFO or NOTIFY requests. On the receiving side, the
messages are passed to the application as GCEV_OFFERED, GCEV_REQ_XFER,
GCEV_CALLINFO, or GEEV_EXTENSION events, depending on the SIP request type, with the
message information contained in the metaevent. The SIP header access feature is described in the
following topics:
SIP Header Access Overview
Enabling Access to SIP Header Information
Enabling Long Header Values
Registering SIP Header Fields to be Retrieved
Setting SIP Header Fields for Outbound Messages
Retrieving SIP Message Header Fields
4.9.1 SIP Header Access Overview
The Dialogic
®
Global Call API library provides a uniform mechanism for setting SIP header fields
in SIP messages using a single Global Call parameter definition (namely IPSET_SIP_MSGINFO /
IPPARM_SIP_HDR). This new mechanism is intended to replace the previous header access
mechanism that relied on header-specific parameter definitions. Among the advantages of the new
mechanism are:
supports all SIP header fields, including optional and proprietary fields
directly extensible to support new header fields
field content length can exceed 255 bytes
uniform programming approach
application can register to receive only the header fields it needs to access from incoming
messages
Header Fields in Outgoing SIP Messages
After access to SIP message information has been enabled (see Section 4.9.2, “Enabling Access to
SIP Header Information”, on page 179), an application sets SIP message header fields for outgoing
messages by inserting the set ID / parm ID pair and the parameter value (header contents) for each
field into a GC_PARM_BLK using gc_util_insert_parm_ref_ex( ) or
gc_util_insert_parm_val( ). The application uses the IPSET_SIP_MSGINFO parameter set ID
and IPPARM_SIP_HDR parameter ID to set any SIP header field. The parameter value must start
with the header name and must conform to the SIP specifications for content, syntax, and
punctuation.