Version5.2.2 Program Initialization 53


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
|
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
|
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.
|
File
|
Description
|
|---|---|
|
imgtdemo.c
|
The main application program with event processing functions.
|
|
imgtdemo.h
|
Header file for the IMGT demonstration program.
|
Figure 6. The imgtdemo Program Structure
5.2.2 Program Initialization
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 */
At this point the message is sent to the IMGT manager.Example 2
The following appears:Show status on Board 1 Nai 0
Channels: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
Status: 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 D 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 = In Service, 1 = Maintenance, 2 = Out Of Service, D = D channel
5.2.4 Event-Handler Thread
Version