(Page 1 of 1 in this chapter)

Figure 1. Fax Application Summary
static DWORD initialize_base (void)
{
CTA_SERVICE_NAME init_services [] =
{
{ "ADI", "ADIMGR" },
{ "FXM", "ADIMGR" },
{ "FAX", "FAXMGR" },
{ "NFX", "NFXMGR" },
};
CTA_INIT_PARMS init_parms =
{
sizeof (CTA_INIT_PARMS),
};
DWORD status;
static int initialized = 0;
if (initialized)
return SUCCESS;
status = ctaInitialize ( init_services,
sizeof init_services / sizeof init_services [0],
& init_parms);
if (status != SUCCESS)
show_error (NULL_CTAHD, status, "CT Access initialization failed");
else
initialized = 1;
return status;
}
|
Service Manager
|
Service
|
|---|---|
|
ADIMGR
|
ADI
|
|
ADIMGR
|
FXM
|
|
NFXMGR
|
NFX
|
|
FAXMGR
|
FAX
|
static DWORD create_context (CTAQUEUEHD queue,
DWORD board,
DWORD stream,
DWORD timeslot,
DWORD closure,
char * contextname,
CTAHD * contextptr)
{
DWORD status;
CTA_SERVICE_DESC services [4];
DWORD service_count = 0;
CTA_EVENT event;
status = ctaCreateContext (queue, closure, contextname, contextptr);
if (status != SUCCESS)
{
show_error (NULL_CTAHD, status, "CT Access context creation failed");
return status;
}
/*
* Now that we have a valid CT Access context, we can use ctaGetText
* to get proper error messages.
*/
memset (& services, 0, sizeof services);
services[service_count].name.svcname = "ADI";
services[service_count].name.svcmgrname = "ADIMGR";
services[service_count].mvipaddr.board = board;
services[service_count].mvipaddr.stream = stream;
services[service_count].mvipaddr.timeslot = timeslot;
services[service_count].mvipaddr.mode = ADI_FULL_DUPLEX;
service_count += 1;
services[service_count].name.svcname = "FXM";
services[service_count].name.svcmgrname = "ADIMGR";
services[service_count].mvipaddr.board = board;
services[service_count].mvipaddr.stream = stream;
services[service_count].mvipaddr.timeslot = timeslot;
services[service_count].mvipaddr.mode = ADI_FULL_DUPLEX;
service_count += 1;
/*
* Specific MVIP_ADDR field assignments for the FXM, FAX, and NFX services
* are ignored; these services use the MVIP_ADDR data that was passed to the
* ADI service.
*/
services[service_count].name.svcname = "FAX";
services[service_count].name.svcmgrname = "FAXMGR";
services[service_count].mvipaddr.board = board;
services[service_count].mvipaddr.stream = stream;
services[service_count].mvipaddr.timeslot = timeslot;
services[service_count].mvipaddr.mode = ADI_FULL_DUPLEX;
service_count += 1;
services[service_count].name.svcname = "NFX";
services[service_count].name.svcmgrname = "NFXMGR";
services[service_count].mvipaddr.board = board;
services[service_count].mvipaddr.stream = stream;
services[service_count].mvipaddr.timeslot = timeslot;
services[service_count].mvipaddr.mode = ADI_FULL_DUPLEX;
service_count += 1;
status = ctaOpenServices (* contextptr, services, service_count);
if (status != SUCCESS)
{
show_error (* contextptr, status, "open services failed");
return status;
}
/* Now we need to wait for the CTAEVN_OPEN_SERVICES_DONE event. */
status = wait_event (queue, * contextptr, CTAEVN_OPEN_SERVICES_DONE,
NULL, 0, & event);
if (status != SUCCESS)
{
show_error (* contextptr, status, "open services failed");
return status;
}
else if (event.value != CTA_REASON_FINISHED)
{
show_error (* contextptr, event.value, "open services done event");
return event.value;
}
else
return SUCCESS;
}

Figure 2. Functions for a Typical Fax Application

Figure 3. Functions for a Typical Fax and Voice Application

Figure 4. Polling the Remote Receiver (one page document)

Figure 5. Responding to the Remote Transmitter's Poll (one page document)

Figure 6. Image Conversion Decision When Transmitting a Fax

Figure 7. Image Conversion Decision When Receiving a Fax
ctaSetTraceLevel( ctahd, "NFX", NFX_TRACE_T30 | CTA_TRACEMASK_ALL_EVENTS );
|
Event
|
Description
|
|---|---|
|
ADIEVN_BOARD_ERROR
|
An unexpected error has occurred on your AG board. Contact NMS with the specific error information. This should be considered a fatal error on this channel.
|
(Page 1 of 1 in this chapter)