[Freeswitch-users] mod_lua play file into conference

Tom C mel0torme at gmail.com
Tue May 10 09:08:08 MSD 2011


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.

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.

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.

Something like this:

streamwelcomefile.lua
<code>

if ( session:ready() ) then
  session:answer();
  session:sleep(10000)  -- wait for 10 seconds for other people to join
conference.
  session:streamFile("ivr/8000/ivr-welcome.wav");
  session:streamFile("ivr/8000/ivr-thank_you_for_calling.wav");
  session:hangup("NORMAL_CLEARING");
end

</code>

And the dialplan might look like this:
<code>

<extension name="StreamWelcome">
        <condition field="destination_number" expression="^000111$">
                <action application="lua" data="streamwelcomefile.lua" />
        </condition>
 </extension>

</code>


Disclaimer:  I haven't actually tested this in a conference.  Good luck!
:-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110509/53eedb0d/attachment.html 


More information about the FreeSWITCH-users mailing list