Dialogic Dialogic Global Call IP IP Phone User Manual


 
402 Dialogic
®
Global Call IP Technology Guide — November 2007
Dialogic Corporation
gc_AcceptModifyCall( ) — accept proposed modification of call characteristics
// Assume application has enabled GCEV_200OK and GCEV_SIP_ACK eventing.
.
.
.
/* 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 */
{
EXTENSIONEVTBLK *extblkp = metaevent.extevtdatap;
GC_PARM_BLKP parm_blkp = &extblkp->parmblk;
GC_PARM_DATA_EXT parm;
GC_PARM_BLKP replyParmblkp = NULL;
GC_PARM_DATAP curParm = NULL;
IP_CAPABILITY cap;
RTP_ADDR rtp;
int frc;
bool proposal_accepted;
GC_PARM_BLKP parm_blkp = metaeventp->extevtdatap;
INIT_GC_PARM_DATA_EXT(&parm);
frc = gc_util_find_parm_ex(parm_blkp,
(unsigned long)IPSET_SDP,
(unsigned long)IPPARM_SDP_OFFER,
&parm);
if (frc == GC_SUCCESS)
{
// Raw SDP is in memory location parm.pData and is
// of length parm.data_size.
char sdpResponse[1000];
int sdpResponseSize = 1000;
// applicationModifyMedia(...) is a user supplied function
// that analyzes the raw SDP; it starts the media and provides
// a raw sdp answer for the remote endpoint if the media offer
// is acceptable. This function is not supplied in this sample.
if (applicationModifyMedia(parm.pData, parm.data_size
sdpResponse, &sdpResponseSize) == SUCCESS)
{