MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)

Listing of all available triggers and their payloads.

MistServer reports certain occurances as configurable triggers to a URL or executable. This page describes the triggers system in full.

Triggers are the preferred way of responding to server events. Each trigger has a name and a payload, and may be stream-specific or global.

Triggers may be handled by a URL or an executable. If the handler contains ://, a HTTP URL is assumed. Otherwise, an executable is assumed. If handled by an URL, a POST request is sent to the URL with an extra X-Trigger header containing the trigger name and the payload as the POST body. If handled by an executable, it's started with the trigger name as its only argument, and the payload is piped into the executable over standard input.

Currently, all triggers are handled asynchronously and responses (if any) are completely ignored. In the future this may change.

Global Controller::AddStreams (JSON::Value &in, JSON::Value &out)
The "STREAM_ADD" trigger is stream-specific, and is ran whenever a new stream is added to the server configuration.
Global Controller::CheckProtocols (JSON::Value &p, const JSON::Value &capabilities)
The "OUTPUT_START" trigger is global, and is ran whenever a new protocol listener is started. It cannot be cancelled. Its payload is:
output listener commandline
The "OUTPUT_STOP" trigger is global, and is ran whenever a protocol listener is terminated. It cannot be cancelled. Its payload is:
output listener commandline
Global Controller::deleteStream (const std::string &name, JSON::Value &out)
The "STREAM_REMOVE" trigger is stream-specific, and is ran whenever a stream is removed from the server configuration.
Global Controller::writeConfig ()
The "SYSTEM_START" trigger is global, and is ran as soon as the server configuration is first stable.
Global main (int argc, char **argv)
The "SYSTEM_STOP" trigger is global, and is ran when the controller shuts down. If cancelled, the controller does not shut down and will attempt to re-open the API socket. Its payload is:
shutdown reason
Global Mist::Input::serve ()
The "STREAM_READY" trigger is stream-specific, and is ran whenever an input finished loading and started serving a stream. If cancelled, the input is immediately shut down again. Its payload is:
streamname
input name
The "STREAM_UNLOAD" trigger is stream-specific, and is ran right before an input shuts down and stops serving a stream. If cancelled, the shut down is delayed. Its payload is:
streamname
input name
Global Mist::inputBuffer::removeUnused ()
The "STREAM_TRACK_REMOVE" trigger is stream-specific, and is ran whenever a track is fully removed from a live strean buffer.
Global Mist::inputBuffer::updateMeta ()
The "STREAM_BUFFER" trigger is stream-specific, and is ran whenever the buffer changes state between playable (FULL) or not (EMPTY).
Global Mist::inputBuffer::userCallback (char *data, size_t len, unsigned int id)
The "STREAM_TRACK_ADD" trigger is stream-specific, and is ran whenever a new track is added to a live strean buffer.
Global Mist::Output::initialize ()
The "CONN_PLAY" trigger is stream-specific, and is ran when an active connection first opens a stream.
Global Mist::Output::run ()
The "CONN_OPEN" trigger is stream-specific, and is ran when a connection is made or passed to a new handler.
Global Mist::OutRTMP::parseAMFCommand (AMF::Object &amfData, int messageType, int streamId)
The "STREAM_PUSH" trigger is stream-specific, and is ran right before an incoming push is accepted. If cancelled, the push is denied. Its payload is:
streamname
connected client host
output handler name
request URL (if any)
The "RTMP_PUSH_REWRITE" trigger is global and ran right before an RTMP publish request is parsed. It cannot be cancelled, but an invalid URL can be returned; which is effectively equivalent to cancelling. This trigger is special: the response is used as RTMP URL override, and not handled as normal. If used, the handler for this trigger MUST return a valid RTMP URL to allow the push to go through. If used multiple times, the last defined handler overrides any and all previous handlers. Its payload is:
current RTMP URL
connected client host
Global Util::startInput (std::string streamname, std::string filename="", bool forkFirst=true)
The "STREAM_LOAD" trigger is stream-specific, and is ran right before launching an input for an inactive stream. If cancelled, the input is not launched. Its payload is:
streamname
The "STREAM_SOURCE" trigger is stream-specific, and is ran right before launching an input for an inactive stream. It cannot be cancelled, but an invalid source can be returned; which is effectively equivalent to cancelling. This trigger is special: the response is used as source override for this stream, and not handled as normal. If used, the handler for this trigger MUST return a valid source to allow the stream input to load up at all. If used multiple times, the last defined handler overrides any and all previous handlers. Its payload is:
streamname