Event Script Reference

Event Script Reference

The following events are available.

Event: playlist_advanced

Description

Called every time a track is selected from a playlist for the autoDJ.

Note that is imperative that your script work very quickly. During the execution of your script, the autoDJ is forced to wait to receive the information for the next track. If your script takes too long, the current song may end before the autoDJ knows which track to play next, and as a result, there may be silence on the stream and/or the server may believe that the source has died due to inactivity. You may wish to design your script to fork, exit, and and continue operation in the background if processing will take more than a few hundred milliseconds.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • pathname (string)
    the pathname of the track to be played

  • artist (string)
    the artist of the track to be played

  • album (string)
    the album of the track to be played

  • title (string)
    the title of the track to be played

  • length (int)
    the length of the track to be played, in seconds

  • royaltycode (string)
    the royalty reporting code of the track to be played

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## playlist_advanced
USERNAME="$playlist_advanced"
PATHNAME="$playlist_advanced"
ARTIST="$playlist_advanced"
ALBUM="$playlist_advanced"
TITLE="$playlist_advanced"
LENGTH="$playlist_advanced"
ROYALTYCODE="$playlist_advanced"

## implementation details here ...

Event: pre-create-reseller

Description

Called just before a reseller account is created.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the reseller can create autoDJ-enabled accounts, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account from being created.

Sample Code

##!/usr/bin/env bash
## pre-create-reseller
USERNAME="$pre-create-reseller"
PASSWORD="$pre-create-reseller"
EMAIL="$pre-create-reseller"
MAXCLIENTS="$pre-create-reseller"
MAXBITRATE="$pre-create-reseller"
TRANSFERLIMIT="$pre-create-reseller"
DISKQUOTA="$pre-create-reseller"
USESOURCE="$pre-create-reseller"
MOUNTLIMIT="$pre-create-reseller"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-create-account

Description

Called just before a streaming account is created.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • ipaddress (string)
    the IP address for the account

  • port (int)
    the port number for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the autoDJ is enabled, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account from being created.

Sample Code

##!/usr/bin/env bash
## pre-create-account
USERNAME="$pre-create-account"
PASSWORD="$pre-create-account"
EMAIL="$pre-create-account"
IPADDRESS="$pre-create-account"
PORT="$pre-create-account"
MAXCLIENTS="$pre-create-account"
MAXBITRATE="$pre-create-account"
TRANSFERLIMIT="$pre-create-account"
DISKQUOTA="$pre-create-account"
USESOURCE="$pre-create-account"
MOUNTLIMIT="$pre-create-account"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-create-reseller

Description

Called just after a reseller account is created.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the reseller can create autoDJ-enabled accounts, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-create-reseller
USERNAME="$post-create-reseller"
PASSWORD="$post-create-reseller"
EMAIL="$post-create-reseller"
MAXCLIENTS="$post-create-reseller"
MAXBITRATE="$post-create-reseller"
TRANSFERLIMIT="$post-create-reseller"
DISKQUOTA="$post-create-reseller"
USESOURCE="$post-create-reseller"
MOUNTLIMIT="$post-create-reseller"

## implementation details here ...

Event: post-create-account

Description

Called just after a streaming account is created.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • ipaddress (string)
    the IP address for the account

  • port (int)
    the port number for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the autoDJ is enabled, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-create-account
USERNAME="$post-create-account"
PASSWORD="$post-create-account"
EMAIL="$post-create-account"
IPADDRESS="$post-create-account"
PORT="$post-create-account"
MAXCLIENTS="$post-create-account"
MAXBITRATE="$post-create-account"
TRANSFERLIMIT="$post-create-account"
DISKQUOTA="$post-create-account"
USESOURCE="$post-create-account"
MOUNTLIMIT="$post-create-account"

## implementation details here ...

Event: pre-terminate-account

Description

Called just before a streaming account is terminated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account from being terminated.

Sample Code

##!/usr/bin/env bash
## pre-terminate-account
USERNAME="$pre-terminate-account"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-terminate-reseller

Description

Called just before a reseller account is terminated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account from being terminated.

Sample Code

##!/usr/bin/env bash
## pre-terminate-reseller
USERNAME="$pre-terminate-reseller"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-terminate-account

Description

Called just after a streaming account is terminated

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-terminate-account
USERNAME="$post-terminate-account"

## implementation details here ...

Event: post-terminate-reseller

Description

Called just after a reseller account is terminated

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-terminate-reseller
USERNAME="$post-terminate-reseller"

## implementation details here ...

Event: pre-reparent-account

Description

Called just before a streaming account is moved to a new reseller

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • newreseller (string)
    the username of the new reseller account to own the streaming account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the streaming server from being reparented.

Sample Code

##!/usr/bin/env bash
## pre-reparent-account
USERNAME="$pre-reparent-account"
NEWRESELLER="$pre-reparent-account"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-reparent-account

Description

Called just after a streaming account is moved to a new reseller

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • newreseller (string)
    the username of the new reseller account to own the streaming account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-reparent-account
USERNAME="$post-reparent-account"
NEWRESELLER="$post-reparent-account"

## implementation details here ...

Event: pre-account-status

Description

Called just before a streaming account's status (enabled/disabled) is changed

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • status (string)
    the new status for the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account's status from changing.

Sample Code

##!/usr/bin/env bash
## pre-account-status
USERNAME="$pre-account-status"
STATUS="$pre-account-status"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-account-status

Description

Called just after a streaming account's status (enabled/disabled) is changed

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • status (string)
    the new status for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-account-status
USERNAME="$post-account-status"
STATUS="$post-account-status"

## implementation details here ...

Event: pre-start-server

Description

Called just before a streaming server is started.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the streaming server from starting.

Sample Code

##!/usr/bin/env bash
## pre-start-server
USERNAME="$pre-start-server"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-start-server

Description

Called just after a streaming server is started.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-start-server
USERNAME="$post-start-server"

## implementation details here ...

Event: pre-start-source

Description

Called just before an autoDJ is started.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the autoDJ from starting.

Sample Code

##!/usr/bin/env bash
## pre-start-source
USERNAME="$pre-start-source"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-start-app

Description

Called just before a supplemental application is started.

Parameters

The following parameters are passed, in the order shown, to this script:

  • type (string)
    the application type

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the application from starting.

Sample Code

##!/usr/bin/env bash
## pre-start-app
TYPE="$pre-start-app"
USERNAME="$pre-start-app"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-start-source

Description

Called just after an autoDJ is started.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-start-source
USERNAME="$post-start-source"

## implementation details here ...

Event: post-start-app

Description

Called just after a supplemental application is started.

Parameters

The following parameters are passed, in the order shown, to this script:

  • type (string)
    the application type

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-start-app
TYPE="$post-start-app"
USERNAME="$post-start-app"

## implementation details here ...

Event: pre-reload

Description

Called just before a streaming server is reloaded.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the streaming server from reloading.

Sample Code

##!/usr/bin/env bash
## pre-reload
USERNAME="$pre-reload"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-reload

Description

Called just after a streaming server is reloaded.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-reload
USERNAME="$post-reload"

## implementation details here ...

Event: pre-stop-source

Description

Called just before an autoDJ is stopped.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the autoDJ from stopping.

Sample Code

##!/usr/bin/env bash
## pre-stop-source
USERNAME="$pre-stop-source"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-stop-app

Description

Called just before a supplemental application is stopped.

Parameters

The following parameters are passed, in the order shown, to this script:

  • type (string)
    the application type

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the application from stopping.

Sample Code

##!/usr/bin/env bash
## pre-stop-app
TYPE="$pre-stop-app"
USERNAME="$pre-stop-app"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-stop-source

Description

Called just after an autoDJ is stopped.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-stop-source
USERNAME="$post-stop-source"

## implementation details here ...

Event: post-stop-app

Description

Called just after a supplemental application is stopped.

Parameters

The following parameters are passed, in the order shown, to this script:

  • app (string)
    the application type

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-stop-app
APP="$post-stop-app"
USERNAME="$post-stop-app"

## implementation details here ...

Event: pre-stop-server

Description

Called just before a streaming server is stopped.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the streaming server from stopping.

Sample Code

##!/usr/bin/env bash
## pre-stop-server
USERNAME="$pre-stop-server"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-stop-server

Description

Called just after a streaming server is stopped.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-stop-server
USERNAME="$post-stop-server"

