[Freeswitch-users] schedule a DTMF tone into bridge
Michael Collins
msc at freeswitch.org
Sat Dec 13 15:04:11 PST 2008
On Sat, Dec 13, 2008 at 1:20 PM, Frank @ Impact <frank at impactfax.com> wrote:
> 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.
Nice - simpler is almost always better! :)
>
> 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.
>
Definitely need the uuid of the leg in question. Could you pastebin or
email a sample dialplan? We could probably work it out together.
> Can uuid_send_dtmf accept anything like "w" for wait or anything else
> special for DTMF stuff?
The uuid_send_dtmf api cannot, but you could easily modify or create a
new version of my Lua script that accepts more (or different)
arguments. I suppose the trick there is that you'd need to read up on
Lua, which I highly recommend anyway because if you know Lua then you
can leverage some serious power in your dialplans.
>
> 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?
>
I believe this "error" is innocuous. Sometimes the devs will log
certain events to the console as ERR so that they stand out during
debugging.
-MC
> 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
>
>
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
More information about the FreeSWITCH-users
mailing list