Dialogic IP Phone 05-2239-009 User Manual

Page of 604
The following code snippet provides an example of enabling message header and body access for 
two virtual boards: 
INIT_IPCCLIB_START_DATA(&ipcclibstart, 2, ip_virtboard); 
INIT_IP_VIRTBOARD(&ip_virtboard[0]); 
INIT_IP_VIRTBOARD(&ip_virtboard[1]); 
ip_virtboard[0].sip_msginfo_mask = IP_SIP_MSGINFO_ENABLE | IP_SIP_MIME_ENABLE; 
ip_virtboard[1].sip_msginfo_mask = IP_SIP_MSGINFO_ENABLE | IP_SIP_MIME_ENABLE; 
The following topics describe how applications send, receive, and respond to SUBSCRIBE and 
NOTIFY requests:
4.15.1
Sending SUBSCRIBE Requests
To send a SUBSCRIBE request message, the application begins by creating a GC_PARM_BLK 
that contains an element with the IPSET_MSG_SIP set ID, the IPPARM_MSGTYPE parameter ID 
and the IP_MSGTYPE_SIP_SUBSCRIBE parameter value. The application adds elements for the 
desired header fields and one or more MIME body parts, if appropriate, to the parameter block, 
then uses the gc_Extension( ) function to send the message. The header may include any 
combination of standard header fields and proprietary header fields. General techniques for setting 
header fields are described in 
The technique for constructing MIME body parts is described in 
.
The header fields that normally must be set in a SUBSCRIBE request include the following:
To display string (IPPARM_TO_DISPLAY)
From display string (IPPARM_FROM_DISPLAY)
Expires header field (IPPARM_EXPIRES_HDR)
Event header field (IPPARM_EVENT_HDR)
Call-ID header field (IPPARM_CALLID_HDR)
SUBSCRIBE requests normally contain an Expires header field, which indicates the duration of 
the subscription. When the application does not explicitly set an Expires header field, the default 
duration that is defined in the SIP “event package” for the particular type of event will apply. To 
keep a subscription effective beyond the accepted duration, the subscriber needs to send a new 
SUBSCRIBE message on the same dialog when it receives an expiration message. To terminate or 
unsubscribe an existing subscription, the application can send a SUBSCRIBE request with the 
value 0 in the Expires header field to specify immediate expiration.