HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] multitech modem dropping DTMF digit



Christopher wrote:
minicom output:
1: info
OK ATI MT5656ZDXV OK AT
+FCLASS=? 0,1,1.0,2,8,10



2: Broken DTMF via minicom
RING AT+FCLASS=8;
+VLS=1 OK ./.4.9.~./.8.~



3: Good DTMF from other modem
RING AT+FCLASS=8;
+VLS=1 OK ./.4.~./.9.~./.8.~

This latter one is how it should be, marked with / and ~. The "broken" version is missing some markers. This is a bug in the modem. But HylaFAX could be made to cope with it in this particular case. (See the attached patch).


In the IS-101 specification there is a provision whereby the modem can inform the DTE (software) how long the DTMF was present. It does this by repeating the DLE+digit within the / and ~ markers.

In this particular case HylaFAX could be made to cope because the "repeated" digit is not the same. It changes from 4 to 9, and so it's easy to see the modem's mistake here.

However, if the DTMF digits had been 448 instead, and if the same error happened, then there's no way to know if the modem was trying to say that it heard one 4 and one 8, but that the 4 was present for twice as long as the 8.

I don't know if that makes sense.

So the untested patch (attached) will work fine as long as the DTMF digits are different from each other. If the DTMF digits are "444" then it won't do much good.

Thanks,

Lee.

--- hylafax.orig/faxd/ClassModem.c++	2010-02-15 12:08:17.000000000 -0800
+++ hylafax/faxd/ClassModem.c++	2010-03-23 21:37:01.608828392 -0700
@@ -1488,25 +1488,26 @@
 		for (u_int j = 0 ; j < conf.idConfig.length(); j++) {
 		    if (conf.idConfig[j].pattern == "SHIELDED_DTMF") {	// retrieve DID, e.g. via voice DTMF
 			ringstart = Sys::now();
-			bool marked = false, gotdigit = false;
+			bool marked = false;
+			int gotdigit = 0;
 			do {
 			    int c = server.getModemChar(10000);
 			    if (c == 0x10) c = server.getModemChar(10000);
 			    if (c == 0x23 || c == 0x2A || (c >= 0x30 && c <= 0x39)) {
 				// a DTMF digit was received...
-				if (!marked || (marked && !gotdigit)) {
+				if (!marked || !gotdigit || (c != gotdigit)) {
 				    protoTrace("MODEM HEARD DTMF: %c", c);
 				    callid[j].append(fxStr::format("%c", c));
-				    gotdigit = true;
+				    gotdigit = c;
 				}
 			    } else if (c == 0x2F) {
 				// got IS-101 DTMF lead marker
 				marked = true;
-				gotdigit = false;
+				gotdigit = 0;
 			    } else if (c == 0x7E) {
 				// got IS-101 DTMF end marker
 				marked = false;
-				gotdigit = false;
+				gotdigit = 0;
 			    } else if (c == 0x73) {
 				// got silence, keep waiting
 				protoTrace("MODEM HEARD SILENCE");



Project hosted by iFAX Solutions