Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Re: [hylafax-users] Custom AT commands for setting fax speed
On 2003.10.14 20:12 ahuxtable@xxxxxxxxxxx wrote:
Hi, I have an issue where I need to be able to use a custom AT command
for
setting the fax transmission speed. Is this possible?
I am having problems with my Diamond 56k modems, they do not seem to
fully
support V.29 faxing. I can tell it to use v.17 but only at each
transmission speed and not as a general setting.
This is done by the following commands:
+FTM=73 V.17, 7200bps
+FTM=74 V.17 (short train), 7200bps
+FTM=97 V.17, 9600bps
+FTM=98 V.17 (short train), 9600bps
+FTM=121 V.17, 12000bps
+FTM=122 V.17 (short train), 12000bps
+FTM=145 V.17, 14400bps
+FTM=146 V.17 (short train), 14400bps
So - What I want to be able to do is (when sending a fax) if the modem
negotiates 9600 speed issue the command at+ftm=97 etc. Is there
anyway/anywhere that this can be done?
When negotiating data signalling rates, both speed *and* protocol are
negotiated together. So if the receiver supports a maximum speed of
9600 baud, that indicates that it does not support V.17 or V.33, and
therefore V.17 cannot be used.
When a fax sender connects with a fax receiver the receiver initially
transmits its capabilities to the sender in the DIS signal. With
respect to the data signalling rates, the DIS signal contains
information about the protocol and *not* about the speed. Thus a
receiver may say it supports one of
V.27 ter
V.29
V.27 ter and V.29
V.27 ter, V.29, and V.33
V.27 ter, V.29, V.33, and V.17
So... if the remote supports V.17 then the system will attempt to train
at 14400 bps and it will only initially attempt to train at 9600 baud
when the remote does not support V.17 or V.33. So using V.17 in lieu
of V.29 is not an option.
If your modem reports V.29 support (AT+FTM=? response includes 72 and
96) but the support is faulty then you're in bad shape as a receiver,
because, as you can see from the list above, V.29 support is an implied
prerequisite to V.17 and V.33 support, therefore you'll be limited to
V.27 ter (4800 bps in theory but 2400 bps as tested - some bug is in
faxgetty somewhere, most certainly) for receiving. Fortunately, as a
sender, HylaFAX controls the negotiation in order to make "skipping"
V.29 negotiations possible while still utilizing V.17.
HylaFAX simplifies bitrates by "mapping" speeds against protocols.
Thus in sending V.29 is always used for 9600 bps and 7200 bps, but not
V.17, and V.33 is never used at all. In other words, you must disable
all 9600 bps (including V.17) and 7200 bps (including V.17). If
HylaFAX sees your modem supporting *any* 9600 or 7200 baud setting,
then it will assume that your modem supports V.29. (This is a safe
assumption if you don't consider broken modems.)
The attached patch implements the Class1TMQueryCmd and Class1RMQueryCmd
configuration options. By default they are "AT+FTM=?" and "AT+FRM=?"
respectively, but you can "force" the response (without querying the
modem) like this:
Class1TMQueryCmd: "!3,24,48,121,122,145,146"
Class1RMQueryCmd: "!3,24,48,121,122,145,146"
which would disable HylaFAX from using V.29 support in your modem (by
disabling every instance of 9600 and 7200 bps). This will allow
HylaFAX to send faxes at 14400 (V.17), 12000 (V.17), 4800 (V.27 ter),
and 2400 (V.27 ter) baud. I haven't tested this, but I believe that
fallbacks will go from 12000 to 4800 bps (which generally won't be a
very bad thing, anyway, since you'd likely reach V.27 ter later in the
same call).
Let me know how you fare.
Lee. (who apparently needed a distraction tonight)
diff -Nru hylafax.orig/faxd/Class1.c++ hylafax/faxd/Class1.c++
--- hylafax.orig/faxd/Class1.c++ Mon Oct 13 16:35:32 2003
+++ hylafax/faxd/Class1.c++ Tue Oct 14 21:15:43 2003
@@ -127,7 +127,7 @@
* rate, data formatting capabilities, etc. for use in
* T.30 negotiations.
*/
- if (!class1Query("AT+FTM=?", xmitCaps)) {
+ if (!class1Query(conf.class1TMQueryCmd, xmitCaps)) {
serverTrace("Error parsing \"+FTM\" query response: \"%s\"", rbuf);
return (false);
}
@@ -153,7 +153,7 @@
* transmit capabilities because we need to know more
* than the signalling rate to formulate the DIS.
*/
- if (!class1Query("AT+FRM=?", recvCaps)) {
+ if (!class1Query(conf.class1RMQueryCmd, recvCaps)) {
serverTrace("Error parsing \"+FRM\" query response: \"%s\"", rbuf);
return (false);
}
@@ -1017,13 +1017,16 @@
}
/*
- * Send <what>=? and get a range response.
+ * Send queryCmd and get a range response.
*/
bool
-Class1Modem::class1Query(const char* what, Class1Cap caps[])
+Class1Modem::class1Query(const fxStr& queryCmd, Class1Cap caps[])
{
char response[1024];
- if (atCmd(what, AT_NOTHING) && atResponse(response) == AT_OTHER) {
+ if (queryCmd[0] == '!') {
+ return (parseQuery(queryCmd.tail(queryCmd.length()-1), caps));
+ }
+ if (atCmd(queryCmd, AT_NOTHING) && atResponse(response) == AT_OTHER) {
sync(5000);
return (parseQuery(response, caps));
}
diff -Nru hylafax.orig/faxd/Class1.h hylafax/faxd/Class1.h
--- hylafax.orig/faxd/Class1.h Mon Oct 13 16:35:32 2003
+++ hylafax/faxd/Class1.h Tue Oct 14 21:10:49 2003
@@ -169,7 +169,7 @@
void abortReceive();
void traceHDLCFrame(const char* direction, const HDLCFrame& frame);
// class 1 command support routines
- bool class1Query(const char* what, Class1Cap caps[]);
+ bool class1Query(const fxStr& queryCmd, Class1Cap caps[]);
bool parseQuery(const char*, Class1Cap caps[]);
public:
Class1Modem(FaxServer&, const ModemConfig&);
diff -Nru hylafax.orig/faxd/ModemConfig.c++ hylafax/faxd/ModemConfig.c++
--- hylafax.orig/faxd/ModemConfig.c++ Mon Oct 13 16:35:32 2003
+++ hylafax/faxd/ModemConfig.c++ Tue Oct 14 21:17:51 2003
@@ -109,7 +109,9 @@
{ "class1hflocmd", &ModemConfig::class1HFLOCmd },
{ "class1ppmwaitcmd", &ModemConfig::class1PPMWaitCmd, "AT+FTS=7" },
{ "class1responsewaitcmd", &ModemConfig::class1ResponseWaitCmd, "" },
+{ "class1rmquerycmd", &ModemConfig::class1RMQueryCmd, "AT+FRM=?" },
{ "class1tcfwaitcmd", &ModemConfig::class1TCFWaitCmd, "AT+FTS=7" },
+{ "class1tmquerycmd", &ModemConfig::class1TMQueryCmd, "AT+FTM=?" },
{ "class1eopwaitcmd", &ModemConfig::class1EOPWaitCmd, "AT+FTS=9" },
{ "class1msgrecvhackcmd", &ModemConfig::class1MsgRecvHackCmd, "" },
{ "class1switchingcmd", &ModemConfig::class1SwitchingCmd, "AT+FRS=7" },
diff -Nru hylafax.orig/faxd/ModemConfig.h hylafax/faxd/ModemConfig.h
--- hylafax.orig/faxd/ModemConfig.h Mon Oct 13 16:35:32 2003
+++ hylafax/faxd/ModemConfig.h Tue Oct 14 21:19:39 2003
@@ -118,7 +118,9 @@
fxStr class1HFLOCmd; // cmd to setup hardware flow control
fxStr class1PPMWaitCmd; // cmd to stop and wait prior to PPM
fxStr class1ResponseWaitCmd; // cmd to wait prior to TCF response
+ fxStr class1RMQueryCmd; // cmd to query modem for receive demodulators
fxStr class1TCFWaitCmd; // cmd to stop and wait prior to TCF
+ fxStr class1TMQueryCmd; // cmd to query modem for transmit modulators
fxStr class1EOPWaitCmd; // cmd to stop and wait prior to EOP
fxStr class1SwitchingCmd; // after recv HDLC and before sending
fxStr class1MsgRecvHackCmd; // cmd to avoid +FCERROR before image