bool setupReceive();
bool recvBegin(fxStr& emsg);
bool recvEOMBegin(fxStr& emsg);
- bool recvPage(TIFF*, u_int& ppm, fxStr& emsg);
+ bool recvPage(TIFF*, u_int& ppm, fxStr& emsg, const fxStr& id);
bool recvEnd(fxStr& emsg);
void recvAbort();
* sending a post-page response in a multi-page document.
*/
bool
-Class1Modem::recvPage(TIFF* tif, u_int& ppm, fxStr& emsg)
+Class1Modem::recvPage(TIFF* tif, u_int& ppm, fxStr& emsg, const fxStr& id)
{
if (/* sendingHDLC */ lastPPM == FCF_MPS && prevPage && pageGood && !sentERR) {
// sendingHDLC = false
* receive the Phase C data.
*/
protoTrace("RECV: begin page");
- recvSetupTIFF(tif, group3opts, FILLORDER_LSB2MSB);
+ recvSetupTIFF(tif, group3opts, FILLORDER_LSB2MSB, id);
pageGood = recvPageData(tif, emsg);
protoTrace("RECV: end page");
if (!wasTimeout()) {
bool setupReceive();
bool recvBegin(fxStr& emsg);
bool recvEOMBegin(fxStr& emsg);
- bool recvPage(TIFF*, u_int& ppm, fxStr& emsg);
+ bool recvPage(TIFF*, u_int& ppm, fxStr& emsg, const fxStr& id);
bool recvEnd(fxStr& emsg);
void recvAbort();
* received post-page-message.
*/
bool
-Class2Modem::recvPage(TIFF* tif, u_int& ppm, fxStr& emsg)
+Class2Modem::recvPage(TIFF* tif, u_int& ppm, fxStr& emsg, const fxStr& id)
{
int ppr;
bool prevPage = false;
* NB: always write data in LSB->MSB for folks that
* don't understand the FillOrder tag!
*/
- recvSetupTIFF(tif, group3opts, FILLORDER_LSB2MSB);
+ recvSetupTIFF(tif, group3opts, FILLORDER_LSB2MSB, id);
if (!recvPageData(tif, emsg)) {
prevPage = false;
goto bad;
* Setup "stock TIFF tags" in preparation for receiving a page of data.
*/
void
-FaxModem::recvSetupTIFF(TIFF* tif, long, int fillOrder)
+FaxModem::recvSetupTIFF(TIFF* tif, long, int fillOrder, const fxStr& id)
{
TIFFSetField(tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE);
TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) params.pageWidth());
TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float) params.verticalRes());
TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
TIFFSetField(tif, TIFFTAG_SOFTWARE, HYLAFAX_VERSION);
- TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, (const char*) tsi);
+ TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, (const char*) id);
char dateTime[24];
time_t now = Sys::now();
strftime(dateTime, sizeof (dateTime), "%Y:%m:%d %H:%M:%S", localtime(&now));
record.fput("\t%s", fmtTime(duration)); // $12 = duration
record.fput("\t%s", fmtTime(conntime)); // $13 = conntime
record.fput("\t\"%s\"", status); // $14 = status
+ record.fput("\t\"%s\"", cidname); // $15 = CIDName
+ record.fput("\t\"%s\"", cidnumber); // $16 = CIDNumber
record.put('\n');
flock(fd, LOCK_EX);
ok = (Sys::write(fd, record, record.getLength()) == (ssize_t)record.getLength());
u_int npages; // pages successfully sent/rcvd
u_int params; // encoded transfer parameters
const char* status; // status info (optional)
+ const char* cidname; // caller id name
+ const char* cidnumber; // caller id number
bool record(const char* cmd) const;
};
void recvNSF(const NSF&);
void recvCSI(const fxStr&);
void recvDCS(const Class2Params&);
- void recvSetupTIFF(TIFF* tif, long group3opts, int fillOrder);
+ void recvSetupTIFF(TIFF* tif, long group3opts, int fillOrder, const fxStr& id);
void recvStartPage(TIFF* tif);
void recvResetPage(TIFF* tif);
u_int decodePageChop(const fxStr& pph, const Class2Params&);
virtual bool setupReceive() = 0;
virtual bool recvBegin(fxStr& emsg);
virtual bool recvEOMBegin(fxStr& emsg);
- virtual bool recvPage(TIFF*, u_int& ppm, fxStr& em) = 0;
+ virtual bool recvPage(TIFF*, u_int& ppm, fxStr& em, const fxStr& id) = 0;
virtual bool recvEnd(fxStr& emsg) = 0;
virtual void recvAbort() = 0;
virtual void recvSucceeded();
recvPages = 0; // count of received pages
fileStart = Sys::now(); // count initial negotiation on failure
if (modem->pollBegin(canonicalizePhoneNumber(FAXNumber), sep, pwd, emsg)) {
+ const CallerID cid; // null
pollOK = recvDocuments(tif, info, docs, emsg);
if (!pollOK)
traceProtocol("POLL FAX: %s", (const char*) emsg);
* after recvBegin can cause part of the first page to
* be lost.)
*/
+ info.cidname = cid.name;
+ info.cidnumber = cid.number;
TIFF* tif = setupForRecv(info, docs, emsg);
if (tif) {
recvPages = 0; // total count of received pages
else
Sys::chmod(ri.qfile, recvFileMode);
if (faxRecognized)
- // It would be cleaner and more versatile to include
- // cid as part of ri now instead of continuing to
- // pass it along. This would require alterations to
- // FaxRecvInfo, though - not as simple an approach.
- notifyRecvDone(ri, cid);
+ notifyRecvDone(ri);
}
traceProtocol("RECV FAX: end");
return (faxRecognized);
bool
FaxServer::recvFaxPhaseD(TIFF* tif, FaxRecvInfo& info, u_int& ppm, fxStr& emsg)
{
+ fxStr id = info.sender;
+ if (info.cidname.length() || info.cidnumber.length()) id.append("\n" | info.cidname);
+ if (info.cidnumber.length()) id.append("\n" | info.cidnumber);
+
do {
if (++recvPages > maxRecvPages) {
emsg = "Maximum receive page count exceeded, job terminated";
return (false);
}
- if (!modem->recvPage(tif, ppm, emsg))
+ if (!modem->recvPage(tif, ppm, emsg, id))
return (false);
info.npages++;
info.time = (u_int) getPageTransferTime();
* Handle final actions associated with a document being received.
*/
void
-FaxServer::notifyRecvDone(const FaxRecvInfo& ri, const CallerID& cid)
+FaxServer::notifyRecvDone(const FaxRecvInfo& ri)
{
if (ri.reason != "")
traceServer("RECV FAX (%s): session with %s terminated abnormally: %s"
virtual void notifyRecvBegun(const FaxRecvInfo&);
virtual void notifyPageRecvd(TIFF* tif, const FaxRecvInfo&, int ppm);
virtual void notifyDocumentRecvd(const FaxRecvInfo& req);
- virtual void notifyRecvDone(const FaxRecvInfo& req, const CallerID& cid);
+ virtual void notifyRecvDone(const FaxRecvInfo& req);
public:
virtual ~FaxServer();
ai.status = ri.reason;
ai.jobid = "";
ai.jobtag = "";
+ ai.cidname = ri.cidname;
+ ai.cidnumber = ri.cidnumber;
if (!ai.record("RECV"))
logError("Error writing RECV accounting record, dest=%s",
(const char*) ai.dest);
* Handle notification that a document has been received.
*/
void
-faxGettyApp::notifyRecvDone(const FaxRecvInfo& ri, const CallerID& cid)
+faxGettyApp::notifyRecvDone(const FaxRecvInfo& ri)
{
- FaxServer::notifyRecvDone(ri, cid);
+ FaxServer::notifyRecvDone(ri);
// hand to delivery/notification command
fxStr cmd(faxRcvdCmd
| quote | getModemDeviceID() | enquote
| quote | getCommID() | enquote
| quote | ri.reason | enquote
- | quote | cid.number | enquote
- | quote | cid.name | enquote
+ | quote | ri.cidnumber | enquote
+ | quote | ri.cidname | enquote
);
traceServer("RECV FAX: %s", (const char*) cmd);
setProcessPriority(BASE); // lower priority
void notifyRecvBegun(const FaxRecvInfo&);
void notifyPageRecvd(TIFF* tif, const FaxRecvInfo&, int ppm);
void notifyDocumentRecvd(const FaxRecvInfo&);
- void notifyRecvDone(const FaxRecvInfo&, const CallerID&);
+ void notifyRecvDone(const FaxRecvInfo&);
public:
faxGettyApp(const fxStr& device, const fxStr& devID);
~faxGettyApp();
ai.jobtag = req->jobtag;
ai.user = req->mailaddr;
ai.csi = info.getCSI();
+ ai.cidname = "";
+ ai.cidnumber = "";
if (req->status == send_done)
ai.status = "";
else
ai.status = ri.reason;
ai.jobid = req.jobid;
ai.jobtag = req.jobtag;
+ ai.cidname = "";
+ ai.cidnumber = "";
if (!ai.record("POLL"))
logError("Error writing POLL accounting record, dest=%s",
(const char*) ai.dest);
ai.dest = req->external;
ai.csi = "";
ai.params = 0;
+ ai.cidname = "";
+ ai.cidnumber = "";
if (req->status == send_done)
ai.status = "";
else
}
#endif
char* cp;
+ ri.sender = "";
+ ri.cidname = "";
+ ri.cidnumber = "";
if (TIFFGetField(tif, TIFFTAG_IMAGEDESCRIPTION, &cp)) {
- ri.sender = cp;
+ while (cp[0] != '\0' and cp[0] != '\n') { // sender
+ ri.sender.append(cp[0]);
+ cp++;
+ }
+ if (cp[0] == '\n') {
+ cp++;
+ while (cp[0] != '\0' and cp[0] != '\n') { // cidname
+ ri.cidname.append(cp[0]);
+ cp++;
+ }
+ }
+ if (cp[0] == '\n') {
+ cp++;
+ while (cp[0] != '\0' and cp[0] != '\n') { // cidnumber
+ ri.cidnumber.append(cp[0]);
+ cp++;
+ }
+ }
sanitize(ri.sender);
+ sanitize(ri.cidname);
+ sanitize(ri.cidnumber);
} else
ri.sender = "<unknown>";
#ifdef TIFFTAG_FAXSUBADDRESS
's', // f (filename)
'g', // g
's', // h (time spent receiving)
- 'i', // i
- 'j', // j
+ 's', // i (CIDName)
+ 's', // j (CIDNumber)
'k', // k
'u', // l (pagelength)
's', // m (protection mode)
case 'h':
fprintf(fd, fspec, fmtTime(ri.time));
break;
+ case 'i':
+ fprintf(fd, fspec, (const char*) ri.cidname);
+ break;
+ case 'j':
+ fprintf(fd, fspec, (const char*) ri.cidnumber);
+ break;
case 'l':
fprintf(fd, fspec, ri.params.pageLength());
break;
e Error description if an error occurred during receive
f Document filename (relative to the \fBrecvq\fP directory)
h Time spent receiving document (HH:MM:SS)
+i CIDName value for received fax
+j CIDNumber value for received fax
l Page length in mm
m Fax-style protection mode string (``-rwxrwx'')
n File size (number of bytes)
is a command script that prints a summary of the \*(Fx
accounting statistics for received facsimile.
The statistics can be sorted using one of several keys:
-the caller's \s-1CSI\s+1 (default),
-the communication speed, and
+the caller's \s-1CSI\s+1 (default), CIDName, CIDNumber,
+the communication speed, or
the communication data format.
Statistics are read from the file
.B ${SPOOL}/etc/xferfaxlog
(using the default sort key):
.sp .5
.nf
-.ta \w'\s-1ALDUS CORPORATION\s+1 'u +\w'Pages 'u +\w'15:03:58 'u +\w'Pg/min 'u +\w'Errs 'u +\w'TypRate 'u
-\fBSender Pages Time Pg/min Errs TypRate TypData\fP
- 61 30:47 2.0 16 9600 1-D MR
-+13037904674 5 1:34 3.2 2 9600 1-D MH
-+14159657824 1 1:00 1.0 0 9600 1-D MH
-+15086636852 2 0:00 2.0 0 9600 1-D MH
-+15105268781 740 5:47:51 2.1 59 9600 1-D MH
-+15105287164 20 7:00 2.9 0 9600 1-D MH
-+15123713545 3 1:19 2.3 0 9600 1-D MH
-+15123713641 5 1:04 4.6 0 9600 1-D MH
-+16099211926 3 2:00 1.5 0 9600 1-D MH
-+17088987617 1 0:18 3.3 0 9600 1-D MH
-415 390 6175 22 6:01 3.6 0 9600 1-D MH
-415 965 7651 56 34:52 1.6 14 9600 1-D MH
-415 973 6723 1 2:09 0.5 0 9600 2-D MR
-49 211 161514 1 0:00 1.0 0 9600 2-D MR
-8185970503 1 0:28 2.1 0 9600 2-D MR
-\s-1ALDUS CORPORATION\s+1 3 2:34 1.2 0 9600 1-D MH
-------------------------------------------------------------
-Total 925 7:19:03 2.1 91
+.ta \w'\s-1ALDUS CORPORATION\s+1 'u +\w'1234567890'u +\w'1234567890'u +\w'Pages 'u +\w'15:03:58 'u +\w'Pg/min 'u +\w'Errs 'u +\w'TypRate 'u
+\fBSender CIDName CIDNumber Pages Time Pg/min Errs TypRate TypData\fP
+ 61 30:47 2.0 16 9600 1-D MR
++13037904674 5 1:34 3.2 2 9600 1-D MH
++14159657824 1 1:00 1.0 0 9600 1-D MH
++15086636852 2 0:00 2.0 0 9600 1-D MH
++15105268781 740 5:47:51 2.1 59 9600 1-D MH
++15105287164 20 7:00 2.9 0 9600 1-D MH
++15123713545 3 1:19 2.3 0 9600 1-D MH
++15123713641 5 1:04 4.6 0 9600 1-D MH
++16099211926 3 2:00 1.5 0 9600 1-D MH
++17088987617 1 0:18 3.3 0 9600 1-D MH
+415 390 6175 22 6:01 3.6 0 9600 1-D MH
+415 965 7651 56 34:52 1.6 14 9600 1-D MH
+415 973 6723 1 2:09 0.5 0 9600 2-D MR
+49 211 161514 1 0:00 1.0 0 9600 2-D MR
+8185970503 1 0:28 2.1 0 9600 2-D MR
+\s-1ALDUS CORPORATION\s+1 ALDUS CO 5551212 3 2:34 1.2 0 9600 1-D MH
+--------------------------------------------------------------------------------------------------
+Total 925 7:19:03 2.1 91
.sp .5
.fi
The
column shows the caller's \s-1TSI\s+1 (notice that some callers have
not setup a \s-1TSI\s+1).
The
+.I CIDName
+column is the received CIDName value for the sender.
+The
+.I CIDNumber
+column is the received CIDNumber value for the sender.
+The
.I Pages
column is the total number of good pages received.
The
Sort output by caller's
.SM CSI.
.TP 12
+.B \-cidname
+Sort output by CIDName
+.TP 12
+.B \-cidnumber
+Sort output by CIDNumber
+.TP 12
.B \-format
Sort output by data format.
.TP 12
Each record of a facsimile transmission is of the form:
.sp .5
.ti +0.5i
-date \s-1SEND\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1CSI\s+1'' params #pages jobtime conntime ``reason''
+date \s-1SEND\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1CSI\s+1'' params #pages jobtime conntime ``reason'' \fI<null>\fP \fI<null>\fP
.sp .5
.PP
A facsimile reception record is of the form:
.sp .5
.ti +0.5i
-date \s-1RECV\s+1 commid modem \fI<null>\fP \fI<null>\fP fax ``local-number'' ``\s-1TSI\s+1'' params #pages jobtime conntime ``reason''
+date \s-1RECV\s+1 commid modem \fI<null>\fP \fI<null>\fP fax ``local-number'' ``\s-1TSI\s+1'' params #pages jobtime conntime ``reason'' ``CIDName'' ``CIDNumber''
.sp .5
.PP
Each facsimile document retrieved by polling has a record of the form:
.sp .5
.ti +0.5i
-date \s-1POLL\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1TSI\s+1'' params #pages jobtime conntime ``reason''
+date \s-1POLL\s+1 commid modem jobid jobtag sender ``dest-number'' ``\s-1TSI\s+1'' params #pages jobtime conntime ``reason'' \fI<null>\fP \fI<null>\fP
.sp .5
An alphanumeric pager request has a record of the form:
.sp .5
.ti +0.5i
-date \s-1PAGE\s+1 commid modem jobid jobtag sender ``dest-number'' ``\fI<null>\fP'' 0 0 jobtime conntime ``reason''
+date \s-1PAGE\s+1 commid modem jobid jobtag sender ``dest-number'' ``\fI<null>\fP'' 0 0 jobtime conntime ``reason'' \fI<null>\fP \fI<null>\fP
.sp .5
.PP
The following describes the fields in the above records:
.TP 14
.B reason
A string that indicates if any problem occured during the session.
+.TP 14
+.B CIDName
+The received CIDName value for the session.
+.TP 14
+.B CIDNumber
+The received CIDNumber value for the session.
.PP
Note that fields may have embedded blanks.
Session parameters are encoded as a decimal number that contains
{ 'e', "Error" }, // e (error description)
{ 'f', "Filename" }, // f (filename)
{ 'h', "Time" }, // h (time spent receiving)
+ { 'i', "CIDName" }, // i (caller id name)
+ { 'j', "CIDNumber" }, // j (caller id number)
{ 'l', "Length" }, // l (pagelength)
{ 'm', "Protect" }, // m (fax-style protection mode, no group bits)
{ 'n', "Size" }, // n (file size)
, subaddr(other.subaddr)
, params(other.params)
, reason(other.reason)
+ , cidname(other.cidname)
+ , cidnumber(other.cidnumber)
{
npages = other.npages;
time = other.time;
fxStr
FaxRecvInfo::encode() const
{
- return fxStr::format("%x,%x,%x,%s,%s,\"%s\",\"%s\",\"%s\""
+ return fxStr::format("%x,%x,%x,%s,%s,\"%s\",\"%s\",\"%s\",\"%s\",\"%s\""
, time
, npages
, params.encode()
, (const char*) sender
, (const char*) subaddr
, (const char*) reason
+ , (const char*) cidname
+ , (const char*) cidnumber
);
}
return (false);
reason = cp+3; // +1 for "/+1 for ,/+1 for "
reason.resize(reason.next(0,'"'));
+ cp = strchr(cp+1, '"');
+ if (cp == NULL || cp[1] != ',' || cp[2] != '"')
+ return (false);
+ reason = cp+3; // +1 for "/+1 for ,/+1 for "
+ cidname.resize(cidname.next(0,'"'));
+ cp = strchr(cp+1, '"');
+ if (cp == NULL || cp[1] != ',' || cp[2] != '"')
+ return (false);
+ reason = cp+3; // +1 for "/+1 for ,/+1 for "
+ cidnumber.resize(cidnumber.next(0,'"'));
return (true);
}
u_int time; // time on the phone
Class2Params params; // transfer parameters
fxStr reason; // reason for failure (if not null)
+ fxStr cidname; // caller id name
+ fxStr cidnumber; // caller id number
FaxRecvInfo();
FaxRecvInfo(const FaxRecvInfo& other);
#ifdef TIFFTAG_FAXRECVPARAMS
}
#endif
- fxStr sender;
+ fxStr sender = "";
+ fxStr cidname = "";
+ fxStr cidnumber = "";
char* cp;
if (TIFFGetField(tif, TIFFTAG_IMAGEDESCRIPTION, &cp)) {
- sender = cp;
+ while (cp[0] != '\0' && cp[0] != '\n') { // sender
+ sender.append(cp[0]);
+ cp++;
+ }
+ if (cp[0] == '\n') {
+ cp++;
+ while (cp[0] != '\0' && cp[0] != '\n') { // cidname
+ cidname.append(cp[0]);
+ cp++;
+ }
+ }
+ if (cp[0] == '\n') {
+ cp++;
+ while (cp[0] != '\0' && cp[0] != '\n') { // cidnumber
+ cidnumber.append(cp[0]);
+ cp++;
+ }
+ }
sanitize(sender);
+ sanitize(cidname);
+ sanitize(cidnumber);
} else
sender = "<unknown>";
printf("%11s %s\n", "Sender:", (const char*) sender);
printf("%11s %s\n", "TimeToRecv:", time == 0 ? "<unknown>" : fmtTime(time));
printf("%11s %s\n", "SignalRate:", params.bitRateName());
printf("%11s %s\n", "DataFormat:", params.dataFormatName());
+ if (cidname != "")
+ printf("%11s %s\n", "CIDName:", (const char*) cidname);
+ if (cidnumber != "")
+ printf("%11s %s\n", "CIDNumber:", (const char*) cidnumber);
return (0);
}
else
echo " CommID: c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)"
fi
- if [ "$CIDNUMBER" ]; then
- echo " CIDNumber: $CIDNUMBER"
- fi
- if [ "$CIDNAME" ]; then
- echo " CIDName: $CIDNAME"
- fi
if [ -n "$SENDTO" ]; then
echo ""
echo "The facsimile was automatically dispatched to: $SENDTO."
else
echo " CommID: c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)"
fi
- if [ "$CIDNUMBER" ]; then
- echo " CIDNumber: $CIDNUMBER"
- fi
- if [ "$CIDNAME" ]; then
- echo " CIDName: $CIDNAME"
- fi
echo ""
echo "--$MIMEBOUNDARY"
if [ "$FILETYPE" = "tif" ]; then
while [ x"$1" != x"" ] ; do
case $1 in
- -send*|-csi|-dest*|-speed|-rate|-format)
+ -send*|-csi|-dest*|-speed|-rate|-format|-cidname|-cidnumber)
SORTKEY=$1;;
-age) shift; AGE=$1;;
-since) shift; SINCE=$1;;
$2 == "RECV" && NF == 12 { acct($7, $10, $11, $8, $9, $12); }
$2 == "RECV" && NF == 13 { acct($9, $11, $12, getBR($10), getDF($10), $13); }
$2 == "RECV" && NF == 14 { acct($9, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "RECV" && NF == 16 { acct($9, $11, $13, getBR($10), getDF($10), $14, $15, $16); }
+ '
+ ;;
+-cidname)
+ AWKRULES='
+ $2 == "RECV" && NF == 16 { acct($15, $11, $13, getBR($10), getDF($10), $14, $15, $16); }
+ '
+ ;;
+-cidnumber)
+ AWKRULES='
+ $2 == "RECV" && NF == 16 { acct($16, $11, $13, getBR($10), getDF($10), $14, $15, $16); }
'
;;
-dest*)
$2 == "RECV" && NF == 11 { acct($5, $9, $10, $7, $8, $11); }
$2 == "RECV" && NF == 12 { acct($6, $10, $11, $8, $9, $12); }
$2 == "RECV" && NF == 14 { acct($8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "RECV" && NF == 16 { acct($8, $11, $13, getBR($10), getDF($10), $14, $15, $16); }
'
;;
-speed|-rate)
$2 == "RECV" && NF == 12 { acct($8, $10, $11, $8, $9, $12); }
$2 == "RECV" && NF == 13 { acct(getBR($10), $11, $12, getBR($10), getDF($10), $13); }
$2 == "RECV" && NF == 14 { acct(getBR($10), $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "RECV" && NF == 16 { acct(getBR($10), $11, $13, getBR($10), getDF($10), $14, $15, $16); }
'
;;
-format)
$2 == "RECV" && NF == 12 { acct($9, $10, $11, $8, $9, $12); }
$2 == "RECV" && NF == 13 { acct(getDF($10), $11, $12, getBR($10), getDF($10), $13); }
$2 == "RECV" && NF == 14 { acct(getDF($10), $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "RECV" && NF == 16 { acct(getDF($10), $11, $13, getBR($10), getDF($10), $14, $15, $16); }
'
;;
esac
#
# Accumulate a statistics record.
#
-function acct(key, pages, time, br, df, status)
+function acct(key, pages, time, br, df, status, cidname, cidnumber)
{
if (cvtDateTime($1) < KEEP)
return;
recvrate[key] = addToMap(recvrate[key], br, pages, rateMap);
gsub("\"", "", df);
recvdata[key] = addToMap(recvdata[key], df, pages, dataMap);
+ gsub("\"", "", cidname);
+ gsub("\"", "", cidnumber);
+ lastcidname[key] = cidname;
+ lastcidnumber[key] = cidnumber;
}
#
sorted[nsorted++] = i;
}
qsort(sorted, 0, nsorted-1);
- fmt = "%-" maxlen "." maxlen "s"; # e.g. %-24.24s
+ fmt = "%-" maxlen "." maxlen "s" " %-" maxlen "." maxlen "s" " %-" maxlen "." maxlen "s"; # e.g. %-24.24s
printf fmt " %5s %8s %6s %4s %7s %7s\n",
- "Sender", "Pages", "Time", "Pg/min",
+ "Sender", "CIDName", "CIDNumber", "Pages", "Time", "Pg/min",
"Errs", "TypRate", "TypData";
tpages = 0;
ttime = 0;
n = recvpages[i]; if (n == 0) n = 1;
brate = best
printf fmt " %5d %8s %6.1f %4d %7d %7s\n",
- i, recvpages[i], fmtTime(recvtime[i]),
+ i, lastcidname[i], lastcidnumber[i], recvpages[i], fmtTime(recvtime[i]),
recvpages[i] / t, recverrs[i],
bestInMap(recvrate[i], rates),
bestInMap(recvdata[i], datas);
ttime += recvtime[i];
terrs += recverrs[i];
}
- printRule(maxlen+1+5+1+8+6+1+4+1+7+1+7, "-");
+ printRule(maxlen+1+maxlen+1+maxlen+1+5+1+8+6+1+4+1+7+1+7, "-");
t = ttime/60; if (t == 0) t = 1;
printf fmt " %5d %8s %6.1f %4d\n",
- "Total", tpages, fmtTime(ttime), tpages/t, terrs;
+ "Total", "", "", tpages, fmtTime(ttime), tpages/t, terrs;
}
EOF
echo "$AWKRULES"
$2 == "SEND" && NF == 12 { acct($5, $6, $10, $11, $8, $9, $12); }
$2 == "SEND" && NF == 13 { acct($7, $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct($7, $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct($7, $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="Sender"
;;
$2 == "SEND" && NF == 12 { acct($7, $6, $10, $11, $8, $9, $12); }
$2 == "SEND" && NF == 13 { acct($9, $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct($9, $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct($9, $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="CSI"
MAPNAMES=no
$2 == "SEND" && NF == 12 { acct($6, $6, $10, $11, $8, $9, $12); }
$2 == "SEND" && NF == 13 { acct($8, $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct($8, $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct($8, $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="Destination"
MAPNAMES=no
$2 == "SEND" && NF == 12 { acct($8, $6, $10, $11, $8, $9, $12); }
$2 == "SEND" && NF == 13 { acct(getBR($10), $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct(getBR($10), $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct(getBR($10), $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="Speed"
MAPNAMES=no
$2 == "SEND" && NF == 12 { acct($9, $6, $10, $11, $8, $9, $12); }
$2 == "SEND" && NF == 13 { acct(getDF($10), $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct(getDF($10), $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct(getDF($10), $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="Format"
MAPNAMES=no
AWKRULES='
$2 == "SEND" && NF == 13 { acct($6, $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct($6, $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct($6, $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="JobTag"
MAPNAMES=no
AWKRULES='
$2 == "SEND" && NF == 13 { acct($4, $8, $11, $12, getBR($10), getDF($10), $13); }
$2 == "SEND" && NF == 14 { acct($4, $8, $11, $13, getBR($10), getDF($10), $14); }
+ $2 == "SEND" && NF == 16 { acct($4, $8, $11, $13, getBR($10), getDF($10), $14); }
'
KEYTITLE="Device"
MAPNAMES=no