PREV TOC HOME INDEX NEXT


gc_GetDNIS( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetDNIS(crn, dnis)
Inputs:

CRN crn

  • call reference number
 

char *dnis

  • pointer to buffer to store DNIS info
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

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

Parameter

Description

crn call reference number
dnis points to the buffer where the DNIS is stored

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


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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