]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 343] increase RING timeout to 6 seconds
authorDarren Nickerson <darren.nickerson@ifax.com>
Sat, 8 Feb 2003 23:25:23 +0000 (23:25 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Sat, 8 Feb 2003 23:25:23 +0000 (23:25 +0000)
Applied Lee's patch to make this timeout configurable. Even 6 seconds was
not long enough in some installs as it turns out, so the configurability
saves a hack/recompile cycle at least ;-)

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

index f51f4664788795016b819a3d88cb220aef3a00ee..961a1264af19b95803d141119a9838370a6f0777 100644 (file)
@@ -1184,10 +1184,10 @@ bool
 ClassModem::waitForRings(u_int n, CallType& type, CallerID& cinfo)
 {
     if (n > 0) {
-       time_t timeout = n*6;                   // 6 second/ring
+       time_t timeout = n * (conf.ringTimeout/1000);   // 6 second/ring
        time_t start = Sys::now();
        do {
-           switch (atResponse(rbuf, 6000)) {
+           switch (atResponse(rbuf, conf.ringTimeout)) {
            case AT_OTHER:                      // check distinctive ring
                 if (streq(conf.ringData, rbuf))
                    type = CALLTYPE_DATA;
index d7ef6cb4381d5d8fefe31f2e3743147f15da3490..ecb2b80cebe4175f92f0e7e37de7b642e278947c 100644 (file)
@@ -174,6 +174,7 @@ static struct {
     u_int ModemConfig::* p;
     u_int               def;
 } numbers[] = {
+{ "ringtimeout",               &ModemConfig::ringTimeout,           6000 },
 { "percentgoodlines",          &ModemConfig::percentGoodLines,      95 },
 { "maxconsecutivebadlines",    &ModemConfig::maxConsecutiveBadLines,5 },
 { "modemresetdelay",           &ModemConfig::resetDelay,            2600 },
index 47c6cc693fecd9e655944090cbe65f7e763e8a79..a113d825de5d091c52001c3b86cdcf1f51a07d2b 100644 (file)
@@ -78,6 +78,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      ringTimeout;            // timeout in ms after RING to reset
     fxStr      waitTimeCmd;            // cmd for setting carrier wait time
     fxStr      pauseTimeCmd;           // cmd for setting "," pause time
     fxStr      mfrQueryCmd;            // cmd for getting modem manufacturer
index 841e9be5d67b271967d25486cfd45197cc0d96fb..6c0625b762e73f3b7fe27089775668c16562b236 100644 (file)
@@ -175,6 +175,7 @@ RingData    string  \-      distinctive ring data call identifier
 RingExtended   string  \s-1"RING "\s+1 extended ring message identifier
 RingFax        string  \-      distinctive ring fax call identifier
 RingsBeforeAnswer      integer \s-10\s+1       rings to wait before answering phone
+RingTimout     integer \s-16000\s+1    timeout in ms after RING before reset
 RingVoice      string  \-      distinctive ring voice call identifier
 RTNHandlingMethod      string  \s-1Retransmit\s+1      RTN signal handling method      
 SendFaxCmd\(S1 string  \s-1bin/faxsend\s+1     fax transmit command script
@@ -1029,6 +1030,10 @@ If this value is set to 0, then the phone will only
 be answered in response to an explicit answer command; see
 .IR faxanswer (${MANNUM1_8}).
 .TP
+.B RingTimeout
+If a ring is heard and the call is not answered, the time in
+ms to wait before reinitializing the modem for the next call.
+.TP
 .B RingVoice
 A modem status string that identifies that an incoming call is
 for voice use.