Hello,<br><br>I spent a few hours playing with DTMF stuff and analog cards and it seems there is 2 issues at hand.<br><br>1. Bleeding DTMF.<br>2. Echo DTMF.<br><br>The first issue, for software DTMF, can be solved with Anthony&#39;s pre buffer size feature. However that introduces delay by design, and it will not work for large DTMFs (if the dtmf is larger than the buffer).<br>
<br>For hardware DTMF a new driver was just released that includes a configuration to allow the EC chip to perform the dtmf tone removal which cuts down the bleeding to only 20ms (in my testing) there is no way a DTMF detector will consider that a valid DTMF and therefore the bleeding should be solved with no delay introduced. The option is HWEC_DTMF_REMOVAL = YES, must be added along with the usual TDMV_HW_DTMF = YES in wanpipex.conf<br>

<br>Ideally the software DTMF detector (in this case teletone) should cut it at the same time that it detects it. I thought may be spandsp would help, but it seems spandsp does not have an option to squelch the dtmf tone. May be Steve can help with that. I pinged him on IRC and he said he may get some code working, but there is no date for that and also that would involve integrating spandsp into FreeTDM, any reason to not do this now that spandsp is LGPL?<br>
<br>As for the echo dtmf. It seems sometimes an outgoing DTMF may be detected as incoming DTMF due to echo. There is not much we can do there if you don&#39;t have echo cancellation. If however you have this issue even with HW EC, call Sangoma tech support and we will be happy to look at the issue.<br>
<br>In another note, I added a variable and application to disable DTMF. <br><br>&lt;action application=&quot;disable_dtmf&quot;/&gt;<br><br>That will disable DTMF (either software or hardware) in the leg executing that app. If you want to disable in the outgoing leg (before a bridge), you must export a special variable:<br>
<br>&lt;action application=&quot;export&quot; data=&quot;freetdm_disable_dtmf=yes&quot;/&gt;<br><br>The DTMF is enabled automatically on each call, so there is no need to enable it for each call. But in case you need to enable it:<br>
<br>&lt;action application=&quot;enable_dtmf&quot;/&gt;<br>
<br clear="all">Moises Silva<br>Senior Software Engineer<br>Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON L3R 9T3 Canada<br>t. 1 905 474 1990 x 128 | e. <a href="mailto:moy@sangoma.com" target="_blank">moy@sangoma.com</a><br>



<br><br><div class="gmail_quote">On Wed, Jun 16, 2010 at 12:09 PM, Anthony Minessale <span dir="ltr">&lt;<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


openzap_pre_buffer_size is a variable you can set to specific number of MS 60 for example.<div>it will pre_buffer the audio on the channel so when you detect dtmf it will completely drop the buffer so all of the original</div>



<div>dtmf should be dropped as well.  probably if the dtmf is too long then it will cause problems anyway.</div><div><br></div><div>if that pre buffer does not fix anything it would point to echo or bleeding.</div><div><br>



</div><div>We could make a variable to disable dtmf detection completely on a per-call basis possibly but you will still probably hear it bleeding.</div><div><br></div><div>This type of problem was reported fixed with sangoma because of the echo canceler.</div>



