mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
ARI event type filtering
Event type filtering is now enabled, and configurable per application. An app is now able to specify which events are sent to the application by configuring an allowed and/or disallowed list(s). This can be done by issuing the following: PUT /applications/{applicationName}/eventFilter And then enumerating the allowed/disallowed event types as a body parameter. ASTERISK-28106 Change-Id: I9671ba1fcdb3b6c830b553d4c5365aed5d588d5b
This commit is contained in:
committed by
George Joseph
parent
4a871c4b79
commit
1c5def4b18
@@ -147,6 +147,17 @@ struct stasis_app;
|
||||
*/
|
||||
const char *stasis_app_name(const struct stasis_app *app);
|
||||
|
||||
/*!
|
||||
* \brief Return the JSON representation of a Stasis application.
|
||||
* \since 16.3.0
|
||||
*
|
||||
* \param app The application.
|
||||
*
|
||||
* \return JSON representation of app with given name.
|
||||
* \return \c NULL on error.
|
||||
*/
|
||||
struct ast_json *stasis_app_object_to_json(struct stasis_app *app);
|
||||
|
||||
/*!
|
||||
* \brief Return the JSON representation of a Stasis application.
|
||||
*
|
||||
@@ -958,6 +969,41 @@ struct ast_cli_args;
|
||||
*/
|
||||
void stasis_app_to_cli(const struct stasis_app *app, struct ast_cli_args *a);
|
||||
|
||||
/*!
|
||||
* \brief Convert and add the app's event type filter(s) to the given json object.
|
||||
*
|
||||
* \param app The application
|
||||
* \param json The json object to add the filter data to
|
||||
*
|
||||
* \return The given json object
|
||||
*/
|
||||
struct ast_json *stasis_app_event_filter_to_json(struct stasis_app *app, struct ast_json *json);
|
||||
|
||||
/*!
|
||||
* \brief Set the application's event type filter
|
||||
*
|
||||
* \param app The application
|
||||
* \param filter The allowed and/or disallowed event filter
|
||||
*
|
||||
* \return 0 if successfully set
|
||||
*/
|
||||
int stasis_app_event_filter_set(struct stasis_app *app, struct ast_json *filter);
|
||||
|
||||
/*!
|
||||
* \brief Check if the given event should be filtered.
|
||||
*
|
||||
* Attempts first to find the event in the application's disallowed events list.
|
||||
* If found then the event won't be sent to the remote. If not found in the
|
||||
* disallowed list then a search is done to see if it can be found in the allowed
|
||||
* list. If found the event message is sent, otherwise it is not sent.
|
||||
*
|
||||
* \param app_name The application name
|
||||
* \param event The event to check
|
||||
*
|
||||
* \return True if allowed, false otherwise
|
||||
*/
|
||||
int stasis_app_event_allowed(const char *app_name, struct ast_json *event);
|
||||
|
||||
/*! @} */
|
||||
|
||||
#endif /* _ASTERISK_STASIS_APP_H */
|
||||
|
Reference in New Issue
Block a user