Fix: Disable DTMF dialing after first received KP (pulse) digit
authorAndreas Eversberg <jolly@eversberg.eu>
Thu, 22 Nov 2012 13:48:44 +0000 (14:48 +0100)
committerAndreas Eversberg <jolly@eversberg.eu>
Sun, 16 Dec 2012 09:12:44 +0000 (10:12 +0100)
Once a pulse digit is detected, it makes no sense to detect DTMF.
Pulses will create distortion with some phones, causing false
detection of DTMF tones.

fxs.cpp
mISDN.cpp

diff --git a/fxs.cpp b/fxs.cpp
index 1928814..0d1a915 100644 (file)
--- a/fxs.cpp
+++ b/fxs.cpp
@@ -409,12 +409,13 @@ void Pfxs::keypulse_ind(unsigned int cont)
 {
        struct lcr_msg *message;
 
+       p_m_fxs_allow_dtmf = 0; /* disable DTMF from now on */
        chan_trace_header(p_m_mISDNport, this, "PULSE", DIRECTION_NONE);
        add_trace("KP", NULL, "%c", cont & DTMF_TONE_MASK);
        end_trace();
        message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_INFORMATION);
        message->param.information.id[0] = cont & POTS_KP_MASK;
-       PDEBUG(DEBUG_ISDN, "Pfxs(%s) PH_CONTROL INDICATION  DTMF digit '%c'\n", p_name, message->param.dtmf);
+       PDEBUG(DEBUG_ISDN, "Pfxs(%s) PH_CONTROL INDICATION  KP digit '%c'\n", p_name, message->param.information.id[0]);
        message_put(message);
 }
 
index cdc24ef..8ae5855 100644 (file)
--- a/mISDN.cpp
+++ b/mISDN.cpp
@@ -1060,7 +1060,7 @@ void PmISDN::bchannel_receive(struct mISDNhead *hh, unsigned char *data, int len
                        if (p_type == PORT_TYPE_POTS_FXS_IN && p_state == PORT_STATE_IN_OVERLAP) {
                                class Pfxs *pfxs = (class Pfxs *)this;
                                if (!pfxs->p_m_fxs_allow_dtmf) {
-                                       PDEBUG(DEBUG_PORT, "PmISDN(%s) DTMF for FXS not yet allowed\n", p_name);
+                                       PDEBUG(DEBUG_PORT, "PmISDN(%s) DTMF for FXS currently disabled\n", p_name);
                                        return;
                                }
                                SCCAT(p_dialinginfo.id, cont & DTMF_TONE_MASK);