]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Class1/Class2: Improve "dialstring" modem response handling
authorAidan Van Dyk <aidan@ifax.com>
Fri, 11 May 2007 15:32:03 +0000 (15:32 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 11 May 2007 15:32:03 +0000 (15:32 +0000)
From Lee:
| commit b4dea3f34202ac2dda1f1183683bfaf805535c2b
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Mon Mar 5 19:57:46 2007 +0000
|
|   Bruno improves "modem echoes dialstring" handling.

CONTRIBUTORS
faxd/ClassModem.c++

index c364317edaa12ea5d24a06f09831bdfe64e74dae..a04ff466c2a0a9c12bbcd7570ac994179822759b 100644 (file)
@@ -10,6 +10,7 @@ for his help in making a working Class 1 driver.
   Simon <iahnl@iah.nl>
   Alvaro Aguilera
   Andre Albsmeier
+  Bruno Almeida do Lago
   Matthias Apitz
   Ronald Appelfelder
   Heinz-Ado Arnolds
index e4c42d6f3d7a2370d5b543581f62d143b3683a92..af9a475f2a877affcb2152de05e2d2c4846a4e0f 100644 (file)
@@ -160,8 +160,15 @@ ClassModem::isNoise(const char* s)
     for (u_int i = 0; i < NNOISE; i++)
        if (strneq(s, noiseMsgs[i], strlen(noiseMsgs[i])))
            return (true);
-    // some modems echo the dialed number
-    if (fxStr(s) == dialedNumber) return (true);
+    /*
+     * Some modems echoes the DTMF of the dialed number, and this should be
+     * ignored too.
+     * Instead of simply checking if "dialedNumber" is equal to "s" we must
+     * consider the possibility of having more numbers at "conf.dialCmd".
+     * Eg.: conf.dialCmd = atdt0%s (zero will be echoed)
+     * The easiest way is to find if "dialedNumber" is a sub-string of "s".
+     */
+    if (strstr(s, (const char *) dialedNumber) != NULL) return (true);
     return (false);
 }
 #undef NNOISE