An application may use a tSMEventId to wait for various events to occur. While the api function smd_ev_wait() is provided, this only allows an application to wait for events on a single channel. It is possible to wait for any of a variety of events, some caused by Prosody and some from other sources, using a function provided by the operating system.
A Prosody event is active while the underlying cause remains. This means, for example, that a channel performing replay will have its event active while there is space to write more data. If you are no longer interested in a channel (e.g. the replay has finished) you must not include its event in the list of events you are waiting for (since it will not wait because the event is already active).
See also these documents: