Yes, this can be accomplished using Centova Cast's Event Scripts system.
For security and performance reasons, support for event notification scripts is disabled by default. You must enable the
EVENT_SCRIPTS setting in
/usr/local/centovacast/etc/centovacast.conf before the event notification scripts will be invoked by Centova Cast.
For performance reasons, Centova Cast caches the list of event notification scripts the first time an event is triggered. As such, if you add a new event notification script after starting Centova Cast, it will not immediately be recognized by Centova Cast. To force Centova Cast to update its cache, simply restart Centova Cast (on the web interface server) by running
/etc/init.d/centovacast restart or clear the cache (on the web interface server) by running
/usr/local/centovacast/sbin/clear_web_cache, or wait 24hr for the cache to expire.
Event notification scripts will be executed on the stream hosting server on which the relevant account is hosted, which may not (necessarily) be the same server that hosts your Centova Cast web interface.
Event notification scripts will be executed under the user ID of the Centova Cast daemon account, which is
ccuserby default. As such, the scripts will have access to the stream accounts' configuration files and media, but will NOT have root privileges.
Scripts that allow a return value MUST output "1" or "0" to indicate whether or not Centova Cast may proceed with the operation. If the last line generated by your script is anything other than 1, Centova Cast will abort with an error. If the last line of output generated by your script is a text string, it will be displayed as part of the error message in Centova Cast.
Note that when implementing code for "pre-" events, there is no guarantee that the operation that is about to be performed will succeed. You should use "pre-" events only for the purposes of (potentially) aborting the operation. Any code which depends on the successful completion of the operation (such as account provisioning code, etc.) should be triggered by the "post-" version of each event.
Centova Cast will by default wait up to 30 seconds for an event notification script to finish. If the script does not finish in this period of time, it will be terminated by Centova Cast. Remember that in most cases, a user will be waiting for a page to load in the web interface while the event notification script is running, so it's important that the script completes quickly. The time limit can be changed by adding an
EVENT_SCRIPT_TIMEOUT=30 line to
with the desired timeout.