[Freeswitch-dev] Detecting in-band DTMF Digits in Openzap?

Alex Green alexg at etherstack.com
Wed Aug 12 00:26:55 PDT 2009

Ok, I think I have gotten to the bottom of it:

Using zap_channel_dequeue_dtmf() correctly identifies digits for both 
in-band PRI and analog.

Setting an event callback and waiting for ZAP_EVENT_DTMF works for 
in-band digits on a PRI channel.

3.: Potential bug:
As suggested by Moises, adding extra logging in libteletone_detect.c 
shows that digits were detected, but the ZAP_EVENT_DTMF events were 
*not* sent back for an analog channel (I am using an Openvox A800p, but 
it looks to be the same for all analog cards).

4.: Potential bug:
DTMF digit detection *eats some audio* each time a digit is detected. If 
the device is connected directly to free switch this is not a problem. 
If a device makes a call through freeswitch (to let's say phone banking) 
a digit that is held down may be detected as 3 digits (sometimes more) 
due to the consumed audio. This can be heard on the other side of 
freeswitch as a start-stop at the start of the DTMF.

Any thoughts?

Cheers -alex

Moises Silva wrote:
> On Tue, Aug 11, 2009 at 1:17 AM, Alex Green <alexg at etherstack.com 
> <mailto:alexg at etherstack.com>> wrote:
>     Thanks Moises, do I need to do a flush_dtmf() or set values for DTMF
>     on/off period, or anything else?
> I think default on/off times are good enough, but I suppose you may have 
> to play with it. As of flushing, sounds like a good idea to do when the 
> call starts, but that depends on your applications, if you are certain 
> of consuming all DTMF always, then is not needed.  
> Are you using hw dtmf? are you using Sangoma boards?
> I noticed that openzap behavior will be different from an API point of 
> view when using hardware DTMF than when using software DTMF, since the 
> callbacks (for span and channel) are currently not available when using 
> hardware DTMF. That sounds like a bug to me, the behavior should be 
> available regardless of the backend system used for DTMF. I will fix 
> that asap. 
>     zap_channel_dequeue_dtmf() correctly identifies the digit, but if the
>     digit is held down it is detected more than once. I am using a frame
>     size of 160 for the read.
> More than once like in twice? 3 times, 4 times? ad infinitum if the 
> digit is hold? I'd need to debug to try to figure out where that comes 
> from. If you are using hardware dtmf in wanpipe boards you can go to 
> src/ozmod/ozmod_wanpipe/ozmod_wanpipe.c and search for 
> WP_TDMAPI_EVENT_DTMF, then uncomment the log line there to see if the 
> digit is detected twice by the drivers.
> If using software DTMF, some logging in zap_channel_read when calling 
> teletone_dtmf_detect() can be added to check if its detecting it twice.
> -- 
> Moises Silva
> Software Developer
> Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON L3R 
> 9T3 Canada
> t. 1 905 474 1990 x 128 | e. moy at sangoma.com <mailto:moy at sangoma.com>
> ------------------------------------------------------------------------
> _______________________________________________
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org

More information about the FreeSWITCH-dev mailing list