[Freeswitch-users] Question about Lua freeswitch.bridge

Mike van Lammeren mike at van.lammeren.net
Wed Oct 6 09:18:16 PDT 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20101006/7abdf773/attachment.html 

More information about the FreeSWITCH-users mailing list