; on a action=waitevent request (actually its httptimeout-10)
; c) httptimeout is also the amount of time the webserver keeps
; a http session alive after completing a successful action
+;
+; disabledevents specifies AMI events which should be completely globally disabled.
+; These events will not be available to any AMI listeners. Use this to disable
+; frequent events which are not desired for any listeners. Default
+; is no events are globally disabled. Event names are case-sensitive.
+; Events disabled in stasis.conf do not also need to be disabled here.
+; If you don't want to completely disable an AMI event, also consider the
+; filter option available on a per-manager user basis to block unwanted
+; events from being received in a stream (as opposed to this option which
+; would prevent specified events from being generated at all).
+;disabledevents = Newexten,Varset
;[mark]
;secret = mysecret
static int authtimeout;
static int authlimit;
static char *manager_channelvars;
+static char *manager_disabledevents;
#define DEFAULT_REALM "asterisk"
static char global_realm[MAXHOSTNAMELEN]; /*!< Default realm */
va_list ap;
int res;
+ if (!ast_strlen_zero(manager_disabledevents)) {
+ if (ast_in_delimited_string(event, manager_disabledevents, ',')) {
+ ast_debug(3, "AMI Event '%s' is globally disabled, skipping\n", event);
+ /* Event is globally disabled */
+ ao2_cleanup(sessions);
+ return 0;
+ }
+ }
+
if (!any_manager_listeners(sessions)) {
/* Nobody is listening */
ao2_cleanup(sessions);
ast_cli(a->fd, FORMAT, "Display connects:", AST_CLI_YESNO(displayconnects));
ast_cli(a->fd, FORMAT, "Timestamp events:", AST_CLI_YESNO(timestampevents));
ast_cli(a->fd, FORMAT, "Channel vars:", S_OR(manager_channelvars, ""));
+ ast_cli(a->fd, FORMAT, "Disabled events:", S_OR(manager_disabledevents, ""));
ast_cli(a->fd, FORMAT, "Debug:", AST_CLI_YESNO(manager_debug));
#undef FORMAT
#undef FORMAT2
*/
static void load_channelvars(struct ast_variable *var)
{
- char *parse = NULL;
- AST_DECLARE_APP_ARGS(args,
- AST_APP_ARG(vars)[MAX_VARS];
- );
+ char *parse = NULL;
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(vars)[MAX_VARS];
+ );
ast_free(manager_channelvars);
manager_channelvars = ast_strdup(var->value);
ast_channel_set_manager_vars(args.argc, args.vars);
}
+/*!
+ * \internal
+ * \brief Load the config disabledevents variable.
+ *
+ * \param var Config variable to load.
+ */
+static void load_disabledevents(struct ast_variable *var)
+{
+ ast_free(manager_disabledevents);
+ manager_disabledevents = ast_strdup(var->value);
+}
+
/*!
* \internal
* \brief Free a user record. Should already be removed from the list
acl_change_stasis_unsubscribe();
ast_free(manager_channelvars);
+ ast_free(manager_disabledevents);
}
}
} else if (!strcasecmp(var->name, "channelvars")) {
load_channelvars(var);
+ } else if (!strcasecmp(var->name, "disabledevents")) {
+ load_disabledevents(var);
} else {
ast_log(LOG_NOTICE, "Invalid keyword <%s> = <%s> in manager.conf [general]\n",
var->name, val);