PREV TOC HOME INDEX NEXT


gc_CompleteTransfer( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_CompleteTransfer(callonhold, consultationcall, mode)
Inputs:

CRN callonhold

  • call reference number for call on hold
 

CRN *consultationcall

  • call reference number for consultation call
 

unsigned long mode

  • async or sync
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

advanced call model

Mode:

asynchronous or synchronous

Platform and Technology:

Springware: T-1/E-1 (PDKRT only)

See the Global Call Technology User's Guides for additional information.

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.

Parameter

Description

callonhold call reference number for the call on hold, that is, the call pending transfer
consultationcall call reference number for the consultation call
mode set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution

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

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


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated February, 2003