Table of Contents Index NMS Glossary Previous Page Next Page Version


Chapter 5

Demonstration Program


5.1 Introduction
5.2 IMGT Service Demo Program: imgtdemo 5.2.1 imgtdemo Structure 52

5.2.2 Program Initialization 53

5.2.3 User-Input Thread 54

Example 1 55

Example 2 55

5.2.4 Event-Handler Thread 55

5.1 IntroductionTop of Page

This chapter describes the functionality and structure of the IMGT demo demonstration program supplied with the NMS ISDN Management software.

The demonstration program is shipped as an executable program and with its source and makefile.

Before you start the demonstration program, verify that:

Refer to the appropriate installation manual for details on installation.

5.2 IMGT Service Demo Program: imgtdemoTop of Page

Name

imgtdemo

Purpose

Uses the NMS ISDN Management API to set and monitor the status of B channels on an ISDN trunk. Shows an example of a management application that uses the ISDN Management API.

The program 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.

Featured Functions

imgtReleaseBuffer, imgtSendMessage, imgtStart, imgtStop

Requirements

· One or more AG digital trunk interface boards

· Natural Access version 3.x, 4.0, or later

· NMS ISDN software

Usage

imgtdemo [options]

where options is 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

NONE

-h or -?

Help

n/a

Compilation

imgtdemo is supplied as executable as well as source code.

To recompile imgtdemo, do one of the following:
Under this OS...

Go to this directory...

Enter...

Windows NT and Windows 2000

\nms\ctaccess\demos\imgtdemo\

nmake

UNIX

/opt/nms/ctaccess/demos/imgtdemo/

make

For more information, see the readme.isdn file that came with the NMS ISDN software package.

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.

5.2.1 imgtdemo Structure

This figure illustrates the architecture of the IMGT demonstration program:


chap5a.gif

Figure 6. The imgtdemo Program Structure


5.2.2	 Program Initialization

The main program reads the command line options and opens both the ADI service and the IMGT service. It 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 NFAS configuration is used, one context is allocated for each trunk in the NFAS group.

If the -n option is specified on the command line, the program reads the internally hard coded context structure.

At this point the program spawns the user-input thread (UserInput) and the event-handler thread (RunDemo).

5.2.3 User-Input Thread

This thread waits for the following user commands:
Command

Description

sc eventmask

Sets configuration to receive the following events:

eventmask - range of incoming events (default = 0x00000003)

0x00000001 - service events

0x00000002 - restart events

rc

Resets configuration, stops receiving service/restart events.

is low_channel high_channel [nai]

Puts a range of channels on nai in service. Specify nai for NFAS only.

tis [nai]

Puts the whole interface in service. Specify nai for NFAS only.

oos low_channel high_channel [nai]

Puts a range of channels on nai out of service. Specify nai for NFAS only.

toos [nai]

Puts the whole interface out of service. Specify nai for NFAS only.

sr low_channel high_channel [nai]

Requests a range of channels status on nai. Specify nai for NFAS only.

sh

Shows the current status of B channels.

help, h, ?

Displays this help screen.

quit, q

Exits the program.

If the user picks the command is, oos, tis, toos, or sr, the program creates the messages based on passed arguments.

The command sh provides the snapshot of the status of all the B channels on the trunk (or the whole NFAS group).

Example 1

To request a SERVICE message to put B channels from 1 through 23 out of service:

To show the status of the B channels on an E1 trunk:

This thread performs the following tasks:



Table of Contents Index NMS Glossary Previous Page Next Page Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights reserved.