PREV TOC HOME INDEX NEXT


gc_GetSigInfo( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetSigInfo(linedev, valuep, info_id, metaeventp)
Inputs:

LINEDEV linedev

  • Global Call line device handle
 

char *valuep

  • pointer to info buffer
 

int info_id

  • call info ID
 

METAEVENT *metaeventp

  • pointer to metaevent block
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

interface specific

Mode:

synchronous

Platform and Technology:

Springware: ISDN

DM3: ISDN

SS7

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

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.

Parameter

Description

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.

Table 7. gc_GetSigInfo( ) info_id Parameter ID Definitions 

info_id Parameter

Definition

Technology

valuep Format

U_IES

Unformatted user-to-user Information Elements (IEs) retrieved in CCITT format. The application needs to allocate sufficient memory (up to 256 bytes) to hold the retrieved IEs. The IEs are returned as raw data and must be parsed and interpreted by the application. Use the IE_BLK data structure to retrieve unprocessed IEs. For a description of the IE_BLK structure, and for DPNSS protocol-related IEs, see the Global Call ISDN Technology User's Guide.

ISDN, SS7

string

UUI

User-to-User Information. The data returned is application-dependent and is retrieved using the USRINFO_ELEM data structure. For a description of the return format for UUI and other technology-specific information, see the Global Call ISDN Technology User's Guide.

ISDN

string

Termination Events

None

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


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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