Dialogic Dialogic Global Call IP IP Phone User Manual


 
Dialogic
®
Global Call IP Technology Guide — November 2007 187
Dialogic Corporation
IP-Specific Operations
In addition to the IPPARM_SIP_HDR elements that correspond to the registered header fields, the
parm block will also contain elements that use the deprecated field-specific parameter IDs listed in
Table 10, “Field-Specific Parameters (Deprecated) for SIP Header Access”, on page 178. Some of
these field-specific parameters provide access to a specific part of the corresponding header field
(specifically just the display string or just the URI) rather than the complete header field.
The following code demonstrates how to copy the Request-URI from a GCEV_OFFERED event
using the (deprecated) field-specific parameter ID IPPARM_REQUEST_URI. The
GC_PARM_BLK structure containing the data is referenced via the extevtdatap pointer in the
METAEVENT structure. In this particular scenario, the GCEV_OFFERED event is generated as a
result of receiving an INVITE message.
#include "gclib.h"
..
..
METAEVENT metaevt;
GC_PARM_DATA_EXT parm_data;
GC_PARM_BLK *pParmBlock = NULL;
char reqestURI[IP_REQUEST_URI_MAXLEN];
/* Get Meta Event */
gc_GetMetaEvent(&metaevt);
switch(metaevt->evttype)
{
.
.
.
case GCEV_OFFERED:
currentCRN = metaevt->crn;
pParmBlock = (GC_PARM_BLK*)(metaevt->extevtdatap);
INIT_GC_PARM_DATA_EXT(&parm_data);
/* going thru each parameter block data*/
while ((ret = gc_util_next_parm_ex(pParmBlock,&parm_data)) == GC_SUCCESS)
{
switch (parm_data.set_ID)
{
/* Handle SIP message information */
case IPSET_SIP_MSGINFO:
switch (parm_data.parm_ID)
{
/* Copy Request URI from parameter block */
/* NOTE: value_size = string length + 1 (for the NULL termination) */
case IPPARM_REQUEST_URI:
strncpy(requestURI, parm_data.value_buf, parm_data.value_size);
break;
}
}
break;
}
.
.
.
}