gc_ResultValue( )
Termination Events | Cautions | Errors | Example | See Also
Description
- Note: The gc_ResultValue( ) function is deprecated in this software release. The suggested equivalent is gc_ResultInfo( ).
The gc_ResultValue( ) function retrieves the cause of an event. The "result" uniquely identifies the cause of the event to which the metaeventp parameter points. The Global Call result value, the call control library ID, and the actual call control library result value are available upon successful return of the function.
metaeventp points to the event data block. This pointer is acquired via the gc_GetMetaEvent( ) function or, for the Windows extended asynchronous model only, the gc_GetMetaEventEx( ) function. gc_resultp address where the Global Call result value is to be stored cclibidp address where the identification of the call control library associated with this metaevent is to be stored cclib_resultp address where the result value associated with the call control library metaevent is to be stored Termination Events
Cautions
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 <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> int get_result_value(void) { int gc_result; /* GlobalCall error code */ int cclibid; /* Call Control Library ID */ long cc_result; /* Call Control Library error code */ char *msg; /* pointer to error message string */ char *lib_name; /* pointer to library name for cclibid */ /* Obtain the event data */ sr_waitevt(-1); /* Wait indefinitely for an event */ if (gc_GetMetaEvent(&metaevent) !=GC_SUCCESS) { /* Process error return as shown in the Example code of the gc_ErrorValue() function description */ gc_GetMetaEvent(&metaevent); /* Get event parameters into metaevent */ if (metaevent.flags &GCME_GC_EVENT) { /* Process GlobalCall events */ /* find the reason for the event */ if(gc_ResultValue( &metaevent, &gc_result, &cclibid, &cc_result) == GC_SUCCESS){ gc_ResultMsg( LIBID_GC, (long) gc_result, &msg); printf ("GlobalCall event 0x%lx received on LDEV: %ld - %s\n", metaevent.evttype, metaevent.evtdev, msg); gc_CCLibIDToName(cclibid, &lib_name); gc_ResultMsg(cclibid, cc_result, &msg); printf ("%s 0x%lx received on LDEV: %ld - %s\n", lib_name, metaevent.evttype, metaevent.evtdev, msg); return(0); } else { printf ("could not get result value\n"); return (-1): /* indicate error */ } } } }See Also
- gc_ResultInfo( )
- gc_ResultMsg( ) (deprecated)
- gc_CCLibIDToName( )
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation