[Freeswitch-users] schedule a DTMF tone into bridge
Frank @ Impact
frank at impactfax.com
Sat Dec 13 13:20:16 PST 2008
Michael,
Got it working. Just a little simpler then you outlined.
I just added to my xml dialplan this line.
<action application="set" data="execute_on_answer=lua uuid_send_dtmf.lua
${uuid} 20 123"/>
I added this just before the bridge application.
I did this instead of adding an extra extension to transfer to on
answer. Everything worked well. The DTMF was played to the calling
party. Out of curiosity, if we wanted also to play the DTMF to the
called party also, what would we have to give uuid_send_dtmf?
Particularly since we call it before the bridge.
Can uuid_send_dtmf accept anything like "w" for wait or anything else
special for DTMF stuff?
Also, I got an error output to the console when the sched_api was run.
See below.
******
2008-12-13 16:07:28 [NOTICE] switch_cpp.cpp:1050 console_log() apicmd:
sched_api
2008-12-13 16:07:28 [NOTICE] switch_cpp.cpp:1050 console_log() apiarg:
+20 none uuid_send_dtmf 37618e54-c959-11dd-bc73-0923daa880b2 123
2008-12-13 16:07:28 [ERR] switch_cpp.cpp:1050 console_log() Result is
+OK Added: 49751
******
is this ERR anything to worry about even though we got a result ok?
Thanks again for the help.
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of
Michael Collins
Frank,
I found a simple way to handle this scenario. I decided just to create
a small Lua script that would do the job. It's committed in latest
trunk. Look in src/scripts/contrib/mcollins for uuid_send_dtmf.lua. It
has comments on how to call it, including a sample dp call.
The way I would use this in your scenario is to setup a destination
using the execute_on_answer variable.
http://wiki.freeswitch.org/wiki/Channel_Variables#execute_on_answer
Have the destination be an extension that does something like this:
<extension...>
<condition...>
<action application="answer"/>
<action application="lua" data="uuid_send_dtmf ${uuid} 10 123"/>
...rest of diaplan...
</condition>
</extension>
The 10 means ten seconds, the 123 means send the dtmf digits 1,2,3 in
order. You can tinker with the settings as you see fit.
Please let me know how it goes. BTW, be sure to put the Lua script in
/usr/local/freeswitch/scripts or specify the complete path name when
calling the lua app in the dialplan.
-MC
More information about the FreeSWITCH-users
mailing list