# imgtStart

Starts the IMGT service on a board.

#### Prototype

DWORD imgtStart ( CTAHD ctahd, unsigned nai, IMGT_CONFIG *pconfig )

Argument | Description
ctahd | Context handle returned by ctaCreateContext.
nai | Network access identifier of the ISDN channel being monitored.
pconfig | Pointer to configuration structure: typedef struct { DWORD size; /* Size of structure */ DWORD imgt_mask; /* IMGT event mask */ DWORD trap_mask; /* Trap event mask (not used) */ DWORD mon_mask; /* Monitor event mask (not used) */ WORD nfas_group; /* Only required for configurations with duplicate NAI values on a board */ BYTE pad[6]; /* Pads */ } IMGT_CONFIG;

#### Return values

Return value | Description
SUCCESS |
CTAERR_INVALID_HANDLE | The specified context handle is invalid.
IMGTERR_INVALID_CONFIG | The IMGT_CONFIG data structure contains invalid fields (invalid fields are those that are not currently implemented).

#### Events

Event | Description
IMGTEVN_RCV_MESSAGE | An IMGT message with the code IMGT_STARTED_CO is returned in response to this command. The message status field contains one of the following return values or reasons: SUCCESS The management manager has been properly configured. The application only receives events for which it is registered. IMGTERR_BAD_NAI The NAI in the message structure is not valid. IMGTERR_NAI_IN_USE The IMGT manager has already been started on this NAI. IMGTERR_ISDN_NOT_STARTED The ISDN stack has not been started for this NAI.

#### Details

The NMS ISDN protocol stack must be started before the IMGT service is started. If the stack is stopped and started, IMGT messages remain as set, either enabled or disabled. See IMGT_CONFIG structure for a list of valid event masks.

#### Example

void SetimgtConfiguration( CTAHD ctahd, unsigned char nai )
{
IMGT_CONFIG config;
DWORD ret;
char *errortext="";
memset(&config, 0, sizeof(IMGT_CONFIG));
/* get service and restart events */
config.imgt_mask = IMGT_SERVICE_MASK | IMGT_RESTART_MASK;
/* start receiving events on nai */
ret = imgtStart( ctahd, nai, &config );
if (ret != SUCCESS)
{
ctaGetText( ctahd, ret, (char *) errortext, 40);
printf( "imgtStart failure: %s\n",errortext );
exit( 1 );
}
/* wait for IMGTEVN_RCV_MESSAGE */
...
}

#### See Also

imgtStop