FaxSample_CS - the FSA custom server

A single custom server provides all functions to access and control incoming and stored faxes.

The interface between the state table and custom server consists of the following functions:

FaxOpen
Called by Blueworx Voice Response when FaxSample_CS is started either manually, or automatically via the Custom Server Manager. FaxOpen sets the user-modifiable inbound fax directory path to the value found in the file named faxpath in the FaxSample custom server directory.

Input Parameters: None
Return Values: Error code

FaxClose
Called by Blueworx Voice Response when FaxSample_CS is stopped either manually or when Blueworx Voice Response is shut down.

Input Parameters: None
Return Values: Error code

FaxLockIncomingList
Builds a list of all incoming faxes currently in the fax directory. If no faxes are found, the list is empty and it is not locked from access by another caller. If one or more faxes are found, the list is locked (held internally within the custom server) to prevent access by a second caller or modification if further incoming faxes are received.

Input Parameters: Dummy variable
Return Values: Error code or number of incoming faxes currently
in the directory, details of which are locked in the list.

FaxUnLockIncomingList
Unlocks any previously locked list of incoming faxes.

Input Parameters: Dummy variable
Return Values: Error code.

FaxQueryIncoming
Returns details of an entry in the locked list of incoming faxes.

Input Parameter: Number of fax in list to be queried (1..n)
Return Values: Structure containing the following information
about the incoming fax:
- time and date of receipt
- size of the fax file in bytes
- channel on which fax was received
Optional extra information which could be made available is:
- calling number
- called number
- error code, if any

Note: This optional extra information is available from the BrooktroutFax custom server. To make use of it, you must change the FaxSample custom server code and the FaxSample state table.
FaxDeleteIncoming
Deletes an entry from the locked list.

Input Parameter: Number of fax in list to be deleted (1..n)
Return Values: Error code

FaxSaveIncoming
Saves an incoming fax in the database (moves the fax file to the faxsave directory).

Input Parameters: Number of fax in list to be saved (1..n)
Database fax number (1..1000)
Return Values: Error code.

FaxQuerySaved
Queries the database for existing faxes

Input Parameter: Database fax number (1..1000)
Return Values:
- Error code
- Name of the database file for this fax.

FaxDeleteSaved
Deletes an inbound fax from the fax database

Input Parameter: Database fax number (1..1000)
Return Values: Error code

FaxSample_CS is built and installed using the Blueworx Voice Response custom server development window. See Blueworx Voice Response for AIX: Custom Servers, "Building a Custom Server". Before it can be run, you must start FaxSample_CS using the custom server manager. You can also set it to start automatically using the custom server manager.

To start the FaxSample_CS from the Blueworx Voice Response Welcome window:
  1. Click Applications —> Custom Servers —> FaxSample

FaxSample_CS is built with a 'system-generated main' that generates code to route requests to the individual function entry points. Input and output parameters for FaxSample_CS functions are follows:

Table 1. FaxSample_CS – input and output parameters
Function Input Output
FaxOpen None SHORT error_code
FaxClose None SHORT error_code
FaxLockIncomingList SHORT (dummy var) SHORT error_code (or number of faxes in list)
FaxUnLockIncomingList SHORT (dummy var) SHORT error_code
FaxQueryIncoming SHORT fax_number STRUCT

   SHORT error_code
   SHORT channel
   CHAR  date[12]
   CHAR  time[10]
   LONG  filesize

ENDSTRUCT
FaxDeleteIncoming SHORT fax_number SHORT error_code
FaxSaveIncoming SHORT fax_number SHORT error_code

SHORT db_number

FaxQuerySaved SHORT db_number SHORT error_code

CHAR file name

FaxDeleteSaved SHORT db_number SHORT error_code