bool recvOK;
u_int ppm = PPM_EOP;
pageStart = Sys::now();
+ batchid = getCommID();
for (;;) {
bool okToRecv = true;
fxStr reason;
/*
* Setup state for another file.
*/
+ if (! batchLogs)
+ {
+ traceServer("SESSION BATCH CONTINUING");
+ endSession();
+ beginSession(FAXNumber);
+ batchid.append(","|getCommID());
+ traceServer("SESSION BATCH %s", (const char*)batchid);
+ }
tif = setupForRecv(info, docs, emsg);
if (tif == NULL)
return (false);
{
u_int prevPages = fax.npages;
if (!(batched & BATCH_FIRST) || lockModem()) {
- beginSession(fax.number);
+ if (batched & BATCH_FIRST)
+ {
+ beginSession(fax.number);
+ batchid = getCommID();
+ } else
+ {
+ if (! batchLogs)
+ {
+ beginSession(fax.number);
+ batchid.append("," | getCommID());
+ traceServer("SESSION BATCH %s", (const char*) batchid);
+ }
+ }
fax.commid = getCommID(); // set by beginSession
traceServer("SEND FAX: JOB %s DEST %s COMMID %s DEVICE '%s'"
, (const char*) fax.jobid
discardModem(true);
changeState(MODEMWAIT, 5);
unlockModem();
- } else
+ endSession();
+ } else if(! batchLogs)
{
- traceServer("BATCH CONTINUING");
+ traceServer("SESSION BATCH CONTINUES");
+ endSession();
}
- endSession();
} else {
if (state != LOCKWAIT)
sendFailed(fax, send_retry,
time_t fileStart; // starting time for file transmit
time_t pageStart; // starting time for page transmit
u_int npages; // # pages sent/received
+ fxStr batchid; // Batch ID, for session logs
friend class FaxModem;
log =
new FaxMachineLog(ftmp, canonicalizePhoneNumber(number), commid);
}
-
- if (batchid)
- {
- batchid.append("," | commid);
- traceServer("CONTINUE BATCH %s", (const char*)batchid);
- } else
- {
- batchid = commid;
- }
-
-
}
/*
bool changePriority; // change process priority by state
bool delayConfig; // suppress effects while reading config
fxStr dialRulesFile; // dial string rules filename
- fxStr batchid; // communication ID from start of batch
fxStr commid; // communication ID
// generic modem-related stuff
int modemFd; // open modem file
#define N(a) (sizeof (a) / sizeof (a[0]))
+ServerConfig::S_booltag ServerConfig::bools[] = {
+{ "batchlogs", &ServerConfig::batchLogs, true },
+};
+
ServerConfig::S_stringtag ServerConfig::strings[] = {
{ "logfacility", &ServerConfig::logFacility, LOG_FAX },
{ "faxnumber", &ServerConfig::FAXNumber },
{
int i;
+ for (i = N(bools)-1; i >= 0; i--)
+ (*this).*bools[i].p = bools[i].def;
for (i = N(strings)-1; i >= 0; i--)
(*this).*strings[i].p = (strings[i].def ? strings[i].def : "");
for (i = N(filemodes)-1; i >= 0; i--)
}
} else if (findTag(tag, (const tags*)filemodes, N(filemodes), ix))
(*this).*filemodes[ix].p = strtol(value, 0, 8);
+ else if (findTag(tag, (const tags*)bools, N(bools), ix))
+ (*this).*bools[ix].p = getBoolean(value);
else if (streq(tag, "speakervolume"))
setModemSpeakerVolume(getVolume(value));
fxStr ServerConfig::* p;
const char* def; // NULL is shorthand for ""
};
+ struct S_booltag {
+ const char* name;
+ bool ServerConfig::* p;
+ bool def; // NULL is shorthand for ""
+ };
struct S_numbertag {
const char* name;
u_int ServerConfig::*p;
fxBoolArray* acceptPWD; // accept/reject matched PWD
fxStr logFacility; // syslog facility to direct trace msgs
+ static S_booltag bools[];
static S_stringtag strings[];
static S_numbertag numbers[];
static S_filemodetag filemodes[];
fxStr localIdentifier; // to use in place of FAXNumber
fxStr FAXNumber; // phone number
u_int maxSetupAttempts; // # times to try initializing modem
+ bool batchLogs; // Batch session logs togther or not
virtual ~ServerConfig();
fxStr cmd(faxRcvdCmd
| quote | ri.qfile | enquote
| quote | getModemDeviceID() | enquote
- | quote | getCommID() | enquote
+ | quote | ri.commid | enquote
| quote | ri.reason | enquote
| callid_formatted);
traceServer("RECV FAX: %s", (const char*) cmd);
AnswerRotary string \s-1Any\s+1 alternatives for answering calls
AnswerBias integer \- bias to apply to successful rotary answer
AreaCode\(S2 string \- local area code
+BatchLogs\(S1 boolean \s-1Yes\s+1 keep all session logs of a batch in a single log
CallIDAnswerLength integer \- answer call when CallIDPattern received
CallIDPattern strint \- call identification pattern string
CIDName string \- equivalent to CallIDPattern (2)
.B DialStringRules
below.)
.TP
+.B BatchLogs\(S1
+When sending or recieving multiple documents (denoted by EOM), this
+value determines if the session logs span the entire batch or, if set
+to no, only contain a single document.
+.TP
.B CallIDPattern
A string that identifies the caller's identity in any call
identification messages provided by the modem (such as Caller*ID or DNIS/DID).