HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-users] adaptive-answer problems on an Agere modem



I've got hylafax set up on a linux box, using a Trendnet TFM-560x modem,
carefully chosen for its serial-port interface -- not a soft modem. It answers
    Agere OCM V.92 Ver2.7a (Jun 14 2004) Voice Mercury DP2SH mode-ii SERIAL
to an AT+FMM query.

Everything works fine, but there is one puzzling bit of lossage I'm having: I
can configure hylafax to receive faxes, or I can configure it to permit me to
make a data connection (that is, dial in). But not both.

If I simply configure it in config.ttyS0 as a class-1 modem (and set the flow
control to rts/cts), then the system will send & receive faxes, but I can't
dial in.

Suppose I add these two lines to config.ttyS0:

    # Listen in class 0 so I can dial in for a non-fax/data connection.
    ModemSetupAACmd:	AT+FCLASS=0
    # ubuntu's getty is agetty: getty <options> <baudrate> <port>
    # -h means rts/cts flow control; -t 120 means nice long 120sec timeout.
    GettyArgs:		"-h -t 120 %s %l"

Then I can dial in (and send faxes), but, of course, it will no longer receive
faxes -- it won't make fax connections when receiving a call. A typical log of
a session where I successfully dialed in with kermit, logged in over the
serial line & then logged right back out looks like this:

    Feb 02 21:04:01.73: [ 4700]: SESSION BEGIN 000000127 16175551212
    Feb 02 21:04:01.73: [ 4700]: HylaFAX (tm) Version 4.4.0
    Feb 02 21:04:01.73: [ 4700]: <-- [4:ATA\r]
    Feb 02 21:04:15.17: [ 4700]: --> [20:CONNECT 31200 V42bis]
    Feb 02 21:04:15.17: [ 4700]: ANSWER: DATA CONNECTION
    Feb 02 21:04:15.17: [ 4700]: GETTY: START "/etc/hylafax/getty-link -h -t 120 19200 ttyS0", pid 4731
    Feb 02 21:06:05.82: [ 4700]: GETTY: exit status 0
    Feb 02 21:06:05.82: [ 4700]: SESSION END

OK, so we know it handles data & fax. Now I'd like to set things up so I
can do both. So I change the setup command to one of these:

    ModemSetupAACmd:	AT+FCLASS=1;+FAA=1
    ModemSetupAACmd:	AT+FCLASS=0;+FAA=1

And I lose. The system will receive faxes (even when the setup command puts
the modem in class 0) but in both cases I cannot make a data connection and
log in, via, say, kermit. A typical log of a successful fax call looks like
this:

    Feb 02 21:10:50.08: [ 5853]: SESSION BEGIN 000000128 16175551212
    Feb 02 21:10:50.08: [ 5853]: HylaFAX (tm) Version 4.4.0
    Feb 02 21:10:50.08: [ 5853]: <-- [4:ATA\r]
    Feb 02 21:10:54.10: [ 5853]: --> [3:FAX]
    Feb 02 21:10:54.10: [ 5853]: ANSWER: FAX CONNECTION  DEVICE '/dev/ttyS0'
    Feb 02 21:10:54.10: [ 5853]: RECV FAX: begin
    Feb 02 21:10:54.10: [ 5853]: <-- data [32]
    Feb 02 21:10:54.10: [ 5853]: <-- data [2]
    ...

A typical log of an unsuccessful data call looks like this:

    Feb 02 22:24:17.78: [17501]: SESSION BEGIN 000000143 16175551212
    Feb 02 22:24:17.78: [17501]: HylaFAX (tm) Version 4.4.0
    Feb 02 22:24:17.78: [17501]: <-- [4:ATA\r]
    Feb 02 22:24:22.04: [17501]: --> [4:DATA]
    Feb 02 22:24:22.04: [17501]: ANSWER: DATA CONNECTION
    Feb 02 22:24:22.04: [17501]: GETTY: START "/etc/hylafax/getty-link -h -t 120 19200 ttyS0", pid 17641
    Feb 02 22:25:23.41: [17501]: GETTY: exit status 0
    Feb 02 22:25:23.41: [17501]: SESSION END

Note the timing: hylafax *instantly* realises it's a data call, then hands off
to getty, but even after that I can hear my sending modem whistling away
for about a minute. Then my kermit session prints out "NO CARRIER" and
the log file goes to "SESSION END".

Now, here's the weird thing. Suppose I go to the receiving machine,
shut down its hylafax server and simply run a kermit there. In that kermit,
I do the *same setup*:

    AT+FCLASS=1;+FAA=1

