Dialogic Dialogic Global Call IP IP Phone User Manual


 
Additionally, the subscriber application may periodically receive an event that indicates the
expiration of the subscription duration. Note that the application does not have to respond to an
expiration message because the message indicates that the transaction is no longer active. The data
associated with the expiration message event is:
IPSET_MSG_SIP
IPPARM_MSGTYPE
value = IP_MSGTYPE_SIP_SUBSCRIBE_EXPIRE
The application must retrieve the necessary SIP message header information by copying it into its
own buffer before the next call to gc_GetMetaEvent( ). Once the next gc_GetMetaEvent( ) call is
issued, the header information is no longer available from the metaevent buffer.
The following example code illustrates the general procedure for extracting information from the
Extension event for any of the incoming messages associated with the SUBSCRIBE and NOTIFY
methods.
// main event loop
// get a GCEV_EXTENSION event and process it
void process_event(void)
{
METAEVENT metaevent;
int evttype;
gc_GetMetaEvent(&metaevent);
evttype = metaevent.evttype;
GC_PARM_BLK *pParmBlock = NULL;
GC_PARM_DATA *parmp = NULL;
switch (evttype)
{
case GCEV_EXTENSION:
OnExtensionEvent(&metaevent);
break;
}
}
// process GCEV_EXTENSION event
// get SIP Msg and SIP Msg Info
void OnExtensionEvent(METAEVENT *metaeventp)
{
GC_PARM_BLK *pParmBlock = NULL;
EXTENSIONEVTBLK *pExtensionBlock = NULL;
GC_PARM_DATA *parmp = NULL;
pExtensionBlock = (EXTENSIONEVTBLK*)(metaeventp->extevtdatap);
pParmBlock = &pExtensionBlock->parmblk;
parmp = NULL;
int CurrentMessage = 0;
// going thru each parameter block data
while ((parmp = gc_util_next_parm(pParmBlock,parmp)) != 0)
{
switch (parmp->set_ID)
{
// Handle SIP message information
case IPSET_MSG_SIP:
CurrentMessage = ProcessSIPMsg(parmp);
break;