## implementation details here ...

Event: pre-reindex

Description

Called just before a media library is reindexed (updated).

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the media library from updating.

Sample Code

##!/usr/bin/env bash
## pre-reindex
USERNAME="$pre-reindex"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-reindex

Description

Called just after a media library is reindexed (updated).

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-reindex
USERNAME="$post-reindex"

## implementation details here ...

Event: pre-process-logs

Description

Called just before an account's logs are processed.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the processing of the account's logs.

Sample Code

##!/usr/bin/env bash
## pre-process-logs
USERNAME="$pre-process-logs"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-process-logs

Description

Called just after an account's logs have been processed.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-process-logs
USERNAME="$post-process-logs"

## implementation details here ...

Event: pre-rotate-logs

Description

Called just before an account's logs are rotated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the rotation of the account's logs.

Sample Code

##!/usr/bin/env bash
## pre-rotate-logs
USERNAME="$pre-rotate-logs"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-rotate-logs

Description

Called just after an account's logs have been rotated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-rotate-logs
USERNAME="$post-rotate-logs"

## implementation details here ...

Event: pre-update-reseller

Description

Called just before a reseller account is updated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the reseller can create autoDJ-enabled accounts, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the update from being saved.

Sample Code

##!/usr/bin/env bash
## pre-update-reseller
USERNAME="$pre-update-reseller"
PASSWORD="$pre-update-reseller"
EMAIL="$pre-update-reseller"
MAXCLIENTS="$pre-update-reseller"
MAXBITRATE="$pre-update-reseller"
TRANSFERLIMIT="$pre-update-reseller"
DISKQUOTA="$pre-update-reseller"
USESOURCE="$pre-update-reseller"
MOUNTLIMIT="$pre-update-reseller"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-update-account

Description

Called just before a streaming account is updated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • ipaddress (string)
    the IP address for the account

  • port (int)
    the port number for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the autoDJ is enabled, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the update from being saved.

Sample Code

##!/usr/bin/env bash
## pre-update-account
USERNAME="$pre-update-account"
PASSWORD="$pre-update-account"
EMAIL="$pre-update-account"
IPADDRESS="$pre-update-account"
PORT="$pre-update-account"
MAXCLIENTS="$pre-update-account"
MAXBITRATE="$pre-update-account"
TRANSFERLIMIT="$pre-update-account"
DISKQUOTA="$pre-update-account"
USESOURCE="$pre-update-account"
MOUNTLIMIT="$pre-update-account"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-update-reseller

Description

Called just after a reseller account is updated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the reseller can create autoDJ-enabled accounts, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-update-reseller
USERNAME="$post-update-reseller"
PASSWORD="$post-update-reseller"
EMAIL="$post-update-reseller"
MAXCLIENTS="$post-update-reseller"
MAXBITRATE="$post-update-reseller"
TRANSFERLIMIT="$post-update-reseller"
DISKQUOTA="$post-update-reseller"
USESOURCE="$post-update-reseller"
MOUNTLIMIT="$post-update-reseller"

## implementation details here ...

Event: post-update-account

Description

Called just after a streaming account is updated.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

  • password (string)
    the password for the account

  • email (string)
    the email address for the account

  • ipaddress (string)
    the IP address for the account

  • port (int)
    the port number for the account

  • maxclients (int)
    the listener limit for the account

  • maxbitrate (int)
    the maximum bit rate for the account

  • transferlimit (int)
    the data transfer limit for the account

  • diskquota (int)
    the disk quota for the account

  • usesource (int)
    1 if the autoDJ is enabled, otherwise 0

  • mountlimit (int)
    the mount point limit for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-update-account
USERNAME="$post-update-account"
PASSWORD="$post-update-account"
EMAIL="$post-update-account"
IPADDRESS="$post-update-account"
PORT="$post-update-account"
MAXCLIENTS="$post-update-account"
MAXBITRATE="$post-update-account"
TRANSFERLIMIT="$post-update-account"
DISKQUOTA="$post-update-account"
USESOURCE="$post-update-account"
MOUNTLIMIT="$post-update-account"

## implementation details here ...

Event: send-email

Description

Called when Centova Cast needs to send an email message (usually for notifications).

Parameters

