Dialogic Dialogic Global Call IP IP Phone User Manual


 
Dialogic
®
Global Call IP Technology Guide — November 2007 419
Dialogic Corporation
request modification of call attributes — gc_ReqModifyCall( )
/* Request remote SIP client to change call to G.729: */
/* Assumes: 1) caller has verified call to be in connected state */
int reqChangeToG729(CRN crn)
{
GC_PARM_BLK *parmblkp = NULL;
char sdpG729[] =
"v=0\r\n" \
"o=Dialogic_IPCCLib 146430240 146430241 IN IP4 169.254.00.01\r\n" \
"s=Dialogic_SIP_CCLLIB\r\n" \
"i=session information\r\n" \
"c=IN IP4 169.254.00.01\r\n" \
"t=0 0\r\n" \
"m=audio 2002 RTP/AVP 18\r\n" \
"a=ptime:10\r\n";
frc = gc_util_insert_parm_ref_ex(&parmblkp,
IPSET_SDP,
IPPARM_SDP_OFFER,
sizeof(sdpG729),
sdpG729);
if (NULL == parmblkp) return FAILURE;
if (gc_ReqModifyCall(crn, parmblkp, EV_ASYNC) < 0) return FAILURE;
gc_util_delete_parm_blk(parmblkp);
return SUCCESS;
} /* End of function. */
The following code example illustrates the use of gc_ReqModifyCall( ) to place the current media
session on hold using the SDP media attribute “inactive”.
.
.
/* Dialogic Header Files */
#include <gcip.h>
#include <gclib.h>
.
.
.
/* Request remote SIP client to place call on hold: */
/* Assumes: 1) caller has verified call to be in connected state */
/* 2) caller has enabled event handler for GCEV_MODIFY_CALL_ACK, */
/* GCEV_MODIFY_CALL_REJ, and GCEV_MODIFY_CALL_FAIL. */
int holdReq(CRN crn, IP_CAPABILITY * pIpcap)
{
GC_PARM_BLK *parmblkp = NULL;
/* Change direction to "inactive" direction */
pIpcap->direction = IP_CAP_DIR_LCLRTPINACTIVE;
/* append the GC_PARM_BLK with the respective modified codec direction */
gc_util_insert_parm_ref(&parmblkp,
GCSET_CHAN_CAPABILITY,
IPPARM_LOCAL_CAPABILITY,
sizeof(IP_CAPABILITY),
pIpcap);
if (NULL == parmblkp) return FAILURE;
if (gc_ReqModifyCall(crn, parmblkp, EV_ASYNC) < 0) return FAILURE;