[Freeswitch-users] key tone trigger event during call
Michael Collins
msc at freeswitch.org
Fri Dec 5 09:38:32 PST 2008
On Fri, Dec 5, 2008 at 8:32 AM, Frank @ Impact <frank at impactfax.com> wrote:
> Looks like tone detect might do it. But..
>
> If so, What frequency would we use for particular keys?
>
http://en.wikipedia.org/wiki/DTMF#Keypad
> Will tone_Detect sniff both legs or would we just do both r and w on the
> called leg?
>
Just do both r and w.
> Can the tone_Detect timeout just be a very large number or can we leave
> out the timeout value so there is no timeout?
I know you can set it to a large number; I've never tried a "forever"
tone_detect. I'll check it out.
>
> Could the trigger from tone Detect do a gentone for a certain key?
>
I don't believe so. This is where the bind_meta_app functionality is
more applicable. The dialplan isn't really the best place to handle
"events" like this. (Event socket would be better if you can swing
that, but I think maybe a workaround is doable with just the dialplan
and some creativity.)
> Not much on the wiki on the mod.
My bad. I'm working on it. :) In the meantime grab those dtmf
frequency values and set up a test extension in your dialplan. Put a
tone_detect app in that test ext. (You could have the ext set tone
detect, sleep 10 seconds, do info app then hangup.) Then call the test
extension, press a few keys, then wait for the info app to dump. If
you have the tone_detect set a chan variable when a dtmf is pressed
then you'll see it in your info app dump. BTW, MikeJ reminded me about
the start_dtmf/stop_dtmf apps:
http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_start_dtmf
Those might be necessary if your dtmf's are not already in-band.
Here's a sample extension you could try for testing, dialing 9990:
<extension name="dtmf_detect_test">
<condition field="destination_number" expression="^9990$">
<action application="answer"/>
<action application="tone_detect" data="DTMF1 697,1209 rw
+10000 set DTMF1=true"/> <!-- detect DTMF 1 key-->
<action application="sleep" data="10000"/>
<action application="info"/>
<action application="hangup"/>
</condition>
</extension>
Give that a try and at least see if you can detect the tones...
-MC
More information about the FreeSWITCH-users
mailing list