Dialogic 05-2239-009 User Manual

Page of 604
4.15.7
Receiving NOTIFY Requests
When the SIP stack receives a SIP NOTIFY request, the Dialogic
®
 Global Call API library 
generates an Extension event (GCEV_EXTENSION) of type IPEXTID_RECEIVEMSG. 
The data associated with this Extension event contains a parameter element as follows:
IPSET_MSG_SIP
IPPARM_MSGTYPE
value = IP_MSGTYPE_SIP_NOTIFY 
Both subscribed and unsubscribed NOTIFY requests can be received; in the case of a subscribed 
NOTIFY, the value of the Call-ID header field will match the Call-ID of a previously sent 
SUBSCRIBE request.
The application can use the techniques described in 
 to retrieve message header fields of interest, including:
To display string 
From display string 
Event header field 
Call-ID header field 
If the message has a body, the application can extract the MIME-encoded information using the 
techniques described in 
The application must retrieve the necessary SIP message header and body information by copying 
the data into its own buffer before the next call to gc_GetMetaEvent( ). Once the next 
gc_GetMetaEvent( ) call is issued, the message information is no longer available from the 
metaevent buffer. 
A code example that illustrates the general procedure for retrieving information from all incoming 
messages associated with the SUBSCRIBE and NOTIFY methods is included in 
4.15.8
Responding to NOTIFY Requests
Once an application has received a GCEV_EXTENSION event for a SIP NOTIFY message (either 
subscribed or unsubscribed) and extracted the information from the event, it must send a response 
message. 
The response is sent as an Extension message using the following parameter element in the 
parameter block:
IPSET_MSG_SIP
IPPARM_MSGTYPE
and one of the following two parameter values:
IP_MSGTYPE_SIP_NOTIFY_ACCEPT
IP_MSGTYPE_SIP_NOTIFY_REJECT