From Lee:
| commit
78114b9300badd714f44f8b25a919b09605f3ac6
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date: Thu Dec 6 18:19:28 2007 +0000
|
| Adds PollLockPokeModem
|
| When polling for the presence/removal of a UUCP lockfile, also test to make
| sure the modem is still reachable. This is useful for scenarios where the
| modem is apt to become disconnected while the modem is idle, such as an
| external modem that may lose power, where the administrator wants notification
| of this (as a ‘‘wedged’’ condition).
atCmd(conf.onHookCmd, AT_OK, 5000);
}
+bool
+ClassModem::poke()
+{
+ return atCmd("AT", AT_OK, 5000);
+}
+
bool
ClassModem::waitForRings(u_short rings, CallType& type, CallID& callid)
{
void resetBlock();
void startTimeout(long ms);
void stopTimeout(const char* whichdir);
+ bool poke();
// host-modem protocol parsing support
virtual ATResponse atResponse(char* buf, long ms = 30*1000);
bool waitFor(ATResponse wanted, long ms = 30*1000);
* If a lockfile exists, go to LOCKWAIT
*/
if (canLockModem()) {
- Dispatcher::instance().startTimer(pollLockWait, 0, this);
+ bool ok = true;
+ if (pollLockPokeModem) {
+ /*
+ * Poke the modem to make sure it's still there.
+ * If not, then mark it to be reset.
+ */
+ lockModem();
+ ok = modem->poke();
+ unlockModem();
+ }
+ if (ok)
+ Dispatcher::instance().startTimer(pollLockWait, 0, this);
+ else
+ changeState(MODEMWAIT, pollModemWait);
} else {
changeState(LOCKWAIT, pollLockWait);
}
ServerConfig::S_booltag ServerConfig::bools[] = {
{ "batchlogs", &ServerConfig::batchLogs, true },
+{ "polllockpokemodem", &ServerConfig::pollLockPokeModem, false },
};
ServerConfig::S_stringtag ServerConfig::strings[] = {
u_int retryOther; // number of retries after other problem
u_int pollModemWait; // polling interval in modem wait state
u_int pollLockWait; // polling interval in lock wait state
+ bool pollLockPokeModem; // poke modem after polling lock
u_int maxRecvPages; // max pages to accept on receive
u_int maxConsecutiveBadCalls; // max consecutive bad phone calls
fxStr localIdentifier; // to use in place of FAXNumber
PageChopThreshold\(S1 float \s-13.0\s+1 whitespace truncation threshold (inches)
PCL2FaxCmd\(S1 string \s-1bin/pcl2fax\s+1 PCL \s-1RIP\s+1 command script
PercentGoodLines integer \s-195\s+1 percentage of good rows for \s-1OK\s+1 page quality
+PollLockPokeModem boolean \s-1false\s+1 check on modem every time the lock is polled
PollLockWait\(S2 integer \s-130\s+1 polling interval for lockfile presence/removal (secs)
PollModemWait integer \s-130\s+1 polling interval when in ``modem wait'' state (secs)
PollRcvdCmd string \s-1bin/pollrcvd\s+1 delivery script for facsimile received by polling
See also
.BR MaxConsecutiveBadLines .
.TP
+.B PollLockPokeModem
+When polling for the presence/removal of a
+.SM UUCP
+lockfile, also test to make sure the modem is still reachable.
+This is useful for scenarios where the modem is apt to become
+disconnected while the modem is idle, such as an external modem
+that may lose power, where the administrator wants notification
+of this (as a ``wedged'' condition).
+.TP
.B PollLockWait
When polling for the presence/removal of a
.SM UUCP