]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Add ModemNoAutoAnswerCmdDelay to handle spurious data during initialization
authorAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:57:24 +0000 (12:57 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:57:24 +0000 (12:57 +0000)
From Lee's commits:
| commit 89d5badd89d8cdd038a508b91c2c86409445a36a
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Tue Aug 21 15:08:18 2007 +0000
|
|   Some modems result oddly with ATV1, so don't fail over it.

| commit 4bd681b08e386063abd252e2bd0d8718cffd109f
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Thu Aug 23 17:52:43 2007 +0000
|
|   Adds ModemNoAutoAnswerCmdDelay to help flush-out those spurious NO CARRIER
|   repsonses following ATS0=0 being reported.

faxd/ClassModem.c++
faxd/ModemConfig.c++
faxd/ModemConfig.h
man/hylafax-config.4f

index 540de9748b34ca401eadb7f61f717a1b91a1da3f..3e990bf3c9bac89baf5efe7690e7ae3c7d988aea 100644 (file)
@@ -750,6 +750,11 @@ ClassModem::reset(long ms)
     if ( true != atCmd(conf.noAutoAnswerCmd, AT_OK, ms) ) {
         return false;
     }
+    if (conf.noAutoAnswerCmdDelay) {
+       /* Some modems do funny things after ATS0=0. */
+       pause(conf.noAutoAnswerCmdDelay);
+       flushModemInput();
+    }
     if ( true != atCmd(conf.echoOffCmd, AT_OK, ms) ) {
         return false;
     }
index 8be2a1c5487c813760d8d1d93d761ab18b2871f5..406c889fb15e62d89515ce8c8013429f29f50a82 100644 (file)
@@ -201,6 +201,7 @@ static struct {
 { "modempagedonetimeout",      &ModemConfig::pageDoneTimeout,       3*60*1000},
 { "modemringsbeforeresponse",  &ModemConfig::ringsBeforeResponse,   0 },
 { "modemsoftresetcmddelay",    &ModemConfig::softResetCmdDelay,     3000 },
+{ "modemnoautoanswercmddelay", &ModemConfig::noAutoAnswerCmdDelay,  0 },
 { "class1tcfrecvtimeout",      &ModemConfig::class1TCFRecvTimeout,  4500 },
 { "class1recvabortok",         &ModemConfig::class1RecvAbortOK,     200 },
 { "class1rmpersistence",       &ModemConfig::class1RMPersistence,   2 },
index 3895e99ae9deccd4787bddee4854f4b1cf932426..50b30d682426cda55bcefcaa5a0a372fc3390248 100644 (file)
@@ -104,6 +104,7 @@ public:
     fxStr      onHookCmd;              // cmd for placing phone ``on hook''
     fxStr      softResetCmd;           // cmd for doing soft reset
     u_int      softResetCmdDelay;      // time in ms to pause after soft reset
+    u_int      noAutoAnswerCmdDelay;   // time in ms to pause after noAutoAnswerCmd
     u_int      ringsBeforeResponse;    // number of rings to wait before ModemRingResponse
     u_int      ringTimeout;            // timeout in ms after RING to reset
     fxStr      waitTimeCmd;            // cmd for setting carrier wait time
index e190629680883b6298a9db2abdedfefa17941c5f..c2bcd457fd9a862022a25c4c6aaafd3e045bc395 100644 (file)
@@ -251,6 +251,7 @@ ModemMinSpeed       string  \s-12400\s+1    minimum acceptable transmit speed
 ModemMfrQueryCmd       string  \-      command for querying modem manufacturer
 ModemModelQueryCmd     string  \-      command for querying modem model
 ModemNoAutoAnswerCmd   string  \s-1ATS0=0\s+1  command for disabling auto-answer
+ModemNoAutoAnswerCmdDelay      integer \s-10\s+1       time, in ms, to pause after a disabling auto-answer
 ModemNoFlowCmd string  \-      command for disabling hardware flow control between \s-1DTE\s+1 and \s-1DCE\s+1
 ModemOnHookCmd string  \s-1ATH0\s+1    command for placing phone ``on hook''
 ModemPageDoneTimeout   integer \s-1180000\s+1  page send/receive timeout (ms)
@@ -2121,6 +2122,12 @@ is issued to the modem.
 The command to stop the modem from automatically
 answering when the phone rings.
 .TP
+.B ModemNoAutoAnswerCmdDelay
+The time, in milliseconds, to pause after receiving the OK following
+.B ModemNoAutoAnswerCmd
+before any further commands are sent to the modem.  All input from
+the modem is flushed after pausing.
+.TP
 .B ModemNoFlowCmd
 The command to disable flow control between
 .SM DTE