gc_GetANI( )
Termination Events | Cautions | Errors | Example | See Also
Description
- Note: The gc_GetANI( ) function is deprecated in this software release. The suggested equivalent is gc_GetCallInfo( ).
The gc_GetANI( ) function retrieves automatic number identification (ANI) information received during call establishment/setup. If the ANI information is not available, an error will be sent and the gc_GetANI( ) function fails. The call must be in the Offered state to retrieve the ANI information.
See also the appropriate Global Call Technology User's Guide for technology-specific information.
crn call reference number ani_buf address of the buffer where ANI is to be loaded. The returned digits will be terminated with "\0". Termination Events
Cautions
- The ani_buf buffer must be large enough to store the largest expected ANI string length (including the zero terminator), which is defined by GC_ADDRSIZE.
- 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. 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_ani(void) { CRN crn; /* call reference number */ char ani_buf[GC_ADDRSIZE]; /* Buffer for ANI digits */ GC_INFO gc_error_info; /* GlobalCall error information data */ /* * Get the calling party number */ crn = metaevent.crn; if (gc_GetANI(crn, ani_buf) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetAPI() 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); } /* Application can answer, accept, or terminate the call at this * point, based on the ANI information. */ return (0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation