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] Multiple "MODEM No carrier"



Lee Howard wrote:

Oct 01 12:07:43.09: [ 8035]: <-- [9:AT+FRH=3\r]
Oct 01 12:07:43.73: [ 8035]: --> [7:CONNECT]
Oct 01 12:07:44.59: [ 8035]: --> [2:10 03]
Oct 01 12:07:44.59: [ 8035]: --> [10:NO CARRIER]
Oct 01 12:07:44.59: [ 8035]: MODEM No carrier
Oct 01 12:07:44.59: [ 8035]: <-- [9:AT+FRH=3\r]
Oct 01 12:07:45.33: [ 8035]: --> [7:CONNECT]
Oct 01 12:07:46.29: [ 8035]: --> [2:10 03]
Oct 01 12:07:46.29: [ 8035]: --> [10:NO CARRIER]
Oct 01 12:07:46.29: [ 8035]: MODEM No carrier
Oct 01 12:07:46.29: [ 8035]: <-- [9:AT+FRH=3\r]
Oct 01 12:07:46.93: [ 8035]: --> [7:CONNECT]


The attached patch should prevent this from going on more than 30 seconds.

Thanks,

Lee.
--- hylafax.orig/faxd/Class1.c++	2007-10-04 17:19:17.048371224 -0700
+++ hylafax/faxd/Class1.c++	2007-10-04 17:55:39.548580760 -0700
@@ -1402,6 +1402,7 @@
     u_short crpcnt = 0, rhcnt = 0;
     u_int onhooks = 0;
     gotCONNECT = true;
+    time_t start = Sys::now();
     if (useV34) {
 	do {
 	    if (crpcnt) traceFCF(dir == FCF_SNDR ? "SEND send" : "RECV send", FCF_CRP);
@@ -1435,7 +1436,8 @@
 		    startTimeout(ms);
 		}
 	    }
-	} while ((lastResponse == AT_FCERROR || (lastResponse == AT_ERROR && onhooks <= conf.class1HookSensitivity)) && !wasTimeout());
+	} while (((u_int) Sys::now()-start < conf.t1Timer) && !wasTimeout() &&
+	    (lastResponse == AT_FCERROR || (lastResponse == AT_ERROR && onhooks <= conf.class1HookSensitivity)));
     }
     if (readPending) {
         stopTimeout("waiting for HDLC flags");
@@ -1472,7 +1474,8 @@
 	     * modem response at that point, anyway.  So it is a good indicator for us.
 	     * So we simply repeat AT+FRH=3 in that case.
 	     */
-	} while (!gotframe && !wasTimeout() && ((conf.class1HasRHConnectBug && !frame.getLength() && lastResponse == AT_NOCARRIER && rhcnt++ < 30) ||
+	} while (((u_int) Sys::now()-start < conf.t1Timer) && !gotframe && !wasTimeout() && 
+	    ((conf.class1HasRHConnectBug && !frame.getLength() && lastResponse == AT_NOCARRIER && rhcnt++ < 30) ||
 	    (docrp && crpcnt++ < 3 && switchingPause(emsg, 3) && transmitFrame(dir|FCF_CRP))));	/* triple switchingPause to avoid sending CRP during TCF */
 	return (gotframe);
     } else {



Project hosted by iFAX Solutions