Previous PageTable Of ContentsIndexNext Page



Description

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

Prototype

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

ctahd CTA context handle associated with a D channel, returned by ctaCreateContext or adiOpenPort.

enable Toggle for tracing: 1 causes tracing messages to be generated by the ISDN protocol entity named by entity_id_string. 0 disables tracing.

nai Network access identifier on which to enable or disable tracing.

entity_id_string
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 by the isdntype.h include file.

Return Values

SUCCESS

CTAERR_BAD_ARGUMENT
The entity string is
NULL.

CTAERR_INVALID_CTAHD
The CTA context handle is invalid.

CTAERR_INVALID_STATE
An ISDN protocol stack instance has not been started on the specified CTA context handle, or is being started by a previous call, or is already started, or the instance is stopping.


Events

ISDNEVN_SET_MSG_CAPTURE
The event
value field contains one of the following:

      SUCCESS

      ISDNERR_BAD_NAI
      The network access identifier
      (NAI) is not valid. The NAI must be less than MAX_NAI.

Details

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

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

In order for messages to be sent to the agmon monitor screen, the flag passed to agtrace must be set to 0xb01000.

Example

#define TRACE_ENABLE 1
#define TRACE_DISABLE 0

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

ret = isdnSetMsgCapture( ctahd, enable, 0, trace_list );
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_API );
mySetTrace( porthd, TRACE_ENABLE, trace_list );
}


Natural MicroSystems, Inc.
100 Crossing Boulevard
Framingham, MA 01702

Contact Developer Support

Previous PageTable Of ContentsIndexNext Page