Dialogic Dialogic Global Call IP IP Phone User Manual


 
316
Dialogic Corporation
/* Invoke transfer */
memset(&t_gclibmakecallblk, 0, sizeof(GCLIB_MAKECALL_BLK));
strcpy(t_gclibmakecallblk.destination.address, invokeaddr);
t_gclibmakecallblk.destination.address_type = GCADDRTYPE_IP;
t_gclibmakecallblk.destination.address_plan = GCADDRPLAN_UNKNOWN;
t_gcmakecallblk.gclib = &t_gclibmakecallblk;
gc_util_insert_parm_ref(&t_pParmBlk, IPSET_CALLINFO, IPPARM_PHONELIST,
sizeof(phonelist), phonelist);
t_gclibmakecallblk.ext_datap = t_pParmBlk;
rc = gc_InvokeXfer(session[channel].crn, 0, 0, &t_gcmakecallblk, 0, EV_ASYNC);
gc_util_delete_parm_blk(t_pParmBlk);
if(GC_SUCCESS != rc)
{
printf("GC_APP : [%d] Invoke Xfer failed!!!\n",channel);
return GC_ERROR;
}
return GC_SUCCESS;
}
4.25.5.3 Invoking an Attended Call Transfer
Note that it is necessary for the consultation call to be in the connected state at both parties before
the transfer operation is invoked. If the transferred-to party (party C) is a Global Call application
and is not in the connected state when the transfer is invoked, it may fail to receive the Global Call
event for the transfer request, which will cause a GCEV_TASKFAIL.
The following code snippet illustrates how a party that is connected to two remote parties, a
primary call and a secondary call, invokes a call transfer by sending a REFER to one of the remote
parties. The Refer-To, Replaces, and Referred-By header fields in the REFER are automatically
filled in by Global Call. Note that the application does not have to specify the Refer-To information
in an attended transfer because the secondary call already contains that information.
int Gc_InvokeXfer(int primaryChannel, int secondaryChannel)
{
INT32 rc;
/* Invoke transfer */
rc = gc_InvokeXfer(session[primaryChannel].crn, session[secondaryChannel].crn,
0, 0, 0, EV_ASYNC);
if(GC_SUCCESS != rc)
{
printf("GC_APP : [%d] Invoke Xfer failed!!!\n",primaryChannel);
return GC_ERROR;
}
return GC_SUCCESS;
}
4.25.5.4 Processing Asynchronous Call Transfer Events
The following code snippets illustrate how to handle the asynchronous events that notify
applications of the call transfer status as a SIP call transfer proceeds.