]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 302] support MultiTech Real-Time Fax Compression Conversion
authorDarren Nickerson <darren.nickerson@ifax.com>
Sat, 6 Jul 2002 18:34:32 +0000 (18:34 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Sat, 6 Jul 2002 18:34:32 +0000 (18:34 +0000)
Read the bug - no way I can do it justice here ;-) -d

CHANGES
config/lucent-mt-20
config/lucent-mt-21
faxd/Class2Send.c++
faxd/FaxSend.c++
util/Class2Params.c++

diff --git a/CHANGES b/CHANGES
index 5087b3714ae8cc2dfd3974dc31608b14d3cafad0..f8e447224fb82714c15d0f11535771407094581d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -9,7 +9,7 @@ Changelog for HylaFAX 4.1.3 - Jun 27, 2002
 * fixed hostname format string vulnerabilities in faxrm, faxalter, 
   faxstat, sendfax, sendpage, and faxwatch (14 Jun 2002)
 * added TagLineFormat option for receiver's name (14 Jun 2002)
-* added MultiTech RTFCC support via Class2RTFCC option (11 Jun 2002)
+* added MultiTech RTFCC support via Class2RTFCC option (11, 28 Jun 2002)
 * workaround a Lucent V92 firmware bug in HDLC frame tracing (08 Jun 2002)
 * added Class2PTSQueryCmd for broken Class 2.0 firmwares (08 Jun 2002)
 * fixed a TSI format string vulnerability in faxgetty (08 Jun 2002)
index e3109e36552c124262a447d5ed9486330fe5de8b..599b5306058bded0c249bf063fa3cc6c1f6e8d36 100644 (file)
@@ -26,5 +26,7 @@ Class2UseHex:         yes
 # versions that respond to AT+FFC=? with non-zero data support RTFCC
 # Class2RTFCC:         yes
 
-# unfortunately, HylaFAX can't currently receive in MMR
-ModemAnswerCmd:                AT+FCC=01,05,02,02,02,01,00,07,7F;A
+# unfortunately, HylaFAX can't currently receive in MMR or color
+ModemAnswerCmd:                AT+FCC=,,,,1,,,,0;A
+# and, let's try to prevent any color sending attempts, also
+ModemDialCmd:          AT+FCC=,,,,,,,,0;DT%s
index 3d9b747e805ff547c5ff6b7dc5e962a6884b5dc2..292eafdde0fb8ef08e9d108a658860b93a0087ad 100644 (file)
@@ -26,5 +26,7 @@ Class2UseHex:         yes
 # versions that respond to AT+FFC=? with non-zero data support RTFCC
 # Class2RTFCC:         yes
 
-# unfortunately, HylaFAX can't currently receive in MMR
-ModemAnswerCmd:                AT+FCC=7F,0D,02,02,02,01,00,07,7F;A
+# unfortunately, HylaFAX can't currently receive in MMR or color
+ModemAnswerCmd:                AT+FCC=,,,,1,,,,0;A
+# and, let's try to prevent any color sending attempts, also
+ModemDialCmd:          AT+FCC=,,,,,,,,0;DT%s
index 7a6b7c9295b76f5bfd3f31e0be3d63e00af9c301..6e6210cd4813809d7bbd850c7d64f8f55e36b94e 100644 (file)
@@ -224,10 +224,9 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
        /*
         * Check the next page to see if the transfer
         * characteristics change.  If so, update the
-        * current T.30 session parameters.  Don't send DIS if
-        * using RTFCC, although unsetting params may be better.
+        * current T.30 session parameters.
         */
-       if (pageInfoChanged(params, next) && !conf.class2RTFCC) {
+       if (pageInfoChanged(params, next)) {
            if (!class2Cmd(disCmd, next)) {
                emsg = "Unable to set session parameters";
                break;
index 95c783d60aa665bce411b8e07f2034113211087b..a1ff7e76d16b7a502c46af644832ccda0535a4f0 100644 (file)
@@ -514,21 +514,28 @@ FaxServer::sendSetupParams1(TIFF* tif,
     uint32 g3opts;
     if (!TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, &g3opts))
        g3opts = 0;
-    if (g3opts & GROUP3OPT_2DENCODING) {
-       if (!clientInfo.getSupports2DEncoding() && !class2RTFCC) {
-           emsg = "Document was encoded with 2DMR,"
-                  " but client does not support this data format";
-           return (send_reformat);
-       }
-       if (!modem->supports2D()) {
-           emsg = "Document was encoded with 2DMR,"
-                  " but modem does not support this data format";
-           return (send_reformat);
-       }
-       params.df = DF_2DMR;
-    } else
-       params.df = DF_1DMR;
-
+    // RTFCC lets us ignore our file data format
+    if (class2RTFCC) {
+       params.df = clientCapabilities.df;
+       // even if RTFCC supported uncompressed mode (and it doesn't)
+       // it's likely that the remote was incorrect in telling us it does
+       if (params.df == DF_2DMRUNCOMP) params.df = DF_2DMR;
+    } else {
+       if (g3opts & GROUP3OPT_2DENCODING) {
+           if (!clientInfo.getSupports2DEncoding()) {
+               emsg = "Document was encoded with 2DMR,"
+                   " but client does not support this data format";
+               return (send_reformat);
+           }
+           if (!modem->supports2D()) {
+               emsg = "Document was encoded with 2DMR,"
+                   " but modem does not support this data format";
+               return (send_reformat);
+           }
+           params.df = DF_2DMR;
+       } else
+           params.df = DF_1DMR;
+    }
     uint32 w;
     (void) TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
     if (w > clientInfo.getMaxPageWidthInPixels()) {
@@ -640,7 +647,7 @@ FaxServer::sendSetupParams(TIFF* tif, Class2Params& params, const FaxMachineInfo
        traceProtocol("USE %s", params.pageWidthName());
        traceProtocol("USE %s", params.pageLengthName());
        traceProtocol("USE %s", params.verticalResName());
-       traceProtocol("USE %s image data", params.dataFormatName());
+       traceProtocol("USE %s", params.dataFormatName());
     } else if (status == send_reformat) {
        traceServer(emsg);
     } else if (status == send_failed) {
index bfd9e4d5bbc54ad41d52bd0840ff98dfc0794113..78226fa094fcc287c925af989f8675aa5efbe5c0 100644 (file)
@@ -553,7 +553,7 @@ Class2Params::bitRate() const
 const char* Class2Params::dataFormatNames[4] = {
     "1-D MR",                  // DF_1DMR
     "2-D MR",                  // DF_2DMR
-    "2-D Uncompressed Mode",   // DF_2DUNCOMP
+    "2-D Uncompressed Mode",   // DF_2DMRUNCOMP
     "2-D MMR"                  // DF_2DMMR
 };
 const char* Class2Params::dataFormatName() const