Difference between revisions of "Handbook:Advanced Server Configuration:Adaptive Answer"
Line 1: | Line 1: | ||
''Adaptive answer'' is the ability for a modem to determine whether an incoming phone call is for data, fax, or voice use. If a modem supports a good adaptive-answering facility then it should be enabled with the <tt>ModemSetupAACmd</tt> and HylaFAX will service fax, data, or voice calls ''as identified by the modem'' and specified in the modem configuration files. For example, | ''Adaptive answer'' is the ability for a modem to determine whether an incoming phone call is for data, fax, or voice use. If a modem supports a good adaptive-answering facility then it should be enabled with the <tt>ModemSetupAACmd</tt> and HylaFAX will service fax, data, or voice calls ''as identified by the modem'' and specified in the modem configuration files. For example, | ||
− | ModemSetupAACmd: AT | + | ModemSetupAACmd: AT FAA=1 |
Beware however that for some modems' adaptive-answer support works properly only when the modem is left in Class 2 or Class 2.0; this may be a problem if you want to configure the modem to "idle in Class 0" to avoid confusing naive programs that make use of the modem for outbound calls. | Beware however that for some modems' adaptive-answer support works properly only when the modem is left in Class 2 or Class 2.0; this may be a problem if you want to configure the modem to "idle in Class 0" to avoid confusing naive programs that make use of the modem for outbound calls. | ||
Line 11: | Line 11: | ||
AdaptiveAnswer: yes # enable adaptive answer | AdaptiveAnswer: yes # enable adaptive answer | ||
AnswerRotary: "fax data" # answer for fax, then data | AnswerRotary: "fax data" # answer for fax, then data | ||
− | ModemAnswerCmd: AT | + | ModemAnswerCmd: AT FCLASS=1;A # default is to answer as fax |
− | ModemAnswerDataCmd: ATH | + | ModemAnswerDataCmd: ATH FCLASS=0;A # hangup and answer as data |
Class1RecvIdentTimer: 10000 # timeout fax answer in 10 secs | Class1RecvIdentTimer: 10000 # timeout fax answer in 10 secs | ||
in the configuration file. The above lines cause the fax server to do the following in response to an incoming phone call: | in the configuration file. The above lines cause the fax server to do the following in response to an incoming phone call: | ||
− | #Issue "<tt>AT | + | #Issue "<tt>AT FCLASS=1;A</tt>" to answer the phone call in Class 1; i.e. as a fax machine (issuing CNG tones). |
#Send TSI and DIS frames as required by the fax protocol. | #Send TSI and DIS frames as required by the fax protocol. | ||
#Wait for DCS from the caller (if it is a fax machine). | #Wait for DCS from the caller (if it is a fax machine). | ||
#Timeout waiting for DCS in 10 seconds (or whatever is specified for <tt>Class1RecvIdentTimer</tt>). | #Timeout waiting for DCS in 10 seconds (or whatever is specified for <tt>Class1RecvIdentTimer</tt>). | ||
− | #Issue "<tt>ATH | + | #Issue "<tt>ATH FCLASS=0;A</tt>" to hangup and then re-answer the phone in Class 0; i.e. as a data modem. |
This technique assumes many things about the capabilities of the modem and the local telephony service and may not work for all Class 1 modems or for all locales. | This technique assumes many things about the capabilities of the modem and the local telephony service and may not work for all Class 1 modems or for all locales. |
Revision as of 04:26, 12 July 2007
Adaptive answer is the ability for a modem to determine whether an incoming phone call is for data, fax, or voice use. If a modem supports a good adaptive-answering facility then it should be enabled with the ModemSetupAACmd and HylaFAX will service fax, data, or voice calls as identified by the modem and specified in the modem configuration files. For example,
ModemSetupAACmd: AT FAA=1
Beware however that for some modems' adaptive-answer support works properly only when the modem is left in Class 2 or Class 2.0; this may be a problem if you want to configure the modem to "idle in Class 0" to avoid confusing naive programs that make use of the modem for outbound calls.
The adaptive-answer algorithm used by some modems can confuse some fax machines and/or data modems. If you do not intend to service both data and fax calls you may not want to configure adaptive-answer for inbound calls.
If a modem does not support adaptive-answering, then there are several options. If the modem is a Class 1 modem, then HylaFAX provides a simple adaptive-answering strategy whereby incoming calls are first answered as if they are for a fax machine and, if that fails, then answered as if they are for a data modem. This facility is enabled by specifying something like:
AdaptiveAnswer: yes # enable adaptive answer AnswerRotary: "fax data" # answer for fax, then data ModemAnswerCmd: AT FCLASS=1;A # default is to answer as fax ModemAnswerDataCmd: ATH FCLASS=0;A # hangup and answer as data Class1RecvIdentTimer: 10000 # timeout fax answer in 10 secs
in the configuration file. The above lines cause the fax server to do the following in response to an incoming phone call:
- Issue "AT FCLASS=1;A" to answer the phone call in Class 1; i.e. as a fax machine (issuing CNG tones).
- Send TSI and DIS frames as required by the fax protocol.
- Wait for DCS from the caller (if it is a fax machine).
- Timeout waiting for DCS in 10 seconds (or whatever is specified for Class1RecvIdentTimer).
- Issue "ATH FCLASS=0;A" to hangup and then re-answer the phone in Class 0; i.e. as a data modem.
This technique assumes many things about the capabilities of the modem and the local telephony service and may not work for all Class 1 modems or for all locales.
Note also that by reversing the order of the items specified in the AnswerRotary parameter you can get HylaFAX to answer first for data and then for fax. If calls are answered first as data, then you may need to constrain the timeout used to recognize a data call so that time still remains to setup a fax connection. Consult your modem manual and the ModemAnswerResponseTimeout configuration parameter.
A second facility supported by the fax server in lieu of adaptive answering is a rotary of answering techniques. The general idea is that a list of alternative ways to answer the phone is supplied and the server will rotate through the list on consecutive inbound calls until it finds one that works. For example, one might specify something like:
AnswerRotary: "fax data"
which would instruct the server to answer incoming calls as if they were from a fax machine until a call was received from a data modem, in which case it would then answer subsequent calls as a data modem until a non-data call was received (in which case it would go back to fax). The rotary list can have up to three items, with items being selected from one of: fax, data, voice, extern, and any (answer a call of an unknown type). The extern answering request forces an external application (the "egetty" program) to be invoked to deduce the type of an inbound call (and possibly handle it). The voice answering request causes a "vgetty" program to be invoked to handle the call. Finally, in conjunction with the rotary answer facility there is an AnswerBias parameter that can be used to specify an index into the rotary list to use after successfull calls. In the above example, this parameter can be used, to force calls to always be answered first as data by specifying:
AnswerRotary: "fax data" AnswerBias: 1
Note that the adaptive-answer and rotary answer facilities differ only in whether the rotary of answering techniques is applied to a single call or to consecutive calls.