gc_CompleteTransfer( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_CompleteTransfer( ) function completes the transfer of a call in a supervised transfer. A supervised transfer means that the party receiving the transferred call is consulted by the party transferring the call, before the transfer is completed. This function must be called only after the transferred call has been delivered and the channel is in the Dialtone state or the OnHoldPendingTransfer state.
This function is supported only under the PDKRT call control library. See the appropriate Global Call Technology User's Guide for technology-specific information.
Termination Events
- GCEV_COMPLETETRANSFER
- indicates that the gc_CompleteTransfer( ) function was successful, that is, the transfer was completed
- GCEV_TASKFAIL
- indicates that the function failed. For more information, see the "Error Handling" section in the Global Call API Programming Guide.
Cautions
- In synchronous mode, after the successful return of the gc_CompleteTransfer( ) function, the application must call the gc_ReleaseCallEx( ) function for both channels (the consultation call and the call that was transferred) to return the channels to the Null state.
- In asynchronous mode, after receiving the GCEV_COMPLETETRANSFER event, the application must call the gc_ReleaseCallEx( ) function for both channels (the consultation call and the call that was transferred) to return the channels to the Null state.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function for error information. If the GCEV_TASKFAIL event is received, use the gc_ResultInfo( ) function to retrieve information about the event. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).
Example
#include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> #define MAX_CHAN 30 /* max. number of channels in system */ /* * Data structure which stores all information for each line */ static struct linebag { LINEDEV ldev; /* GlobalCall API line device handle */ CRN original_crn; /* GlobalCall API call handle */ CRN consultation_crn; /* GlobalCall API call handle */ int blocked; /* channel blocked/unblocked */ int networkh; /* network handle */ } port[MAX_CHAN+1]; struct linebag *pline; /* pointer to access line device */ /* * Assume the following has been done: * 1. Opened line devices for each time slot on DTIB1. * 2. Each line device is stored in linebag structure "port". * 3. A call has been established (original_crn) and is in connected state. * 4. The gc_SetupTransfer() has been called successfully to initiate the transfer. */ int call_completetransfer(int port_num) { GC_INFO gc_error_info; /* GlobalCall error information data */ /* Find info for this time slot, specified by 'port_num' */ /* (assumes port_num is valid) */ pline = port + port_num; /* Complete the transfer of the consultation call to the original call */ if (gc_CompleteTransfer(pline->original_crn, pline->consultation_crn, EV_ASYNC) == -1) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_CompleteTransfer() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", pline->ldev, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); return (gc_error_info.gcValue); } /* The gc_ReleaseCallEx() function must be called next on both /* the consultation_crn and the original_crn to return /* the local channels to the NULL state. */ return (0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation