PREV TOC HOME INDEX NEXT


gc_GetANI( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetANI(crn, ani_buf )
Inputs:

CRN crn

  • call reference number

char *ani_buf

  • buffer for storing ANI digits
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

optional call handling (deprecated)

Mode:

synchronous

Platform and Technology:

Springware: T-1/E-1, ISDN, Analog

DM3: T-1/E-1, ISDN, Analog

SS7

IP (embedded stack)

See the Global Call Technology User's Guides for additional information.

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.

Parameter

Description

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

None

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_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


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated February, 2003