]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 663: various session logging improvements
authorLee Howard <faxguy@howardsilvan.com>
Tue, 27 Sep 2005 18:26:43 +0000 (18:26 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Tue, 27 Sep 2005 18:26:43 +0000 (18:26 +0000)
CHANGES
faxd/Class1.c++
faxd/Class1.h
faxd/Class1Send.c++
faxd/FaxModem.c++
faxd/FaxModem.h
faxd/FaxSend.c++
faxd/FaxTrace.h
faxd/faxGettyApp.c++
man/hylafax-config.4f

diff --git a/CHANGES b/CHANGES
index 0012fa2a2151c8c7b20af01235eb6615854cc31a..3386e4bce7d925d700b807bc88f17916d616aa18 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog for HylaFAX
 
+* session logging improvements (27 Sep 2005)
 * add Retransmit-Ignore RTNHandlingMethod (27 Sep 2005)
 
 Changelog for HylaFAX 4.2.2
index 21b71ba7e3ce277c1beabd04e162421c2d6b78b6..51b9f56b19d505b23f7598216aa37ba2984b9845 100644 (file)
@@ -903,7 +903,7 @@ Class1Modem::recvECMFrame(HDLCFrame& frame)
                        break;
                    case ETX:
                        if (frame.getLength() > 0)
-                           traceHDLCFrame("-->", frame);
+                           traceHDLCFrame("-->", frame, true);
                        if (frame.getLength() < 5) {            // RCP frame size
                            protoTrace("HDLC frame too short (%u bytes)", frame.getLength());
                            return (false);
@@ -1008,7 +1008,7 @@ Class1Modem::recvECMFrame(HDLCFrame& frame)
     bit = getModemBit(0);                      // trailing bit on flag
     if (!rcpframe) {
        if (frame.getLength() > 0)
-           traceHDLCFrame("-->", frame);
+           traceHDLCFrame("-->", frame, true);
        if (bit) {                              // should have been zero
            protoTrace("Bad HDLC terminating flag received.");
            return (false);
@@ -1065,10 +1065,13 @@ Class1Modem::endECMBlock()
  * Log an HLDC frame along with a time stamp (secs.10ms).
  */
 void
-Class1Modem::traceHDLCFrame(const char* direction, const HDLCFrame& frame)
+Class1Modem::traceHDLCFrame(const char* direction, const HDLCFrame& frame, bool isecm)
 {
-    if (!getHDLCTracing())
-       return;
+    if (!isecm) {
+       if (!getHDLCTracing()) return;
+    } else {
+       if (!getECMTracing()) return;
+    }
     const char* hexdigits = "0123456789ABCDEF";
     fxStackBuffer buf;
     for (u_int i = 0; i < frame.getLength(); i++) {
index 900df1612990df15c59e45e15ed4b7fe03603ef7..7116c81325287d43e8046cdd7829bc4e3c105b5f 100644 (file)
@@ -189,7 +189,7 @@ protected:
     bool       blockFrame(const u_char* bitrev, bool lastframe, u_int ppmcmd, fxStr& emsg);
     bool       endECMBlock();
     void       abortReceive();
-    void       traceHDLCFrame(const char* direction, const HDLCFrame& frame);
+    void       traceHDLCFrame(const char* direction, const HDLCFrame& frame, bool isecm = false);
 // class 1 command support routines
     bool       class1Query(const fxStr& queryCmd, Class1Cap caps[]);
     bool       parseQuery(const char*, Class1Cap caps[]);
index 2b233c914e58f52a994698120fd85186f5c45baa..c06c9241cd3f5d6d69f45051e29b8f89304ff28a 100644 (file)
@@ -981,7 +981,7 @@ Class1Modem::blockFrame(const u_char* bitrev, bool lastframe, u_int ppmcmd, fxSt
                    ecmframe.put(fcs1); ecmframe.put(fcs2);
                    blockData(fcs1, false);
                    blockData(fcs2, false);
-                   traceHDLCFrame("<--", ecmframe);
+                   traceHDLCFrame("<--", ecmframe, true);
                    protoTrace("SEND send frame number %u", fnum);
 
                    if (!useV34) {
@@ -1006,7 +1006,7 @@ Class1Modem::blockFrame(const u_char* bitrev, bool lastframe, u_int ppmcmd, fxSt
                    blockData(firstframe[i], false);
                }
                ecmframe.put(firstframe, (frameSize + 6));
-               traceHDLCFrame("<--", ecmframe);
+               traceHDLCFrame("<--", ecmframe, true);
                protoTrace("SEND send frame number %u", frameRev[firstframe[3]]);
                if (!useV34) blockData(0x7e, true);
            }
@@ -1016,7 +1016,7 @@ Class1Modem::blockFrame(const u_char* bitrev, bool lastframe, u_int ppmcmd, fxSt
            for (u_short k = 0; k < 3; k++) {           // three RCP frames
                for (u_short j = 0; j < 5; j++)
                    blockData(rcpframe[j], false);
-               traceHDLCFrame("<--", rcpframe);
+               traceHDLCFrame("<--", rcpframe, true);
 
                // separate frames with a 0x7e flag
                if (!useV34) blockData(0x7e, true);
index 36042e71e286f77f9dc4889c7f5142eafe721601..44e0593854cfafdbb26f42e30f82b3973cbe1428 100644 (file)
@@ -655,6 +655,8 @@ bool FaxModem::isFaxModem() const           { return true; }
 
 bool FaxModem::getHDLCTracing()
     { return (server.getSessionTracing() & FAXTRACE_HDLC) != 0; }
+bool FaxModem::getECMTracing()
+    { return (server.getSessionTracing() & FAXTRACE_ECM) != 0; }
 
 FaxSendStatus
 FaxModem::sendSetupParams(TIFF* tif, Class2Params& params,
index 768b56a01abc76b13b21c1bb945f33d4b208fa5b..7744d510f4e81ec96d25b898576db42d4e6a6f4c 100644 (file)
@@ -120,6 +120,7 @@ protected:
     void       tracePPM(const char* dir, u_int ppm);
 // server-related stuff
     bool       getHDLCTracing();
+    bool       getECMTracing();
     FaxSendStatus sendSetupParams(TIFF*, Class2Params&,
                    FaxMachineInfo&, fxStr&);
     void       recvTSI(const fxStr&);
index 1b3b0f9189f6565e463ff58167fff178205640c4..a9ebdd305d48a785e34f0f9507db58d16d8f6f52 100644 (file)
@@ -61,11 +61,14 @@ FaxServer::sendFax(FaxRequest& fax, FaxMachineInfo& clientInfo, FaxAcctInfo& ai,
            }
         }
        fax.commid = getCommID();               // set by beginSession
-       traceServer("SEND FAX: JOB %s DEST %s COMMID %s DEVICE '%s'"
+       traceServer("SEND FAX: JOB %s DEST %s COMMID %s DEVICE '%s' FROM '%s <%s>' USER %s"
            , (const char*) fax.jobid
            , (const char*) fax.external
            , (const char*) fax.commid
            , (const char*) getModemDevice()
+           , (const char*) fax.sender
+           , (const char*) fax.mailaddr
+           , (const char*) fax.owner
        );
 
        /* Dispatcher already did setupModem() */
index 497298840c749e85d78d9b82bb6f615646007f4f..e7cbdb2e1d9ea8a37994b5a44f6b5109cbbd54aa 100644 (file)
@@ -47,6 +47,7 @@ const int FAXTRACE_MODEMSTATE = 0x08000;      // modem state changes
 const int FAXTRACE_DIALRULES   = 0x10000;      // dialstring processing
 const int FAXTRACE_DOCREFS     = 0x20000;      // document reference handling
 const int FAXTRACE_TIFF                = 0x40000;      // TIFF library msgs
+const int FAXTRACE_ECM         = 0x80000;      // ECM HDLC image data frames
 const int FAXTRACE_ANY         = 0xffffffff;
 
 const int FAXTRACE_MASK                = 0xfffff;
index dbbfee4bf00613ccc86c98f0a8497b60217a075a..0decb68c7c1f0f8de188d1f45da91b968dc90665 100644 (file)
@@ -339,10 +339,12 @@ faxGettyApp::answerPhone(AnswerType atype, CallType ctype, const CallID& callid,
        callResolved = false;
        advanceRotary = false;
     } else {
+       fxStr callid_formatted = "";
+       for (u_int i = 0; i < callid.size(); i++)
+           callid_formatted.append(quote | callid.id(i) | enquote);
+       if (callid_formatted.length()) traceProtocol("CallID:%s", (const char*) callid_formatted);
        if (dynamicConfig.length()) {
-           fxStr cmd(dynamicConfig | quote | getModemDevice() | enquote);
-           for (u_int i = 0; i < callid.size(); i++)
-               cmd.append(quote | callid.id(i) | enquote);
+           fxStr cmd(dynamicConfig | quote | getModemDevice() | enquote | callid_formatted);
            fxStr localid = "";
            int pipefd[2], idlength, status;
            char line[1024];
index 2afe36f5b56b5065506758db1f0db7becb465ad6..331f38c83f5e79f7c4ce74178f8cd800d9b5140b 100644 (file)
@@ -1407,6 +1407,8 @@ form the value for this tag.
 32768 (0x08000)        Modem State Transitions modem state changes (down, busy, ready)
 65536 (0x10000)        Dial Rules      dialstring rules parsing and execution
 131072 (0x20000)       Docq Changes    document reference handling
+262144 (0x40000)       TIFF library    any messages produced by the TIFF library
+524288 (0x80000)       ECM Frames      binary \s-1T.30-A HDLC\s+1 ECM frames
 .sp .5
 .fi
 For example, to enable tracing of server operations and