Personal tools
HylaFAX The world's most advanced open source fax server

Handbook:Advanced Server Configuration:Modem Parameter Usage for Outbound Calls

An outbound facsimile job is broken up into phases that correspond roughly to the phases defined in the CCITT T.30 facsimile protocol:

  • call placement
  • selection of station session capabilities
  • per-page capabilities negotiation
  • page transfer
  • page acknowledgement

The last three phases may be repeated multiple times depending on the number and characteristics of the facsimile being transmitted.

To send a facsimile a phone call must be placed. HylaFAX takes the following actions:

  1. Lock the modem.
  2. Initialize the modem for outbound facsimile use.
  3. Instruct the modem to place the phone call.

The corresponding set of commands sent to the modem are:

Class 2/2.0 modems:

Class2Cmd 	force the modem into Class 2/2.0
Class2FlowControlCmd 	establish DTE-DCE flow control scheme
Class2TBCCmd 	select stream modem host-modem communication
Class2BORCmd 	set the bit order for HDLC and page data
Class2PHCTOCmd 	set the timeout during page transfer (Phase C)
Class2CQCmd 	enable copy quality checking
Class2NRCmd 	enable negotiation reporting (Class 2.0 only)
Class2PIECmd 	disable program interrupt handling (Class 2.0 only)
Class2BUGCmd 	enable HDLC frame reporting if requested
Class2DCCCmd 	initialize modem capabilities
Class2LIDCmd 	set local station identifier
Class2SPLCmd 	request polling status (if a polled receive is to be done)
Class2DDISCmd 	setup initial session parameters (optional)
ModemDialCmd 	place the call

Class 1 modems:

Class1Cmd 	force the modem into Class 1
Class1FlowControlCmd 	establish DTE-DCE flow control scheme
ModemDialCmd 	place the call

Note that the modem is always switched into the appropriate class and flow control scheme before placing the call. For Class 2 modems that do not properly implement the AT+FDIS command the Class2DDISCmd parameter must be configured so that HylaFAX will setup initial session parameters before placing the phone call.

If the call completes and a facsimile transmit session is started then HylaFAX will send ModemSendBeginCmd to the modem. This parameter can be used to enable servicing that must be done only while Carrier Detect (CD) is asserted to the host. For example, on Sun systems it is not possible to enable RTS/CTS flow control on serial ports implemented with the ZS8530 unless CD is asserted; to workaround this problem for outbound calls one can use:

ModemSendBeginCmd:	"<rts>"

to force HylaFAX to enable RTS/CTS flow control on the host tty device after carrier is established. Beware however that some modems raise and lower CD during Class 1 operation and this can cause problems for systems with restrictions of this sort.

The next phase in the processing of an outbound job is the selection of station capabilities. The receiver is required to transmit a series of messages that provide its identity and capabilities (e.g. whether it can accept 2D-encoded facsimile data). HylaFAX examines the received capabilities and compares them to the capabilities required for the job. If the receiver is capable of accepting the documents to be sent then HylaFAX proceeds with the transmission. Otherwise HylaFAX will disconnect and, either re-prepare the outbound documents according to the receiver's capabilities or reject the job because it cannot be sent.

Page transfer requires the selection of session capabilities that correspond to the page to be transferred and the actual transfer of the page data to the modem. HylaFAX handles documents with varying page characteristics. In particular this means that documents with a mixture of high res and low res data (e.g. a low res cover page followed by high res image or text) are handled transparently.

For Class 2 modems session parameters are set using the Class2DISCmd (note that this is not the same as Class2DDISCmd). If the negotiated session parameter needs to be changed then this command will be sent to the modem. The Class 2 specification requires that a modem accept this command at any time prior to an AT+FDT command. However because some modems do not properly implement this part of the specification the Class2DDISCmd is provided to workaround modem limitations. Beware however that modems that require Class2DDISCmd may not be capable of renegotiating session parameters at all; this can be an annoying problem.

For Class 2/2.0 modems, page data is transferred using the AT+FDT command. This command instructs the modem that a page of facsimile data will follow. The modem is released to negotiate session parameters (as needed) and HylaFAX then waits for a response that indicates page data may be transferred to the modem. Class 2 modems indicate they are ready for page data by sending CONNECT followed by XON (DC1) to the host. (The ModemWaitForXON configuration parameter controls whether or not HylaFAX should wait for XON because some Class 2 modems do not follow this aspect of the spec.) Class 2.0 modems indicate they are ready for page data by sending a CONNECT response to the host (but no XON). Class 2 modems return OK to the host when they have accepted all the page data. Class 2.0 modems do not return OK.

After a page of data has been transferred to the modem HylaFAX indicates whether this is the last page to be sent and/or whether more documents are to come. A post-page message is then sent and a post-page response is awaited. Class 2/2.0 modems handle this exchange entirely within the modem. For Class 1 modems HylaFAX implements this part of the protocol on the host: the post-page message may be retransmitted as many as three times. A post-page response indicates whether a page was successfully received and/or whether or not the receiver wants to resynchronize the line due to a perceived loss in signal quality. HylaFAX is capable of retransmitting pages that a receiver deems unacceptable. HylaFAX will automatically retransmit a page up to three times if it does not receive a positive acknowledgement from the receiver.


This page was last modified on 19 December 2005, at 23:02.

Powered by MediaWiki
Attribution-ShareAlike 2.5

Project hosted by iFAX Solutions