Dialogic Dialogic Global Call IP IP Phone User Manual


 
Contact URI
The application must retrieve the necessary SIP message header and body information by copying
it 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.
The following pseudo-code illustrates how to extract “OK” and “Failed” responses to OPTIONS
requests from a GCEV_EXTENSION event.
char siphdr[IP_SIP_HDR_MAXLEN];
char AcceptHeader[IP_SIP_HDR_MAXLEN];
char Accept_encodingHeader[IP_SIP_HDR_MAXLEN];
char Accept_languageHeader[IP_SIP_HDR_MAXLEN];
case GCEV_EXTENSION:
if( pextensionBlk->ext_id== IPEXTID_RECEIVEMSG )
{
while ((l_pParm = gc_util_next_parm(pParmBlock, l_pParm )) != 0)
{
int l_mtype= (int)(*( l_pParm ->value_buf));
switch (l_pParm ->set_ID)
{
case IPSET_MSG_SIP:
if(l_pParm ->parm_ID == IPPARM_MSGTYPE)
{
if(l_mtype== IP_MSGTYPE_SIP_OPTIONS_OK)
{
printf("OPTIONS request successful\n");
}
else if (l_mtype== IP_MSGTYPE_SIP_ OPTIONS_FAILED)
{
printf("OPTIONS request failedl\n");
}
}
else if(l_pParm ->parm_ID == PARM_MSG_SIP_RESPONSE_CODE)
{
int *l_RC= (int *) l_pParm ->value_buf;
printf ("Response Code %d \n",*l_RC);
}
case IPSET_SIP_MSGINFO:
switch(l_pParm ->parm_ID)
{
case IPPARM_SIP_HDR:
strncpy(siphdr,(char*)parmp->value_buf,parmp->value_size);
siphdr[parmp->value_size]='\0';
if(!strnicmp(siphdr,"Accept-encoding",strlen("Accept-encoding" )))
{
strcpy(Accept_encodingHeader,siphdr);
}
else if (! strnicmp(siphdr,"Accept-language",strlen("Accept-language")))
{
strcpy(Accept_languageHeader,siphdr);
}
else if (! strnicmp(siphdr,"Accept",strlen("Accept")))
{
strcpy(AcceptHeader,siphdr);
}
//(process other headers)
default :
break;
}