From: Lee Howard Date: Thu, 5 May 2005 00:41:36 +0000 (+0000) Subject: Bug 648: add remoteNSF, remoteDIS to info files and add X-Git-Tag: HYLAFAX-4_2_2BETA1~34 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=c351d7d72a9c4e9ee73a365c8fb6faf17af8d92a;p=thirdparty%2FHylaFAX.git Bug 648: add remoteNSF, remoteDIS to info files and add NSF and CSI to notify mail --- diff --git a/CHANGES b/CHANGES index 835eb4ec..e7403d83 100644 --- 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) diff --git a/faxd/FaxMachineInfo.c++ b/faxd/FaxMachineInfo.c++ index d6a94c9d..b9dad7b7 100644 --- a/faxd/FaxMachineInfo.c++ +++ b/faxd/FaxMachineInfo.c++ @@ -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); diff --git a/faxd/FaxMachineInfo.h b/faxd/FaxMachineInfo.h index 93a87705..475a3d39 100644 --- a/faxd/FaxMachineInfo.h +++ b/faxd/FaxMachineInfo.h @@ -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; } diff --git a/faxd/FaxRequest.c++ b/faxd/FaxRequest.c++ index da18359f..35873a21 100644 --- a/faxd/FaxRequest.c++ +++ b/faxd/FaxRequest.c++ @@ -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: /* diff --git a/faxd/FaxRequest.h b/faxd/FaxRequest.h index 1122c82a..ca014cde 100644 --- a/faxd/FaxRequest.h +++ b/faxd/FaxRequest.h @@ -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 diff --git a/faxd/FaxSend.c++ b/faxd/FaxSend.c++ index 60f8a394..2d8102a1 100644 --- a/faxd/FaxSend.c++ +++ b/faxd/FaxSend.c++ @@ -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(""); (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); diff --git a/faxd/mkhash.c b/faxd/mkhash.c index 442b47b1..0a8198fa 100644 --- a/faxd/mkhash.c +++ b/faxd/mkhash.c @@ -139,6 +139,8 @@ main() hash("notify"); hash("pagechop"); hash("chopthreshold"); + hash("csi"); + hash("nsf"); hash("status"); hash("returned"); hash("doneop"); diff --git a/man/hylafax-info.4f b/man/hylafax-info.4f index 725ae547..1738ff4e 100644 --- a/man/hylafax-info.4f +++ b/man/hylafax-info.4f @@ -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) diff --git a/util/notify.sh.in b/util/notify.sh.in index 56d7866b..c943bf83 100644 --- a/util/notify.sh.in +++ b/util/notify.sh.in @@ -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