Version


Figure 3. NMS ISDN Management API Application Flowchart
|
In this phase...
|
The application...
|
|---|---|
|
Initialize Natural Access
|
· Initializes Natural Access services and creates one context for each B channel and D channel.
|
|
Start IMGT Session
|
· Calls imgtStart to start an IMGT session on each D channel context.
|
|
Perform Tasks
|
· Uses the standard Natural Access event structure to send IMGT messages and receive IMGT events.
|
|
Stop Protocol Stack
|
· Calls imgtStop to end the IMGT session.
|

2. Create event queues.
3. Create CTA contexts for each event queue.
4. Open services on each context.


{
DWORD ret;
CTA_INIT_PARMS initparms = { 0 };
CTA_ERROR_HANDLER hdlr;
CTA_SERVICE_NAME InitServices[] = /* for ctaInitialize */
{ { "ADI", "ADIMGR" },
{ "IMGT", "ADIMGR" },
};
/* Initialize size of init parms structure */
initparms.size = sizeof(CTA_INIT_PARMS);
if ( ( ret = ctaInitialize(
InitServices,
sizeof(InitServices)/sizeof(InitServices[0]),
&initparms)) != SUCCESS)
{
/* ... handle error conditions here.... */
}
}
2. Create a context by calling ctaCreateContext.

{
CTA_SERVICE_NAME name; /* service name */
CTA_SERVICE_ADDR svcaddr; /* reserved */
CTA_SERVICE_ARGS svcargs; /* passes service-specific arguments */
CTA_MVIP_ADDR mvipaddr; /* board #, stream, timeslot, mode */
}CTA_SERVICE_DESC;
CTA_EVENT event ;
CTA_SERVICE_DESC services[] =
{
{ {"IMGT", "ADIMGR"}, { 0 }, { 0 }, { 0 } } ,
} ;
/* open the IMGT service */
ret = ctaOpenServices( ctahd, /* a CTA context handle */
services,
sizeof(InitServices)/sizeof(InitServices[0]),);
if(ret != SUCCESS)
{
/* opening IMGT service failed */
printf ( "OpenServices failed\n" );
}
else
{
/* wait for the CTAEVN_OPEN_SERVICES_DONE event */
while (1)
{
ctaWaitEvent( ctaqueuehd, &event, CTA_WAIT_FOREVER);
if (event.id == CTAEVN_OPEN_SERVICES_DONE)
{
/* check the reason of completion */
if (event.value != CTA_REASON_FINISHED)
{
printf ( "Open services failed\n" );
}
break;
}
else
{
/* Process other (unrelated) messages. */
...
}
}
}


|
Digital Trunk Interface Board Type
|
Number of D Channels
|
Default NAI Values
|
Number of NFAS groups
|
|---|---|---|---|
|
Four-trunk boards
|
1 - 4
|
0 - 3
|
1 - 4
|
|
Two-trunk boards
|
1 - 2
|
0 - 1
|
1 - 2
|
|
One-trunk boards
|
1
|
0
|
0
|

- IMGT_MESSAGE. In this structure, the application specifies the message to be sent, using one of the message primitives documented in Chapter 4. (The message primitive appears in the code field in this structure.) For details about IMGT_MESSAGE, see Chapter 4.- A primitive-specific data structure (if needed). For messages that require additional data, a message structure is sent containing the data. The data differs for each message type. For details on each message type, see Chapter 4.


{
DWORD id; /* Event code (and source service id) */
|
This prefix...
|
Indicates...
|
|---|---|
|
CTAEVN
|
A Natural Access event
|
|
NCCEVN
|
An NCC service event
|
|
ADIEVN
|
An ADI service event
|
|
ISDNEVN
|
An NMS ISDN event
|
|
IMGTEVN
|
An IMGT event
|



Version