julio 18, 2005

RECV FAX: No answer (T.30 T1 timeout)

Problema recibiendo faxes con hylafax 4.2, viendo en los logs de recepcion de fax entradas tal que: RECV FAX: No answer (T.30 T1 timeout)

Tras hacer una busqueda sobre los foros de Hylafax descubro que se trata de un bug en el código de fax Class1.
http://www.hylafax.org/archive/2004-10/msg00022.html

http://bugs.hylafax.org/bugzilla/attachment.cgi?id=669&action=view



diff -r -u hylafax-4.2.0.orig/faxd/Class1.c++ hylafax-4.2.0/faxd/Class1.c++
--- hylafax-4.2.0.orig/faxd/Class1.c++ 2004-08-09 21:29:58.000000000 +0200
+++ hylafax-4.2.0/faxd/Class1.c++ 2005-07-18 09:31:43.000000000 +0200
@@ -1088,9 +1088,9 @@
* sendFrame() is always called with a timeout set.
* Let's keep it that way
*/
- return (putModemDLEData(frame, frame.getLength(), frameRev, 0) &&
- putModem(buf, 2, 0) &&
- (useV34 ? true : waitFor(frame.moreFrames() ? AT_CONNECT : AT_OK, 0)));
+ return (putModemDLEData(frame, frame.getLength(), frameRev, 60*1000) &&
+ putModem(buf, 2, 60*1000) &&
+ (useV34 ? true : waitFor(frame.moreFrames() ? AT_CONNECT : AT_OK, 60*1000)));
}

/*
@@ -1258,8 +1258,8 @@
return recvRawFrame(frame);
}
startTimeout(ms);
- bool readPending = atCmd(rhCmd, AT_NOTHING, 0);
- if (readPending && waitFor(AT_CONNECT,0)){
+ bool readPending = atCmd(rhCmd, AT_NOTHING);
+ if (readPending && waitFor(AT_CONNECT, ms)){
stopTimeout("waiting for HDLC flags");
if (wasTimeout()){
abortReceive();
@@ -1289,8 +1289,8 @@
fxStr rmCmd(br, rmCmdFmt);
startTimeout(ms);
do {
- readPending = atCmd(rmCmd, AT_NOTHING, 0);
- gotCarrier = readPending && waitFor(AT_CONNECT, 0);
+ readPending = atCmd(rmCmd, AT_NOTHING);
+ gotCarrier = readPending && waitFor(AT_CONNECT, ms);
} while (readPending && !gotCarrier && lastResponse == AT_FCERROR);
/*
* If carrier was recognized, collect the data.


Para aplicar el parche sobre gentoo realizamos los siguientes pasos con las facilidades del portage:


# ebuild /usr/portage/net-misc/hylafax/hylafax-4.2.0-r2.ebuild fetch
# ebuild /usr/portage/net-misc/hylafax/hylafax-4.2.0-r2.ebuild unpack
# cd /var/tmp/portage/hylafax-4.2.0-r2/work
# patch -p0 < parche_class1.diff
# ebuild /usr/portage/net-misc/hylafax/hylafax-4.2.0-r2.ebuild compile
# ebuild /usr/portage/net-misc/hylafax/hylafax-4.2.0-r2.ebuild install
# ebuild /usr/portage/net-misc/hylafax/hylafax-4.2.0-r2.ebuild qmerge

comentarios: