isdnSetMsgCapture

Sends tracing messages to the oammon monitor screen from the selected ISDN entity on the board associated with the specified context.

Prototype

DWORD isdnSetMsgCapture ( CTAHD ctahd, DWORD enable, DWORD nai, char *entity_id_string, DWORD nfas_group)

Argument

Description

ctahd

Context handle associated with a D channel, returned by ctaCreateContext.

enable

Toggle for tracing:

1 - ISDN protocol entity entity_id_string generates tracing messages.

0 - tracing disabled.

nai

Network access identifier (NAI) on which to enable or disable tracing.

entity_id_string

Pointer to the NULL-terminated string of one-character names of ISDN protocol entities for which tracing is either enabled or disabled according to the enable parameter. The entity names are defined in the isdntype.h include file.

nfas_group

NFAS group number. This parameter is used only if duplicate NAI values are defined in the configuration. Otherwise, NMS recommends setting nfas_group to the NAI used to set the capture mask.


Return values

Return value

Description

SUCCESS

 

CTAERR_BAD_ARGUMENT

The entity string is NULL.

CTAERR_INVALID_CTAHD

The context handle is invalid.

CTAERR_INVALID_STATE

An ISDN protocol stack instance:

  • Has not been started on the specified context handle,

  • Is being started by a previous call,

  • Is already started, or

  • Is stopping.


Events

Event name

Description

ISDNEVN_SET_MSG_CAPTURE

The event value field contains one of the following reasons or an error code:

SUCCESS

ISDNERR_BAD_NAI

The network access identifier (NAI) is not valid. The NAI must be less than MAX_NAI specified in isdnparm.h. An NAI and NFAS group couple is invalid if the NAI value is not unique in the configuration.


Details

This function enables or disables tracing of messages generated by the ISDN protocol entities named by the entity_id_string. The associated board is indicated by the specified ctahd.

When the entity_id_string contains an asterisk (*), all entities are affected. By default, tracing is enabled for all entities.

In order for messages to be sent to the monitor screen, the flag passed to oamtrace (formerly agtrace) must be set to 0x801000.

For configurations where all NAI values are unique, NMS recommends setting nfas_group to 0.

Example

#define TRACE_ENABLE   1
#define TRACE_DISABLE  0 

DWORD mySetTrace( CTAHD ctahd, DWORD enable, char *list )
{
DWORD ret;
CTA_EVENT event;
char errortext[40];

    ret = isdnSetMsgCapture(  ctahd,  enable, 0, trace_list, 0 );
    if( ret != SUCCESS)
    {
        ctaGetText(ctahd, ret, errortext, 40);
        printf("TRACE_FAIL: %s\n", errrortext);
        return MY_ERROR_TRACE_FAILED;
    }

    myWaitForEvent( ctahd, &event)
    if( event.value != SUCCESS)
    {
        ctaGetText(ctahd, event.value, errortext, 40);
        printf("TRACE_FAIL: %s\n", errortext);
        return MY_ERROR_TRACE_FAILED;
    }
}


void do_trace (CTAHD ctahd)
{
    char trace_list[20];

     /*
     **  Disable all tracing first
     */
    mySetTrace( ctahd, TRACE_DISABLE, "*" );

     /*
     ** Enable tracing for call control layer and the application
     */
    sprintf(trace_list, "%c%c", ENT_CC, ENT_APPLI );
    mySetTrace( porthd, TRACE_ENABLE,  trace_list );
}