gc_GetCRN( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_GetCRN(crn_ptr, metaeventp) Inputs: Returns: Includes: Category: Mode: Platform and Technology: Description
The gc_GetCRN( ) function retrieves a call reference number for the event to which the pointer metaeventp is pointing. This metaeventp pointer is filled in by the gc_GetMetaEvent( ) function or, for the Windows extended asynchronous model only, the gc_GetMetaEventEx( ) function.
The gc_GetCRN( ) function is supported for backward compatibility only. The application can access the CRN directly from the crn field in the METAEVENT structure pointed to by the metaeventp parameter retrieved by the gc_GetMetaEvent( ) or gc_GetMetaEventEx( ) (Windows only) function.
If the event is associated with a call, the crn_ptr parameter contains a pointer to the CRN. If the event is associated with a line device, the crn_ptr parameter is 0.
- Note: The application can access the line device directly from the linedev field in the METAEVENT structure pointed to by the metaeventp parameter retrieved by the gc_GetMetaEvent( ) or gc_GetMetaEventEx( ) (Windows only) function.
crn_ptr points to the memory address where the call reference number is stored metaeventp points to the METAEVENT structure filled in by the gc_GetMetaEvent( ) or gc_GetMetaEventEx( ) function. See METAEVENT for more information. 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 already 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) */ CRN get_crn(METAEVENT *metaeventp) { CRN crn; /* call reference number */ GC_INFO gc_error_info; /* GlobalCall error information data */ if (gc_GetCRN(&crn, metaeventp) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetCRN() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", metaeventp->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); } else { /* * Else return the CRN and next issue the GlobalCall function call * using the CRN. */ return(crn); } }See Also
- gc_GetLineDev( )
- gc_GetMetaEvent( )
- gc_GetMetaEventEx( ) (Windows extended asynchronous model only)
- gc_MakeCall( )
- gc_WaitCall( )
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation