Table of Contents Index NMS Glossary Previous Page Next Page (Page 12 of 69 in this chapter) Version


adiGetContextInfo

Description

Retrieves configuration information about a specified CTA context.

Prototype

DWORD adiGetContextInfo ( CTAHD ctahd,
ADI_CONTEXT_INFO *info,
unsigned size )

ctahd CTA context handle returned by ctaCreateContext.

info Buffer to receive the information. The ADI_CONTEXT_INFO structure is shown below:

typedef struct

{ /* User accessible CONTEXT INFO structure: */

DWORD size; /* returned size of this structure */

DWORD queueid; /* not used in CT Access */

DWORD userid; /* not used in CT Access */

INT32 agliberr; /* last error code after calling AGLIB */

DWORD channel; /* AG Channel */

DWORD board; /* AG Board number */

DWORD stream; /* MVIP stream of this port */

DWORD timeslot; /* MVIP slot of this port */

DWORD mode; /* MVIP mode of operation of this port */

DWORD maxbufsize; /* maximum board buffer size */

char tcpname[12]; /* Current Protocol */

DWORD state; /* port state */

DWORD stream95; /* MVIP-95 base stream number */

} ADI_CONTEXT_INFO;

size Amount of memory available at info, which must be large enough to receive the ADI_CONTEXT_INFO size return value.

Return Values

Events

None.

Details

This function returns information about the current state of a specified CTA context.

Up to size bytes of the ADI_CONTEXT_INFO structure are copied to the address at info. If size is greater than or equal to sizeof (ADI_CONTEXT_INFO), the complete structure is copied. The number of bytes actually copied is returned in the ADI_CONTEXT_INFO size field.

Note: If you are using Natural Call Control, this function will not fill in the tcpname field of the ADI_CONTEXT_INFO structure. To retrieve this information, the application must call nccGetLineStatusInfo.

The following table summarizes the ADI_CONTEXT_INFO structure. Many of these CTA context characteristics are described in other functions, as noted:
Field

Description

Related Functions

size

The returned size.

N/A

queueid

Not used.

N/A

userid

Not used.

N/A

agliberr

NMS internal.

N/A

channel

NMS internal.

N/A

board

Board number on which the CTA context's DSP resides.

ctaCreateContext

stream

Base MVIP stream for the CTA context.

ctaCreateContext

timeslot

CTA context's MVIP-90 timeslot.

ctaCreateContext

mode

CTA context's MVIP mode.

ctaCreateContext

maxbufsize

AG physical buffer size.

adiGetEncodingInfo

tcpname

Protocol executing on the CTA context.

adiStartProtocol

state

CTA context state.

N/A

stream95

Base MVIP-95 stream.

N/A

Example


int  myShowContextState( CTAHD ctahd )
{
    ADI_CONTEXT_INFO info;

    if( adiGetContextInfo( ctahd, &info, sizeof info ) != SUCCESS )
        return MYFAILURE;

    printf( "        Queue ID = %d\n",      info.queueid    );
    printf( "         User ID = %08Xh\n",   info.userid     );
    printf( "      AG Channel = %08Xh\n",   info.channel    );
    printf( "Last AGLIB Error = %d \n",     info.agliberr   );
    printf( "  AG Buffer Size = %d\n",      info.maxbufsize );
    printf( "        Protocol = %s\n",      info.tcpname    );
    printf( "    Board Number = %d\n",      info.board      );
    printf( "Stream:Slot,Mode = %d:%d,",    info.stream, info.timeslot );

    switch( info.mode )
    {
        case ADI_FULL_DUPLEX   : puts("ADI_FULL_DUPLEX" );   break;
        case ADI_VOICE_DUPLEX  : puts("ADI_VOICE_DUPLEX" );  break;
        case ADI_SIGNAL_DUPLEX : puts("ADI_SIGNAL_DUPLEX" ); break;
        default:
            if( info.mode & ADI_VOICE_INPUT  ) printf( "+ADI_VOICE_INPUT"  );
            if( info.mode & ADI_VOICE_OUTPUT ) printf( "+ADI_VOICE_OUTPUT" );
            if( info.mode & ADI_SIGNAL_INPUT ) printf( "+ADI_SIGNAL_INPUT" );
            if( info.mode & ADI_SIGNAL_OUTPUT) printf( "+ADI_SIGNAL_OUTPUT");
            printf( "\n" );
                break;
    }
    printf("\n");
    return SUCCESS;
}



Table of Contents Index NMS Glossary Previous Page Next Page (Page 12 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.