July 2017
Intermediate to advanced
434 pages
12h 59m
English
This object creates a listener/consumer for a certain kind of event in FreeSWITCH Event System:
-- You may subscribe to specific events if you want to, and even subclasses -- con1 = freeswitch.EventConsumer("CUSTOM") -- or -- con2 = freeswitch.EventConsumer("CUSTOM","conference::maintenance") --listen for an event specific subclass con3 = freeswitch.EventConsumer("CUSTOM", "ping::running") -- create an event in that specific subclass event = freeswitch.Event("CUSTOM", "ping::running") event:addHeader("hi", "there") -- fire the event event:fire() -- look in the listened events stack for events to "pop" out, block there for max 20 seconds received_event = con3:pop(1, 20000) if(received_event) then stream:write("event ...Read now
Unlock full access