Then I dial in from a kermit on my sending machine, answering with ATA in the
kermit on my receiving machine. If I do this, I win:

    Receiving side		Sending side
    --------------		------------
    atz				atz
    OK				OK
    AT+FCLASS=1;+FAA=1		atdt6175551212
    OK				CONNECT 31200 V42bis

    RING			<here I type the "I'm typing this ..." text
    ata				seen on the receiving side, which isn't echoed
				locally>
    DATA


    CONNECT 31200 V42bis
    I'm typing this on the sending machine, 
    but seeing it on the receiving machine.

    NO CARRIER

If I then try to send a fax with kermit receiving instead of hylafax, I see
the following in kermit:
    OK

    RING

    RING
    ATA		<-- me answering; all other text produced by the modem

    FAX


    CONNECT

    ERROR	<-- modem realises kermit is not a fax machine.

This seems to indicate that the modem can do the job in adaptive-answer mode. 
So something is going wrong with the handoff to getty. What that might be is
a mystery to me. Can anyone advise me?

By the way, I also tried this less desireable hack, as discussed in the
handbook:

    AdaptiveAnswer:          yes              # enable adaptive answer
    AnswerRotary:            "data fax"       # answer for fax, then data
    ModemAnswerCmd:          AT+FCLASS=0;A    # default is to answer as data
    ModemAnswerFaxCmd:      ATH+FCLASS=1;A    # hangup and answer as fax
    Class1RecvIdentTimer:    10000            # timeout fax answer in 10 secs
    ModemAnswerResponseTimeout: 300000	      # nice, long 300 sec timeout

This doesn't work. The modem answers with the ATA+FCLASS=0;A, but then
it listens for longer than 10 secs (which is odd), then it simply terminates
the session, in much less than 300 secs (which is odd):
    Feb 02 22:08:41.93: [15225]: SESSION BEGIN 000000140 16175551212
    Feb 02 22:08:41.93: [15225]: HylaFAX (tm) Version 4.4.0
    Feb 02 22:08:41.93: [15225]: <-- [14:AT+FCLASS=0;A\r]
    Feb 02 22:09:11.14: [15225]: --> [10:NO CARRIER]
    Feb 02 22:09:11.14: [15225]: ANSWER: Ring detected without successful handshake
    Feb 02 22:09:11.14: [15225]: Ring detected without successful handshake
    Feb 02 22:09:11.14: [15225]: SESSION END


    -Olin

-------------------------------------------------------------------------------
My entire config.ttyS0 file, stripped of comments, is just these 31 lines:
------
CountryCode:		1
AreaCode:		617
FAXNumber:		+1.617.555.1212
LongDistancePrefix:	1
InternationalPrefix:	011
DialStringRules:	etc/dialrules.neu
ServerTracing:		1
SessionTracing:		11
RecvFileMode:		0600
LogFileMode:		0600
DeviceMode:		0600
RingsBeforeAnswer:	0
SpeakerVolume:		low
LocalIdentifier:	"Olin Shivers/NEU CCIS"
TagLineFont:		etc/lutRS18.pcf
TagLineFormat:		"From %%l|%c|Page %%P of %%T"
MaxRecvPages:		100
ModemSetupAACmd:	AT+FCLASS=1
GettyArgs:		"-h -t 120 %s %l"
ModemType:		Class1		# use this to supply a hint
ModemFlowControl:	rtscts		
Class1Cmd:		AT+FCLASS=1	# command to enter class 1
Class1PPMWaitCmd:	AT+FTS=7	# command to stop and wait before PPM
Class1TCFWaitCmd:	AT+FTS=7	# command to stop and wait before TCF
Class1EOPWaitCmd:	AT+FTS=9	# command to stop and wait before EOP
Class1SwitchingCmd:	AT+FRS=7	# silence between HDLC recv and trans
Class1RecvAbortOK:	200		# wait 200ms for abort response
Class1FrameOverhead:	4		# 4 byte overhead in recvd HDLC frames
Class1RecvIdentTimer:	40000		# 35+5secs waiting for ident frames
Class1TCFMaxNonZero:	10		# max 10% of data may be non-zero
Class1TCFMinRun:	1000		# min run is 2/3rds of TCF duration
------

Note that I have RingsBeforeAnswer set to 0; I currently always manually
answer this line using faxanswer. 

My global hfaxd.conf file has nothing in it that should affect things --
just these three lines (plus comments, which I've stripped out):

    LogFacility:	daemon		# syslog facility (want this 1st))
    ServerTracing:	0x001		# just server operation
    FaxContact:		root		# who gets questions/complaints


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions