Skip to content

KAZOO Support Channels

This documentation is curated by 2600Hz as part of the KAZOO open source project. Join our community forums here for peer support. Only features in the docs.2600hz.com/supported space are included as part of our 2600Hz Support Services plan.

Using Monster Events#

Monster UI use postal.js as a local message bus (pub/sub system). It is mostly used to subscribe and publish Common Controls into applications and is wrapped inside Monster methods to simplify their invocation.

Subscribe#

Named Functions#

To subscribe to a specific function, the following steps need to be respected: * in the app variable exists an object called subscribed; inside it link the function to subscribe to to a topic name:

subscribe: {
    'topicName': 'functionName'
}
* respect the naming conventions and name the topic following this rule: {appName}.{commonControl}.{functionName}

Anonymous Functions#

To subscribe to an anonymous function, the following steps need to be respected: * call the Monster method:

monster.sub(topic, callback, context);
* respect the naming conventions and name the topic following this rule: '{appName}.{commonControl}.{functionName}' * the context parameter is optional and will be used as this in the callback

Publish#

Thanks to Monster UI core methods, publishing is really easy:

monster.pub(topic, data);
The topic should follow the rule: '{appName}.{commonControl}.{functionName}' The data parameter can be a callback or an object containing a function used as callback.