![]() |
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?
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
Class1TMQueryCmd: "!3,24,48,121,122,145,146" Class1RMQueryCmd: "!3,24,48,121,122,145,146"
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