From 4c9f613309d66ae6a8e5454cd53276459bcd2674 Mon Sep 17 00:00:00 2001 From: Matt Jordan Date: Fri, 4 Sep 2015 12:25:07 -0500 Subject: 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 --- include/asterisk/stasis_app.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/asterisk') diff --git a/include/asterisk/stasis_app.h b/include/asterisk/stasis_app.h index 567670b69..f2b07e0bf 100644 --- a/include/asterisk/stasis_app.h +++ b/include/asterisk/stasis_app.h @@ -91,6 +91,21 @@ struct ao2_container *stasis_app_get_all(void); */ int stasis_app_register(const char *app_name, stasis_app_cb handler, void *data); +/*! + * \brief Register a new Stasis application that receives all Asterisk events. + * + * If an application is already registered with the given name, the old + * application is sent a 'replaced' message and unregistered. + * + * \param app_name Name of this application. + * \param handler Callback for application messages. + * \param data Data blob to pass to the callback. Must be AO2 managed. + * + * \return 0 for success + * \return -1 for error. + */ +int stasis_app_register_all(const char *app_name, stasis_app_cb handler, void *data); + /*! * \brief Unregister a Stasis application. * \param app_name Name of the application to unregister. -- cgit v1.2.3