]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 539: add recognition of blacklisted dialing responses
authorLee Howard <faxguy@howardsilvan.com>
Sat, 8 May 2004 21:52:47 +0000 (21:52 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Sat, 8 May 2004 21:52:47 +0000 (21:52 +0000)
faxd/Class1Send.c++
faxd/Class2Send.c++

index fb81f2da8642e818f7d29a25f16b35765eb5bbb5..b755f67f6dfe9aa7e9e58127dd3b30e49b3aab1d 100644 (file)
@@ -60,6 +60,28 @@ Class1Modem::dialResponse(fxStr& emsg)
     ATResponse r;
     do {
        r = atResponse(rbuf, conf.dialResponseTimeout);
+       
+       /*
+        * Blacklisting is handled internally just like a NOCARRIER.
+        * emsg is customized to let the user know the problem lies in
+        * the modem and not in line conditions, cables ...
+        * The known blacklisting modem responses are:
+        * 1. "BLACKLISTED"
+        * 2. "DELAYED HH:MM:SS" (ie: "DELAYED 00:59:02")
+        * 3. "DIALING DISABLED" (USR)
+        * User can switch on/off the modem or use appropriate reset commands
+        * to clear/disable blacklisted numbers, ie:
+        * ModemResetCmds: AT%TCB  (Some rockwell chipsets)
+        * ModemResetCmds: AT%D0   (Some topic chipsets)
+        * ModemResetCmds: ATS40=7 (Some usr chipsets)
+        */
+       if (strncmp(rbuf, "BLACKLISTED", 11) == 0
+               || strncmp(rbuf, "DELAYED", 7) == 0
+               || strncmp(rbuf, "DIALING DISABLED", 16) == 0) {
+           emsg = "Blacklisted by modem";
+           return (NOCARRIER);
+       }
+
        switch (r) {
        case AT_ERROR:      return (ERROR);     // error in dial command
        case AT_BUSY:       return (BUSY);      // busy signal
index 1dbc6e0813c5e65b989e966abc8162667543736d..50bde1728b1f07e46cadd4b2969e47ca0ad48bfd 100644 (file)
@@ -86,6 +86,15 @@ Class2Modem::dialResponse(fxStr& emsg)
         * modems seem to get hosed and lockup.
         */
        r = atResponse(rbuf, conf.dialResponseTimeout);
+
+       // Blacklisting (see notes in Class1Send.c++)
+       if (strncmp(rbuf, "BLACKLISTED", 11) == 0
+               || strncmp(rbuf, "DELAYED", 7) == 0
+               || strncmp(rbuf, "DIALING DISABLED", 16) == 0) {
+           emsg = "Blacklisted by modem";
+           return (NOCARRIER);
+       }
+
        switch (r) {
        case AT_ERROR:      return (ERROR);     // error in dial command
        case AT_BUSY:       return (BUSY);      // busy signal