# isdndemo program structure and coding

isdndemo is a single-threaded C++ application consisting of global functions and classes. The following table lists the global functions found in the isdndemo.cpp file:

Function | Description
--- | ---
cta_error_handler | Processes Natural Access errors.
dfprintf, dvprintf | Provides conditional program output.
error | Provides critical application error notification.
error_cta | Provides output of Natural Access codes in text form.
getACU, getACUERR | Converts some constants to text form.
main | Provides a program entry point, performs processing of program-wide command line arguments, and initializes Natural Access and program classes.
readConfig | Creates a program object hierarchy based on command line arguments.

The global classes used with isdndemo are found in several files. The following table lists each class along with its associated file and description:

Class | File | Description
--- | --- | ---
BChannel | BChannel.cpp | Specifies a context class that represents the ISDN B channel.
Board | Board.cpp | Provides access to information about NMS boards.
Call | Call.cpp | Specifies an object that represents a single NMS ISDN call.
Context | Context.cpp | Implements a single-threaded program model and a generic mechanism for processing Natural Access events.
DChannel | DChannel.cpp | Specifies a context class that represents the ISDN D channel.
NAI | NAI.cpp | Specifies an object that represents board trunks (or NAI in NFAS terminology) associated with BChannel and Call objects.
Timer | Timer.cpp | Implements a synchronous timer based on the asynchronous ADI timer.

The following illustration shows how isdndemo functions and classes are related: