Purpose
This state table provides the interface to the BrooktroutFax functionality
in Blueworx Voice Response for
receiving a fax in .tif format (see tif - tag image format).
ASCII syntax
InvokeStateTable ("DIRECT", BFAX_RECV_FAX, begin, filename, calling_number, called_number, device_rc, device_state);
Entry Point
The entry point for this state table is begin
Parameters
- filename (STRING)
- This parameter is optional. If it is supplied, then the specified
file in the form of a file name only (the file name will be concatenated
with the path set with BFIT) will be used for the fax being received.
The directory must have write permission for all users.
If it is not supplied, then the custom server will generate a file
name which will be returned to the calling state table. The file extension
is set to .tif, and the file name has the form, YYYYMMDDhhmmss.dtchannelnum.tif where YYYY is
the year, MM is the month, DD is
the day, hh is the hour, mm is
the minutes and ss the seconds, and where dtchannelnum is
the Blueworx Voice Response channel
on which the fax was received.
- calling_number (STRING)
- Not used. Retained for backwards compatibility only.
- called_number (STRING)
- Not used. Retained for backwards compatibility only.
- device_rc (NUMBER)
- This is set to zero if the fax was received successfully. If
there was an error, it will be non-zero. See Return codes below for a description of
the possible return codes
- device_state (NUMBER)
- This is the state of the fax handler. If the fax was received
successfully, this will be 9. If it is -1, it means that an error
has occurred and device_rc should be checked.
Return codes
- 0
- success
- -500
- failed to communicate with the custom server
- 400
-
- file does not exist (for example, invalid file name specified)
- file is not accessible (check file permissions)
- file is empty
- 401
- unable to parse list file
- 402
- unsupported extension on file name
- 404
- Brooktrout fax API failed to handle text file. Problems include:
- unable to open it
- unable to close it
- unable to send part or all of it
- unable to receive all or part of it (for example, nonexistent
directory specified)
- 405
- Brooktrout fax API failed to handle TIFF file. Problems include:
- unable to open it
- unable to close it
- unable to send part or all of it
- unable to receive all or part of it (for example, nonexistent
directory specified)
- 406
- dynamic memory allocation error
- 408
- channel number is invalid
- 409
- file name error: for example, generated file name too long
- 410
- failed to get free fax channel
- 413
- invalid fax number (for example, wrong number of digits)
- 416
- failed to get timeslot for fax card or DTTA
card
- 460
- failed to invoke custom server function
- 480
- internal error (for example, function called with invalid parameter)
- 490
- device error (Brooktrout fax API call failed)
In addition, many of the error codes corresponding to values of
CA_errno may be returned in the variable device_rc if an invocation
by the custom server of one of the CA_XXX family of functions fails
for some reason. These error codes start at value 51 (50 is actually
the first code but as this represents the 'no error' case it will
never actually be seen). For an explanation of these error codes,
see Blueworx Voice Response for AIX:
Custom Servers, "Error Return Codes".
Description
To receive a fax, an application state table should call BFAX_RECV_FAX.
BFAX_RECV_FAX operates within the context of the current call and
requires that appropriate fax tones from the remote fax device be
detected by Blueworx Voice Response prior
to the application invoking BFAX_RECV_FAX. Once BFAX_RECV_FAX is called,
control is not returned until the fax operation is complete.
If successful, device_rc is set to 0, and device_state is
set to 9. If device_state returns with a value other than
9, the request failed and device_rc should be checked for failure
reason.
BFAX_RECV_FAX can be invoked again when control returns to the
application state table. If
device_state does not = 9, this
does not prevent the application from retrying BFAX_RECV_FAX .
Note: It is the responsibility of the user application to move received
faxes from the directory specified in FaxReceptionDirectory (see BFIT
configuration entries in
Brooktrout Fax Interface Tool) to prevent
overwriting or deletion. The appropriate time to move or copy a received
fax is when control returns to the application state table.
Prerequisites:
- fax tone detected on active Blueworx Voice Response telephony
channel
- file system space is available to receive fax