Just curious - would a bind_meta_app call work for you? I ask because you can't do asynchronous operations like you described when calling scripts from the dialplan. I'm afraid you will need to graduate to ESL. :) Check out ESL and the event socket on the wiki and chapter 9 of the FreeSWITCH book. Some things you will want to check out: uuid_broadcast (to play media to a channel) the DTMF event (http://wiki.freeswitch.org/wiki/Event_list#DTMF) fs-ivrd (example of a daemon that sits there and connects outbound event socket connects to an ESL script) Using the event socket allows total and complete 3rd party control of your sessions. The drawback is the the learning curve. It's a bit steep but it's worth it. -MC On Wed, Oct 6, 2010 at 9:18 AM, Mike van Lammeren <mike@van.lammeren.net>wrote:
Hello!
I'm a huge FreeSWITCH fan and am always amazed at how much I can do with it. I have a Lua script that has been working great, but now have been tasked with enhancing it, and have run into a problem.
I want to be able to play media, detect DTMF and hang up a call after bridging two sessions, but my Lua script blocks on freeswitch.bridge(), and doesn't resume until one side or the other hangs up.
Here is my problem reduced to a Lua script in its simplest form:
-- first session session1 = session -- call out session2 = freeswitch.Session("{ignore_early_media=true}sofia/gateway/ etc.com/" .. phoneNumber) -- bridge the calls freeswitch.bridge(session1, session2) -- this next line doesn't execute until after either session 1 or 2 hangs up freeswitch.consoleLog("info", "This is a test.\n")
How can I do an asynchronous bridge, and still be able to play media and detect dtmf afterwards?
Mike van Lammeren
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org