gc_GetResourceH( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_GetResourceH( ) function retrieves the resource device handle associated with the specified line device, linedev. The *resourcehp parameter is actually the SRL handle of the resource associated with the line device.
If the linedev parameter is not an IP media Global Call line device, the resource to be retrieved can be a network, voice, or media device, as determined by the resourcetype parameter.
If the linedev parameter is an IP media Global Call line device, the resource that is retrieved is the Global Call line device to which the media handle is attached, as determined by a resourcetype parameter with a value of GC_NET_GCLINEDEVICE.
Termination Events
Cautions
If this function is invoked for an unsupported technology, the function fails. The error value EGC_UNSUPPORTED will be the Global Call value returned when the gc_ErrorInfo( ) function is used to retrieve the error code.
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> /* * Assume the following has been done: * 1. A line device has been opened specifying voice resource * 2. A call associated with ldev is in the connected state */ int get_voice_handle(LINEDEV ldev, int *voicehp) { GC_INFO gc_error_info; /* GlobalCall error information data */ if (gc_GetResourceH(ldev, voicehp, GC_VOICEDEVICE) == GC_SUCCESS) { /* * Application may now perform voice processing (e.g., play a prompt) * using the voice handle. */ return(0); } else { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetResourceH() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", 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); } }See Also
- gc_GetNetworkH( ) (deprecated)
- gc_GetVoiceH( ) (deprecated)
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation