mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
ARI: Add the ability to subscribe to all events
This patch adds the ability to subscribe to all events. There are two possible ways to accomplish this: (1) On initial WebSocket connection. This patch adds a new query parameter, 'subscribeAll'. If present and True, Asterisk will subscribe the applications to all ARI events. (2) Via the applications resource. When subscribing in this manner, an ARI client should merely specify a blank resource name, i.e., 'channels:' instead of 'channels:12354'. This will subscribe the application to all resources of the 'channels' type. ASTERISK-24870 #close Change-Id: I4a943b4db24442cf28bc64b24bfd541249790ad6
This commit is contained in:
@@ -36,6 +36,19 @@
|
||||
*/
|
||||
struct stasis_app;
|
||||
|
||||
enum stasis_app_subscription_model {
|
||||
/*
|
||||
* \brief An application must manually subscribe to each
|
||||
* resource that it cares about. This is the default approach.
|
||||
*/
|
||||
STASIS_APP_SUBSCRIBE_MANUAL,
|
||||
/*
|
||||
* \brief An application is automatically subscribed to all
|
||||
* resources in Asterisk, even if it does not control them.
|
||||
*/
|
||||
STASIS_APP_SUBSCRIBE_ALL
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Create a res_stasis application.
|
||||
*
|
||||
@@ -45,7 +58,7 @@ struct stasis_app;
|
||||
* \return New \c res_stasis application.
|
||||
* \return \c NULL on error.
|
||||
*/
|
||||
struct stasis_app *app_create(const char *name, stasis_app_cb handler, void *data);
|
||||
struct stasis_app *app_create(const char *name, stasis_app_cb handler, void *data, enum stasis_app_subscription_model subscription_model);
|
||||
|
||||
/*!
|
||||
* \brief Tears down an application.
|
||||
|
Reference in New Issue
Block a user