gc_SetUserInfo( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_SetUserInfo( ) function permits the setting of technology-specific user information. The definition and use of the user information is totally technology dependent. See the associated Global Call Technology User's Guide for definition and usage of the user information parameter.
For the gc_SetUserInfo( ) function, the target type identifies whether the basic entity is either a line device (GCTGT_GCLIB_CHAN) or a call (GCTGT_GCLIB_CRN). See Section 6.2, "Target Objects" for more information.
target_type target object type. Valid values are: See Table 22, "GC Parameter Entry List Maintained in GCLIB" for details. target_id target object identifier. This identifier, along with target_type, uniquely specifies the target object. infoparmblkp points to GC_PARM_BLK which contains parameters defining user information. See the appropriate Global Call Technology User's Guide for GC_PARM_BLK pointer referenced structure definitions. duration duration of the user information block setting: Termination Events
Cautions
If the duration is specified as GC_ALLCALLS, the specified user information block is maintained for either the duration of the line device (that is, until gc_Close( ) is invoked on the device) or until gc_SetUserInfo( ) is invoked again. In the case where gc_SetUserInfo( ) is invoked subsequent times on a single line device, each prior data setting is overwritten with the data specified in each subsequent call.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. 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 "gclib.h" #include "gcerr.h" #include "gcisdn.h" /* ISDN Example: Include specified information element in the next outbound message. */ /* Refer to "ISDN Technology User's Guide" for details. */ int SetInfoElemt(LINEDEV linedev, IE_BLK *ie_blkp) { GC_PARM_BLKP infoparmblkp = NULL; /* input parameter block pointer */ int retval = GC_SUCCESS; GC_INFO gc_error_info; /* GlobalCall error information data */ GC_PARM_DATAP t_parm_datap = NULL; /* allocate GC_PARM_BLK for call progress message parameter */ gc_util_insert_parm_ref(&infoparmblkp, GCIS_SET_IE, GCIS_PARM_UIEDATA, sizeof(IE_BLK), ie_blkp); if (infoparmblkp == NULL) { /* memory allocation error */ return(-1); } /* configure user specified info element for transmitting in next outbound message to network */ retval = gc_SetUserInfo(GCTGT_GCLIB_NETIF, linedev, infoparmblkp, GC_SINGLECALL); if (retval != GC_SUCCESS) { gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_SetUsrInfo() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", linedev, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); } /* free the parameter block */ gc_util_delete_parm_blk(infoparmblkp); return (retval); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation