Dialogic Dialogic Global Call IP IP Phone User Manual


 
408 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
gc_RejectModifyCall( ) — reject proposed modification of call attributes
.
.
.
/* Dialogic Header Files */
#include <gcip.h>
#include <gclib.h>
.
.
.
/* SRL event handler: */
for (;;)
{
if (-1 != sr_waitevt(500)) process_event();
}
void process_event(void)
{
METAEVENT metaevent;
GC_INFO t_info;
/* Populate the metaEvent structure */
if(GC_SUCCESS != gc_GetMetaEvent(&metaevent)) return;
/* process GlobalCall events */
if ((metaevent.flags & GCME_GC_EVENT) == 0) return;
switch (metaevent.evttype)
{
.
.
.
case GCEV_REQ_MODIFY_CALL: /* request to modify call attribute */
{
GC_PARM_BLKP parm_blkp = (GC_PARM_BLKP) metaEvent.extevtdatap;
GC_PARM_BLKP replyParmblkp = NULL;
GC_PARM_DATAP curParm = NULL;
IP_CAPABILITY cap;
RTP_ADDR rtp;
unsigned char proposal_accepted = FALSE;
while ((curParm = gc_util_next_parm(parm_blkp, curParm)) != NULL)
{
if ((curParm->set_ID == GCSET_CHAN_CAPABILITY) &&
(curParm->parm_ID == IPPARM_LOCAL_CAPABILITY))
{
memcpy(&cap, curParm->value_buf, curParm->value_size);
/* determine if capability is acceptable (logic not shown) */
if (isCapabilityAcceptable(cap) == TRUE)
{
/* insert parameter with accepted capability in parameter block reply */
/* (logic not shown) */
insertCapIntoReply(cap,replyParmblkp);
proposal_accepted = TRUE;
}
else if ((curParm->set_ID == IPSET_SIP_MSGINFO) &&
(curParm->parm_ID == IPPARM_SIP_HDR))
{
/* parse SIP header and make appropriate updates (logic not shown) */
proposal_accepted = TRUE;
}
else if ((curParm->set_ID == IPSET_RTP_ADDRESS) &&
(curParm->parm_ID == IPPARM_REMOTE))
{
memcpy(&rtp, curParm->value_buf, curParm->value_size);
if (isMediaReRouteAcceptable(rtp) == TRUE)
{
/* update RTP transport addresses in application (logic not shown) */