gc_GetLineDev( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_GetLineDev(linedevp, metaeventp) Inputs: Returns: Includes: Category: Mode: Platform and Technology: Description
The gc_GetLineDev( ) function retrieves a line device associated with an event received from the event queue. If this function is called for an event that is not a Global Call event, then the *linedevp parameter is set to 0. The line device may also be retrieved using the linedev field in the METAEVENT structure instead of using this function.
The gc_GetLineDev( ) function is supported for backward compatibility but is not otherwise needed since the line device ID is available when the metaevent is returned from the gc_GetMetaEvent( ) function or, for the Windows extended asynchronous model only, the gc_GetMetaEventEx( ) function.
linedevp points to the location where the output LINEDEV is stored metaeventp points to the METAEVENT structure filled in by the gc_GetMetaEvent( ) or the gc_GetMetaEventEx( ) function 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> /* * Assume the following has been done: * 1. Opened line devices for each time slot on DTIB1. * 2. Wait for a call using gc_WaitCall() * 3. An event has arrived and has been converted to a metaevent * using gc_GetMetaEvent() or gc_GetMetaEventEx() (Windows) * 4. The event is determined to be a GCEV_OFFERED event */ int get_linedev(LINEDEV *ldevp) { GC_INFO gc_error_info; /* GlobalCall error information data */ /* * Get Line Device corresponding to this event */ if (gc_GetLineDev(ldevp, &metaevent) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetInfoElem() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", metaevent.evtdev, 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 line device ID may then be used for functions like * gc_SetParm(), gc_SetUsrAttr(), and gc_GetVoiceH(). */ return (0); }See Also
- gc_GetCRN( )
- gc_GetMetaEvent( )
- gc_GetMetaEventEx( ) (Windows extended asynchronous model only)
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation