Tracing in Natural Access-based applications

Introduction

This article provides instructions on how to capture two logs, ctdaemon and oammon,  commonly requested when troubleshooting Dialogic® Natural Access (NA) issues. 

Ctdaemon logging is performed by the ctdaemon process which is the middleware between the application and Dialogic®  AG Series Media Boards, Dialogic CG Series Media Boards.The ctdaemon log captures commands issued by the application to the board and captures events sent from the board to the application.  

Oammon logging is performed by the oammon process and is responsible for capturing messages sent from the board to the network and messages received from the network.

Ctdaemon logging

Ctdaemon logging can configured in one of two ways, either by modifying the cta.cfg file or by using the utility setctatrace. This setctatrace utility is delivered in Natural Access releases starting with R8 but is compatible with previous releases. setctatraceallows the TraceMask to be configured dynamically without having to restart ctdaemon.

Important Note

 Regardless of which method is used to configure ctdaemon tracing, there are two keywords in the cta.cfg file that must be set appropriately:

  • TraceMode must be set to 1 (one) which is the default setting when Natural Access is installed. 

  • TraceFile must be set to a filename such as \nms\cta.log for Windows or /opt/nms/cta.log for Unix variants.

The keyword that controls the level of tracing is TraceMask. Typically a TraceMask=all is used which will trace server, client, dispatcher, debug, API and driver commands.

However, should this level of logging cause issues with performance, then a TraceMask of 0x70 will trace just API commands, events and errors which is sufficient in many cases.

Important Note

In order for any changes made to cta.cfg to become effective, you must restart ctdaemon.

If your application does not enable ctdaemon logging, then regardless of whether you modify the cta.cfg file or use setctatrace, your application will not log CT Access information.  Enabling of ctdaemon logging is done by setting the traceflags member of the CTA_INIT_PARMS structure to CTA_TRACE_ENABLE. The CTA_INIT_PARMS structure is passed to ctaInitialize. Here is a code sample on how this is done:

CTA_INIT_PARMS initparms = { 0 };

initparms.size = sizeof(CTA_INIT_PARMS);
initparms.parmflags = CTA_PARM_MGMT_SHARED;
initparms.traceflags = CTA_TRACE_ENABLE;
initparms.filename = NULL;
initparms.ctacompatlevel = CTA_COMPATLEVEL;
ctaInitialize (*serviceNames, numServiceNames, &initparms) ;


Controlling TraceMask using cta.cfg file

If you control the TraceMask setting by modifying the cta.cfg file, you will need to restart ctdaemon in order to make the new TraceMask effective.

Controlling TraceMask using setctatrace

The syntax for setctatrace is:     setctatrace -m mask 

Here are some examples:

setctatrace -m all       which is equivalent to TraceMask=all
setctatrace -m 0x70  which is equivalent to TraceMask=0x70  (traces CT Access API commands, events and errors)
setctatrace -m 0        which turns off all tracing
setctatrace -m 0x7f0f70 which will enable all Fax tracing bits as well as enabling tracing for CT Access API commands, events and errors
setctatrace -m 0xf0000fc which enables Fusion tracing as well as enabling tracing for CT Access API commands, events and errors

Also, setctatrace is dynamic and will not update the cta.cfg file. Therefore if you restart ctdaemon, the TraceMask value will revert to the value as defined in the cta.cfg file.

Oammon logging

Typically, oammon logs are requested in order to troubleshoot protocol problems such as ISDN, CAS (WNK, OPS, etc). The oammon log will capture messages between the TCP (Trunk control program) in the board runtime and the network. There is a separate TCP for each protocol that is supported on the board. Oammon logging is controlled using the program agtrace. Agtrace allows you to send a tracemask to the oammon process.  Typically, support will ask that one of two tracemasks be used, one for ISDN tracing and one for tracing CAS protocols.  Following are the steps required for activating the oammon tracing.

  1. Run oammon in the foreground in a separate window

  2. For CAS tracing - Issue the command agtrace 3073 B' where B is the board number as it appears in the output of boardinf. If tracing board 0, then there is no need to specify the board number.

  3. For ISDN tracing - Issue the command agtrace 803073 B where B is the board number as it appears in the output of boardinf. If tracing board 0, then there is no need to specify the board number.

  4. After running the test, issue the command agtrace 0 B to disable the tracing.

 

By default OAM messages are written to the oammon.log file in the \nms\oam\log directory or /opt/nms/oam/log for Unix variants.

Return to Documentation Home I Return to Sangoma Support