gc_GetDNIS( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_GetDNIS(crn, dnis) Inputs: Returns: Includes: Category: Mode: Platform and Technology: †See the Global Call Technology User's Guides for additional information.
Description
- Note: The gc_GetDNIS( ) function is deprecated in this software release. The suggested equivalent is gc_GetCallInfo( ).
The gc_GetDNIS( ) function retrieves the dialed number identification service (DNIS) information (DDI digits) associated with a specific call reference number (CRN). The DDI digits are in ASCII string format and end with "\0". See also the appropriate Global Call Technology User's Guide for technology-specific information.
crn call reference number dnis points to the buffer where the DNIS is stored Termination Events
Cautions
- The buffer pointed to by dnis must be large enough to store the largest expected DNIS string length, which is defined by GC_ADDRSIZE.
- If the application needs more DDI digits, the application can use the gc_CallAck( ) function to request more digits, if the protocol supports this feature. The gc_GetDNIS( ) function may be called again to retrieve these digits.
- 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 <string.h> #include <gclib.h> #include <gcerr.h> /* * Assume the following has been done: * 1. 'maxddi' has been setup depending on needs * of application/protocol. * 2. Line devices have been opened for each time slot on dtiB1. * 3. Wait for a call using gc_WaitCall() * 4. An event has arrived and has been converted to a metaevent * using gc_GetMetaEvent() or gc_GetMetaEventEx() (Windows) * 5. The event is determined to be a GCEV_OFFERED event */ int get_dnis(void) { CRN crn; /* call reference number */ int maxddi = 10; /* maximum allowable DDI digits */ char dnis_buf[GC_ADDRSIZE]; /* DNIS digit Buffer */ GC_INFO gc_error_info; /* GlobalCall error information data */ /* 1st get the crn */ if (gc_GetCRN(&crn, &metaevent) != GC_SUCCESS) { /* handle the gc_GetCRN error */ } /* * Get called party number and check that there were not too * many digits collected. */ if (gc_GetDNIS(crn, dnis_buf) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetDNIS() 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); } if (strlen(dnis_buf) <= maxddi) { /* * Process called party number as needed by the application. */ } else { /* * Drop the call if number of DDI digits exceeds maximum limit */ if (gc_DropCall(crn, GC_NORMAL_CLEARING, EV_ASYNC) != GC_SUCCESS) { /* process error return from gc_DropCall() */ } } /* * Application can answer, accept, or terminate the call at this * point, based on the DNIS information. */ return (0); }See Also
- gc_CallAck( )
- gc_GetANI( ) (deprecated)
- gc_GetCallInfo( )
- gc_WaitCall( )
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation