]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 648: add remoteNSF, remoteDIS to info files and add
authorLee Howard <faxguy@howardsilvan.com>
Thu, 5 May 2005 00:41:36 +0000 (00:41 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Thu, 5 May 2005 00:41:36 +0000 (00:41 +0000)
         NSF and CSI to notify mail

CHANGES
faxd/FaxMachineInfo.c++
faxd/FaxMachineInfo.h
faxd/FaxRequest.c++
faxd/FaxRequest.h
faxd/FaxSend.c++
faxd/mkhash.c
man/hylafax-info.4f
util/notify.sh.in

diff --git a/CHANGES b/CHANGES
index 835eb4ec475a7f023b5c65bc18198039570520a2..e7403d83fb2f46ccfc06de6b1e1d21745c9a8628 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
 
 Changelog for HylaFAX
 
+* add remoteNSF, remoteDIS to info files and return
+  CSI and interpreted NSF with notify information (4 May 2005)
 * improved disconnection detection (25, 26 Apr 2005)
 * wait longer for partial-page signals (19 Apr 2005)
 * adjust the timing of input buffering enabling (15 Apr 2005)
index d6a94c9dbce4744aab990acb5e4e578cafcf84ac..b9dad7b777e395b6704fc61ee5f20148fe082996 100644 (file)
@@ -44,6 +44,8 @@ FaxMachineInfo::FaxMachineInfo(const FaxMachineInfo& other)
     : FaxConfig(other)
     , file(other.file)
     , csi(other.csi)
+    , nsf(other.nsf)
+    , dis(other.dis)
     , lastSendFailure(other.lastSendFailure)
     , lastDialFailure(other.lastDialFailure)
     , pagerPassword(other.pagerPassword)
@@ -219,6 +221,10 @@ FaxMachineInfo::setConfigItem(const char* tag, const char* value)
        dialFailures = getNumber(value);
     } else if (streq(tag, "remotecsi")) {
        csi = value;
+    } else if (streq(tag, "remotensf")) {
+       nsf = value;
+    } else if (streq(tag, "remotedis")) {
+       dis = value;
     } else if (streq(tag, "lastsendfailure")) {
        lastSendFailure = value;
     } else if (streq(tag, "lastdialfailure")) {
@@ -296,6 +302,10 @@ FaxMachineInfo::setCalledBefore(bool b)
 
 void FaxMachineInfo::setCSI(const fxStr& v)
     { checkChanged(csi, v); }
+void FaxMachineInfo::setNSF(const fxStr& v)
+    { checkChanged(nsf, v); }
+void FaxMachineInfo::setDIS(const fxStr& v)
+    { checkChanged(dis, v); }
 void FaxMachineInfo::setLastSendFailure(const fxStr& v)
     { checkChanged(lastSendFailure, v); }
 void FaxMachineInfo::setLastDialFailure(const fxStr& v)
@@ -374,6 +384,8 @@ FaxMachineInfo::writeConfig(fxStackBuffer& buf)
     putString(buf, "minScanlineTime", isLocked(ST),
        stnames[fxmin(minScanlineTime, ST_40MS)]);
     putString(buf, "remoteCSI", false, csi);
+    putString(buf, "remoteNSF", false, nsf);
+    putString(buf, "remoteDIS", false, dis);
     putDecimal(buf, "sendFailures", false, sendFailures);
     putIfString(buf, "lastSendFailure", false, lastSendFailure);
     putDecimal(buf, "dialFailures", false, dialFailures);
index 93a877052ff28d3d01fb2c772d52ddf1f67d9cf4..475a3d395da75bc9591ec1a46493620c82348d39 100644 (file)
@@ -61,6 +61,8 @@ private:
     u_short            maxSignallingRate;      // max capable signalling rate
     u_short            minScanlineTime;        // min scanline time capable
     fxStr      csi;                    // last received CSI
+    fxStr      nsf;                    // last received NSF
+    fxStr      dis;                    // last received DIS
     int                sendFailures;           // count of failed send attempts
     int                dialFailures;           // count of failed dial attempts
     fxStr      lastSendFailure;        // reason for last failed send attempt
@@ -103,6 +105,8 @@ public:
     u_short getMaxSignallingRate() const;
     u_short getMinScanlineTime() const;
     const fxStr& getCSI() const;
+    const fxStr& getNSF() const;
+    const fxStr& getDIS() const;
 
     int getSendFailures() const;
     int getDialFailures() const;
@@ -121,6 +125,8 @@ public:
     void setMaxSignallingRate(int);
     void setMinScanlineTime(int);
     void setCSI(const fxStr&);
+    void setNSF(const fxStr&);
+    void setDIS(const fxStr&);
 
     void setSendFailures(int);
     void setDialFailures(int);
@@ -159,6 +165,10 @@ inline u_short FaxMachineInfo::getMinScanlineTime() const
     { return minScanlineTime; }
 inline const fxStr& FaxMachineInfo::getCSI() const
     { return csi; }
+inline const fxStr& FaxMachineInfo::getNSF() const
+    { return nsf; }
+inline const fxStr& FaxMachineInfo::getDIS() const
+    { return dis; }
 
 inline int FaxMachineInfo::getSendFailures() const
     { return sendFailures; }
index da18359f74269ee7650504d1a805a9c6af1af2ad..35873a219740185cc7c3a8f9ac1d0b471c7bf6d2 100644 (file)
@@ -71,6 +71,8 @@ FaxRequest::reset(void)
     usexvres = false;
     pagechop = chop_default;
     chopthreshold = -1;
+    csi = fxStr::null;
+    nsf = fxStr::null;
     notify = no_notice;
     jobtype = "facsimile";             // for compatibility w/ old clients
     writeQFilePid = 0;
@@ -114,6 +116,8 @@ FaxRequest::stringval FaxRequest::strvals[] = {
     { "passwd",                &FaxRequest::passwd },
     { "doneop",                &FaxRequest::doneop },
     { "commid",                &FaxRequest::commid },
+    { "csi",           &FaxRequest::csi },
+    { "nsf",           &FaxRequest::nsf },
 };
 FaxRequest::shortval FaxRequest::shortvals[] = {
     { "state",         &FaxRequest::state },
@@ -327,6 +331,8 @@ FaxRequest::readQFile(bool& rejectJob)
        case H_NOTIFY:          checkNotifyValue(tag); break;
        case H_PAGECHOP:        checkChopValue(tag); break;
        case H_CHOPTHRESHOLD:   chopthreshold = atof(tag); break;
+       case H_CSI:             csi = tag; break;
+       case H_NSF:             nsf = tag; break;
        case H_DONEOP:          doneop = tag; break;
        case H_STATUS:
            /*
index 1122c82a895d2d046030515d9987f51930a4da79..ca014cde2c2401538e5f5975a3e45ae5c4a496c9 100644 (file)
@@ -161,6 +161,8 @@ public:
     fxStr      jobtype;        // job type for selecting send command
     fxStr      tagline;        // tag line format
     fxStr      doneop;         // operation to do when job completes
+    fxStr      csi;            // CSI string from receiving equipment (ASCII representation)
+    fxStr      nsf;            // NSF string from receiving equipment (ASCII representation)
     pid_t      writeQFilePid;  // pid of last writeQFile operation
     FaxItemArray items;        // set of requests
 
index 60f8a39408428cbbc8eeba50f65186b244cbffe3..2d8102a1d57f8dc4212adc328591d1e3fab2cea1 100644 (file)
@@ -222,9 +222,23 @@ FaxServer::sendFax(FaxRequest& fax, FaxMachineInfo& clientInfo, const fxStr& num
        if (status != send_ok) {
            sendFailed(fax, status, notice, requeueProto);
        } else {
+           // CSI
            fxStr csi("<UNSPECIFIED>");
            (void) modem->getSendCSI(csi);
            clientInfo.setCSI(csi);                     // record remote CSI
+           fax.csi = csi;                              // store in queue file also for notify
+
+           // NSF
+           NSF nsf;
+           (void) modem->getSendNSF(nsf);
+           clientInfo.setNSF(nsf.getHexNsf());         // record remote NSF
+           fax.nsf = fxStr::format("Equipment:%s %s:Station:%s", nsf.getVendor(), nsf.getModel(), nsf.getStationId());
+
+           // DIS
+           fxStr clientdis;
+           clientCapabilities.asciiEncode(clientdis);
+           clientInfo.setDIS(clientdis);
+
            if (!sendClientCapabilitiesOK(fax, clientInfo, notice)) {
                // NB: mark job completed 'cuz there's no way recover
                sendFailed(fax, send_failed, notice);
index 442b47b15cbdc15390a10fa6cdef5842b42993d8..0a8198faee2ffc191fe893c70ad50d411f31effc 100644 (file)
@@ -139,6 +139,8 @@ main()
     hash("notify");
     hash("pagechop");
     hash("chopthreshold");
+    hash("csi");
+    hash("nsf");
     hash("status");
     hash("returned");
     hash("doneop");
index 725ae5474de89684d1c540ea48913e13cc417c72..1738ff4ef88f66371c7e59bf2798423ec285e922 100644 (file)
@@ -80,6 +80,8 @@ pagerTTYParity        string  parity & # bits configuration for IXO/TAP communication
 pageSource     string  parameter to tell the paging central who we are
 pagingProtocol string  protocol (IXO or UCP) for this provider
 remoteCSI      string  remote device Called Subscriber Identification
+remoteNSF      string  remote equipment Non-Standard Facilities information
+remoteDIS      string  remote Digital Identification Signal: capabilities
 sendFailures   number  count of consecutive failed send attempts
 supportsBatching       boolean accepts batching protocol
 supportsHighRes        boolean accepts 196 line/inch images (obsolete)
index 56d7866ba11a6ccc1209b36c60a6076faf151622..c943bf83e1634f6023c241fb93466d40b7e8f66a 100644 (file)
@@ -187,7 +187,13 @@ parseQfile()
         doneop = "default";
         pagernum = "unknown";
         commid = "";
+       csi = "";
+       equipment = "";
+       station = "";
     }
+    /^csi/     { p("csi",$2); }
+    /^nsf/     { p("equipment",$3); }
+    /^nsf/     { p("station",$5); }
     /^jobid/    { p("jobid",$2); }
     /^groupid/    { p("groupid", $2); }
     /^state/    { p("state", $2+0); }  
@@ -471,7 +477,7 @@ printItem()
     FMT="$1"
     TAG="$2"
     VALUE="$3"
-    printf "%14s: $FMT\n" "$TAG" "$VALUE"
+    printf "%16s: $FMT\n" "$TAG" "$VALUE"
 }
 
 
@@ -694,6 +700,7 @@ if [ "$WHY" = "done" ] ; then
     echo "";
     if [ "$jobtype" = "facsimile" ] ; then
         printItem "%u" "Pages" "$npages"
+        printItem "%s" "Receiver" "$csi"
         if [ "$RETURNTECHINFO" = "yes" ] ; then
             if [ "$resolution" = "196" ] ; then 
                 printItem "%s" "Quality" "Fine"
@@ -704,6 +711,8 @@ if [ "$WHY" = "done" ] ; then
             printItem "%.0f (mm)" "Page Length" "$pagelength"
             printItem "%s" "Signal Rate" "$signalrate"
             printItem "%s" "Data Format" "$dataformat"
+            printItem "%s" "Remote Equipment" "$equipment"
+            printItem "%s" "Remote Station" "$station"
         fi
     fi
     if [ "$RETURNTECHINFO" = "yes" ] ; then