From: Lee Howard Date: Sat, 8 May 2004 21:52:47 +0000 (+0000) Subject: Bug 539: add recognition of blacklisted dialing responses X-Git-Tag: HYLAFAX-4_2_0BETA2~7 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=3c9fbf0300e1685b3535cf82cb44a1cfbd109336;p=thirdparty%2FHylaFAX.git Bug 539: add recognition of blacklisted dialing responses --- diff --git a/faxd/Class1Send.c++ b/faxd/Class1Send.c++ index fb81f2da..b755f67f 100644 --- a/faxd/Class1Send.c++ +++ b/faxd/Class1Send.c++ @@ -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 diff --git a/faxd/Class2Send.c++ b/faxd/Class2Send.c++ index 1dbc6e08..50bde172 100644 --- a/faxd/Class2Send.c++ +++ b/faxd/Class2Send.c++ @@ -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