<div>I don&#39;t use dahdi or digium stuff much so I can&#39;t comment on what happens when you use it.</div><div> </div><div><div><div></div><div> <br><br><div class="gmail_quote">On Wed, Jun 16, 2010 at 3:41 AM, François Legal <span dir="ltr">&lt;<a href="mailto:devel@thom.fr.eu.org" target="_blank">devel@thom.fr.eu.org</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Does this really fix it ?<br>
I wonder because the problem I see here is also that the FXS side detects<br>
the DTMF and then queues it on the FXO side for generation. That leads to<br>
the called party receiving twice the DTMF, the first one is the inband<br>
DTMF, the second is the one queued/generated by the FXO channel.<br>
<br>
For a clean fix, I guess some kind of application should be created, that<br>
would prevent DTMF to be queued on the other channel. Such application<br>
would then be called before the bridge. Maybe there is a cleaner way to do<br>
this.<br>
<font color="#888888"><br>
François<br>
</font><div><div></div><div><br>
On Tue, 15 Jun 2010 18:23:13 -0500, &quot;Jeroen C. van Gelderen&quot;<br>
&lt;<a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a>&gt; wrote:<br>
&gt; Hi everybody,<br>
&gt;<br>
&gt; I have a problem that is very similar to a problem<br>
&gt; reported by François [1] except for the fact that<br>
&gt; my FXS and FXO ports are on a Xorcom Astribank<br>
&gt; device instead of a Sangoma.<br>
&gt;<br>
&gt; To quote François: &quot;The problem is that each leg of<br>
&gt; the bridge is detecting the inband DTMF, and so<br>
&gt; [F]reeswitch sends each detected DTMF from one leg<br>
&gt; to the other, and so on and so forth (as each leg<br>
&gt; detects the DTMF again and again)&quot;<br>
&gt;<br>
&gt; HIS words but evidenced by the MY log :)<br>
&gt;<br>
&gt; The snippet below has DTMF coming in on the FXS port<br>
&gt; (1:1) and bouncing between it and the FXO port (3:1).<br>
&gt; The ports are simply bridged together with<br>
&gt;<br>
&gt;   &quot;bridge(OpenZap/3/1/F)&quot; or &quot;bridge(OpenZap/3/1/w)&quot;<br>
&gt;<br>
&gt; I&#39;m running:<br>
&gt;<br>
&gt; FreeSWITCH version: 1.0.head (git-01c0c69 2010-06-08 16-22-21 -0500)<br>
&gt; dahdi: Version: SVN-trunk-r8762<br>
&gt;<br>
&gt; Output of lsdahdi at end of message.<br>
&gt;<br>
&gt; ----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----<br>
&gt; [...]<br>
&gt; 2010-06-13 04:18:39.217256 [DEBUG] mod_openzap.c:721 queue DTMF [4]<br>
&gt; 2010-06-13 04:18:39.256255 [DEBUG] zap_io.c:2062 3:1 GENERATE DTMF [4]<br>
&gt; 2010-06-13 04:18:39.397253 [DEBUG] mod_openzap.c:721 queue DTMF [4]<br>
&gt; 2010-06-13 04:18:39.439252 [DEBUG] mod_openzap.c:780 Dropping frame!<br>
(write<br>
&gt; not ready)<br>
&gt; 2010-06-13 04:18:39.439252 [DEBUG] zap_io.c:2062 1:1 GENERATE DTMF [4]<br>
&gt; 2010-06-13 04:18:39.637249 [DEBUG] mod_openzap.c:721 queue DTMF [4]<br>
&gt; 2010-06-13 04:18:39.676248 [DEBUG] zap_io.c:2062 3:1 GENERATE DTMF [4]<br>
&gt; 2010-06-13 04:18:39.859244 [DEBUG] mod_openzap.c:780 Dropping frame!<br>
(write<br>
&gt; not ready)<br>
&gt; [...ad infinitum...]<br>
&gt; ----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----<br>
&gt;<br>
&gt; Because I needed DTMF pass-through working &quot;now&quot;<br>
&gt; I applied an ugly HACK. This drops DTMF tones<br>
&gt; detected on spans 3 and 4 (which are my FXO<br>
&gt; spans). This is very WRONG but it does solve<br>
&gt; my immediate problem:<br>
&gt;<br>
&gt; ----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----<br>
&gt; diff --git a/libs/openzap/mod_openzap/mod_openzap.c<br>
&gt; b/libs/openzap/mod_openzap/mod_openzap.c<br>
&gt; index 5aebfea..ff3b081 100644<br>
&gt; --- a/libs/openzap/mod_openzap/mod_openzap.c<br>
&gt; +++ b/libs/openzap/mod_openzap/mod_openzap.c<br>
&gt; @@ -718,8 +718,12 @@ static switch_status_t<br>
&gt; channel_read_frame(switch_core_session_t *session, switch<br>
&gt;                 for (p = dtmf; p &amp;&amp; *p; p++) {<br>
&gt;                         if (is_dtmf(*p)) {<br>
&gt;                                 _dtmf.digit = *p;<br>
&gt; -                               zap_log(ZAP_LOG_DEBUG, &quot;queue DTMF<br>
[%c]\n&quot;,<br>
&gt; *p);<br>
&gt; -                               switch_channel_queue_dtmf(channel,<br>
&amp;_dtmf);<br>
&gt; +                               if (tech_pvt-&gt;zchan-&gt;span_id == 3 ||<br>
&gt; tech_pvt-&gt;zchan-&gt;span_id == 4) {<br>
&gt; +                                       zap_log(ZAP_LOG_DEBUG, &quot;Ignoring<br>
&gt; DTMF [%c] on FXO port %d:%d\n&quot;, *p, tech_pvt-&gt;zchan-&gt;span_id,<br>
&gt; tech_pvt-&gt;zchan-&gt;chan_id)<br>
&gt; ;<br>
&gt; +                               } else {<br>
&gt; +                                       zap_log(ZAP_LOG_DEBUG, &quot;queue<br>
DTMF<br>
&gt; [%c]\n&quot;, *p);<br>
&gt; +<br>
switch_channel_queue_dtmf(channel,<br>
&gt; &amp;_dtmf);<br>
&gt; +                               }<br>
&gt;                         }<br>
&gt;                 }<br>
&gt;         }<br>
&gt; ----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----<br>
&gt;<br>
&gt; Can someone point me in the &quot;right&quot; direction<br>
&gt; instead? Do I need to do this at the OpenZAP/DAHDI<br>
&gt; level by disabling some kind of DTMF detection<br>
&gt; like was done for the Sangoma driver?<br>
&gt;<br>
&gt; Any and all pointers appreciated.<br>
&gt;<br>
&gt; Cheers,<br>
&gt; -Slim<br>
&gt;<br>
&gt; [1] [Freeswitch-dev] FXS bridged on FXO ports and DTMF<br>
&gt;<br>
<a href="http://www.mail-archive.com/freeswitch-dev@lists.freeswitch.org/msg02830.htm" target="_blank">http://www.mail-archive.com/freeswitch-dev@lists.freeswitch.org/msg02830.htm</a><br>
&gt; l<br>
&gt;<br>
&gt; [Freeswitch-dev] Problem with sending<br>
&gt; DTMF on FXS port bridged to   an FXO port<br>
&gt;<br>
<a href="http://lists.freeswitch.org/pipermail/freeswitch-dev/2010-April/003607.html" target="_blank">http://lists.freeswitch.org/pipermail/freeswitch-dev/2010-April/003607.html</a><br>
&gt;<br>
&gt;<br>
&gt; ----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----<br>
&gt; [root@localhost freeswitch]# lsdahdi<br>
&gt; ### Span  1: XBUS-00/XPD-00 &quot;Xorcom XPD #00/00: FXS&quot; (MASTER)<br>
&gt;   1 FXS        FXOKS<br>
&gt;   2 FXS        FXOKS<br>
&gt;   3 FXS        FXOKS<br>
&gt;   4 FXS        FXOKS<br>
&gt;   5 FXS        FXOKS<br>
&gt;   6 FXS        FXOKS<br>
&gt;   7 FXS        FXOKS<br>
&gt;   8 FXS        FXOKS<br>
&gt;   9 Output     FXOKS<br>
&gt;  10 Output     FXOKS<br>
&gt;  11 Input      FXOKS<br>
&gt;  12 Input      FXOKS<br>
&gt;  13 Input      FXOKS<br>
&gt;  14 Input      FXOKS<br>
&gt; ### Span  2: XBUS-00/XPD-10 &quot;Xorcom XPD #00/10: FXS&quot;<br>
&gt;  15 FXS        FXOKS<br>
&gt;  16 FXS        FXOKS<br>
&gt;  17 FXS        FXOKS<br>
&gt;  18 FXS        FXOKS<br>
&gt;  19 FXS        FXOKS<br>
&gt;  20 FXS        FXOKS<br>
&gt;  21 FXS        FXOKS<br>
&gt;  22 FXS        FXOKS<br>
&gt; ### Span  3: XBUS-00/XPD-20 &quot;Xorcom XPD #00/20: FXO&quot;<br>
&gt;  23 FXO        FXSKS        RED<br>
&gt;  24 FXO        FXSKS        RED<br>
&gt;  25 FXO        FXSKS        RED<br>
&gt;  26 FXO        FXSKS        RED<br>
&gt;  27 FXO        FXSKS        RED<br>
&gt;  28 FXO        FXSKS        RED<br>
&gt;  29 FXO        FXSKS        RED<br>
&gt;  30 FXO        FXSKS        RED<br>
&gt; ### Span  4: XBUS-00/XPD-30 &quot;Xorcom XPD #00/30: FXO&quot;<br>
&gt;  31 FXO        FXSKS        RED<br>
&gt;  32 FXO        FXSKS        RED<br>
&gt;  33 FXO        FXSKS        RED<br>
&gt;  34 FXO        FXSKS        RED<br>
&gt;  35 FXO        FXSKS        RED<br>
&gt;  36 FXO        FXSKS        RED<br>
&gt;  37 FXO        FXSKS        RED<br>
&gt;  38 FXO        FXSKS        RED<br>
&gt; ----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----8&lt;----<br>
&gt;<br>
&gt;<br>
&gt; Cheers,<br>
&gt; -Slim<br>
&gt; --<br>
&gt; Jeroen C. &quot;Slim&quot; van Gelderen<br>
&gt; Olympic Sports Data Services<br>
&gt; Email: <a href="mailto:jeroeng@thegreek.com" target="_blank">jeroeng@thegreek.com</a><br>
&gt; Phone: +1 876 953 6182 x128<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; FreeSWITCH-dev mailing list<br>
&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>



Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:anthony_minessale@hotmail.com</a><br>


GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com" target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br>


<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org" target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div>
<br>_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org" target="_blank">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>