[Freeswitch-users] mod_lua play file into conference
Josh M. Patten
jpatten at co.brazos.tx.us
Wed May 11 18:23:57 MSD 2011
If you look at my original post you'll see I tried to do that with the same results:
session:execute("conference", argv[1] .. "@default")
api = freeswitch.API()
confplay = api:execute("conference", argv[1] .. " play /usr/local/freeswitch/sounds/tones/norstar.wav ")
What is happening in Lua is because it's not a threadable language you can't do an "execute and forget" on a particular command. So when the conference is run Lua will stop executing at that point.
Josh Patten
Brazos County Network Engineer
979.361.4676
From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Michael Collins
Sent: Wednesday, May 11, 2011 12:48 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] mod_lua play file into conference
On Mon, May 9, 2011 at 11:34 PM, Josh M. Patten <jpatten at co.brazos.tx.us<mailto:jpatten at co.brazos.tx.us>> wrote:
It seems the way this could be accomplished is to allow asynchronous execution capabilities in lua. However I don't think this exists.
Is there a better way to "execute and forget" the conference app so the script can move on to the next bit of code?
Try using an API instead of messing with session:xxx and all that stuff:
api = freeswitch.API();
res = api:execute("conference",conf_name .. " play /path/to/file.wav";
conf_name is the name of the conference you are using. If you're not sure what name you have then just start up a conference and then type "conference list" at fs_cli and you'll see the name. You can use channel variables, etc. if the name changes depending on the destination number.
-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110511/f3138f44/attachment-0001.html
More information about the FreeSWITCH-users
mailing list