The Subscription Filter Plugin allows you to intercept the incoming subscription when a new conversation is being requested as well as the actions taken from that subscription notification.
Add the plugin by letting the Userplane API know you require the plugin:
onReady = function () {
up.api.require("SubscriptionFilter", {deniedHandler:deniedHandler,acceptedHandler:acceptedHandler});
}
up.api.addEventListener(up.api.events.READY,onReady);
You must pass the plugin a config which contains both a deniedHandler and an acceptedHandler which are javascript functions which will be sent a PresenceSubscriptionEvent.
Config Parameters
| Parameter | Optional/Required | Default | Description |
|---|---|---|---|
| deniedHandler | required | Handler function to receive all PresenceSubscriptionEvent generated by the SDK. This handler will have priority receiving the event before any other widget or service so you can manipulate the events before they propagate. | |
| acceptedHandler | required | Handler function to receive all PresenceSubscriptionEvent generated by the SDK. This handler will have priority receiving the event before any other widget or service so you can manipulate the events before they propagate. |