Starts the IMGT service on a board.
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
|
|
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). |
|
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 IMGTERR_BAD_NAI IMGTERR_NAI_IN_USE IMGTERR_ISDN_NOT_STARTED |
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.
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 */
...
}