<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">It seems the way this could be accomplished is to allow asynchronous execution capabilities in lua. However I don't think this exists.<br>
<br>
Is there a better way to "execute and forget" the conference app so the script can move on to the next bit of code?
<br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF355261"><font color="#000000" size="2" face="Tahoma"><b>From:</b> freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] on behalf of Josh M. Patten [jpatten@co.brazos.tx.us]<br>
<b>Sent:</b> Tuesday, May 10, 2011 1:21 AM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] mod_lua play file into conference<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt;">
Only problem is session:streamFile doesn't make it into conference.<br>
<br>
The only way I've found to do this so far is to conference_set_auto_outcall a loopback extension to a non-user extension that simply streams a file in a context:<br>
session:execute("conference_set_auto_outcall","loopback/3041/custom/")<br>
<br>
but if I want to mute the conference so only the originator is heard (a standard "overhead" style page) using:<br>
session:execute("set", "conference_auto_outcall_flags=mute") then this is never heard because this loopback "participant" is muted as well.<br>
<br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div id="divRpF856805" style="direction: ltr;"><font color="#000000" size="2" face="Tahoma"><b>From:</b> freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] on behalf of Tom C [mel0torme@gmail.com]<br>
<b>Sent:</b> Tuesday, May 10, 2011 12:08 AM<br>
<b>To:</b> FreeSWITCH Users Help<br>
<b>Subject:</b> Re: [Freeswitch-users] mod_lua play file into conference<br>
</font><br>
</div>
<div></div>
<div>
<div>I was thinking about this a few days ago. Slightly different scenario: I want to stream audio into a conference every ten minutes or so.</div>
<div> </div>
<div>My ideas was to do it by connecting another extension to the conference. This extra extension would (theoretically) run a Lua script to stream the audio, and then sleep, and every few seconds it would look to see if it was the only extension still connected
to the conference.</div>
<div> </div>
<div>In your case, if you're doing the "mad boss" and inviting all the participants to the conference, it should be easy to add one more extension to the list of invites. Just have the extension's script wait 10 seconds or so before streaming the audio, and
then it can just hang up.</div>
<div> </div>
<div>Something like this:</div>
<div> </div>
<div>streamwelcomefile.lua</div>
<div><code></div>
<div> </div>
<div>if ( session:ready() ) then</div>
<div> session:answer();</div>
<div> session:sleep(10000) -- wait for 10 seconds for other people to join conference.<br>
session:streamFile("ivr/8000/ivr-welcome.wav");<br>
session:streamFile("ivr/8000/ivr-thank_you_for_calling.wav");<br>
session:hangup("NORMAL_CLEARING");<br>
end</div>
<div> </div>
<div></code></div>
<div> </div>
<div>And the dialplan might look like this:</div>
<div><code></div>
<div> </div>
<div><extension name="StreamWelcome"><br>
<condition field="destination_number" expression="^000111$"><br>
<action application="lua" data="streamwelcomefile.lua" /><br>
</condition><br>
</extension></div>
<div> </div>
<div></code></div>
<div> </div>
<div> </div>
<div>Disclaimer: I haven't actually tested this in a conference. Good luck! :-)</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>