# Natural Call Control (NCC) transfer interface

To transfer a call using the Natural Call Control transfer interface, one of the calls must have a callid. This topic describes how to obtain a callid and how to initiate a call transfer using the NCC transfer interface.

## Obtaining a callid

There are two ways to obtain a callid:

- Set the getcallid field in the PLACECALL_EXT structure to 1, enabling the request of a callid upon outbound call setup.

typedef struct
{
DWORD size; /* size of this structure */
. . .
DWORD getcallid; /* get callid for this call */
. . .
} PLACECALL_EXT;

- The application invokes nccSendCallMessage for one of the existing calls to be transferred. In the function invocation request, the message argument should point to an NCC_ISDN_SEND_CALL_MESSAGE structure. The size argument should be set to the size of the structure in which message_id = NCC_ISDN_TRANSFER_CALLID_RQ and message_type = 0.
  This method is required to obtain a callid for an inbound call.

typedef struct
{
WORD message_id;
WORD message_type;
} NCC_ISDN_SEND_CALL_MESSAGE;

Note: Some protocol variants do not support this method of obtaining a callid.

In either case, the application is informed (by the NCCEVN_CALLID_AVAILABLE event) when a callid is available. Any time after this occurs, the application can initiate a call transfer.

## Initiating call transfer

There are two ways to initiate call transfer:

- The application invokes nccTransferCall with the call handles of the two calls to be transferred. Using this method, the application has only to request a callid. The callid is managed and used by NCC.

- An application can be written with several contexts and processes (or several machines) and can be required to transfer two calls that are each managed by different processes. In this situation, each process has the call handle for one of the calls, but not the other. Neither process can call nccTransferCall with both call handles.
  In this situation, nccTransferCall can be invoked with one call handle and a second call handle of 0, as long as the TRANSFERCALL_EXT structure is supplied. For example:

typedef struct
{
DWORD size; /* size of this structure */
WORD id[NCC_ISDN_CALLID_LEN]; /* call identifier */
} TRANSFERCALL_EXT;

Set the size field to the size of the structure and the id field to the callid for the other leg of the transfer. The callid is available to the other process in the callid field of the NCC_ISDN_EXT_CALL_STATUS structure after the NCCEVN_CALLID_AVAILABLE event is received. For example:

typedef struct
{
. . .
WORD callid[NCC_ISDN_CALLID_LEN]; /* call identifier */
. . .
} NCC_ISDN_EXT_CALL_STATUS;

Note: For NCC, transfer can be performed only on calls on two separate B channels.

When a transfer is successful, the application receives the NCCEVN_CALL_DISCONNECTED message, with the reason code NCC_DIS_TRANSFER for the call that was transferred.

If call transfer fails, the application receives the NCCEVN_PROTOCOL_ERROR message with a value of NCC_PROTERR_TCT_FAILED and the size field is set to one of the error codes given in NMS ISDN messaging transfer interface. For more information, refer to the Dialogic® NaturalAccess™ ISDN Software Developer's Manual.