Hello!<div><br></div><div>I&#39;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.</div>
<div><br></div><div>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&#39;t resume until one side or the other hangs up.</div>
<div><br></div><div>Here is my problem reduced to a Lua script in its simplest form:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">-- first session</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">session1 = session</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">-- call out</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">session2 = freeswitch.Session(&quot;{ignore_early_media=true}sofia/gateway/<a href="http://etc.com/">etc.com/</a>&quot; .. phoneNumber)</font></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">-- bridge the calls</font></div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">freeswitch.bridge(session1, session2)</font></div>
</div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">-- this next line doesn&#39;t execute until after either session 1 or 2 hangs up</font></div></div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">freeswitch.consoleLog(&quot;info&quot;, &quot;This is a test.\n&quot;)</font></div>
</div></blockquote><div><br></div><div>How can I do an asynchronous bridge, and still be able to play media and detect dtmf afterwards?</div><div><br></div><div>Mike van Lammeren</div><div><br></div>