gc_GetSigInfo( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_GetSigInfo( ) function retrieves the signaling information of an incoming message. The Global Call technology library uses valuep to retrieve the associated signaling information elements (IEs) and puts the information in the queue. To use the gc_GetSigInfo( ) function for a channel, the application needs to specify the size of the queue by calling the gc_SetParm( ) function and setting the RECEIVE_INFO_BUF to the desired size. See also the appropriate Global Call Technology User's Guide for technology-specific information.
linedev Global Call line device handle valuep points to buffer where call information is stored info_id identifies the type of signaling information to be retrieved; see Table 7 metaeventp points to the METAEVENT structure filled in by the gc_GetMetaEvent( ) function or the gc_GetMetaEventEx( ) function (Windows extended asynchronous model only). See METAEVENT for more information.
Termination Events
Cautions
Ensure that the application verifies that the buffer pointed to by the valuep parameter is large enough to hold the information requested by the info_id parameter.
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> #include <gcisdn.h> #define MAX_QUEUE_SIZE 20 METAEVENT metaevent; GC_PARM gcparm; void main() { LINEDEV ldev; char *devname = ":N_dtiB1T1:P_isdn"; GC_INFO gc_error_info; /* GlobalCall error information data */ /*get line device handler */ if (gc_OpenEx(&ldev, devname, EV_SYNC, &ldev) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_OpenEx() on devname: %s, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", devname, 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 (-1); } /* using gc_SetParm() to set size of the buffer queue for gc_GetSigInfo() */ gcparm.longvalue = MAX_QUEUE_SIZE; if (gc_SetParm(ldev, RECEIVE_INFO_BUF, gcparm) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_SetParm() 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); } } /* Retrieve events from SRL */ int evt_hdlr() { IE_BLK ie_blk; /* Information Element */ LINEDEV ldev; /* Line device */ CRN crn; /* Call Reference Number */ GC_INFO gc_error_info; /* GlobalCall error information data */ int retcode; /* Return Code */ retcode = gc_GetMetaEvent(&metaevent); if (retcode <0 ) { /* get and process the error */ } else { /* Continue with normal processing */ } crn = metaevent.crn; if(gc_CRN2LineDev(crn, &ldev) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_CRN2LineDev() on crn: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", crn, 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); } switch(metaevent.evttype) { case GCEV_CALLINFO: /* retrieve signaling information from queue */ if (gc_GetSigInfo(ldev, (char *)&ie_blk, U_IES, &metaevent) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetSigInfo() 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); } else { /* succeeded, process signaling information */ } break; } return 0; }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation