]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 52] - TSI rectrictions cause MPS/EOP (HylaFAX at both sides)
authorDarren Nickerson <darren.nickerson@ifax.com>
Sun, 12 Aug 2001 23:40:31 +0000 (23:40 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Sun, 12 Aug 2001 23:40:31 +0000 (23:40 +0000)
Backed out the offending patch, and applied the new one
[Bug 81] -  faxcover documentation differs from execution ("from" options, commentsX)
Applied your patch Lee - thanks!

13 files changed:
faxcover/faxcover.c++
faxd/Class1.h
faxd/Class1Recv.c++
faxd/Class2.h
faxd/Class2Recv.c++
faxd/FaxModem.h
faxd/FaxRecv.c++
man/faxcover.1
man/sendfax.1
sendfax/sendfax.c++
util/SendFaxClient.c++
util/SendFaxJob.c++
util/SendFaxJob.h

index f9bf61efbd23d871e8e968bbdb3c04ef22aad149..cd71563543b0d566a26b9044357b256a586d3df3 100644 (file)
@@ -45,6 +45,10 @@ private:
     fxStr      toVoiceNumber;  // to's voice number
     fxStr      toLocation;     // to's geographical location
     fxStr      toCompany;      // to's company/institution
+    fxStr      fromFaxNumber;  // sender's fax number
+    fxStr      fromVoiceNumber;        // sender's voice number
+    fxStr      fromLocation;   // sender's geographical location
+    fxStr      fromCompany;    // sender's company/institution
     fxStr      regarding;      // fax is regarding...
     fxStr      comments;       // general comments
     fxStr      sender;         // sender's identity
@@ -53,6 +57,7 @@ private:
     float      pageWidth;      // page width (mm)
     float      pageLength;     // page length (mm)
     int                maxcomments;    // max # of comment lines
+    int                maxlencomments; // max length of comment lines
 
     static const char* prologue;
 
@@ -81,6 +86,7 @@ faxCoverApp::faxCoverApp()
 {
     db = 0;
     maxcomments = 20;
+    maxlencomments = 35;
 }
 
 faxCoverApp::~faxCoverApp()
@@ -103,7 +109,7 @@ faxCoverApp::initialize(int argc, char** argv)
        cover = cp;
 
     setupPageSize("default");
-    while ((c = getopt(argc, argv, "C:D:n:t:f:c:p:l:m:r:s:v:x:")) != -1)
+    while ((c = getopt(argc, argv, "C:D:L:N:V:X:n:t:f:c:p:l:m:z:r:s:v:x:")) != -1)
        switch (c) {
        case 's':                       // page size
            setupPageSize(optarg);
@@ -114,9 +120,24 @@ faxCoverApp::initialize(int argc, char** argv)
        case 'D':                       // date format string
            dateFmt = optarg;
            break;
+       case 'L':                       // sender's geographic location
+           fromLocation = optarg;
+           break;
+       case 'N':                       // sender's fax number
+           fromFaxNumber = optarg;
+           break;
+       case 'V':                       // sender's voice number
+           fromVoiceNumber = optarg;
+           break;
+       case 'X':                       // sender's company/institution
+           fromCompany = optarg;
+           break;
        case 'm':                       // max # comment lines
            maxcomments = atoi(optarg);
            break;
+       case 'z':                       // max length comment lines
+           maxlencomments = atoi(optarg);
+           break;
        case 'n':                       // fax number
            toFaxNumber = optarg;
            break;
@@ -181,11 +202,16 @@ faxCoverApp::usage()
        " [-p #pages]"
        " [-l to-location]"
        " [-m maxcomments]"
+       " [-z maxlencomments]"
        " [-r regarding]"
        " [-v to-voice-number]"
        " [-x to-company]"
        " [-C template-file]"
        " [-D date-format]"
+       " [-L from-location]"
+       " [-N from-fax-number]"
+       " [-V from-voice-number]"
+       " [-X from-company]"
        " [-s pagesize]"
        " -f from"
        " -n fax-number"
@@ -235,6 +261,51 @@ const char* faxCoverApp::prologue = "\
     -1 1 { cbuf exch 7 exch 48 add put cbuf cvn exch def } for\n\
     1 add exch 1 exch { cbuf exch 7 exch 48 add put cbuf cvn () def } for\n\
 } def\n\
+/XtoCommentsX {\n\
+% <X> XtoCommentsX <commentsX>\n\
+    3 string cvs (comments) dup length dup 4 1 roll\n\
+    2 index length add string dup 0 4 -1 roll\n\
+    putinterval dup 4 -2 roll putinterval\n\
+} def\n\
+/BreakIntoCommentsX {\n\
+% <maxlines> <text> BreakIntoCommentsX -\n\
+    exch 1 1 3 2 roll\n\
+    { XtoCommentsX cvn () def } for\n\
+    dup length string copy 0 1 index 0 4 1 roll\n\
+    {   linebreak 0 get eq {\n\
+            exch dup 0 3 index getinterval 4 -1 roll 1 add dup 5 1 roll\n\
+            XtoCommentsX cvn exch def dup length 2 index sub 1 sub\n\
+            2 index 1 add exch getinterval exch pop 0\n\
+        }{ 1 add } ifelse\n\
+        dup MaxLenComments gt {\n\
+            exch MaxLenComments 1 sub -1 0 {\n\
+                2 copy get wordbreak 0 get eq {\n\
+                    mark 4 1 roll\n\
+                    {   2 copy 1 add 1 index length 1 index 1 add sub\n\
+                        getinterval 5 -1 roll search { 3 -2 roll pop pop } if\n\
+                        length MaxLenComments gt { 4 -1 roll exec\n\
+                        }{ false } ifelse\n\
+                    }\n\
+                    { true }\n\
+                    5 1 roll linebreak 1 index wordbreak 7 3 roll exec\n\
+                    counttomark 1 add 4 roll cleartomark { pop exit } if\n\
+                    2 copy 1 add 0 exch getinterval 5 -1 roll\n\
+                    1 add dup 6 1 roll XtoCommentsX cvn exch def\n\
+                    2 copy 1 add 1 index length 1 index sub getinterval\n\
+                    3 -1 roll pop 3 -2 roll 1 add sub exch exit\n\
+                } if\n\
+                pop\n\
+            } for\n\
+            exch dup MaxLenComments gt {\n\
+                pop dup 0 MaxLenComments getinterval 3 -1 roll\n\
+                1 add dup 4 1 roll XtoCommentsX cvn exch def\n\
+                dup length MaxLenComments sub\n\
+                MaxLenComments exch getinterval 1\n\
+            } if\n\
+        }if\n\
+    } forall\n\
+    pop exch 1 add XtoCommentsX cvn exch def\n\
+} def\n\
 ";
 
 void
@@ -263,7 +334,7 @@ faxCoverApp::makeCoverSheet()
     printf("%%%%Pages: 1 +1\n");
     printf("%%%%EndComments\n");
     printf("%%%%BeginProlog\n");
-    printf("100 dict begin\n");
+    printf("%i dict begin\n", maxcomments*2 + 80);
     printf("%s", prologue);
     emitToDefs(toName, toName != "" ? db->find(toName) : (FaxDBRecord*) NULL);
     printf("/pageWidth %.2f def\n", pageWidth);
@@ -273,7 +344,10 @@ faxCoverApp::makeCoverSheet()
     emitDateDefs();
     coverDef("regarding", regarding);
     emitCommentDefs();
-    printf("%i comments BreakIntoCommentX", maxcomments);
+    printf("/MaxComments %i def\n", maxcomments);
+    printf("MaxComments comments BreakIntoCommentX\n");
+    printf("/MaxLenComments %i def\n", maxlencomments);
+    printf("MaxComments comments BreakIntoCommentsX\n");
     printf("%%%%EndProlog\n");
     printf("%%%%Page: \"1\" 1\n");
     // copy prototype cover page
@@ -282,7 +356,7 @@ faxCoverApp::makeCoverSheet()
     while ((n = read(fd, buf, sizeof (buf))) > 0) 
        fwrite(buf, n, 1, stdout);
     Sys::close(fd);
-    printf("end\n");
+    printf("\nend\n");
 }
 
 void
@@ -313,11 +387,6 @@ faxCoverApp::emitToDefs(const char* to, FaxDBRecord* rec)
 void
 faxCoverApp::emitFromDefs(FaxDBRecord* rec)
 {
-    fxStr fromCompany;
-    fxStr fromLocation;
-    fxStr fromFaxNumber;
-    fxStr fromVoiceNumber;
-
     if (rec) {
        fromCompany = rec->find("Company");
        fromLocation = rec->find("Location");
index b5c45ae718e0da39cc4ffc3191bf32b98bf82182..800a6138b20b08fbdd06efa6af49b4da5a658db9 100644 (file)
@@ -64,6 +64,7 @@ protected:
     bool       recvdDCN;               // received DCN frame
     bool       messageReceived;        // expect/don't expect message carrier
     u_int      lastPPM;                // last PPM during receive
+    bool       sendCFR;                // received TCF was not confirmed
 
     static const u_int modemPFMCodes[8];// map T.30 FCF to Class 2 PFM
     static const u_int modemPPMCodes[8];// map T.30 FCF to Class 2 PPM
@@ -167,8 +168,6 @@ public:
     bool       recvPage(TIFF*, int& ppm, fxStr& emsg);
     bool       recvEnd(fxStr& emsg);
     void       recvAbort();
-    void       trainingSucceeded();
-    void       trainingFailed();
 
 // polling support
     bool       requestToPoll(fxStr&);
index 98b3aad0957344c1d3c72c8f38ff025904339a3d..92ddefe07b5ac75dbf7847d5b5c0800596a04ab0 100644 (file)
@@ -86,6 +86,7 @@ Class1Modem::recvBegin(fxStr& emsg)
     messageReceived = false;                   // expect message carrier
     recvdDCN = false;                          // haven't seen DCN
     lastPPM = FCF_DCN;                         // anything will do
+    sendCFR = false;                           // TCF was not received
 
     return FaxModem::recvBegin(emsg) && recvIdentification(
        0, fxStr::null,
@@ -163,6 +164,7 @@ Class1Modem::recvIdentification(
                        if (frame.getFCF() == FCF_DCN) {
                            emsg = "RSPREC error/got DCN";
                            recvdDCN = true;
+                               return (false);
                        } else                  // XXX DTC/DIS not handled
                            emsg = "RSPREC invalid response received";
                        break;
@@ -301,31 +303,24 @@ Class1Modem::recvTraining()
        }
        (void) waitFor(AT_NOCARRIER);   // wait for message carrier to drop
     }
-    return (ok);
-}
-
-/*
- * Send training response (success); we follow the spec
- * by delaying 75ms before switching carriers.
- */
-void
-Class1Modem::trainingSucceeded()
-{
-    pause(conf.class1TCFResponseDelay);
-    transmitFrame(FCF_CFR|FCF_RCVR);
-    protoTrace("TRAINING succeeded");
-}
-
-/*
- * Send training response (failure); we follow the spec
- * by delaying 75ms before switching carriers.
- */
-void
-Class1Modem::trainingFailed()
-{
+    /*
+     * Send training response; we follow the spec
+     * by delaying 75ms before switching carriers.
+     */
     pause(conf.class1TCFResponseDelay);
-    transmitFrame(FCF_FTT|FCF_RCVR);
-    protoTrace("TRAINING failed");
+    if (ok) {
+       /*
+        * Send CFR later so that we can cancel
+        * session by DCN if it's needed. 
+        */
+       sendCFR = true;
+       protoTrace("TRAINING succeeded");
+    } else {
+       transmitFrame(FCF_FTT|FCF_RCVR);
+       sendCFR = false;
+       protoTrace("TRAINING failed");
+    }
+    return (ok);
 }
 
 /*
@@ -367,6 +362,10 @@ top:
     do {
        u_int timer = conf.t2Timer;
        if (!messageReceived) {
+           if (sendCFR ) {
+               transmitFrame(FCF_CFR|FCF_RCVR);
+               sendCFR = false;
+           }
            /*
             * Look for message carrier and receive Phase C data.
             */
@@ -467,8 +466,6 @@ top:
                    && recvDCSFrames(frame)
                    && recvTraining()
                );
-               if (messageReceived) trainingFailed();
-               else trainingSucceeded();
                break;
            case FCF_MPS:                       // MPS
            case FCF_EOM:                       // EOM
@@ -566,10 +563,8 @@ top:
         * timeout, we need to achieve CONNECT first, just
         * as we did following ATA back in the beginning.
         */
-       if (atCmd(thCmd, AT_NOTHING) && atResponse(rbuf, 0) == AT_CONNECT && recvBegin(emsg)) {
-           trainingSucceeded();
+       if (atCmd(thCmd, AT_NOTHING) && atResponse(rbuf, 0) == AT_CONNECT && recvBegin(emsg))
            goto top;
-       } else trainingFailed();
     } else
        emsg = "T.30 T2 timeout, expected page not received";
     return (false);
index 40efeb532a625f4e1fbd15ecabbdaf711434456b..cb0787cf3be08082091d086c18cd71efc058a408 100644 (file)
@@ -147,8 +147,6 @@ public:
     bool       recvPage(TIFF*, int& ppm, fxStr& emsg);
     bool       recvEnd(fxStr& emsg);
     void       recvAbort();
-    void       trainingSucceeded();
-    void       trainingFailed();
 
 // polling support
     bool       requestToPoll(fxStr& emsg);
index 8be8fddf613fd50a6868d61dd011218ab8ffa4b4..abdb594d62b1bf6ce6391cbd7080f531c72743a9 100644 (file)
@@ -346,23 +346,3 @@ Class2Modem::recvAbort()
 {
     strcpy(hangupCode, "50");                  // force abort in recvEnd
 }
-
-/*
- * Processes to perform at the end of training,
- * but after TSI screening, so we know where
- * we're going.
- */
-void
-Class2Modem::trainingSucceeded()
-{
-    // nothing
-}
-
-/*
- * ibid.
- */
-void
-Class2Modem::trainingFailed()
-{
-    // nothing
-}
index 17324cb94613bb26d3f80b6ca15fa3b3f5eac4b3..625360269e2c08508be9a8bfc16501d41ad7ca25 100644 (file)
@@ -251,8 +251,6 @@ public:
     virtual bool recvPage(TIFF*, int& ppm, fxStr& em) = 0;
     virtual bool recvEnd(fxStr& emsg) = 0;
     virtual void recvAbort() = 0;
-    virtual void trainingSucceeded() = 0;
-    virtual void trainingFailed() = 0;
     // query interfaces for optional state
     virtual bool getRecvPWD(fxStr&);
     virtual bool getRecvTSI(fxStr&);
index 1edbdad5de40f69bacfc4c0c88158cb15020b2e3..765ccd20664ccc1a7845fdece953d3968c6e2895 100644 (file)
@@ -74,7 +74,6 @@ FaxServer::recvFax(const CallerID& cid)
            if (!modem->recvEnd(emsg))
                traceProtocol("RECV FAX: %s", (const char*) emsg);
        } else {
-           modem->trainingFailed();            // wait until after QualifyTSI
            traceProtocol("RECV FAX: %s", (const char*) emsg);
            TIFFClose(tif);
        }
@@ -215,12 +214,12 @@ FaxServer::recvDocuments(TIFF* tif, FaxRecvInfo& info, FaxRecvInfoArray& docs, f
                emsg = "Permission denied (unacceptable client TSI)";
                info.time = (u_int) getFileTransferTime();
                info.reason = emsg;
+               docs[docs.length()-1] = info;
                notifyDocumentRecvd(info);
                TIFFClose(tif);
                return (false);
            }
        }
-       modem->trainingSucceeded();             // wait until after QualifyTSI
        setServerStatus("Receiving from \"%s\"", (const char*) info.sender);
        recvOK = recvFaxPhaseD(tif, info, ppm, emsg);
        TIFFClose(tif);
index 839f8e75e76677973bc5e9fc9501bb60660b9ce0..685e0e0c52636a328aac52ddb38cdcb6e40c64cb 100644 (file)
@@ -28,7 +28,7 @@
 .if n .po 0
 .ds Fx \fIHyla\s-1FAX\s+1\fP
 .ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2
-.TH FAXCOVER 1 "November 14, 1996"
+.TH FAXCOVER 1 "January 06, 2001"
 .SH NAME
 faxcover \- generate a \*(Ps cover page for an outgoing facsimile
 .SH SYNOPSIS
@@ -70,22 +70,25 @@ symbols are defined:
 \fIto-voice-number\fP  person's voice phone number     \fIfrom-voice-number\fP sender's voice phone number
 \fIto-fax-number\fP    destination fax phone number    \fIfrom-fax-number\fP   sender's fax phone number
 \fIcomments\fP unbroken comment string \fIcommentsX\fP \fI\s-1X\s+1\fP'th line of comments
-\fIregarding\fP        Re: subject     \fIpage-count\fP        # pages other than cover page
-\fIpageWidth\fP        page width in millimeters       \fItodays-date\fP       current date and time
-\fIpageLength\fP       page length in millimeters
+\fIregarding\fP        Re: subject     \fICommentX\fP  similar to \fIcommentsX\fP
+\fIpageWidth\fP        page width in millimeters       \fIpage-count\fP        # pages other than cover page
+\fIpageLength\fP       page length in millimeters      \fItodays-date\fP       current date and time
 .fi
 .PP
 If the
 .I comments
-string is longer than 35 characters, it
-is broken, on word boundaries, into multiple \*(Ps strings
+string is longer than
+.I maxlencomments
+characters, it is broken, on word boundaries or instances of ``\\n\'\', into multiple \*(Ps strings
 .I comments\s-1X\s+1
 where
 .I \s-1X\s+1
 is the line number; e.g.
 .I comments2
 for the second line of comments.
-By default
+Long substrings without whitespace which exceed
+.I maxlencomments
+are also broken. By default
 .I faxcover
 will generate 20
 .I comments\s-1X\s+1
@@ -93,6 +96,27 @@ strings, emitting null string values for empty lines.
 This number can be changed with the
 .B \-m
 option; see below.
+.I maxlencomments
+is changed with the
+.B \-z
+option; see below.
+.PP
+Note that use of
+.I commentsX
+with non-fixed-width fonts can lead to spatial problems where characters
+run off the edge of the generated cover page.  In such cases, use of
+.I BreakIntoLines
+(see below) may be a more suitable approach.
+.PP
+.I CommentX
+is similar to
+.I commentsX
+except that its values are created only by breaking
+.I comments
+on instances of ``\\n\'\' and not otherwise.
+.I maxlines
+does not affect
+.I CommentX
 .PP
 .I faxcover
 also emits a \*(Ps procedure for breaking comment strings into
@@ -190,11 +214,26 @@ Use
 .I location
 for the geographic location of the destination company.
 .TP 12
+.BI \-L " location"
+Use
+.I location
+for the geographic location of the sender's company.
+.TP 12
+.BI \-m " maxlines"
+indicates the maximum number of
+.I commentsX
+lines to generate.
+.TP 12
 .BI \-n " number"
 Use
 .I number
 for the destination fax machine number.
 .TP 12
+.BI \-N " number"
+Use
+.I number
+for the sender's fax machine number.
+.TP 12
 .BI \-p " count"
 Use
 .I count
@@ -262,27 +301,43 @@ Use
 .I number
 for the receiver's voice phone number.
 .TP 12
+.BI \-V " number"
+Use
+.I number
+for the sender's voice phone number.
+.TP 12
 .BI \-x " company"
 Use
 .I company
 for the destination company name.
+.TP 12
+.BI \-X " company"
+Use
+.I company
+for the sender's company name.
+.TP 12
+.BI \-z " maxlencomments"
+indicates the maximum length in number of characters allowed in a
+.I commentsX
+string.
 .SH DIAGNOSTICS
 Complaints about not being able to locate a template file.
 .SH FILES
 .ta \w'${LIBDATA}/faxcover.ps    'u
 ~/.faxdb       personal fax number database
 .br
+~/.hylarc      per-user configuration file
+.br
+${LIBDATA}/hyla.conf   system-wide configuration file
+.br
 ${LIBDATA}/faxcover.ps default cover page template
 .br
 ${LIBDATA}/pagesizes   page size database
 .SH BUGS
-Information not supplied on the command line is
-currently obtained from the
-.I ~/.faxdb
-file.
 .I faxcover
-should read configuration parameters from the standard \*(Fx
-configuration files.
+should be able to determine the appropriate length of
+.I commentsX
+strings by using font metric information.
 .SH "SEE ALSO"
 .IR hylafax-client (1),
 .IR sendfax (1)
index 1e43cac6880c6ed65ff5af625165fdd9dabfc12b..513522a192c2b0d3bb74c263cc89f878fd654711 100644 (file)
@@ -28,7 +28,7 @@
 .if n .po 0
 .ds Fx \fIHyla\s-1FAX\s+1\fP
 .ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2
-.TH SENDFAX 1 "June 21, 1996"
+.TH SENDFAX 1 "January 06, 2001"
 .SH NAME
 sendfax \- submit a facsimile job for transmission
 .SH SYNOPSIS
@@ -550,6 +550,13 @@ Make no more than
 calls in attempting to send the facsimile.  By default, HylaFAX will 
 redial 12 times before killing a job.
 .TP 12
+.BI \-U " voice-no"
+Pass
+.I voice-no
+to the
+.IR faxcover (1)
+program as the sender's voice number.
+.TP 12
 .BI \-V " voice-no"
 Pass
 .I voice-no
@@ -562,6 +569,13 @@ Wait for the job to complete before ending the sendfax session.
 If this option is used, the sendfax process will not terminate until
 the job is completed.
 .TP 12
+.BI \-W " fax-no"
+Pass
+.I fax-no
+to the
+.IR faxcover (1)
+program as the sender's fax number.
+.TP 12
 .BI \-x " company"
 Pass
 .I company
@@ -569,6 +583,13 @@ to the
 .IR faxcover (1)
 program as the destination company name.
 .TP 12
+.BI \-X " company"
+Pass
+.I company
+to the
+.IR faxcover (1)
+program as the sender's company name.
+.TP 12
 .BI \-y " location"
 Pass
 .I location
@@ -576,6 +597,13 @@ to the
 .IR faxcover (1)
 program as the destination company's location.
 .TP 12
+.BI \-Y " location"
+Pass
+.I location
+to the
+.IR faxcover (1)
+program as the sender's company location.
+.TP 12
 .B \-v
 Print information on the standard output
 about each conversion and cover sheet
@@ -600,7 +628,8 @@ in that order, with later-read settings superceding any
 that may have been previously read.
 Configuration files follow the conventions described in
 .IR hylafax-client (1).
-The following configuration parameters are recognized:
+The following configuration parameters are recognized.
+Parameters marked with \(S1 are not available in ${LIBDATA}/hfaxd.conf :
 .sp .5
 .nf
 .ta \w'AutoCoverPage    'u +\w'boolean    'u +\w'\s-1\fIsee below\fP\s+1    'u
@@ -609,11 +638,15 @@ AutoCoverPage     boolean \s-1Yes\s+1     automatically generate cover page
 ChopThreshold  float   \s-13.0\s+1     page chopping threshold
 CoverCmd       string  \s-1\fIsee below\fP\s+1 pathname of cover sheet program
 Cover-Comments string  \-      cover page comments string
-Cover-Company  string  \-      cover page company name string
-Cover-Location string  \-      cover page company location string
+Cover-Company\(S1      string  \-      cover page to-company name string
+Cover-Location\(S1     string  \-      cover page to-company location string
 Cover-Regarding        string  \-      cover page regarding string
 Cover-Template string  \-      cover page template filename
-Cover-Voice    string  \-      cover page voice number string
+Cover-Voice\(S1        string  \-      cover page to-voice number string
+Cover-From-Company\(S1 string  \-      cover page from-company string
+Cover-From-Location\(S1        string  \-      cover page from-location string
+Cover-From-Voice\(S1   string  \-      cover page from-voice number string
+Cover-From-Fax\(S1     string  \-      cover page from-fax number string
 DateFormat     string  \-      cover page date format string
 DesiredEC      boolean \-      desired use of \s-1ECM\s+1
 DesiredMST     string  \-      desired minimum scanling time to use
@@ -671,11 +704,11 @@ The comments string to pass to the cover sheet program when
 auto-generating cover pages.
 .TP 16
 .B Cover-Company
-The company name string to pass to the cover sheet program when
+The to-company name string to pass to the cover sheet program when
 auto-generating cover pages.
 .TP 16
 .B Cover-Location
-The company location string to pass to the cover sheet program when
+The to-company location string to pass to the cover sheet program when
 auto-generating cover pages.
 .TP 16
 .B Cover-Regarding
@@ -687,7 +720,23 @@ The absolute pathname of a cover sheet template file to use
 in auto-generating cover pages.
 .TP 16
 .B Cover-Voice
-The voice number string to pass to the cover sheet program when
+The to-voice number string to pass to the cover sheet program when
+auto-generating cover pages.
+.TP 16
+.B Cover-From-Company
+The from-company name string to pass to the cover sheet program
+when auto-generating cover pages.
+.TP 16
+.B Cover-From-Location
+The from-location string to pass to the cover sheet program when
+auto-generating cover pages.
+.TP 16
+.B Cover-From-Voice
+The from-voice number string to pass to the cover sheet program when
+auto-generating cover pages.
+.TP 16
+.B Cover-From-Fax
+The from-fax number string to pass to the cover sheet program when
 auto-generating cover pages.
 .TP 16
 .B DateFormat
index 0d65095d79dcbb51d62b36eafce6161684f7c25d..9fc5d828ea66ec821389a16fc1e06bb58561f78d 100644 (file)
@@ -86,7 +86,7 @@ sendFaxApp::run(int argc, char** argv)
     int verbose = 0;
     SendFaxJob& proto = getProtoJob();
     db = new FaxDB(tildeExpand(dbName));
-    while ((c = Sys::getopt(argc, argv, "a:b:B:c:C:d:f:F:h:i:I:k:M:P:r:s:t:T:V:x:y:12lmnpvwDENR")) != -1)
+    while ((c = Sys::getopt(argc, argv, "a:b:B:c:C:d:f:F:h:i:I:k:M:P:r:s:t:T:U:V:W:x:X:y:Y:12lmnpvwDENR")) != -1)
     switch (c) {
     case '1':                  // restrict to 1D-encoded data
         proto.setDesiredDF(0);
@@ -172,6 +172,9 @@ sendFaxApp::run(int argc, char** argv)
     case 'T':                  // times to dial telephone
         proto.setMaxDials(atoi(optarg));
         break;
+    case 'U':                  // cover page: sender's voice number
+       proto.setCoverFromVoice(optarg);
+       break;
     case 'v':                  // verbose mode
         verbose++;
         setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
@@ -184,12 +187,21 @@ sendFaxApp::run(int argc, char** argv)
     case 'w':                  // wait for job to complete
         waitForJob = true;
         break;
+    case 'W':                  // cover page: sender's fax number
+       proto.setCoverFromFax(optarg);
+       break;
     case 'x':                  // cover page: to's company
         proto.setCoverCompany(optarg);
         break;
+    case 'X':                  // cover page: sender's company
+       proto.setCoverFromCompany(optarg);
+       break;
     case 'y':                  // cover page: to's location
         proto.setCoverLocation(optarg);
         break;
+    case 'Y':                  // cover page: sender's location
+       proto.setCoverFromLocation(optarg);
+       break;
     case '?':
         usage();
         /*NOTREACHED*/
index 7245faea96c71c71aafd6ccff9f2700a35d5299c..72422c5717a5f0d6a0900b38f64c23e0eae62941 100644 (file)
@@ -216,6 +216,10 @@ SendFaxClient::makeCoverPage(const SendFaxJob& job, fxStr& file, fxStr& emsg)
        addarg(av, ac, "-t", job.getCoverName());
        addarg(av, ac, "-v", job.getCoverVoiceNumber());
        addarg(av, ac, "-x", job.getCoverCompany());
+       addarg(av, ac, "-L", job.getCoverFromLocation());
+       addarg(av, ac, "-N", job.getCoverFromFax());
+       addarg(av, ac, "-V", job.getCoverFromVoice());
+       addarg(av, ac, "-X", job.getCoverFromCompany());
        fxStr pages;
        if (totalPages > 0) {
            pages = fxStr::format("%u", totalPages);
index b07eb36fb832d89655d49aba45818d00aa936d00..c049b8d9a7d52c04035c90020e20cdd8f615643c 100644 (file)
@@ -64,6 +64,10 @@ SendFaxJob::SendFaxJob(const SendFaxJob& other)
     , sendTime(other.sendTime)
     , tagline(other.tagline)
     , pageSize(other.pageSize)
+    , fromlocation(other.fromlocation)
+    , fromfax(other.fromfax)
+    , fromvoice(other.fromvoice)
+    , fromcompany(other.fromcompany)
 {
     notify = other.notify;
     autoCover = other.autoCover;
@@ -110,6 +114,10 @@ const SendFaxJob::SFJ_stringtag SendFaxJob::strings[] = {
 { "cover-company",     &SendFaxJob::company,           NULL },
 { "cover-location",    &SendFaxJob::location,          NULL },
 { "cover-voice",       &SendFaxJob::voicenumber,       NULL },
+{ "cover-from-location",       &SendFaxJob::fromlocation,      NULL },
+{ "cover-from-fax",    &SendFaxJob::fromfax,           NULL },
+{ "cover-from-voice",  &SendFaxJob::fromvoice,         NULL },
+{ "cover-from-company",        &SendFaxJob::fromcompany,       NULL },
 };
 const SendFaxJob::SFJ_numbertag SendFaxJob::numbers[] = {
 { "maxtries",          &SendFaxJob::maxRetries,        FAX_RETRIES },
@@ -299,6 +307,10 @@ void SendFaxJob::setCoverCompany(const char* s)            { company = s; }
 void SendFaxJob::setCoverComments(const char* s)       { comments = s; }
 void SendFaxJob::setCoverRegarding(const char* s)      { regarding = s; }
 void SendFaxJob::setCoverVoiceNumber(const char* s)    { voicenumber = s; }
+void SendFaxJob::setCoverFromLocation(const char* s)   { fromlocation = s; }
+void SendFaxJob::setCoverFromFax(const char* s)                { fromfax = s; }
+void SendFaxJob::setCoverFromVoice(const char* s)      { fromvoice = s; }
+void SendFaxJob::setCoverFromCompany(const char* s)    { fromcompany = s; }
 
 bool
 SendFaxJob::setPageSize(const char* name)
index ef222bfc6c7f54a8857cae2415acaa3aaf2ea89b..0a84073c5be840d246f785d2a3d9cf69da4860e5 100644 (file)
@@ -86,6 +86,10 @@ private:
     fxStr      company;                // rec. company identity for cover page
     fxStr      comments;               // comments for cover page
     fxStr      regarding;              // regarding info for cover page
+    fxStr      fromlocation;           // rec. from location for cover page
+    fxStr      fromfax;                // rec. from fax for cover page
+    fxStr      fromvoice;              // rec. from voice for cover page
+    fxStr      fromcompany;            // rec. from company for cover page
 
     bool       sendTagLine;            // if true, use custom tagline format
     fxStr      killTime;               // job's time to be killed
@@ -202,6 +206,14 @@ public:
     const fxStr& getCoverComments() const;
     void setCoverVoiceNumber(const char*);// receipient's voice number
     const fxStr& getCoverVoiceNumber() const;
+    void setCoverFromLocation(const char*);// sender's location
+    const fxStr& getCoverFromLocation() const;
+    void setCoverFromFax(const char*); // sender's fax number
+    const fxStr& getCoverFromFax() const;
+    void setCoverFromVoice(const char*);// sender's voice number
+    const fxStr& getCoverFromVoice() const;
+    void setCoverFromCompany(const char*);// sender's company
+    const fxStr& getCoverFromCompany() const;
     u_int getTotalPages() const;       // counted pages (for cover sheet)
 
     /*
@@ -275,6 +287,10 @@ inline const fxStr& SendFaxJob::getCoverCompany() const    { return company; }
 inline const fxStr& SendFaxJob::getCoverRegarding() const{ return regarding; }
 inline const fxStr& SendFaxJob::getCoverComments() const{ return comments; }
 inline const fxStr& SendFaxJob::getCoverVoiceNumber() const{ return voicenumber; }
+inline const fxStr& SendFaxJob::getCoverFromLocation() const{ return fromlocation; }
+inline const fxStr& SendFaxJob::getCoverFromFax() const        { return fromfax; }
+inline const fxStr& SendFaxJob::getCoverFromVoice() const{ return fromvoice; }
+inline const fxStr& SendFaxJob::getCoverFromCompany() const{ return fromcompany; }
 inline float SendFaxJob::getPageWidth() const          { return pageWidth; }
 inline float SendFaxJob::getPageLength() const         { return pageLength; }
 inline const fxStr& SendFaxJob::getPageSize() const    { return pageSize; }