User`s guide

Dialogic
®
System Release 6.0 PCI for Windows
®
Release Update, Rev 62 — January 30, 2008 205
Dialogic Corporation
1.51.3.2 Invoking an Unattended Call Transfer
The following code snippet illustrates how to invoke an unattended (blind) transfer on a
channel that is in the connected state. In this example, the Refer-To header field of the
REFER message that is sent is set to “sip:500@192.168.1.10”, while the Referred-By
header field is automatically populated by Global Call.
int Gc_InvokeXfer(int channel)
{
INT32 rc;
GCLIB_MAKECALL_BLK t_gclibmakecallblk;
GC_MAKECALL_BLK t_gcmakecallblk = {0};
char invokeaddr[] = "192.168.1.10"; // party C (TRTSE)
char phonelist[] = "500";
/* 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;
}
1.51.3.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;