;
; User configuration
;
+; WARNING: This configuration file is deprecated and will be removed in
+; a future version of Asterisk. It is recommended that you make configurations
+; in the appropriate module-specific configuration file for more flexibility.
+; Many Asterisk modules already no longer support users.conf.
+;
; Creating entries in users.conf is a "shorthand" for creating individual
; entries in each configuration file. Using users.conf is not intended to
; provide you with as much flexibility as using the separate configuration
}
}
+static void startup_event_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
+{
+ struct ast_json_payload *payload;
+ const char *type;
+
+ if (stasis_message_type(message) != ast_manager_get_generic_type()) {
+ return;
+ }
+
+ payload = stasis_message_data(message);
+ type = ast_json_string_get(ast_json_object_get(payload->json, "type"));
+
+ if (strcmp(type, "FullyBooted")) {
+ return;
+ }
+
+ ast_log(LOG_WARNING, "users.conf is deprecated and will be removed in a future version of Asterisk\n");
+
+ stasis_unsubscribe(sub);
+}
+
static void pbx_load_users(void)
{
struct ast_config *cfg;
if (!cfg)
return;
+ /*! \todo Remove users.conf support in Asterisk 23 */
+ stasis_subscribe_pool(ast_manager_get_topic(), startup_event_cb, NULL);
+
for (cat = ast_category_browse(cfg, NULL); cat ; cat = ast_category_browse(cfg, cat)) {
if (!strcasecmp(cat, "general"))
continue;