# IMGT service demonstration program: imgtdemo

#### Name

imgtdemo

#### Purpose

imgtdemo uses the IMGT service to set and monitor the status of D channels and B channels on an ISDN trunk. imgtdemo provides an example of a management application that uses ISDN Management service functions.

imgtdemo is multi-threaded and interactive. One thread is used for user input and the other sends commands and monitors events from the ISDN stack. Multiple instances of the program can be run to monitor multiple trunks. With a command-line option, you can specify the board, the NAI, the NFAS group number, or the NFAS configuration number coded in the application.

imgtdemo is supplied with the NMS ISDN Management software in executable format with its source code and makefile.

#### Featured functions

imgtReleaseBuffer, imgtSendMessage, imgtStart, imgtStop

#### Requirements

- One or more digital trunk interface boards

- Natural Access

- NMS ISDN software

Before you start the demonstration program, verify that:

- Natural Access is properly installed.

- The board is operating correctly.

- MVIP switching is correctly configured.

- The ISDN stack is properly running.

#### Usage

imgtdemo [options]

Where options represents one or more of the following:

Option | Meaning | Defaults
--- | --- | ---
-a nai | Network access identifier | 0
-b board_number | Board number | 0
-g nfas_group | NFAS group number | 0
-n nfas_confignum | Enable internal NFAS configuration | N/A
-h or -? | Help | N/A

#### Compilation

imgtdemo is supplied in executable format as well as source code. To recompile imgtdemo, do one of the following:

Under this OS... | Go to this directory... | Enter...
--- | --- | ---
Windows | \nms\ctaccess\demos\imgtdemo\ | nmake
UNIX | /opt/nms/ctaccess/demos/imgtdemo/ | make

For more information, refer to the readme_isdn file that was installed with Natural Access.

#### Files

imgtdemo consists of the following files:

File | Description
--- | ---
imgtdemo.c | The main application program with event processing functions.
imgtdemo.h | Header file for the IMGT demonstration program.

#### Details

The following illustration shows the architecture of the IMGT demonstration program:

imgtdemo program structure

The main program reads the command line options and opens both the ADI service and the IMGT service. imgtdemo then allocates a context containing the following information:

unsigned NFAS_group /* NFAS group number */
unsigned board; /* Board number */
unsigned trunk; /* Trunk number, from 0 - 3 */
unsigned nai; /* Network Access Identifier */
unsigned d_channel; /* 0 - trunk not bearing D channel */
/* 1 - trunk bearing D channel */
unsigned channel_status[30]; /* Store information about channel status */

If you use an NFAS configuration, one context is allocated for each trunk in the NFAS group. If you use the -n option at the command line, the program reads the internally hard-coded context structure. imgtdemo then spawns the user-input thread (UserInput) and the event-handler thread (RunDemo).