The following parameters are passed, in the order shown, to this script:

  • name (string)
    the name of the email template to send

  • recipients (array)
    a list of recipient email addresses for the message

  • subject (string)
    the subject for the message

  • variables (array)
    a list of variables available to be populated into the message text

  • text (string)
    the text/plain version of the message body

  • html (string)
    the text/html version of the message body

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value triggers an error and prevents the email from being sent by Centova Cast.

Sample Code

##!/usr/bin/env bash
## send-email
NAME="$send-email"
RECIPIENTS="$send-email"
SUBJECT="$send-email"
VARIABLES="$send-email"
TEXT="$send-email"
HTML="$send-email"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-rename-account

Description

Called just before a streaming account is renamed.

Parameters

The following parameters are passed, in the order shown, to this script:

  • old_username (string)
    the original (current) username of the account

  • new_username (string)
    the new username to be assigned to the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account from being renamed.

Sample Code

##!/usr/bin/env bash
## pre-rename-account
OLD_USERNAME="$pre-rename-account"
NEW_USERNAME="$pre-rename-account"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: pre-rename-reseller

Description

Called just before a reseller account is renamed.

Parameters

The following parameters are passed, in the order shown, to this script:

  • old_username (string)
    the original (current) username of the account

  • new_username (string)
    the new username to be assigned to the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the account from being renamed.

Sample Code

##!/usr/bin/env bash
## pre-rename-reseller
OLD_USERNAME="$pre-rename-reseller"
NEW_USERNAME="$pre-rename-reseller"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"

Event: post-rename-account

Description

Called just after a streaming account is renamed

Parameters

The following parameters are passed, in the order shown, to this script:

  • old_username (string)
    the original (old) username of the account

  • new_username (string)
    the new (current) username for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-rename-account
OLD_USERNAME="$post-rename-account"
NEW_USERNAME="$post-rename-account"

## implementation details here ...

Event: post-rename-reseller

Description

Called just after a reseller account is renamed

Parameters

The following parameters are passed, in the order shown, to this script:

  • old_username (string)
    the original (old) username of the account

  • new_username (string)
    the new (current) username for the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## post-rename-reseller
OLD_USERNAME="$post-rename-reseller"
NEW_USERNAME="$post-rename-reseller"

## implementation details here ...

Event: server-outage-restarted

Description

Called when a streaming server is restarted due to an outage

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## server-outage-restarted
USERNAME="$server-outage-restarted"

## implementation details here ...

Event: server-outage-restart-failed

Description

Called when a streaming server cannot be restarted after an outage

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## server-outage-restart-failed
USERNAME="$server-outage-restart-failed"

## implementation details here ...

Event: source-outage-restarted

Description

Called when an autoDJ is restarted due to an outage

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## source-outage-restarted
USERNAME="$source-outage-restarted"

## implementation details here ...

Event: source-outage-restart-failed

Description

Called when an autoDJ cannot be restarted after an outage

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## source-outage-restart-failed
USERNAME="$source-outage-restart-failed"

## implementation details here ...

Event: app-outage-restarted

Description

Called when a supplemental application is restarted due to an outage

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## app-outage-restarted
USERNAME="$app-outage-restarted"

## implementation details here ...

Event: app-outage-restart-failed

Description

Called when a supplemental application cannot be restarted after an outage

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

Ignored.

Sample Code

##!/usr/bin/env bash
## app-outage-restart-failed
USERNAME="$app-outage-restart-failed"

## implementation details here ...

Event: bitrate-exceeded

Description

Called when a stream is broadcasting in excess of its configured bit rate limit.

Parameters

The following parameters are passed, in the order shown, to this script:

  • username (string)
    the username of the account

Return Value

The last line of output from the script determines whether or not the associated event will continue.

If the last line of output contains only the number 1, the event will proceed normally.

Any other value prevents the bit rate limit from being enforced and allows the stream to continue broadcasting.

Sample Code

##!/usr/bin/env bash
## bitrate-exceeded
USERNAME="$bitrate-exceeded"
ERROR=""

## implementation details here ...

## if you want to force Centova Cast to abort the event, your script should
## set ERROR to an error message string
[ -z "$ERROR" ] && echo "1" || echo "$ERROR"