to V.34-Fax also.
tracePPR("RECV send", FCF_PPR);
pprcnt++;
- if (pprcnt == 4) {
+ if (pprcnt == 4 && (!useV34 || !conf.class1PersistentECM)) {
// expect sender to send CTC/EOR after every fourth PPR, not just the fourth
protoTrace("RECV sent fourth PPR");
pprcnt = 0;
}
} while (!gotppr);
}
+ bool doctceor;
switch (pprframe.getFCF()) {
case FCF_MCF:
case FCF_PIP:
+ hadV34Trouble = false;
blockgood = true;
signalRcvd = pprframe.getFCF();
break;
}
}
}
- if (useV34 && badframes && badframes >= (badframesbefore / 2) && pprcnt < 4) {
- /*
- * With V.34-Fax we cannot send CTC, but we can request
- * to renegotiate the primary rate any time. (T.31-A1 B.8.5)
- * In practice, if we do not constrain the rate then
- * we may likely speed up the rate; so we constrain it.
- */
- renegotiatePrimary(true); // constrain
+ doctceor = (pprcnt == 4);
+ /*
+ * T.30 Annex F prohibits CTC in V.34-Fax. Per the spec our options
+ * are to do EOR or DCN. However, many receivers will allow us to
+ * simply continue sending image blocks followed by PPS. Coupled with
+ * primary rate negotiations, this becomes a better-than-CTC solution.
+ * Do this up to 12 attempts and only when something has gotten through.
+ */
+ if (useV34) {
+ if (pprcnt >= 4 && badframes) hadV34Trouble = true; // problematic V.34?
+ if (pprcnt == 8) doctceor = true;
+ if (conf.class1PersistentECM && badframes && badframes != frameNumber) doctceor = false;
+ if (pprcnt == 12) doctceor = true;
+ if (!doctceor && badframes && badframes >= (badframesbefore / 2)) {
+ /*
+ * Request to renegotiate the primary rate. (T.31-A1 B.8.5)
+ * In practice, if we do not constrain the rate then
+ * we may likely speed up the rate; so we constrain it.
+ */
+ renegotiatePrimary(true); // constrain
+ }
}
- if (pprcnt == 4) {
+ if (doctceor) {
pprcnt = 0;
// Some receivers will ignorantly transmit PPR showing all frames good,
// so if that's the case then do EOR instead of CTC.
if (badframes == 0) {
+ hadV34Trouble = false;
blockgood = true;
signalRcvd = FCF_MCF;
}
// There is no CTC with V.34-fax (T.30 Annex F.3.4.5 Note 1).
- if (conf.class1ECMDoCTC && !useV34 && (blockgood == false) &&
+ if (conf.class1PersistentECM && !useV34 && (blockgood == false) &&
!((curcap->br == 0) && (badframes >= badframesbefore))) {
// send ctc even at 2400 baud if we're getting somewhere
if (curcap->br != 0) {
* disabling MMR to this destination would be advisable.
*/
if (blockgood == false && params.df == DF_2DMMR) {
- if (useV34) {
- // not using CTC seems to be a problem
- hadV34Trouble = true;
- }
emsg = "Failure to transmit clean MMR image data.";
protoTrace(emsg);
return (false);
class2UseLineCount = false; // don't trust firmware decoders
class1ECMSupport = true; // support for ECM
class1ExtendedRes = true; // support for extended resolutions
- class1ECMDoCTC = true; // continue to correct through all bitrates
+ class1PersistentECM = true; // continue to correct
class1TCFRecvHack = false; // historical behavior
class1ValidateV21Frames = false; // assume the modem does this
setVolumeCmds("ATM0 ATL0M1 ATL1M1 ATL2M1 ATL3M1");
class2SendRTC = getBoolean(value);
else if (streq(tag, "class1ecmsupport"))
class1ECMSupport = getBoolean(value);
- else if (streq(tag, "class1ecmdoctc"))
- class1ECMDoCTC = getBoolean(value);
+ else if (streq(tag, "class1persistentecm"))
+ class1PersistentECM = getBoolean(value);
else if (streq(tag, "class1extendedres"))
class1ExtendedRes = getBoolean(value);
else if (streq(tag, "class1tcfrecvhack"))
u_int class1TMConnectDelay; // delay (ms) after +FTM CONNECT
u_int class1ECMFrameSize; // ECM frame size for transmission
bool class1ECMSupport; // support T.30-A ECM
- bool class1ECMDoCTC; // continue to correct
+ bool class1PersistentECM; // continue to correct
bool class1ExtendedRes; // support for extended resolutions
bool class1TCFRecvHack; // deliberately look for V.21 disconnect
bool class1ValidateV21Frames;// check received FCS values in V.21
Class1Cmd string \s-1AT+FCLASS=1.0\s+1 Class 1.0: command to enter class 1
Class1EnableV34Cmd string \- Class 1/1.0: command to enable V.34-fax support
Class1ECMSupport boolean \s-1Yes\s+1 Class 1/1.0: enable T.30-A ECM support
-Class1ECMDoCTC boolean \s-1Yes\s+1 Class 1/1.0: to perform CTC in ECM protocol
+Class1PersistentECM boolean \s-1Yes\s+1 Class 1/1.0: to continue to correct while in ECM
Class1ECMFrameSize integer \s-1256\s+1 Class 1/1.0: image frame size in ECM protocol
Class1ExtendedRes boolean \s-1Yes\s+1 Class 1/1.0: enable extended resolution support
Class1HFLOCmd string \- Class 1/1.0: command to set hardware flow control
Whether or not to support T.30-A error correction protocol. Use of
ECM will require 64 kilobytes of free memory per modem in active use.
.TP
-.B Class1ECMDoCTC
-Whether or not to continue to retransmit image data in ECM protocol
-at a lower bitrate which is not accepted as valid after four successive
-attempts at the current bitrate.
+.B Class1PersistentECM
+Whether or not to continue to retransmit and allow to continue to
+receive image data in ECM protocol
+which is not accepted as valid after four successive attempts.
.TP
.B Class1ECMFrameSize
The size in bytes of image frames to transmit during ECM protocol.