To configure an event handler, follow these steps.
To configure an event handler
Set the OnStart
, OnFinish
, OnError
, or OnQueueEvent
parameter to specify the name of a section in the configuration file that contains the event handler settings.
To run an event handler for all asynchronous actions, set these parameters in the [Actions]
section. For example:
[Actions] OnStart=NormalEvents OnFinish=NormalEvents OnError=ErrorEvents
To run an event handler for a specific action, set these parameters in the [ActionName]
section, where ActionName
is the name of the action. The following example calls an event handler when the Example
action starts and finishes successfully, and uses a different event handler to monitor the queue size:
[Example] OnStart=NormalEvents OnFinish=NormalEvents OnQueueEvent=QueueSizeEvents
Create a new section in the configuration file to contain the settings for your event handler. You must name the section using the name you specified with the OnStart
, OnFinish
, OnError
, or OnQueueEvent
parameter.
In the new section, set the LibraryName
parameter.
LibraryName
|
The type of event handler to use to handle the event.
|
For example:
[NormalEvents] LibraryName=TextFileHandler FilePath=./events.txt [ErrorEvents] LibraryName=HTTPHandler URL=http://handlers:8080/lo-proxy/callback.htm? [QueueSizeEvents] LibraryName=LuaHandler LuaScript=./handle_queue_events.lua
Save and close the configuration file. You must restart Media Server for your changes to take effect.