[Freeswitch-users] Another fifo request

Matthew Fong mattdfong at gmail.com
Thu Mar 26 09:00:23 PDT 2009


Hi Brian,
Thanks for the link...I saw that, but i'm a newbie to lua (only use it cause
of FS), and I'm a little confused how the example works.

It consumes all events? Then subscribes to a session? and then, every second
checks to see if an event has been fired for that session?

Would it be possible to get an idea of how to subscribe to all events, and
have a function execute for each time an event is fired? Can lua "wait"
until an event is fired, or must it loop and sleep every second? Thanks for
the help.

--matt

---
the example...
con = freeswitch.EventConsumer("all");


session = freeswitch.Session("sofia/default/dest at host.com");
while session:ready() do

   session:execute("sleep", "1000");

   for e in (function() return con:pop() end) do

      print("event\n" .. e:serialize("xml"));

   end

end

2009/3/26 Brian West <brian at freeswitch.org>

> http://wiki.freeswitch.org/wiki/Mod_lua#freeswitch.EventConsumer
>
> On Mar 26, 2009, at 10:30 AM, Matt Hunter wrote:
>
> > Ahhh....can you point me to a doc or wiki, I can experiment with?
> >
>
>
> _______________________________________________
> 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/20090326/b96eb8c5/attachment-0002.html 


More information about the FreeSWITCH-users mailing list