[Freeswitch-users] mod_lua play file into conference

Fernando Testa testa at voicetechnology.com.br
Wed May 11 18:51:11 MSD 2011


When you api:execute('conference'...) the function blocks. Then you have to
stream from outside, possibly using an inbound socket application.
Maybe alternatively you can call
http://wiki.freeswitch.org/wiki/Mod_commands#sched_api just before put
someone on the conference.

On Wed, May 11, 2011 at 11:23 AM, Josh M. Patten <jpatten at co.brazos.tx.us>wrote:

>  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>
> 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
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110511/36227684/attachment.html 


More information about the FreeSWITCH-users mailing list